Move StyleResolver ownership from Document/ShadowRoot to Style::Scope
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 8 Oct 2016 08:42:03 +0000 (08:42 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 8 Oct 2016 08:42:03 +0000 (08:42 +0000)
commit6cd522c534aaecbf420f30f1df185a302cff46da
tree92c70c2248fc0250902c4c0c18adef4cbaced281
parent845ca1422e3d319d1a4422265a04bd31d54d0ca5
Move StyleResolver ownership from Document/ShadowRoot to Style::Scope
https://bugs.webkit.org/show_bug.cgi?id=163148

Reviewed by Andreas Kling.

Reduce duplication between Document and ShadowRoot.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::didMutateRules):
* css/ElementRuleCollector.cpp:
(WebCore::ElementRuleCollector::matchHostPseudoClassRules):
(WebCore::ElementRuleCollector::matchSlottedPseudoElementRules):
* css/MediaQueryMatcher.cpp:
(WebCore::MediaQueryMatcher::documentElementUserAgentStyle):
* css/StyleMedia.cpp:
(WebCore::StyleMedia::matchMedium):
* css/parser/SizesAttributeParser.cpp:
(WebCore::SizesAttributeParser::mediaConditionMatches):
* dom/Document.cpp:
(WebCore::Document::~Document):
(WebCore::Document::childrenChanged):
(WebCore::Document::isPageBoxVisible):
(WebCore::Document::pageSizeAndMarginsInPixels):
(WebCore::Document::userAgentShadowTreeStyleResolver):
(WebCore::Document::fontsNeedUpdate):
(WebCore::Document::didClearStyleResolver):
(WebCore::Document::updateViewportUnitsOnResize):
(WebCore::Document::createStyleResolver): Deleted.
(WebCore::Document::clearStyleResolver): Deleted.
* dom/Document.h:
(WebCore::Document::styleResolverIfExists): Deleted.
(WebCore::Document::ensureStyleResolver): Deleted.
* dom/Element.cpp:
(WebCore::Element::styleResolver):
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::styleResolver): Deleted.
(WebCore::ShadowRoot::styleResolverIfExists): Deleted.
(WebCore::ShadowRoot::resetStyleResolver): Deleted.
* dom/ShadowRoot.h:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::getMatchedCSSRules):
* page/FrameView.cpp:
(WebCore::FrameView::layout):
* page/Page.cpp:
(WebCore::Page::updateStyleForAllPagesAfterGlobalChangeInEnvironment):
* page/PrintContext.cpp:
(WebCore::PrintContext::pageProperty):
* platform/MemoryPressureHandler.cpp:
(WebCore::MemoryPressureHandler::releaseCriticalMemory):
* style/AttributeChangeInvalidation.cpp:
(WebCore::Style::mayBeAffectedByHostStyle):
* style/ClassChangeInvalidation.cpp:
(WebCore::Style::mayBeAffectedByHostStyle):
* style/IdChangeInvalidation.cpp:
(WebCore::Style::mayBeAffectedByHostStyle):
* style/StyleScope.cpp:
(WebCore::Style::Scope::resolver):
(WebCore::Style::Scope::resolverIfExists):
(WebCore::Style::Scope::clearResolver):
(WebCore::Style::Scope::analyzeStyleSheetChange):
(WebCore::Style::Scope::updateActiveStyleSheets):
(WebCore::Style::Scope::updateStyleResolver):
(WebCore::Style::Scope::styleResolver): Deleted.
(WebCore::Style::Scope::styleResolverIfExists): Deleted.
* style/StyleScope.h:
* style/StyleSharingResolver.cpp:
(WebCore::Style::SharingResolver::resolve):
(WebCore::Style::SharingResolver::canShareStyleWithElement):
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::Scope::Scope):
(WebCore::Style::TreeResolver::resolve):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@206951 268f45cc-cd09-0410-ab3c-d52691b4dbfc
24 files changed:
Source/WebCore/ChangeLog
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSStyleSheet.cpp
Source/WebCore/css/ElementRuleCollector.cpp
Source/WebCore/css/MediaQueryMatcher.cpp
Source/WebCore/css/StyleMedia.cpp
Source/WebCore/css/parser/SizesAttributeParser.cpp
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Document.h
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/ShadowRoot.cpp
Source/WebCore/dom/ShadowRoot.h
Source/WebCore/page/DOMWindow.cpp
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/Page.cpp
Source/WebCore/page/PrintContext.cpp
Source/WebCore/platform/MemoryPressureHandler.cpp
Source/WebCore/style/AttributeChangeInvalidation.cpp
Source/WebCore/style/ClassChangeInvalidation.cpp
Source/WebCore/style/IdChangeInvalidation.cpp
Source/WebCore/style/StyleScope.cpp
Source/WebCore/style/StyleScope.h
Source/WebCore/style/StyleSharingResolver.cpp
Source/WebCore/style/StyleTreeResolver.cpp