aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/document.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/document.rs')
-rw-r--r--components/script/dom/document.rs13
1 files changed, 10 insertions, 3 deletions
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs
index 8211830e9eb..39c617c8099 100644
--- a/components/script/dom/document.rs
+++ b/components/script/dom/document.rs
@@ -131,7 +131,7 @@ use std::rc::Rc;
use std::time::{Duration, Instant};
use style::attr::AttrValue;
use style::context::{QuirksMode, ReflowGoal};
-use style::restyle_hints::{RestyleHint, RESTYLE_STYLE_ATTRIBUTE};
+use style::invalidation::element::restyle_hints::{RestyleHint, RESTYLE_SELF, RESTYLE_STYLE_ATTRIBUTE};
use style::selector_parser::{RestyleDamage, Snapshot};
use style::shared_lock::SharedRwLock as StyleSharedRwLock;
use style::str::{HTML_SPACE_CHARACTERS, split_html_space_chars, str_join};
@@ -2376,17 +2376,24 @@ impl Document {
entry.snapshot = Some(Snapshot::new(el.html_element_in_html_document()));
}
if attr.local_name() == &local_name!("style") {
- entry.hint.insert(RestyleHint::for_replacements(RESTYLE_STYLE_ATTRIBUTE));
+ entry.hint.insert(RESTYLE_STYLE_ATTRIBUTE);
}
// FIXME(emilio): This should become something like
// element.is_attribute_mapped(attr.local_name()).
if attr.local_name() == &local_name!("width") ||
attr.local_name() == &local_name!("height") {
- entry.hint.insert(RestyleHint::for_self());
+ entry.hint.insert(RESTYLE_SELF);
}
let mut snapshot = entry.snapshot.as_mut().unwrap();
+ if attr.local_name() == &local_name!("id") {
+ snapshot.id_changed = true;
+ } else if attr.local_name() == &local_name!("class") {
+ snapshot.class_changed = true;
+ } else {
+ snapshot.other_attributes_changed = true;
+ }
if snapshot.attrs.is_none() {
let attrs = el.attrs()
.iter()