-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add test for document wg color #13842
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of nits, but great start.
...e/requirements-for-implementations/other-elements-attributes-and-apis/document-color-fg.html
Outdated
Show resolved
Hide resolved
<link rel="help" href="https://html.spec.whatwg.org/multipage/obsolete.html"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<div id="log"></div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I don’t think you need this div. The test harness adds it automatically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, also, I think adding the div also creates a body automagically.
...e/requirements-for-implementations/other-elements-attributes-and-apis/document-color-fg.html
Show resolved
Hide resolved
...e/requirements-for-implementations/other-elements-attributes-and-apis/document-color-fg.html
Outdated
Show resolved
Hide resolved
...e/requirements-for-implementations/other-elements-attributes-and-apis/document-color-fg.html
Outdated
Show resolved
Hide resolved
...e/requirements-for-implementations/other-elements-attributes-and-apis/document-color-fg.html
Outdated
Show resolved
Hide resolved
...e/requirements-for-implementations/other-elements-attributes-and-apis/document-color-fg.html
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there! These are starting to look good.
...e/requirements-for-implementations/other-elements-attributes-and-apis/document-color-fg.html
Outdated
Show resolved
Hide resolved
...e/requirements-for-implementations/other-elements-attributes-and-apis/document-color-fg.html
Outdated
Show resolved
Hide resolved
<script> | ||
test(function() { | ||
assert_equals(document.fgColor, document.body.text); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I this test, let’s confirm that each of these is “red”.
assert_equal(document.fgColor, “red”);
And so on...
...e/requirements-for-implementations/other-elements-attributes-and-apis/document-color-fg.html
Show resolved
Hide resolved
|
||
assert_equals(document.bgColor, "yellow"); | ||
}, "document's bgColor IDL attribute reflects the body's bgColor content attribute"); | ||
</script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need one more set of tests, where we finally remove the attributes from body
to make sure that they get reflected properly in document
. So:
test(function(){
document.body.removeAttribute("test");
assert_equals(document.fgColor, "");
// and so on...
}, "Removing the attributes causes them to be reflected as the empty string");
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aren't all these reflection tests already done in an automated fashion by https://github.com/web-platform-tests/wpt/blob/master/html/dom/elements-sections.js ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed... we don't need these tests :) @akansha2608 was learning how to read/process spec text.
So, I think we should abandon this and do the "TODO" in https://github.com/web-platform-tests/wpt/blob/master/html/dom/elements-sections.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So yeah, looking at the above, we could basically run everything above in a frameset and on a new body.
@akansha2608, ping me on Slack on Monday and I’ll help you with it. In the meantime, read over the original bug to get a more clear sense of exactly what we need to test.
Closing it as its already in https://github.com/web-platform-tests/wpt/blob/master/html/dom/elements-sections.js :) Thanks for everyone to helping me 😄 |
Fixes #2391