Changeset 154809 in webkit


Ignore:
Timestamp:
Aug 29, 2013, 7:02:22 AM (12 years ago)
Author:
Antti Koivisto
Message:

Remove NodeRenderingContext
https://bugs.webkit.org/show_bug.cgi?id=120466

Reviewed by Andreas Kling.

Switch the few remaining clients of this class to call the underlying code directly.

  • CMakeLists.txt:
  • GNUmakefile.list.am:
  • Target.pri:
  • WebCore.exp.in:
  • WebCore.vcxproj/WebCore.vcxproj:
  • WebCore.xcodeproj/project.pbxproj:
  • css/StyleResolver.cpp:

(WebCore::StyleResolver::State::initForStyleResolve):

  • dom/DOMAllInOne.cpp:
  • dom/Node.cpp:
  • dom/Node.h:


Remove Node::parentNodeForRenderingAndStyle(). Make clients invoke NodeRenderingTraversal::parent() directly.

  • dom/NodeRenderingContext.cpp: Removed.
  • dom/NodeRenderingContext.h: Removed.
  • dom/ShadowRoot.h:
  • dom/Text.cpp:
  • dom/Text.h:
  • dom/TreeScope.cpp:
  • dom/TreeScope.h:


Remove virtual TreeScope::resetStyleInheritance. Make clients cast to ShadowRoot when needed.

  • html/HTMLSummaryElement.cpp:

(WebCore::HTMLSummaryElement::detailsElement):

  • style/StyleResolveTree.cpp:

(WebCore::Style::createTextRendererIfNeeded):

For consistency switch resetStyleInheritance check to use parentNode() instead of renderingParentNode. This matches the NodeRenderingTraversal implementation.
This difference is probably not testable in current trunk.

(WebCore::Style::resolveTree):

Location:
trunk/Source/WebCore
Files:
2 deleted
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/CMakeLists.txt

    r154778 r154809  
    11991199    dom/NodeIterator.cpp
    12001200    dom/NodeRareData.cpp
    1201     dom/NodeRenderingContext.cpp
    12021201    dom/NodeRenderingTraversal.cpp
    12031202    dom/NodeTraversal.cpp
  • trunk/Source/WebCore/ChangeLog

    r154806 r154809  
     12013-08-29  Antti Koivisto  <antti@apple.com>
     2
     3        Remove NodeRenderingContext
     4        https://bugs.webkit.org/show_bug.cgi?id=120466
     5
     6        Reviewed by Andreas Kling.
     7
     8        Switch the few remaining clients of this class to call the underlying code directly.
     9
     10        * CMakeLists.txt:
     11        * GNUmakefile.list.am:
     12        * Target.pri:
     13        * WebCore.exp.in:
     14        * WebCore.vcxproj/WebCore.vcxproj:
     15        * WebCore.xcodeproj/project.pbxproj:
     16        * css/StyleResolver.cpp:
     17        (WebCore::StyleResolver::State::initForStyleResolve):
     18        * dom/DOMAllInOne.cpp:
     19        * dom/Node.cpp:
     20        * dom/Node.h:
     21       
     22            Remove Node::parentNodeForRenderingAndStyle(). Make clients invoke NodeRenderingTraversal::parent() directly.
     23
     24        * dom/NodeRenderingContext.cpp: Removed.
     25        * dom/NodeRenderingContext.h: Removed.
     26        * dom/ShadowRoot.h:
     27        * dom/Text.cpp:
     28        * dom/Text.h:
     29        * dom/TreeScope.cpp:
     30        * dom/TreeScope.h:
     31           
     32            Remove virtual TreeScope::resetStyleInheritance. Make clients cast to ShadowRoot when needed.
     33
     34        * html/HTMLSummaryElement.cpp:
     35        (WebCore::HTMLSummaryElement::detailsElement):
     36        * style/StyleResolveTree.cpp:
     37        (WebCore::Style::createTextRendererIfNeeded):
     38       
     39            For consistency switch resetStyleInheritance check to use parentNode() instead of renderingParentNode. This matches the NodeRenderingTraversal implementation.
     40            This difference is probably not testable in current trunk.
     41
     42        (WebCore::Style::resolveTree):
     43
    1442013-08-29  Antti Koivisto  <antti@apple.com>
    245
  • trunk/Source/WebCore/GNUmakefile.list.am

    r154778 r154809  
    29692969        Source/WebCore/dom/NodeFilter.h \
    29702970        Source/WebCore/dom/NodeRareData.cpp \
    2971         Source/WebCore/dom/NodeRenderingContext.cpp \
    29722971        Source/WebCore/dom/Node.h \
    29732972        Source/WebCore/dom/NodeIterator.cpp \
     
    29752974        Source/WebCore/dom/NodeList.h \
    29762975        Source/WebCore/dom/NodeRareData.h \
    2977         Source/WebCore/dom/NodeRenderingContext.h \
    29782976        Source/WebCore/dom/NodeRenderingTraversal.h \
    29792977        Source/WebCore/dom/NodeRenderingTraversal.cpp \
  • trunk/Source/WebCore/Target.pri

    r154778 r154809  
    448448    dom/NodeIterator.cpp \
    449449    dom/NodeRareData.cpp \
    450     dom/NodeRenderingContext.cpp \
    451450    dom/NodeRenderingTraversal.cpp \
    452451    dom/NodeTraversal.cpp \
     
    16591658    dom/NodeIterator.h \
    16601659    dom/NodeRareData.h \
    1661     dom/NodeRenderingContext.h \
    16621660    dom/NodeRenderingTraversal.h \
    16631661    dom/NodeTraversal.h \
  • trunk/Source/WebCore/WebCore.exp.in

    r154780 r154809  
    666666__ZN7WebCore20DisplaySleepDisablerC1EPKc
    667667__ZN7WebCore20DisplaySleepDisablerD1Ev
    668 __ZN7WebCore20NodeRenderingContextC1EPNS_4NodeE
    669 __ZN7WebCore20NodeRenderingContextD1Ev
    670668__ZN7WebCore20RenderEmbeddedObject29setPluginUnavailabilityReasonENS0_26PluginUnavailabilityReasonE
    671669__ZN7WebCore20RenderEmbeddedObject37setUnavailablePluginIndicatorIsHiddenEb
  • trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj

    r154783 r154809  
    1298212982    </ClCompile>
    1298312983    <ClCompile Include="..\dom\NodeRareData.cpp" />
    12984     <ClCompile Include="..\dom\NodeRenderingContext.cpp">
    12985       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
    12986       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
    12987       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
    12988       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>
    12989       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
    12990       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
    12991       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
    12992       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
    12993       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
    12994       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
    12995       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
    12996       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
    12997     </ClCompile>
    1299812984    <ClCompile Include="..\dom\NodeTraversal.cpp" />
    1299912985    <ClCompile Include="..\dom\Notation.cpp">
     
    2032420310    <ClInclude Include="..\dom\NodeFilterCondition.h" />
    2032520311    <ClInclude Include="..\dom\NodeIterator.h" />
    20326     <ClInclude Include="..\dom\NodeRenderingContext.h" />
    2032720312    <ClInclude Include="..\dom\NodeTraversal.h" />
    2032820313    <ClInclude Include="..\dom\Notation.h" />
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r154778 r154809  
    34503450                A7DBF8DD1276919C006B6008 /* TextCheckingHelper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7DBF8DB1276919C006B6008 /* TextCheckingHelper.cpp */; };
    34513451                A7DBF8DE1276919C006B6008 /* TextCheckingHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = A7DBF8DC1276919C006B6008 /* TextCheckingHelper.h */; };
    3452                 A7F5D94F1384F02D00A29A87 /* NodeRenderingContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7F5D94D1384F02D00A29A87 /* NodeRenderingContext.cpp */; };
    3453                 A7F5D9501384F02D00A29A87 /* NodeRenderingContext.h in Headers */ = {isa = PBXBuildFile; fileRef = A7F5D94E1384F02D00A29A87 /* NodeRenderingContext.h */; };
    34543452                A80A38FE0E50CC8200A25EBC /* PatternCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A80A38FD0E50CC8200A25EBC /* PatternCG.cpp */; };
    34553453                A80D67080E9E9DEB00E420F0 /* GraphicsContextPlatformPrivateCG.h in Headers */ = {isa = PBXBuildFile; fileRef = A80D67070E9E9DEB00E420F0 /* GraphicsContextPlatformPrivateCG.h */; };
     
    99059903                A7F1F4C017148BDB00CD4852 /* StorageUsageCallback.idl */ = {isa = PBXFileReference; lastKnownFileType = text; name = StorageUsageCallback.idl; path = Modules/quota/StorageUsageCallback.idl; sourceTree = SOURCE_ROOT; };
    99069904                A7F1F4C117148BDB00CD4852 /* WorkerNavigatorStorageQuota.idl */ = {isa = PBXFileReference; lastKnownFileType = text; name = WorkerNavigatorStorageQuota.idl; path = Modules/quota/WorkerNavigatorStorageQuota.idl; sourceTree = SOURCE_ROOT; };
    9907                 A7F5D94D1384F02D00A29A87 /* NodeRenderingContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NodeRenderingContext.cpp; sourceTree = "<group>"; };
    9908                 A7F5D94E1384F02D00A29A87 /* NodeRenderingContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NodeRenderingContext.h; sourceTree = "<group>"; };
    99099905                A7F73ED9169AD7AA00CBAA4B /* DOMShadowRoot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMShadowRoot.h; sourceTree = "<group>"; };
    99109906                A7F73EDA169AD7AA00CBAA4B /* DOMShadowRoot.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMShadowRoot.mm; sourceTree = "<group>"; };
     
    2035120347                                4FAB48661643A67E00F70C07 /* NodeRareData.cpp */,
    2035220348                                63189AE20E83A33300012E41 /* NodeRareData.h */,
    20353                                 A7F5D94D1384F02D00A29A87 /* NodeRenderingContext.cpp */,
    20354                                 A7F5D94E1384F02D00A29A87 /* NodeRenderingContext.h */,
    2035520349                                A7211F231678A54200957444 /* NodeRenderingTraversal.cpp */,
    2035620350                                A7211F241678A54200957444 /* NodeRenderingTraversal.h */,
     
    2284422838                                A818721B0977D3C0005826D9 /* NodeList.h in Headers */,
    2284522839                                63189AE30E83A33300012E41 /* NodeRareData.h in Headers */,
    22846                                 A7F5D9501384F02D00A29A87 /* NodeRenderingContext.h in Headers */,
    2284722840                                A74F3EF51678B24F00B05A6E /* NodeRenderingTraversal.h in Headers */,
    2284822841                                63D7B32D0E78CD3F00F7617C /* NodeRenderStyle.h in Headers */,
     
    2603926032                                854FE7340A2297BE0058D7AD /* NodeIterator.cpp in Sources */,
    2604026033                                4FFC022B1643B710004E1638 /* NodeRareData.cpp in Sources */,
    26041                                 A7F5D94F1384F02D00A29A87 /* NodeRenderingContext.cpp in Sources */,
    2604226034                                A74F3EF31678B24A00B05A6E /* NodeRenderingTraversal.cpp in Sources */,
    2604326035                                E43105B816750F0C00DB2FB8 /* NodeTraversal.cpp in Sources */,
  • trunk/Source/WebCore/css/StyleResolver.cpp

    r154327 r154809  
    8484#include "MediaQueryEvaluator.h"
    8585#include "NodeRenderStyle.h"
    86 #include "NodeRenderingContext.h"
     86#include "NodeRenderingTraversal.h"
    8787#include "Page.h"
    8888#include "PageRuleCollector.h"
     
    429429
    430430    if (e) {
    431         NodeRenderingContext context(e);
    432         m_parentNode = context.parentNodeForRenderingAndStyle();
    433         m_parentStyle = context.resetStyleInheritance() ? 0 :
     431        m_parentNode = NodeRenderingTraversal::parent(e);
     432        bool resetStyleInheritance = hasShadowRootParent(e) && toShadowRoot(e->parentNode())->resetStyleInheritance();
     433        m_parentStyle = resetStyleInheritance ? 0 :
    434434            parentStyle ? parentStyle :
    435435            m_parentNode ? m_parentNode->renderStyle() : 0;
  • trunk/Source/WebCore/dom/DOMAllInOne.cpp

    r154271 r154809  
    107107#include "NodeFilterCondition.cpp"
    108108#include "NodeIterator.cpp"
    109 #include "NodeRenderingContext.cpp"
    110109#include "NodeRenderingTraversal.cpp"
    111110#include "Notation.cpp"
  • trunk/Source/WebCore/dom/Node.cpp

    r154769 r154809  
    8080#include "NamedNodeMap.h"
    8181#include "NodeRareData.h"
    82 #include "NodeRenderingContext.h"
    8382#include "NodeTraversal.h"
    8483#include "Page.h"
     
    943942}
    944943
    945 ContainerNode* Node::parentNodeForRenderingAndStyle()
    946 {
    947     return NodeRenderingContext(this).parentNodeForRenderingAndStyle();
    948 }
    949 
    950944RenderStyle* Node::virtualComputedStyle(PseudoId pseudoElementSpecifier)
    951945{
  • trunk/Source/WebCore/dom/Node.h

    r154414 r154809  
    464464    RenderBox* renderBox() const;
    465465    RenderBoxModelObject* renderBoxModelObject() const;
    466 
    467     ContainerNode* parentNodeForRenderingAndStyle();
    468466   
    469467    // Wrapper for nodes that don't have a renderer, but still cache the style (like HTMLOptionElement).
  • trunk/Source/WebCore/dom/ShadowRoot.h

    r154371 r154809  
    5959    virtual bool applyAuthorStyles() const OVERRIDE { return m_applyAuthorStyles; }
    6060    void setApplyAuthorStyles(bool);
    61     virtual bool resetStyleInheritance() const OVERRIDE { return m_resetStyleInheritance; }
     61    bool resetStyleInheritance() const { return m_resetStyleInheritance; }
    6262    void setResetStyleInheritance(bool);
    6363
  • trunk/Source/WebCore/dom/Text.cpp

    r154738 r154809  
    2525#include "ExceptionCode.h"
    2626#include "ExceptionCodePlaceholder.h"
    27 #include "NodeRenderingContext.h"
    2827#include "RenderCombineText.h"
    2928#include "RenderText.h"
  • trunk/Source/WebCore/dom/Text.h

    r154738 r154809  
    2929namespace WebCore {
    3030
    31 class NodeRenderingContext;
    3231class RenderText;
    3332
  • trunk/Source/WebCore/dom/TreeScope.cpp

    r154679 r154809  
    362362}
    363363
    364 bool TreeScope::resetStyleInheritance() const
    365 {
    366     return false;
    367 }
    368 
    369364void TreeScope::adoptIfNeeded(Node* node)
    370365{
  • trunk/Source/WebCore/dom/TreeScope.h

    r150733 r154809  
    9595
    9696    virtual bool applyAuthorStyles() const;
    97     virtual bool resetStyleInheritance() const;
    9897
    9998    // Used by the basic DOM mutation methods (e.g., appendChild()).
  • trunk/Source/WebCore/html/HTMLSummaryElement.cpp

    r154371 r154809  
    2929#include "KeyboardEvent.h"
    3030#include "MouseEvent.h"
     31#include "NodeRenderingTraversal.h"
    3132#include "PlatformMouseEvent.h"
    3233#include "RenderBlock.h"
     
    8788HTMLDetailsElement* HTMLSummaryElement::detailsElement() const
    8889{
    89     Node* mayDetails = const_cast<HTMLSummaryElement*>(this)->parentNodeForRenderingAndStyle();
     90    Node* mayDetails = NodeRenderingTraversal::parent(this);
    9091    if (!mayDetails || !mayDetails->hasTagName(detailsTag))
    9192        return 0;
  • trunk/Source/WebCore/style/StyleResolveTree.cpp

    r154806 r154809  
    3333#include "FlowThreadController.h"
    3434#include "NodeRenderStyle.h"
    35 #include "NodeRenderingContext.h"
     35#include "NodeRenderingTraversal.h"
    3636#include "NodeTraversal.h"
    3737#include "RenderFullScreen.h"
     
    347347    Document* document = textNode.document();
    348348    RefPtr<RenderStyle> style;
    349     bool resetStyleInheritance = renderingParentNode->isShadowRoot() && toShadowRoot(renderingParentNode)->resetStyleInheritance();
     349    bool resetStyleInheritance = textNode.parentNode()->isShadowRoot() && toShadowRoot(textNode.parentNode())->resetStyleInheritance();
    350350    if (resetStyleInheritance)
    351351        style = document->ensureStyleResolver().defaultStyleForElement();
     
    693693    }
    694694
    695     bool hasParentStyle = current->parentNodeForRenderingAndStyle() && current->parentNodeForRenderingAndStyle()->renderStyle();
     695    ContainerNode* renderingParentNode = NodeRenderingTraversal::parent(current);
     696    bool hasParentStyle = renderingParentNode && renderingParentNode->renderStyle();
    696697    bool hasDirectAdjacentRules = current->childrenAffectedByDirectAdjacentRules();
    697698    bool hasIndirectAdjacentRules = current->childrenAffectedByForwardPositionalRules();
Note: See TracChangeset for help on using the changeset viewer.