Repeatedly adding and removing the same stylesheet grows viewportDependentMediaQueryResults
Reported by
r...@opera.com,
May 23 2016
|
|||
Issue descriptionWe never reset m_viewportDependentMediaQueryResults in StyleResolver unless we clear the resolver. For certain operations where we end up with a Reset for AnalyzedStyleUpdate, it means the vector may grow large without increasing the number of stylesheets. With the attached vpdep.html, observe in the debugger that the array grows.
,
Oct 24 2016
,
Nov 24 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/4462ce68a6f0808d4f3d7e530b4920250d3675fd commit 4462ce68a6f0808d4f3d7e530b4920250d3675fd Author: rune <rune@opera.com> Date: Thu Nov 24 19:50:19 2016 Move MediaQueryResults to RuleFeatureSet. The existing code only cleared the query results on the StyleResolver when the StyleResolver was cleared. That meant we could end up in a situation where the result list was ever-growing. That wasn't a big issue in practice as the StyleResolver would be cleared quite often on stylesheet changes. However, that will change when the RuleSet based style invalidation is enabled. We move the media query results to RuleFeatureSet so that: - Results for @media rules are stored in RuleFeatureSet instead of RuleSet. - Results for media attributes are stored in the ScopedStyleResolver when added instead of appending them directly to StyleResolver. - Accumulated results for all scopes are stored in CSSGlobalRuleSet on StyleEngine instead of StyleResolver and are accumulated with other rule features in ScopedStyleResolver::collectFeaturesTo(). This CL introduces StyleEngine::ruleSetForSheet() for evaluating the media attribute of the stylesheet node and create the RuleSet if the media attribute matches. That way we are able to make the MediaQueryEvaluator private to StyleEngine. Also, this method is required when we start using ActiveStyleSheets. R=meade@chromium.org BUG= 567021 , 614026 Review-Url: https://codereview.chromium.org/2528633003 Cr-Commit-Position: refs/heads/master@{#434383} [modify] https://crrev.com/4462ce68a6f0808d4f3d7e530b4920250d3675fd/third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.cpp [modify] https://crrev.com/4462ce68a6f0808d4f3d7e530b4920250d3675fd/third_party/WebKit/Source/core/css/CSSStyleSheet.cpp [modify] https://crrev.com/4462ce68a6f0808d4f3d7e530b4920250d3675fd/third_party/WebKit/Source/core/css/CSSStyleSheet.h [modify] https://crrev.com/4462ce68a6f0808d4f3d7e530b4920250d3675fd/third_party/WebKit/Source/core/css/RuleFeature.cpp [modify] https://crrev.com/4462ce68a6f0808d4f3d7e530b4920250d3675fd/third_party/WebKit/Source/core/css/RuleFeature.h [modify] https://crrev.com/4462ce68a6f0808d4f3d7e530b4920250d3675fd/third_party/WebKit/Source/core/css/RuleSet.cpp [modify] https://crrev.com/4462ce68a6f0808d4f3d7e530b4920250d3675fd/third_party/WebKit/Source/core/css/RuleSet.h [modify] https://crrev.com/4462ce68a6f0808d4f3d7e530b4920250d3675fd/third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.cpp [modify] https://crrev.com/4462ce68a6f0808d4f3d7e530b4920250d3675fd/third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.h [modify] https://crrev.com/4462ce68a6f0808d4f3d7e530b4920250d3675fd/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp [modify] https://crrev.com/4462ce68a6f0808d4f3d7e530b4920250d3675fd/third_party/WebKit/Source/core/css/resolver/StyleResolver.h [modify] https://crrev.com/4462ce68a6f0808d4f3d7e530b4920250d3675fd/third_party/WebKit/Source/core/dom/StyleEngine.cpp [modify] https://crrev.com/4462ce68a6f0808d4f3d7e530b4920250d3675fd/third_party/WebKit/Source/core/dom/StyleEngine.h [modify] https://crrev.com/4462ce68a6f0808d4f3d7e530b4920250d3675fd/third_party/WebKit/Source/core/dom/StyleEngineTest.cpp [modify] https://crrev.com/4462ce68a6f0808d4f3d7e530b4920250d3675fd/third_party/WebKit/Source/core/frame/FrameView.cpp
,
Nov 24 2016
|
|||
►
Sign in to add a comment |
|||
Comment 1 by dstockwell@chromium.org
, Aug 10 2016