Commit 4706ab0f authored by Anders Hartvoll Ruud's avatar Anders Hartvoll Ruud Committed by Commit Bot

Update active style in InspectorCSSAgent::MatchingStyles

MatchingStyles can apparently be called from from within probe::
AnimationPlayStateChanged. Updating style synchronously here means
that new animations can start (via CSS animations). The animations team
wants to prohibit starting/updating animations from within the probe
call (see bug for details). Therefore we must avoid recalculating
style here, since that _may_ trigger new/updated animations.

As it happens, we don't actually need to recalculate the style, since
this function is only matching selectors. It's sufficient to
UpdateActiveStyle() instead, which ensures that information needed for
selector matching is up-to-date.

Fixed: 1106539
Change-Id: I75eb10ee1792f78ca1e5d44e42a63974af55162a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2317795Reviewed-by: default avatarAlex Rudenko <alexrudenko@chromium.org>
Reviewed-by: default avatarPeter Marshall <petermarshall@chromium.org>
Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org>
Cr-Commit-Position: refs/heads/master@{#792213}
parent 4cf90a0b
......@@ -2326,7 +2326,7 @@ HeapVector<Member<CSSStyleDeclaration>> InspectorCSSAgent::MatchingStyles(
// This ensures that active stylesheets are up-to-date, such that
// the subsequent collection of matching rules actually match against
// the correct RuleSets.
element->GetDocument().UpdateStyleAndLayoutTreeForNode(element);
element->GetDocument().GetStyleEngine().UpdateActiveStyle();
HeapVector<Member<CSSStyleRule>> rules =
FilterDuplicateRules(style_resolver.PseudoCSSRulesForElement(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment