diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2017-06-15 20:28:56 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-15 20:28:56 -0700 |
commit | 33766b2714443399808c950e5bb74b1f124f2bc4 (patch) | |
tree | e55725db70e6f70b0d8d139097ca42646f021c14 /components/style/invalidation | |
parent | e3a52536b650f4aeb951b474936a0b67821f112e (diff) | |
parent | ffc45e9aaa59d5540c5f0480fbe13f48658ec593 (diff) | |
download | servo-33766b2714443399808c950e5bb74b1f124f2bc4.tar.gz servo-33766b2714443399808c950e5bb74b1f124f2bc4.zip |
Auto merge of #17348 - emilio:bup, r=bholley
style: Inline RestyleData.
Bug: 1368236
MozReview-Commit-ID: 49s3SO0PMHf
<!-- 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/17348)
<!-- Reviewable:end -->
Diffstat (limited to 'components/style/invalidation')
-rw-r--r-- | components/style/invalidation/element/invalidator.rs | 12 | ||||
-rw-r--r-- | components/style/invalidation/stylesheets.rs | 14 |
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; } } |