Skip to content
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

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<!DOCTYPE html>
<title>document wg color</title>
<link rel="help" href="https://html.spec.whatwg.org/multipage/obsolete.html#dom-document-fgcolor">
<link rel="help" href="https://html.spec.whatwg.org/multipage/obsolete.html#dom-document-linkcolor">
<link rel="help" href="https://html.spec.whatwg.org/multipage/obsolete.html#dom-document-vlinkcolor">
<link rel="help" href="https://html.spec.whatwg.org/multipage/obsolete.html#dom-document-alinkcolor">
<link rel="help" href="https://html.spec.whatwg.org/multipage/obsolete.html#dom-document-bgcolor">
<link rel="help" href="https://html.spec.whatwg.org/multipage/obsolete.html">
akansha2608 marked this conversation as resolved.
Show resolved Hide resolved
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<body text="red" linkColor="red" vlink="red" alink="red" bgColor="red">
<script>
marcoscaceres marked this conversation as resolved.
Show resolved Hide resolved
test(function() {

Copy link
Contributor

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...

document.linkColor = "red";

assert_equals(document.fgColor, "red");

assert_equals(document.linkColor, "red");

assert_equals(document.vlinkColor, "red");

assert_equals(document.alinkColor, "red");

assert_equals(document.bgColor, "red");

}, "testing every attribute is red")

test(function() {
document.body.text = "blue";

akansha2608 marked this conversation as resolved.
Show resolved Hide resolved
assert_equals(document.fgColor, "blue");
}, "document's fgColor IDL attribute reflects the body's text content attribute");

test(function() {
document.body.link = "green";

assert_equals(document.linkColor, "green");
}, "document's linkColor IDL attribute reflects the body's link content attribute");

test(function() {
document.body.vLink = "blue";

assert_equals(document.vlinkColor, "blue");
}, "document's vlinkColor IDL attribute reflects the body's vLink content attribute");

test(function() {
document.body.aLink = "orange";

assert_equals(document.alinkColor, "orange");
}, "document's alinkColor IDL attribute reflects the body's aLink content attribute");

test(function() {
document.body.bgColor = "yellow";

assert_equals(document.bgColor, "yellow");
}, "document's bgColor IDL attribute reflects the body's bgColor content attribute");

test(function(){
document.body.removeAttribute("text");
assert_equals(document.fgColor, "");

document.body.removeAttribute("link");
assert_equals(document.linkColor, "");

document.body.removeAttribute("vlink");
assert_equals(document.vlinkColor, "");

document.body.removeAttribute("alink");
assert_equals(document.alinkColor, "");

document.body.removeAttribute("bgColor");
assert_equals(document.bgColor, "");

}, "Removing the attributes causes them to be reflected as the empty string");

</script>