mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-25 11:15:34 +00:00
Bug 1418433 - increment RestyleGeneration for undisplayed elements when updating servo stylist. r=heycam
In the current implementation, we call SetStylistStyleSheetsDirty() every time a style sheet is changed. However, the dirty bit setting may or may not always update the style data. For example, the style data for undisplayed elements are deliberately not updated in Stylo. However, the getComputedStyle API is supposed to provide a way to get the up-to-date computed style data, even for undisplayed elements. In this patch, we increment RestyleGeneration for undisplayed elements when we decide to update style data (i.e., calling ServoStyleSet::UpdateStylist()) due to (XBL)StyleSheet is dirty. This could flush the cached data that getComputedStyle API holds, and ensures the getComputedStyle API computes a new one. MozReview-Commit-ID: JDDhACOG3z4 --HG-- extra : rebase_source : 51d37757b5449d315aa7c2e0aedb4a4622e2a859
This commit is contained in:
parent
b44b5ae893
commit
52cf386fc1
@ -1330,6 +1330,11 @@ ServoStyleSet::UpdateStylist()
|
||||
mBindingManager->UpdateBoundContentBindingsForServo(mPresContext);
|
||||
}
|
||||
|
||||
// We need to invalidate cached style in getComputedStyle for undisplayed
|
||||
// elements, since we don't know if any of the style sheet change that we
|
||||
// do would affect undisplayed elements.
|
||||
mPresContext->RestyleManager()->AsServo()->IncrementUndisplayedRestyleGeneration();
|
||||
|
||||
mStylistState = StylistState::NotDirty;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user