aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/invalidation
diff options
context:
space:
mode:
Diffstat (limited to 'components/style/invalidation')
-rw-r--r--components/style/invalidation/element/invalidator.rs12
-rw-r--r--components/style/invalidation/stylesheets.rs14
2 files changed, 11 insertions, 15 deletions
diff --git a/components/style/invalidation/element/invalidator.rs b/components/style/invalidation/element/invalidator.rs
index df92a4f3a8d..ed759076e23 100644
--- a/components/style/invalidation/element/invalidator.rs
+++ b/components/style/invalidation/element/invalidator.rs
@@ -114,7 +114,7 @@ impl<'a, 'b: 'a, E> TreeStyleInvalidator<'a, 'b, E>
// We can't just return here because there may also be attribute
// changes as well that imply additional hints.
let mut data = self.data.as_mut().unwrap();
- data.ensure_restyle().hint.insert(RestyleHint::restyle_subtree().into());
+ data.restyle.hint.insert(RestyleHint::restyle_subtree());
}
let mut classes_removed = SmallVec::<[Atom; 8]>::new();
@@ -211,7 +211,7 @@ impl<'a, 'b: 'a, E> TreeStyleInvalidator<'a, 'b, E>
if invalidated_self {
if let Some(ref mut data) = self.data {
- data.ensure_restyle().hint.insert(RESTYLE_SELF.into());
+ data.restyle.hint.insert(RESTYLE_SELF);
}
}
@@ -287,10 +287,8 @@ impl<'a, 'b: 'a, E> TreeStyleInvalidator<'a, 'b, E>
match self.data {
None => return false,
Some(ref data) => {
- if let Some(restyle) = data.get_restyle() {
- if restyle.hint.contains_subtree() {
- return false;
- }
+ if data.restyle.hint.contains_subtree() {
+ return false;
}
}
}
@@ -494,7 +492,7 @@ impl<'a, 'b: 'a, E> TreeStyleInvalidator<'a, 'b, E>
if invalidated_self {
if let Some(ref mut data) = self.data {
- data.ensure_restyle().hint.insert(RESTYLE_SELF.into());
+ data.restyle.hint.insert(RESTYLE_SELF);
}
}
diff --git a/components/style/invalidation/stylesheets.rs b/components/style/invalidation/stylesheets.rs
index c72a733467c..b28ae6fed87 100644
--- a/components/style/invalidation/stylesheets.rs
+++ b/components/style/invalidation/stylesheets.rs
@@ -134,7 +134,7 @@ impl StylesheetInvalidationSet {
if self.fully_invalid {
debug!("process_invalidations: fully_invalid({:?})",
element);
- data.ensure_restyle().hint.insert(RestyleHint::restyle_subtree());
+ data.restyle.hint.insert(RestyleHint::restyle_subtree());
return true;
}
}
@@ -165,19 +165,17 @@ impl StylesheetInvalidationSet {
return false;
}
- if let Some(ref r) = data.get_restyle() {
- if r.hint.contains_subtree() {
- debug!("process_invalidations_in_subtree: {:?} was already invalid",
- element);
- return false;
- }
+ if data.restyle.hint.contains_subtree() {
+ debug!("process_invalidations_in_subtree: {:?} was already invalid",
+ element);
+ return false;
}
for scope in &self.invalid_scopes {
if scope.matches(element) {
debug!("process_invalidations_in_subtree: {:?} matched {:?}",
element, scope);
- data.ensure_restyle().hint.insert(RestyleHint::restyle_subtree());
+ data.restyle.hint.insert(RestyleHint::restyle_subtree());
return true;
}
}