mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Implement attribute 'fgColor' on 'document'
The 'text' attribute was implemented on '<body>' in #7841
This commit is contained in:
parent
29c42a9f78
commit
320263199f
9 changed files with 25 additions and 156 deletions
|
@ -2281,6 +2281,16 @@ impl DocumentMethods for Document {
|
||||||
self.set_body_attribute(&atom!("bgcolor"), value)
|
self.set_body_attribute(&atom!("bgcolor"), value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://html.spec.whatwg.org/multipage/#dom-document-fgcolor
|
||||||
|
fn FgColor(&self) -> DOMString {
|
||||||
|
self.get_body_attribute(&atom!("text"))
|
||||||
|
}
|
||||||
|
|
||||||
|
// https://html.spec.whatwg.org/multipage/#dom-document-fgcolor
|
||||||
|
fn SetFgColor(&self, value: DOMString) {
|
||||||
|
self.set_body_attribute(&atom!("text"), value)
|
||||||
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/#dom-tree-accessors:dom-document-nameditem-filter
|
// https://html.spec.whatwg.org/multipage/#dom-tree-accessors:dom-document-nameditem-filter
|
||||||
fn NamedGetter(&self, _cx: *mut JSContext, name: DOMString, found: &mut bool) -> *mut JSObject {
|
fn NamedGetter(&self, _cx: *mut JSContext, name: DOMString, found: &mut bool) -> *mut JSObject {
|
||||||
#[derive(JSTraceable, HeapSizeOf)]
|
#[derive(JSTraceable, HeapSizeOf)]
|
||||||
|
|
|
@ -141,7 +141,7 @@ Document implements GlobalEventHandlers;
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/#Document-partial
|
// https://html.spec.whatwg.org/multipage/#Document-partial
|
||||||
partial interface Document {
|
partial interface Document {
|
||||||
// [TreatNullAs=EmptyString] attribute DOMString fgColor;
|
[TreatNullAs=EmptyString] attribute DOMString fgColor;
|
||||||
|
|
||||||
// https://github.com/servo/servo/issues/8715
|
// https://github.com/servo/servo/issues/8715
|
||||||
// [TreatNullAs=EmptyString] attribute DOMString linkColor;
|
// [TreatNullAs=EmptyString] attribute DOMString linkColor;
|
||||||
|
|
|
@ -54,9 +54,6 @@
|
||||||
[Document interface: attribute commands]
|
[Document interface: attribute commands]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Document interface: attribute fgColor]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Document interface: attribute linkColor]
|
[Document interface: attribute linkColor]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
@ -9045,9 +9042,6 @@
|
||||||
[Document interface: document.implementation.createDocument(null, "", null) must inherit property "commands" with the proper type (70)]
|
[Document interface: document.implementation.createDocument(null, "", null) must inherit property "commands" with the proper type (70)]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Document interface: document.implementation.createDocument(null, "", null) must inherit property "fgColor" with the proper type (72)]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Document interface: document.implementation.createDocument(null, "", null) must inherit property "linkColor" with the proper type (73)]
|
[Document interface: document.implementation.createDocument(null, "", null) must inherit property "linkColor" with the proper type (73)]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -12528,135 +12528,6 @@
|
||||||
[#document.dir (<html dir>): IDL set to "AUTO" followed by IDL get]
|
[#document.dir (<html dir>): IDL set to "AUTO" followed by IDL get]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[#document.fgColor (<body text>): typeof IDL attribute]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[#document.fgColor (<body text>): IDL get with DOM attribute unset]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[#document.fgColor (<body text>): setAttribute() to "" followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[#document.fgColor (<body text>): setAttribute() to " \\0\\x01\\x02\\x03\\x04\\x05\\x06\\x07 \\b\\t\\n\\v\\f\\r\\x0e\\x0f \\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17 \\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f foo " followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[#document.fgColor (<body text>): setAttribute() to undefined followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[#document.fgColor (<body text>): setAttribute() to 7 followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[#document.fgColor (<body text>): setAttribute() to 1.5 followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[#document.fgColor (<body text>): setAttribute() to true followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[#document.fgColor (<body text>): setAttribute() to false followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[#document.fgColor (<body text>): setAttribute() to object "[object Object\]" followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[#document.fgColor (<body text>): setAttribute() to NaN followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[#document.fgColor (<body text>): setAttribute() to Infinity followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[#document.fgColor (<body text>): setAttribute() to -Infinity followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[#document.fgColor (<body text>): setAttribute() to "\\0" followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[#document.fgColor (<body text>): setAttribute() to null followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[#document.fgColor (<body text>): setAttribute() to object "test-toString" followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[#document.fgColor (<body text>): setAttribute() to object "test-valueOf" followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[#document.fgColor (<body text>): IDL set to "" followed by getAttribute()]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[#document.fgColor (<body text>): IDL set to " \\0\\x01\\x02\\x03\\x04\\x05\\x06\\x07 \\b\\t\\n\\v\\f\\r\\x0e\\x0f \\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17 \\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f foo " followed by getAttribute()]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[#document.fgColor (<body text>): IDL set to undefined followed by getAttribute()]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[#document.fgColor (<body text>): IDL set to undefined followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[#document.fgColor (<body text>): IDL set to 7 followed by getAttribute()]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[#document.fgColor (<body text>): IDL set to 7 followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[#document.fgColor (<body text>): IDL set to 1.5 followed by getAttribute()]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[#document.fgColor (<body text>): IDL set to 1.5 followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[#document.fgColor (<body text>): IDL set to true followed by getAttribute()]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[#document.fgColor (<body text>): IDL set to true followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[#document.fgColor (<body text>): IDL set to false followed by getAttribute()]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[#document.fgColor (<body text>): IDL set to false followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[#document.fgColor (<body text>): IDL set to object "[object Object\]" followed by getAttribute()]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[#document.fgColor (<body text>): IDL set to object "[object Object\]" followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[#document.fgColor (<body text>): IDL set to NaN followed by getAttribute()]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[#document.fgColor (<body text>): IDL set to NaN followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[#document.fgColor (<body text>): IDL set to Infinity followed by getAttribute()]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[#document.fgColor (<body text>): IDL set to Infinity followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[#document.fgColor (<body text>): IDL set to -Infinity followed by getAttribute()]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[#document.fgColor (<body text>): IDL set to -Infinity followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[#document.fgColor (<body text>): IDL set to "\\0" followed by getAttribute()]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[#document.fgColor (<body text>): IDL set to null followed by getAttribute()]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[#document.fgColor (<body text>): IDL set to null followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[#document.fgColor (<body text>): IDL set to object "test-toString" followed by getAttribute()]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[#document.fgColor (<body text>): IDL set to object "test-toString" followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[#document.fgColor (<body text>): IDL set to object "test-valueOf" followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[#document.linkColor (<body link>): typeof IDL attribute]
|
[#document.linkColor (<body link>): typeof IDL attribute]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -1,17 +1,11 @@
|
||||||
[document-color-02.html]
|
[document-color-02.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
[document: fg/bg/link/vlink/alink-color 1]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[document: fg/bg/link/vlink/alink-color 3]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[document: fg/bg/link/vlink/alink-color 4]
|
[document: fg/bg/link/vlink/alink-color 4]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[document: fg/bg/link/vlink/alink-color 5]
|
[document: fg/bg/link/vlink/alink-color 5]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[document: fg/bg/link/vlink/alink-color]
|
[document: fg/bg/link/vlink/alink-color 6]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -1,17 +1,11 @@
|
||||||
[document-color-03.html]
|
[document-color-03.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
[document: fg/bg/link/vlink/alink-color 1]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[document: fg/bg/link/vlink/alink-color 3]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[document: fg/bg/link/vlink/alink-color 4]
|
[document: fg/bg/link/vlink/alink-color 4]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[document: fg/bg/link/vlink/alink-color 5]
|
[document: fg/bg/link/vlink/alink-color 5]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[document: fg/bg/link/vlink/alink-color]
|
[document: fg/bg/link/vlink/alink-color 6]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
[document-color-04.html]
|
[document-color-04.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
[document: fg/bg/link/vlink/alink-color 1]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[document: fg/bg/link/vlink/alink-color 3]
|
[document: fg/bg/link/vlink/alink-color 3]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
@ -12,6 +9,3 @@
|
||||||
[document: fg/bg/link/vlink/alink-color 5]
|
[document: fg/bg/link/vlink/alink-color 5]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[document: fg/bg/link/vlink/alink-color]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,12 @@ test(function() {
|
||||||
assert_equals(document.vlinkColor, document.body.vLink);
|
assert_equals(document.vlinkColor, document.body.vLink);
|
||||||
assert_equals(document.alinkColor, document.body.aLink);
|
assert_equals(document.alinkColor, document.body.aLink);
|
||||||
})
|
})
|
||||||
|
test(function() {
|
||||||
|
document.fgColor = null;
|
||||||
|
assert_equals(document.fgColor, "");
|
||||||
|
assert_equals(document.body.text, "");
|
||||||
|
assert_equals(document.body.getAttribute("text"), "");
|
||||||
|
})
|
||||||
test(function() {
|
test(function() {
|
||||||
document.fgColor = "blue";
|
document.fgColor = "blue";
|
||||||
assert_equals(document.fgColor, "blue");
|
assert_equals(document.fgColor, "blue");
|
||||||
|
|
|
@ -14,6 +14,12 @@ test(function() {
|
||||||
assert_equals(document.vlinkColor, document.body.vLink);
|
assert_equals(document.vlinkColor, document.body.vLink);
|
||||||
assert_equals(document.alinkColor, document.body.aLink);
|
assert_equals(document.alinkColor, document.body.aLink);
|
||||||
})
|
})
|
||||||
|
test(function() {
|
||||||
|
document.body.text = null;
|
||||||
|
assert_equals(document.fgColor, "");
|
||||||
|
assert_equals(document.body.text, "");
|
||||||
|
assert_equals(document.body.getAttribute("text"), "");
|
||||||
|
})
|
||||||
test(function() {
|
test(function() {
|
||||||
document.body.text = "blue";
|
document.body.text = "blue";
|
||||||
assert_equals(document.fgColor, "blue");
|
assert_equals(document.fgColor, "blue");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue