I confirmed that this assertion fires (along with the other failures)
when running layout/style/test/test_transitions_events.html with patch 3
but not patch 1.
Without this patch, patch 3 will cause bugs where we'll never remove the
cover rule we create during the process of starting a transition. This
won't actually be problematic during the transition, since the
transition will overwrite it, but once the transition completes, the
cover rule will still be around, and we'll be stuck with the
pre-transition value instead of the post-transition value.
It's possible it also fixes existing bugs prior to the patch series in
this bug.
I originally wrote this to see if it would fix bug 1086937, but it
didn't.
Note that this conflicts a bit with the patch in bug 1085769; whoever
lands second will have some merging (though it shouldn't be difficult).
The updating of the style rule is needed as part of the animation-only
style update, but it shouldn't be in the general restyling code, so it
has moved there.
This is an additional bit on nsRestyleHint that says that the restyling
operation should also perform all the work needed to switch between
style-without-animation and style-with-animation (based on
nsPresContext::IsProcessingAnimationStyleChange). These concepts will
go away in bug 960465.
Note that we don't want this behavior for the animation-only style
update code (bug 996796, etc.), and I wanted to make this explicit so
that it was clear when it was happening, and so that it was clear what
code should be removed when we git rid of it.
This is the workaround needed to land bug 977991 prior to bug 960465.
(I think there's also a minor dependency in the other direction, so we
need a workaround one way or the other.)
Note that this depends on bug 1057231.
This allows posting a restyle that says that only the rule(s) from the
StyleAttrSheet cascade level will be replaced, which avoids running
selector matching.
Part 4 will ensure that we only invoke this code for element styles (and
not pseudo-element or anonymous box styles). Despite that, I prefer
having the runtime check here as well given that it's a very simple way
to ensure we don't do something silly that might have security
implications.
This allows posting a restyle that says that only the rule(s) from the
SVGAttrAnimationSheet cascade level will be replaced, which avoids running
selector matching.
This is needed to land bug 977991 prior to landing bug 960465, since
that requires replacing all levels that contain animations.
(I'll rename this to match the name determined in bug 1057231.)
I will fix the indentation of gCascadeLevels in bug 977991 patch 2,
which adds a member to each element of the array.
Note that this bumps the maximum sheetType from 8 to 9 (and number of
them from 9 to 10), which does not require updating
NS_RULE_NODE_LEVEL_MASK, since NS_RULE_NODE_LEVEL_MASK currently has 4
bits and allows a maximum of 15.
This is fine since the assertion is just checking that we're not calling
RuleNodeWithReplacement in cases when stronger restyling (i.e.,
restyling that does more work) is needed; the new eRestyle_Force and
eRestyle_ForceDescendants flags control whether we restyle at all.
This probably should have been done in bug 931668 (since bug 996796
landed before bug 931668, although not before the patches were written),
but it doesn't actually show up in our test suite until bug 977991 (or
maybe slightly earlier in bug 1057231 or bug 1058346).
This matches patch 2, and also fixes an incorrect use of eRestyle_Self
on the parents of pseudo-elements in order to restyle those
pseudo-elements, where it would not previously have been effective.
This should all be temporary, since this code can go away with bug
960465, when animation phases are removed.
Note that we're not yet using this code for style contexts that have
pseudo-elements, since we don't run transitions or animations on
pseudo-elements on the compositor thread. But bug 960465 will (with
some more work) start doing so.
The added test passes locally on Linux with OMT compositing and OMT
animations enabled. However, it also passes without the patch because
the calls to FlushAnimations and FlushTransitions from
PresShell::FlushPendingNotifications cover up the damage done by bugs in
the animation-only style flush.
Unfortunately due to lack of global history on B2G and not running OMT
animations tests on any other platforms, the new test won't actually run
in automation right now.
ResolveStyleForRules had various problems: it failed to set importance
correctly and really only handled replacing a path in the rule tree
since it didn't handle creating important rules. (Possibly more.)
This means ResolveStyleWithReplacement will replace only the rules in
the nsRestyleHint rather than always replacing both the animations rule
and the transitions rule. (This will become even more useful later when
we add the ability to replace the style attribute rule.)
I believe this will fix some cache misses in the FindChildWithRules
lookup when restyling. I don't think it will fix any correctness bugs
because the RelevantLinkVisited() bit will always end up set to true
anyway as the non-link descendant of a visited link style context, and
link descendants shouldn't be able to share styles with non-link
descendants due to matching rules in the UA style sheet.