Don't clear RuleSet for MQ changes until active sheet update.
This is the implementation of phase 2 of [1]. When collecting rules from StyleSheetContents into a RuleSet, push refptrs to each @media or @import media query along with its current evaluation into a vector on the RuleSet. When a media feature value or the media type changes, mark stylesheet collections which has media queries for active stylesheet update, but no longer clear their current RuleSet. Instead evaluate the media query sets in the RuleSets during active stylesheet and clear the RuleSet if the media query evaluation changed. This should avoid clearing RuleSets, hence cause less invalidation on changing media query affecting values. [1] https://docs.google.com/document/d/1TMqAq4k3aTHNH1m2sYoj-5QAndNmEXLI1QeD-oQ7jWE/edit#heading=h.vxytkk66ckr2 Bug: 1014920, 589083 Change-Id: I6ef9ffdfb2d94987796db15ebb8c39669e7cf96a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2117110Reviewed-by:Anders Hartvoll Ruud <andruud@chromium.org> Commit-Queue: Rune Lillesveen <futhark@chromium.org> Cr-Commit-Position: refs/heads/master@{#752788}
Showing
Please register or sign in to comment