mirror of
https://github.com/servo/servo.git
synced 2025-08-08 23:15:33 +01:00
style: Fix the broken invariants of the rule node cache.
We were spuriously reframing the <shadow> because it initially shared style with the <br>, which ended up being display: none, while the <shadow> should've been display: contents from the beginning. lookup_by_rules seems pretty prone to obscure bugs, and also it's pretty complex... Probably we should try to get rid of it, I'm unconvinced that it's worth it. Even with that, in a normal restyle the <details> wouldn't have ended up with a style. It of course never had it before the reframe because the <shadow> was display: none, but that doesn't mean it shouldn't have gotten one, since we detected we needed to go through kids in: https://searchfox.org/mozilla-central/rev/6eea08365e7386a2b81c044e7cc8a3daa51d8754/servo/components/style/matching.rs#500 That code did happen, but since it's an animation-only restyle, we don't look at unstyled stuff. That looks somewhat fishy, but I guess for now it's fine as long as display isn't animatable. Bug: 1469076 Reviewed-by: heycam MozReview-Commit-ID: B6NMSTNOKgK
This commit is contained in:
parent
8db8f95f1f
commit
3b90ddd5d1
2 changed files with 23 additions and 2 deletions
|
@ -19,6 +19,14 @@ use properties::longhands::position::computed_value::T as Position;
|
|||
/// NOTE(emilio): If new adjustments are introduced that depend on reset
|
||||
/// properties of the parent, you may need tweaking the
|
||||
/// `ChildCascadeRequirement` code in `matching.rs`.
|
||||
///
|
||||
/// NOTE(emilio): Also, if new adjustments are introduced that break the
|
||||
/// following invariant:
|
||||
///
|
||||
/// Given same tag name, namespace, rules and parent style, two elements would
|
||||
/// end up with exactly the same style.
|
||||
///
|
||||
/// Then you need to adjust the lookup_by_rules conditions in the sharing cache.
|
||||
pub struct StyleAdjuster<'a, 'b: 'a> {
|
||||
style: &'a mut StyleBuilder<'b>,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue