Remove StyleResolver::State::m_parentNode
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Mar 2014 17:29:09 +0000 (17:29 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Mar 2014 17:29:09 +0000 (17:29 +0000)
commit339fdfc11268396ca592ddaaaeec75caec324e3c
treed13d957b608b86d930f5c4b8683937f4ae78d580
parent7585f77b0a6a6d2f0b2a4a675df6d53361b375b7
Remove StyleResolver::State::m_parentNode
https://bugs.webkit.org/show_bug.cgi?id=130194

Reviewed by Andreas Kling.

This variable was the "parent" node where the style was being inherited from, not the actual parent.
The code would also recompute it even though the call sites generally know the rendering parent already.

If we consistently pass parent style to StyleResolver::styleForElement we won't need the variable and
the associated code. We also get rid of one more client of NodeRenderingTraversal.

* css/MediaQueryMatcher.cpp:
(WebCore::MediaQueryMatcher::prepareEvaluator):
* css/SVGCSSStyleSelector.cpp:
(WebCore::StyleResolver::applySVGProperty):
* css/StyleMedia.cpp:
(WebCore::StyleMedia::matchMedium):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::State::clear):
(WebCore::StyleResolver::StyleResolver):
(WebCore::StyleResolver::State::initForStyleResolve):
(WebCore::StyleResolver::applyProperty):
* css/StyleResolver.h:
(WebCore::StyleResolver::document):
(WebCore::StyleResolver::State::State):
* dom/Element.cpp:
(WebCore::Element::customStyleForRenderer):

    Add parentStyle parameter.

* dom/Element.h:
* dom/PseudoElement.cpp:
(WebCore::PseudoElement::customStyleForRenderer):
* dom/PseudoElement.h:
* html/HTMLOptGroupElement.cpp:
(WebCore::HTMLOptGroupElement::didAttachRenderers):
(WebCore::HTMLOptGroupElement::updateNonRenderStyle):
(WebCore::HTMLOptGroupElement::customStyleForRenderer):
* html/HTMLOptGroupElement.h:
* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::didAttachRenderers):
(WebCore::HTMLOptionElement::updateNonRenderStyle):
(WebCore::HTMLOptionElement::customStyleForRenderer):
* html/HTMLOptionElement.h:
* html/HTMLTitleElement.cpp:
(WebCore::HTMLTitleElement::textWithDirection):
* html/shadow/TextControlInnerElements.cpp:
(WebCore::TextControlInnerElement::customStyleForRenderer):
(WebCore::TextControlInnerTextElement::customStyleForRenderer):
* html/shadow/TextControlInnerElements.h:
* rendering/RenderNamedFlowFragment.cpp:
(WebCore::RenderNamedFlowFragment::computeStyleInRegion):
(WebCore::RenderNamedFlowFragment::computeChildrenStyleInRegion):
(WebCore::RenderNamedFlowFragment::setRegionObjectsRegionStyle):
* rendering/RenderNamedFlowFragment.h:
* style/StyleResolveTree.cpp:
(WebCore::Style::styleForElement):

    This used to be Element::styleForRenderer. It is now a standalone static.

(WebCore::Style::elementInsideRegionNeedsRenderer):
(WebCore::Style::createRendererIfNeeded):
(WebCore::Style::resolveLocal):
* svg/SVGElement.cpp:
(WebCore::SVGElement::customStyleForRenderer):
* svg/SVGElement.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@165542 268f45cc-cd09-0410-ab3c-d52691b4dbfc
22 files changed:
Source/WebCore/ChangeLog
Source/WebCore/css/MediaQueryMatcher.cpp
Source/WebCore/css/SVGCSSStyleSelector.cpp
Source/WebCore/css/StyleMedia.cpp
Source/WebCore/css/StyleResolver.cpp
Source/WebCore/css/StyleResolver.h
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/Element.h
Source/WebCore/dom/PseudoElement.cpp
Source/WebCore/dom/PseudoElement.h
Source/WebCore/html/HTMLOptGroupElement.cpp
Source/WebCore/html/HTMLOptGroupElement.h
Source/WebCore/html/HTMLOptionElement.cpp
Source/WebCore/html/HTMLOptionElement.h
Source/WebCore/html/HTMLTitleElement.cpp
Source/WebCore/html/shadow/TextControlInnerElements.cpp
Source/WebCore/html/shadow/TextControlInnerElements.h
Source/WebCore/rendering/RenderNamedFlowFragment.cpp
Source/WebCore/rendering/RenderNamedFlowFragment.h
Source/WebCore/style/StyleResolveTree.cpp
Source/WebCore/svg/SVGElement.cpp
Source/WebCore/svg/SVGElement.h