mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Add support for dynamic bgcolor change
This commit is contained in:
parent
f2879a568d
commit
3b4deb4388
4 changed files with 52 additions and 0 deletions
|
@ -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);
|
||||
|
|
|
@ -755,6 +755,18 @@
|
|||
{}
|
||||
]
|
||||
],
|
||||
"css/body_bgcolor_attribute_change.html": [
|
||||
[
|
||||
"/_mozilla/css/body_bgcolor_attribute_change.html",
|
||||
[
|
||||
[
|
||||
"/_mozilla/css/body_bgcolor_attribute_change_ref.html",
|
||||
"=="
|
||||
]
|
||||
],
|
||||
{}
|
||||
]
|
||||
],
|
||||
"css/border-image-linear-gradient.html": [
|
||||
[
|
||||
"/_mozilla/css/border-image-linear-gradient.html",
|
||||
|
@ -8186,6 +8198,11 @@
|
|||
{}
|
||||
]
|
||||
],
|
||||
"css/body_bgcolor_attribute_change_ref.html": [
|
||||
[
|
||||
{}
|
||||
]
|
||||
],
|
||||
"css/border-image-linear-gradient-ref.html": [
|
||||
[
|
||||
{}
|
||||
|
@ -23067,6 +23084,14 @@
|
|||
"d0bf8fafec5ff2c0cfde8f0d47083ca23b745588",
|
||||
"support"
|
||||
],
|
||||
"css/body_bgcolor_attribute_change.html": [
|
||||
"87ac2d974938dccdec21b522af13ecd2ae9b1ab1",
|
||||
"reftest"
|
||||
],
|
||||
"css/body_bgcolor_attribute_change_ref.html": [
|
||||
"aa8be9d8b11635dc87f287530ef76ccf529a7ed9",
|
||||
"support"
|
||||
],
|
||||
"css/border-image-linear-gradient-ref.html": [
|
||||
"3c1b61477c8a3cb7befc3ab81b80a128b142e3f1",
|
||||
"support"
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="match" href="body_bgcolor_attribute_change_ref.html">
|
||||
</head>
|
||||
<body bgcolor="yellow" onclick="this.setAttribute('bgcolor', 'green');">
|
||||
Click me, I should become green.
|
||||
</body>
|
||||
<script>
|
||||
document.body.offsetTop;
|
||||
document.querySelector("body").setAttribute("bgcolor", "green");
|
||||
</script>
|
||||
</html>
|
|
@ -0,0 +1,6 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<body bgcolor="green" onclick="this.setAttribute('bgcolor', 'green');">
|
||||
Click me, I should become green.
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue