diff options
4 files changed, 47 insertions, 0 deletions
diff --git a/components/script/dom/htmlbodyelement.rs b/components/script/dom/htmlbodyelement.rs index 4ade5560700..53fb0637b0d 100644 --- a/components/script/dom/htmlbodyelement.rs +++ b/components/script/dom/htmlbodyelement.rs @@ -125,6 +125,14 @@ impl VirtualMethods for HTMLBodyElement { Some(self.upcast::<HTMLElement>() as &VirtualMethods) } + fn attribute_affects_presentational_hints(&self, attr: &Attr) -> bool { + if attr.local_name() == &local_name!("bgcolor") { + return true; + } + + self.super_type().unwrap().attribute_affects_presentational_hints(attr) + } + fn bind_to_tree(&self, tree_in_doc: bool) { if let Some(ref s) = self.super_type() { s.bind_to_tree(tree_in_doc); diff --git a/tests/wpt/metadata/MANIFEST.json b/tests/wpt/metadata/MANIFEST.json index 3725edf9ece..ff6334f4d99 100644 --- a/tests/wpt/metadata/MANIFEST.json +++ b/tests/wpt/metadata/MANIFEST.json @@ -168233,6 +168233,18 @@ {} ] ], + "html/rendering/the-css-user-agent-style-sheet-and-presentational-hints/body-bgcolor-attribute-change.html": [ + [ + "/html/rendering/the-css-user-agent-style-sheet-and-presentational-hints/body-bgcolor-attribute-change.html", + [ + [ + "/html/rendering/the-css-user-agent-style-sheet-and-presentational-hints/body-bgcolor-attribute-change-ref.html", + "==" + ] + ], + {} + ] + ], "html/semantics/document-metadata/the-link-element/stylesheet-change-href.html": [ [ "/html/semantics/document-metadata/the-link-element/stylesheet-change-href.html", @@ -293042,6 +293054,11 @@ {} ] ], + "html/rendering/the-css-user-agent-style-sheet-and-presentational-hints/body-bgcolor-attribute-change-ref.html": [ + [ + {} + ] + ], "html/rendering/unstyled-xml-documents/.gitkeep": [ [ {} @@ -584743,6 +584760,14 @@ "da39a3ee5e6b4b0d3255bfef95601890afd80709", "support" ], + "html/rendering/the-css-user-agent-style-sheet-and-presentational-hints/body-bgcolor-attribute-change-ref.html": [ + "8040cdc2d5096bbb27ebed7539706574faa8515f", + "support" + ], + "html/rendering/the-css-user-agent-style-sheet-and-presentational-hints/body-bgcolor-attribute-change.html": [ + "3cd7418ba8ea44bc2a643e63d38574c39041de24", + "reftest" + ], "html/rendering/unstyled-xml-documents/.gitkeep": [ "da39a3ee5e6b4b0d3255bfef95601890afd80709", "support" diff --git a/tests/wpt/web-platform-tests/html/rendering/the-css-user-agent-style-sheet-and-presentational-hints/body-bgcolor-attribute-change-ref.html b/tests/wpt/web-platform-tests/html/rendering/the-css-user-agent-style-sheet-and-presentational-hints/body-bgcolor-attribute-change-ref.html new file mode 100644 index 00000000000..43f0c6dd200 --- /dev/null +++ b/tests/wpt/web-platform-tests/html/rendering/the-css-user-agent-style-sheet-and-presentational-hints/body-bgcolor-attribute-change-ref.html @@ -0,0 +1,4 @@ +<!doctype html> +<body bgcolor="green"> + Passes if the background is green. +</body> diff --git a/tests/wpt/web-platform-tests/html/rendering/the-css-user-agent-style-sheet-and-presentational-hints/body-bgcolor-attribute-change.html b/tests/wpt/web-platform-tests/html/rendering/the-css-user-agent-style-sheet-and-presentational-hints/body-bgcolor-attribute-change.html new file mode 100644 index 00000000000..d0b2396a404 --- /dev/null +++ b/tests/wpt/web-platform-tests/html/rendering/the-css-user-agent-style-sheet-and-presentational-hints/body-bgcolor-attribute-change.html @@ -0,0 +1,10 @@ +<!doctype html> +<link rel="help" href="https://html.spec.whatwg.org/multipage/obsolete.html#attr-body-bgcolor"> +<link rel="match" href="body-bgcolor-attribute-change-ref.html"> +<body bgcolor="yellow"> + Passes if the background is green. +</body> +<script> + document.body.offsetTop; + document.body.setAttribute("bgcolor", "green"); +</script> |