mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
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 -->
This commit is contained in:
commit
33766b2714
11 changed files with 183 additions and 202 deletions
|
@ -171,19 +171,14 @@ impl<T: ThreadSafeLayoutNode> ThreadSafeLayoutNodeHelpers for T {
|
|||
|
||||
let damage = {
|
||||
let data = node.get_raw_data().unwrap();
|
||||
if let Some(r) = data.style_data.element_data.borrow().get_restyle() {
|
||||
// We're reflowing a node that just got a restyle, and so the
|
||||
// damage has been computed and stored in the RestyleData.
|
||||
r.damage
|
||||
} else if !data.layout_data.borrow().flags.contains(::data::HAS_BEEN_TRAVERSED) {
|
||||
|
||||
if !data.layout_data.borrow().flags.contains(::data::HAS_BEEN_TRAVERSED) {
|
||||
// We're reflowing a node that was styled for the first time and
|
||||
// has never been visited by layout. Return rebuild_and_reflow,
|
||||
// because that's what the code expects.
|
||||
RestyleDamage::rebuild_and_reflow()
|
||||
} else {
|
||||
// We're reflowing a node whose style data didn't change, but whose
|
||||
// layout may change due to changes in ancestors or descendants.
|
||||
RestyleDamage::empty()
|
||||
data.style_data.element_data.borrow().restyle.damage
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue