mirror of
https://github.com/servo/servo.git
synced 2025-06-17 21:04:28 +00:00
Auto merge of #18758 - stuartnelson3:stn/dynamic-body-bgcolor, r=emilio
Add support for dynamic bgcolor change - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] There are tests for these changes <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18758) <!-- Reviewable:end -->
This commit is contained in:
commit
712d32e899
4 changed files with 47 additions and 0 deletions
|
@ -125,6 +125,14 @@ impl VirtualMethods for HTMLBodyElement {
|
||||||
Some(self.upcast::<HTMLElement>() as &VirtualMethods)
|
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) {
|
fn bind_to_tree(&self, tree_in_doc: bool) {
|
||||||
if let Some(ref s) = self.super_type() {
|
if let Some(ref s) = self.super_type() {
|
||||||
s.bind_to_tree(tree_in_doc);
|
s.bind_to_tree(tree_in_doc);
|
||||||
|
|
|
@ -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": [
|
||||||
[
|
[
|
||||||
"/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": [
|
"html/rendering/unstyled-xml-documents/.gitkeep": [
|
||||||
[
|
[
|
||||||
{}
|
{}
|
||||||
|
@ -584743,6 +584760,14 @@
|
||||||
"da39a3ee5e6b4b0d3255bfef95601890afd80709",
|
"da39a3ee5e6b4b0d3255bfef95601890afd80709",
|
||||||
"support"
|
"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": [
|
"html/rendering/unstyled-xml-documents/.gitkeep": [
|
||||||
"da39a3ee5e6b4b0d3255bfef95601890afd80709",
|
"da39a3ee5e6b4b0d3255bfef95601890afd80709",
|
||||||
"support"
|
"support"
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
<!doctype html>
|
||||||
|
<body bgcolor="green">
|
||||||
|
Passes if the background is green.
|
||||||
|
</body>
|
|
@ -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>
|
Loading…
Add table
Add a link
Reference in a new issue