De-virtualize recalcStyle()
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Sep 2011 11:19:35 +0000 (11:19 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Sep 2011 11:19:35 +0000 (11:19 +0000)
commit3fe62ea86181a9376f55789c8e30debb185e41dc
tree8314fbd2cabb843af07db1932a894779119c12d4
parentac4eb0a997206850813f3a6170a41970c24536a0
De-virtualize recalcStyle()
https://bugs.webkit.org/show_bug.cgi?id=67378

Reviewed by Dimitri Glazkov.

Element::recalcStyle() does not need to be virtual, there are very few legit overrides. This will
also make it possible to de-recursify it later.

Added willRecalcStyle()/didRecalcStyle() virtual function for subclasses that need custom style recalc.
These are only invoked if hasCustomWillOrDidRecalcStyle() bit is set.

* dom/Document.cpp:
(WebCore::Document::recalcStyle):
* dom/Document.h:
* dom/Element.cpp:
(WebCore::Element::recalcStyle):
* dom/Element.h:
(WebCore::Element::willRecalcStyle):
(WebCore::Element::didRecalcStyle):
* dom/Node.h:
(WebCore::Node::hasCustomWillOrDidRecalcStyle):
(WebCore::Node::setHasCustomWillOrDidRecalcStyle):
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::recalcShadowTreeStyle):
* dom/ShadowRoot.h:
* dom/Text.cpp:
(WebCore::Text::recalcTextStyle):
* dom/Text.h:
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::HTMLFormControlElement):
(WebCore::HTMLFormControlElement::didRecalcStyle):
* html/HTMLFormControlElement.h:
* html/HTMLFrameSetElement.cpp:
(WebCore::HTMLFrameSetElement::HTMLFrameSetElement):
(WebCore::HTMLFrameSetElement::willRecalcStyle):
* html/HTMLFrameSetElement.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement):
(WebCore::HTMLMediaElement::didRecalcStyle):
* html/HTMLMediaElement.h:
* html/HTMLNoScriptElement.cpp:
(WebCore::HTMLNoScriptElement::HTMLNoScriptElement):
(WebCore::HTMLNoScriptElement::willRecalcStyle):
* html/HTMLNoScriptElement.h:
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::HTMLPlugInImageElement):
(WebCore::HTMLPlugInImageElement::willRecalcStyle):
* html/HTMLPlugInImageElement.h:
* html/HTMLSelectElement.cpp:
* html/HTMLSelectElement.h:
* svg/SVGTRefElement.cpp:
(WebCore::SVGTRefElement::SVGTRefElement):
(WebCore::SVGShadowText::willRecalcStyle):
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::SVGUseElement):
(WebCore::SVGUseElement::willRecalcStyle):
(WebCore::SVGUseElement::didRecalcStyle):
* svg/SVGUseElement.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94406 268f45cc-cd09-0410-ab3c-d52691b4dbfc
25 files changed:
Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Document.h
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/Element.h
Source/WebCore/dom/Node.h
Source/WebCore/dom/ShadowRoot.cpp
Source/WebCore/dom/ShadowRoot.h
Source/WebCore/dom/Text.cpp
Source/WebCore/dom/Text.h
Source/WebCore/html/HTMLFormControlElement.cpp
Source/WebCore/html/HTMLFormControlElement.h
Source/WebCore/html/HTMLFrameSetElement.cpp
Source/WebCore/html/HTMLFrameSetElement.h
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLMediaElement.h
Source/WebCore/html/HTMLNoScriptElement.cpp
Source/WebCore/html/HTMLNoScriptElement.h
Source/WebCore/html/HTMLPlugInImageElement.cpp
Source/WebCore/html/HTMLPlugInImageElement.h
Source/WebCore/html/HTMLSelectElement.cpp
Source/WebCore/html/HTMLSelectElement.h
Source/WebCore/svg/SVGTRefElement.cpp
Source/WebCore/svg/SVGUseElement.cpp
Source/WebCore/svg/SVGUseElement.h