Changeset 86726 in webkit


Ignore:
Timestamp:
May 17, 2011 6:48:39 PM (13 years ago)
Author:
morrita@google.com
Message:

2011-05-16 MORITA Hajime <morrita@google.com>

Reviewed by Dimitri Glazkov.

[Refactoring] ShadowContentElement should be part of dom/
https://bugs.webkit.org/show_bug.cgi?id=59117

  • Moved html/shadow/ShadowContentElement.h to dom/ShadowContentElement.h
  • Pulled ShadowContentElement up to a subclass of StyledElement, from HTMLDivElement
  • Added ShadowContentElement.cpp
  • Extracted ShadowContentSelector.{cpp,h} from ShadowRoot.{cpp,h}

No new tests, no behavior change.

  • CMakeLists.txt:
  • GNUmakefile.list.am:
  • WebCore.gypi:
  • WebCore.pro:
  • WebCore.vcproj/WebCore.vcproj:
  • WebCore.xcodeproj/project.pbxproj:
  • dom/DOMAllInOne.cpp: Added new ShadowContentSelector.cpp and ShadowContentElement.cpp.
  • dom/Node.h: (WebCore::Node::forceReattach): Moved from static local function to share between classes.
  • dom/ShadowContentElement.cpp: Copied from Source/WebCore/html/shadow/ShadowContentElement.h. (WebCore::ShadowContentElement::attach):
  • dom/ShadowContentElement.h: Copied from Source/WebCore/html/shadow/ShadowContentElement.h. (WebCore::ShadowContentElement::ShadowContentElement): (WebCore::ShadowContentElement::isShadowBoundary): (WebCore::ShadowContentElement::rendererIsNeeded): (WebCore::ShadowContentElement::createRenderer):
  • dom/ShadowContentSelector.cpp: Copied from Source/WebCore/html/shadow/ShadowContentElement.h. (WebCore::ShadowContentSelector::ShadowContentSelector): (WebCore::ShadowContentSelector::~ShadowContentSelector): (WebCore::ShadowContentSelector::attachChildrenFor):
  • dom/ShadowContentSelector.h: Renamed from Source/WebCore/html/shadow/ShadowContentElement.h. (WebCore::ShadowContentSelector::shadowRoot): (WebCore::ShadowContentSelector::activeElement): (WebCore::ShadowContentSelector::currentInstance):
  • dom/ShadowRoot.cpp: (WebCore::ShadowRoot::recalcStyle):
  • html/HTMLDetailsElement.cpp: (WebCore::DetailsContentElement::DetailsContentElement): (WebCore::DetailsSummaryElement::DetailsSummaryElement):
  • html/HTMLSummaryElement.cpp: (WebCore::SummaryContentElement::SummaryContentElement):
Location:
trunk/Source/WebCore
Files:
12 edited
3 copied
1 moved

Legend:

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

    r86669 r86726  
    606606    dom/SelectElement.cpp
    607607    dom/SelectorNodeList.cpp
     608    dom/ShadowContentElement.cpp
     609    dom/ShadowContentSelector.cpp
    608610    dom/ShadowRoot.cpp
    609611    dom/SpaceSplitString.cpp
  • trunk/Source/WebCore/ChangeLog

    r86725 r86726  
     12011-05-16  MORITA Hajime  <morrita@google.com>
     2
     3        Reviewed by Dimitri Glazkov.
     4
     5        [Refactoring] ShadowContentElement should be part of dom/
     6        https://bugs.webkit.org/show_bug.cgi?id=59117
     7
     8        - Moved html/shadow/ShadowContentElement.h to dom/ShadowContentElement.h
     9        - Pulled ShadowContentElement up to a subclass of StyledElement, from HTMLDivElement
     10        - Added ShadowContentElement.cpp
     11        - Extracted ShadowContentSelector.{cpp,h} from ShadowRoot.{cpp,h}
     12       
     13        No new tests, no behavior change.
     14
     15        * CMakeLists.txt:
     16        * GNUmakefile.list.am:
     17        * WebCore.gypi:
     18        * WebCore.pro:
     19        * WebCore.vcproj/WebCore.vcproj:
     20        * WebCore.xcodeproj/project.pbxproj:
     21        * dom/DOMAllInOne.cpp: Added new ShadowContentSelector.cpp and ShadowContentElement.cpp.
     22        * dom/Node.h:
     23        (WebCore::Node::forceReattach): Moved from static local function to share between classes.
     24        * dom/ShadowContentElement.cpp: Copied from Source/WebCore/html/shadow/ShadowContentElement.h.
     25        (WebCore::ShadowContentElement::attach):
     26        * dom/ShadowContentElement.h: Copied from Source/WebCore/html/shadow/ShadowContentElement.h.
     27        (WebCore::ShadowContentElement::ShadowContentElement):
     28        (WebCore::ShadowContentElement::isShadowBoundary):
     29        (WebCore::ShadowContentElement::rendererIsNeeded):
     30        (WebCore::ShadowContentElement::createRenderer):
     31        * dom/ShadowContentSelector.cpp: Copied from Source/WebCore/html/shadow/ShadowContentElement.h.
     32        (WebCore::ShadowContentSelector::ShadowContentSelector):
     33        (WebCore::ShadowContentSelector::~ShadowContentSelector):
     34        (WebCore::ShadowContentSelector::attachChildrenFor):
     35        * dom/ShadowContentSelector.h: Renamed from Source/WebCore/html/shadow/ShadowContentElement.h.
     36        (WebCore::ShadowContentSelector::shadowRoot):
     37        (WebCore::ShadowContentSelector::activeElement):
     38        (WebCore::ShadowContentSelector::currentInstance):
     39        * dom/ShadowRoot.cpp:
     40        (WebCore::ShadowRoot::recalcStyle):
     41        * html/HTMLDetailsElement.cpp:
     42        (WebCore::DetailsContentElement::DetailsContentElement):
     43        (WebCore::DetailsSummaryElement::DetailsSummaryElement):
     44        * html/HTMLSummaryElement.cpp:
     45        (WebCore::SummaryContentElement::SummaryContentElement):
     46
    1472011-05-17  Cris Neckar  <cdn@chromium.org>
    248
  • trunk/Source/WebCore/GNUmakefile.list.am

    r86669 r86726  
    12351235        Source/WebCore/dom/SelectorNodeList.cpp \
    12361236        Source/WebCore/dom/SelectorNodeList.h \
     1237        Source/WebCore/dom/ShadowContentElement.cpp \
     1238        Source/WebCore/dom/ShadowContentElement.h \
     1239        Source/WebCore/dom/ShadowContentSelector.cpp \
     1240        Source/WebCore/dom/ShadowContentSelector.h \
    12371241        Source/WebCore/dom/ShadowRoot.cpp \
    12381242        Source/WebCore/dom/ShadowRoot.h \
  • trunk/Source/WebCore/WebCore.gypi

    r86669 r86726  
    549549            'dom/ScriptRunner.h',
    550550            'dom/ShadowRoot.h',
     551            'dom/ShadowContentElement.h',
    551552            'dom/SpaceSplitString.h',
    552553            'dom/StyledElement.h',
     
    25442545            'dom/SelectorNodeList.cpp',
    25452546            'dom/SelectorNodeList.h',
     2547            'dom/ShadowContentElement.cpp',
     2548            'dom/ShadowContentElement.h',
     2549            'dom/ShadowContentSelector.cpp',
     2550            'dom/ShadowContentSelector.h',
    25462551            'dom/ShadowRoot.cpp',
    25472552            'dom/ShadowRoot.h',
     
    31713176            'html/shadow/ProgressShadowElement.cpp',
    31723177            'html/shadow/ProgressShadowElement.h',
    3173             'html/shadow/ShadowContentElement.h',
    31743178            'html/shadow/SliderThumbElement.cpp',
    31753179            'html/shadow/SliderThumbElement.h',
  • trunk/Source/WebCore/WebCore.pro

    r86669 r86726  
    532532    dom/SelectElement.cpp \
    533533    dom/SelectorNodeList.cpp \
     534    dom/ShadowContentElement.cpp \
     535    dom/ShadowContentSelector.cpp \
    534536    dom/ShadowRoot.cpp \
    535537    dom/SpaceSplitString.cpp \
     
    15041506    dom/SelectElement.h \
    15051507    dom/SelectorNodeList.h \
     1508    dom/ShadowContentElement.h \
     1509    dom/ShadowContentSelector.h \
    15061510    dom/ShadowRoot.h \
    15071511    dom/SpaceSplitString.h \
  • trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj

    r86669 r86726  
    4648346483                        </File>
    4648446484                        <File
    46485                                 RelativePath="..\dom\ShadowRoot.cpp"
    46486                                 >
    46487                                 <FileConfiguration
    46488                                         Name="Debug|Win32"
    46489                                         ExcludedFromBuild="true"
    46490                                         >
    46491                                         <Tool
    46492                                                 Name="VCCLCompilerTool"
    46493                                         />
    46494                                 </FileConfiguration>
    46495                                 <FileConfiguration
    46496                                         Name="Release|Win32"
    46497                                         ExcludedFromBuild="true"
    46498                                         >
    46499                                         <Tool
    46500                                                 Name="VCCLCompilerTool"
    46501                                         />
    46502                                 </FileConfiguration>
    46503                                 <FileConfiguration
    46504                                         Name="Debug_Cairo_CFLite|Win32"
    46505                                         ExcludedFromBuild="true"
    46506                                         >
    46507                                         <Tool
    46508                                                 Name="VCCLCompilerTool"
    46509                                         />
    46510                                 </FileConfiguration>
    46511                                 <FileConfiguration
    46512                                         Name="Release_Cairo_CFLite|Win32"
    46513                                         ExcludedFromBuild="true"
    46514                                         >
    46515                                         <Tool
    46516                                                 Name="VCCLCompilerTool"
    46517                                         />
    46518                                 </FileConfiguration>
    46519                                 <FileConfiguration
    46520                                         Name="Debug_All|Win32"
    46521                                         ExcludedFromBuild="true"
    46522                                         >
    46523                                         <Tool
    46524                                                 Name="VCCLCompilerTool"
    46525                                         />
    46526                                 </FileConfiguration>
    46527                                 <FileConfiguration
    46528                                         Name="Production|Win32"
    46529                                         ExcludedFromBuild="true"
    46530                                         >
    46531                                         <Tool
    46532                                                 Name="VCCLCompilerTool"
    46533                                         />
    46534                                 </FileConfiguration>
    46535                         </File>
    46536                         <File
    46537                                 RelativePath="..\dom\ShadowRoot.h"
     46485                                RelativePath="..\dom\ShadowContentElement.cpp"
     46486                                >
     46487                                <FileConfiguration
     46488                                        Name="Debug|Win32"
     46489                                        ExcludedFromBuild="true"
     46490                                        >
     46491                                        <Tool
     46492                                                Name="VCCLCompilerTool"
     46493                                        />
     46494                                </FileConfiguration>
     46495                                <FileConfiguration
     46496                                        Name="Release|Win32"
     46497                                        ExcludedFromBuild="true"
     46498                                        >
     46499                                        <Tool
     46500                                                Name="VCCLCompilerTool"
     46501                                        />
     46502                                </FileConfiguration>
     46503                                <FileConfiguration
     46504                                        Name="Debug_Cairo_CFLite|Win32"
     46505                                        ExcludedFromBuild="true"
     46506                                        >
     46507                                        <Tool
     46508                                                Name="VCCLCompilerTool"
     46509                                        />
     46510                                </FileConfiguration>
     46511                                <FileConfiguration
     46512                                        Name="Release_Cairo_CFLite|Win32"
     46513                                        ExcludedFromBuild="true"
     46514                                        >
     46515                                        <Tool
     46516                                                Name="VCCLCompilerTool"
     46517                                        />
     46518                                </FileConfiguration>
     46519                                <FileConfiguration
     46520                                        Name="Debug_All|Win32"
     46521                                        ExcludedFromBuild="true"
     46522                                        >
     46523                                        <Tool
     46524                                                Name="VCCLCompilerTool"
     46525                                        />
     46526                                </FileConfiguration>
     46527                                <FileConfiguration
     46528                                        Name="Production|Win32"
     46529                                        ExcludedFromBuild="true"
     46530                                        >
     46531                                        <Tool
     46532                                                Name="VCCLCompilerTool"
     46533                                        />
     46534                                </FileConfiguration>
     46535                        </File>
     46536                        <File
     46537                                RelativePath="..\dom\ShadowContentElement.h"
     46538                                >
     46539                        </File>
     46540                        <File
     46541                                RelativePath="..\dom\SelectorNodeList.cpp"
     46542                                >
     46543                                <FileConfiguration
     46544                                        Name="Debug|Win32"
     46545                                        ExcludedFromBuild="true"
     46546                                        >
     46547                                        <Tool
     46548                                                Name="VCCLCompilerTool"
     46549                                        />
     46550                                </FileConfiguration>
     46551                                <FileConfiguration
     46552                                        Name="Release|Win32"
     46553                                        ExcludedFromBuild="true"
     46554                                        >
     46555                                        <Tool
     46556                                                Name="VCCLCompilerTool"
     46557                                        />
     46558                                </FileConfiguration>
     46559                                <FileConfiguration
     46560                                        Name="Debug_Cairo_CFLite|Win32"
     46561                                        ExcludedFromBuild="true"
     46562                                        >
     46563                                        <Tool
     46564                                                Name="VCCLCompilerTool"
     46565                                        />
     46566                                </FileConfiguration>
     46567                                <FileConfiguration
     46568                                        Name="Release_Cairo_CFLite|Win32"
     46569                                        ExcludedFromBuild="true"
     46570                                        >
     46571                                        <Tool
     46572                                                Name="VCCLCompilerTool"
     46573                                        />
     46574                                </FileConfiguration>
     46575                                <FileConfiguration
     46576                                        Name="Debug_All|Win32"
     46577                                        ExcludedFromBuild="true"
     46578                                        >
     46579                                        <Tool
     46580                                                Name="VCCLCompilerTool"
     46581                                        />
     46582                                </FileConfiguration>
     46583                                <FileConfiguration
     46584                                        Name="Production|Win32"
     46585                                        ExcludedFromBuild="true"
     46586                                        >
     46587                                        <Tool
     46588                                                Name="VCCLCompilerTool"
     46589                                        />
     46590                                </FileConfiguration>
     46591                        </File>
     46592                        <File
     46593                                RelativePath="..\dom\SelectorNodeList.h"
     46594                                >
     46595                        </File>
     46596                        <File
     46597                                RelativePath="..\dom\ShadowContentElement.cpp"
     46598                                >
     46599                                <FileConfiguration
     46600                                        Name="Debug|Win32"
     46601                                        ExcludedFromBuild="true"
     46602                                        >
     46603                                        <Tool
     46604                                                Name="VCCLCompilerTool"
     46605                                        />
     46606                                </FileConfiguration>
     46607                                <FileConfiguration
     46608                                        Name="Release|Win32"
     46609                                        ExcludedFromBuild="true"
     46610                                        >
     46611                                        <Tool
     46612                                                Name="VCCLCompilerTool"
     46613                                        />
     46614                                </FileConfiguration>
     46615                                <FileConfiguration
     46616                                        Name="Debug_Cairo_CFLite|Win32"
     46617                                        ExcludedFromBuild="true"
     46618                                        >
     46619                                        <Tool
     46620                                                Name="VCCLCompilerTool"
     46621                                        />
     46622                                </FileConfiguration>
     46623                                <FileConfiguration
     46624                                        Name="Release_Cairo_CFLite|Win32"
     46625                                        ExcludedFromBuild="true"
     46626                                        >
     46627                                        <Tool
     46628                                                Name="VCCLCompilerTool"
     46629                                        />
     46630                                </FileConfiguration>
     46631                                <FileConfiguration
     46632                                        Name="Debug_All|Win32"
     46633                                        ExcludedFromBuild="true"
     46634                                        >
     46635                                        <Tool
     46636                                                Name="VCCLCompilerTool"
     46637                                        />
     46638                                </FileConfiguration>
     46639                                <FileConfiguration
     46640                                        Name="Production|Win32"
     46641                                        ExcludedFromBuild="true"
     46642                                        >
     46643                                        <Tool
     46644                                                Name="VCCLCompilerTool"
     46645                                        />
     46646                                </FileConfiguration>
     46647                        </File>
     46648                        <File
     46649                                RelativePath="..\dom\ShadowContentElement.h"
     46650                                >
     46651                        </File>
     46652                        <File
     46653                                RelativePath="..\dom\ShadowContentSelector.cpp"
     46654                                >
     46655                                <FileConfiguration
     46656                                        Name="Debug|Win32"
     46657                                        ExcludedFromBuild="true"
     46658                                        >
     46659                                        <Tool
     46660                                                Name="VCCLCompilerTool"
     46661                                        />
     46662                                </FileConfiguration>
     46663                                <FileConfiguration
     46664                                        Name="Release|Win32"
     46665                                        ExcludedFromBuild="true"
     46666                                        >
     46667                                        <Tool
     46668                                                Name="VCCLCompilerTool"
     46669                                        />
     46670                                </FileConfiguration>
     46671                                <FileConfiguration
     46672                                        Name="Debug_Cairo_CFLite|Win32"
     46673                                        ExcludedFromBuild="true"
     46674                                        >
     46675                                        <Tool
     46676                                                Name="VCCLCompilerTool"
     46677                                        />
     46678                                </FileConfiguration>
     46679                                <FileConfiguration
     46680                                        Name="Release_Cairo_CFLite|Win32"
     46681                                        ExcludedFromBuild="true"
     46682                                        >
     46683                                        <Tool
     46684                                                Name="VCCLCompilerTool"
     46685                                        />
     46686                                </FileConfiguration>
     46687                                <FileConfiguration
     46688                                        Name="Debug_All|Win32"
     46689                                        ExcludedFromBuild="true"
     46690                                        >
     46691                                        <Tool
     46692                                                Name="VCCLCompilerTool"
     46693                                        />
     46694                                </FileConfiguration>
     46695                                <FileConfiguration
     46696                                        Name="Production|Win32"
     46697                                        ExcludedFromBuild="true"
     46698                                        >
     46699                                        <Tool
     46700                                                Name="VCCLCompilerTool"
     46701                                        />
     46702                                </FileConfiguration>
     46703                        </File>
     46704                        <File
     46705                                RelativePath="..\dom\ShadowContentSelector.h"
    4653846706                                >
    4653946707                        </File>
     
    5631156479                                <File
    5631256480                                        RelativePath="..\html\shadow\ProgressShadowElement.h"
    56313                                         >
    56314                                 </File>
    56315                                 <File
    56316                                         RelativePath="..\html\shadow\ShadowContentElement.h"
    5631756481                                        >
    5631856482                                </File>
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r86669 r86726  
    31943194                A718760E0B2A120100A16ECE /* DragActions.h in Headers */ = {isa = PBXBuildFile; fileRef = A718760D0B2A120100A16ECE /* DragActions.h */; settings = {ATTRIBUTES = (Private, ); }; };
    31953195                A71878900B2D04AC00A16ECE /* DragControllerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = A718788F0B2D04AC00A16ECE /* DragControllerMac.mm */; };
     3196                A71C30B81381265E00DBC351 /* ShadowContentSelector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A71C30B61381265E00DBC351 /* ShadowContentSelector.cpp */; };
     3197                A71C30B91381265E00DBC351 /* ShadowContentSelector.h in Headers */ = {isa = PBXBuildFile; fileRef = A71C30B71381265E00DBC351 /* ShadowContentSelector.h */; };
    31963198                A73F95FE12C97BFE0031AAF9 /* RoundedIntRect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A73F95FC12C97BFE0031AAF9 /* RoundedIntRect.cpp */; };
    31973199                A73F95FF12C97BFE0031AAF9 /* RoundedIntRect.h in Headers */ = {isa = PBXBuildFile; fileRef = A73F95FD12C97BFE0031AAF9 /* RoundedIntRect.h */; settings = {ATTRIBUTES = (Private, ); }; };
    3198                 A7477538135FC56900937899 /* ShadowContentElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A7477537135FC56900937899 /* ShadowContentElement.h */; };
     3200                A74C2D3C13811E0D00F83572 /* ShadowContentElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A74C2D3B13811E0D00F83572 /* ShadowContentElement.h */; settings = {ATTRIBUTES = (Private, ); }; };
    31993201                A75E497610752ACB00C9B896 /* SerializedScriptValue.h in Headers */ = {isa = PBXBuildFile; fileRef = A75E497410752ACB00C9B896 /* SerializedScriptValue.h */; settings = {ATTRIBUTES = (Private, ); }; };
    32003202                A75E497710752ACB00C9B896 /* SerializedScriptValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A75E497510752ACB00C9B896 /* SerializedScriptValue.cpp */; };
     
    32073209                A75E8B8E0E1DE2D6007F2481 /* FEComposite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A75E8B860E1DE2D6007F2481 /* FEComposite.cpp */; };
    32083210                A75E8B8F0E1DE2D6007F2481 /* FEComposite.h in Headers */ = {isa = PBXBuildFile; fileRef = A75E8B870E1DE2D6007F2481 /* FEComposite.h */; };
     3211                A766CF8C13810E0C0011A0B3 /* ShadowContentElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A766CF8B13810E0C0011A0B3 /* ShadowContentElement.cpp */; };
    32093212                A76E5F7F135E0DCF00A69837 /* RenderedDocumentMarker.h in Headers */ = {isa = PBXBuildFile; fileRef = A76E5F7E135E0DCF00A69837 /* RenderedDocumentMarker.h */; };
    32103213                A77979190D6B9D0C003851B9 /* ImageData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A77979130D6B9D0C003851B9 /* ImageData.cpp */; };
     
    97139716                A718788F0B2D04AC00A16ECE /* DragControllerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DragControllerMac.mm; sourceTree = "<group>"; };
    97149717                A71A70C911AFB02000989D6D /* HTMLMeterElement.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HTMLMeterElement.idl; sourceTree = "<group>"; };
     9718                A71C30B61381265E00DBC351 /* ShadowContentSelector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ShadowContentSelector.cpp; sourceTree = "<group>"; };
     9719                A71C30B71381265E00DBC351 /* ShadowContentSelector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShadowContentSelector.h; sourceTree = "<group>"; };
    97159720                A73F95FC12C97BFE0031AAF9 /* RoundedIntRect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RoundedIntRect.cpp; sourceTree = "<group>"; };
    97169721                A73F95FD12C97BFE0031AAF9 /* RoundedIntRect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RoundedIntRect.h; sourceTree = "<group>"; };
    9717                 A7477537135FC56900937899 /* ShadowContentElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShadowContentElement.h; sourceTree = "<group>"; };
     9722                A74C2D3B13811E0D00F83572 /* ShadowContentElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShadowContentElement.h; sourceTree = "<group>"; };
    97189723                A75E497410752ACB00C9B896 /* SerializedScriptValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SerializedScriptValue.h; sourceTree = "<group>"; };
    97199724                A75E497510752ACB00C9B896 /* SerializedScriptValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SerializedScriptValue.cpp; sourceTree = "<group>"; };
     
    97269731                A75E8B860E1DE2D6007F2481 /* FEComposite.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FEComposite.cpp; path = filters/FEComposite.cpp; sourceTree = "<group>"; };
    97279732                A75E8B870E1DE2D6007F2481 /* FEComposite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FEComposite.h; path = filters/FEComposite.h; sourceTree = "<group>"; };
     9733                A766CF8B13810E0C0011A0B3 /* ShadowContentElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ShadowContentElement.cpp; sourceTree = "<group>"; };
    97289734                A76E5F7E135E0DCF00A69837 /* RenderedDocumentMarker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderedDocumentMarker.h; sourceTree = "<group>"; };
    97299735                A77979130D6B9D0C003851B9 /* ImageData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ImageData.cpp; sourceTree = "<group>"; };
     
    1345713463                                A715E650134BBBEC00D8E713 /* ProgressShadowElement.cpp */,
    1345813464                                A715E651134BBBEC00D8E713 /* ProgressShadowElement.h */,
    13459                                 A7477537135FC56900937899 /* ShadowContentElement.h */,
    1346013465                                4150F9F012B6E0E70008C860 /* SliderThumbElement.cpp */,
    1346113466                                4150F9EF12B6E0E70008C860 /* SliderThumbElement.h */,
     
    1916119166                                BC9462CB107A7A3900857193 /* BeforeLoadEvent.idl */,
    1916219167                                5172204A11D2960500638B42 /* BeforeProcessEvent.cpp */,
     19168                                AB23A32509BBA7D00067CC53 /* BeforeTextInsertedEvent.cpp */,
    1916319169                                51721FB911D2790700638B42 /* BeforeProcessEvent.h */,
    1916419170                                51721FBA11D2790700638B42 /* BeforeProcessEvent.idl */,
    19165                                 AB23A32509BBA7D00067CC53 /* BeforeTextInsertedEvent.cpp */,
    1916619171                                AB23A32609BBA7D00067CC53 /* BeforeTextInsertedEvent.h */,
    1916719172                                85031B260A44EFC700F992E0 /* BeforeUnloadEvent.cpp */,
     
    1940519410                                BC7FA6800D1F167900DB22A9 /* SelectorNodeList.cpp */,
    1940619411                                BC7FA67F0D1F167900DB22A9 /* SelectorNodeList.h */,
     19412                                A766CF8B13810E0C0011A0B3 /* ShadowContentElement.cpp */,
     19413                                A74C2D3B13811E0D00F83572 /* ShadowContentElement.h */,
     19414                                A71C30B61381265E00DBC351 /* ShadowContentSelector.cpp */,
     19415                                A71C30B71381265E00DBC351 /* ShadowContentSelector.h */,
    1940719416                                A6D169611346B49B000EB770 /* ShadowRoot.cpp */,
    1940819417                                A6D169631346B4C1000EB770 /* ShadowRoot.h */,
     
    2224722256                                498770E91242C535002226BA /* Shader.h in Headers */,
    2224822257                                0F3DD45012F5EA1B000D9190 /* ShadowBlur.h in Headers */,
    22249                                 A7477538135FC56900937899 /* ShadowContentElement.h in Headers */,
    2225022258                                BC5EB8C40E82031B00B25965 /* ShadowData.h in Headers */,
     22259                                A74C2D3C13811E0D00F83572 /* ShadowContentElement.h in Headers */,
     22260                                A71C30B91381265E00DBC351 /* ShadowContentSelector.h in Headers */,
    2225122261                                A7F338A411C0EFCA00A320A7 /* ShadowElement.h in Headers */,
    2225222262                                A6D169641346B4C1000EB770 /* ShadowRoot.h in Headers */,
     
    2505825068                                0F3DD44F12F5EA1B000D9190 /* ShadowBlur.cpp in Sources */,
    2505925069                                BC5EB8C30E82031B00B25965 /* ShadowData.cpp in Sources */,
     25070                                A766CF8C13810E0C0011A0B3 /* ShadowContentElement.cpp in Sources */,
     25071                                A71C30B81381265E00DBC351 /* ShadowContentSelector.cpp in Sources */,
    2506025072                                A7F338A311C0EFCA00A320A7 /* ShadowElement.cpp in Sources */,
    2506125073                                A6D169621346B49B000EB770 /* ShadowRoot.cpp in Sources */,
  • trunk/Source/WebCore/dom/DOMAllInOne.cpp

    r85998 r86726  
    109109#include "SelectElement.cpp"
    110110#include "SelectorNodeList.cpp"
     111#include "ShadowContentElement.cpp"
     112#include "ShadowContentSelector.cpp"
    111113#include "ShadowRoot.cpp"
    112114#include "SpaceSplitString.cpp"
  • trunk/Source/WebCore/dom/Node.h

    r86491 r86726  
    447447    virtual void detach();
    448448
     449    void forceReattach();
     450
    449451    virtual void willRemove();
    450452    void createRendererIfNeeded();
     
    733735}
    734736
     737inline void Node::forceReattach()
     738{
     739    if (!attached())
     740        return;
     741    detach();
     742    attach();
     743}
     744
    735745} //namespace
    736746
  • trunk/Source/WebCore/dom/ShadowContentElement.cpp

    r86725 r86726  
    88 *     * Redistributions of source code must retain the above copyright
    99 * notice, this list of conditions and the following disclaimer.
    10  *     * Redistributions in binary form must reproduce the above
    11  * copyright notice, this list of conditions and the following disclaimer
    12  * in the documentation and/or other materials provided with the
    13  * distribution.
    1410 *     * Neither the name of Google Inc. nor the names of its
    1511 * contributors may be used to endorse or promote products derived from
     
    2925 */
    3026
    31 #ifndef ShadowContentElement_h
    32 #define ShadowContentElement_h
     27#include "config.h"
     28#include "ShadowContentElement.h"
    3329
    34 #include "HTMLDivElement.h"
    35 #include "HTMLNames.h"
    36 #include <wtf/Forward.h>
     30#include "ShadowContentSelector.h"
    3731
    3832namespace WebCore {
    3933
    40 // NOTE: Current implementation doesn't support dynamic insertion/deletion of ShadowContentElement.
    41 // You should create ShadowContentElement during the host construction.
    42 class ShadowContentElement : public HTMLDivElement {
    43 public:
    44     ShadowContentElement(Document* document)
    45         : HTMLDivElement(HTMLNames::divTag, document)
    46     {
    47     }
    48 
    49     virtual bool shouldInclude(Node*) = 0;
    50     virtual void attach();
    51 
    52 private:
    53     // FIXME: This should be replaced with tag-name checking once <content> is ready.
    54     // See also http://webkit.org/b/56973
    55     virtual bool isShadowBoundary() const { return true; }
    56     virtual bool rendererIsNeeded(RenderStyle*) { return false; }
    57     virtual RenderObject* createRenderer(RenderArena*, RenderStyle*) { return 0; }
    58 };
     34void ShadowContentElement::attach()
     35{
     36    ASSERT(!firstChild()); // Currently doesn't support any light child.
     37    Element::attach();
     38    if (ShadowContentSelector* selector = ShadowContentSelector::currentInstance())
     39        selector->attachChildrenFor(this);
     40}
    5941
    6042}
    61 
    62 #endif
  • trunk/Source/WebCore/dom/ShadowContentElement.h

    r86725 r86726  
    3232#define ShadowContentElement_h
    3333
    34 #include "HTMLDivElement.h"
    35 #include "HTMLNames.h"
     34#include "StyledElement.h"
    3635#include <wtf/Forward.h>
    3736
     
    4039// NOTE: Current implementation doesn't support dynamic insertion/deletion of ShadowContentElement.
    4140// You should create ShadowContentElement during the host construction.
    42 class ShadowContentElement : public HTMLDivElement {
     41class ShadowContentElement : public StyledElement {
    4342public:
    44     ShadowContentElement(Document* document)
    45         : HTMLDivElement(HTMLNames::divTag, document)
     43    ShadowContentElement(const QualifiedName& name, Document* document)
     44        : StyledElement(name, document, CreateHTMLElement)
    4645    {
    4746    }
  • trunk/Source/WebCore/dom/ShadowContentSelector.cpp

    r86725 r86726  
    88 *     * Redistributions of source code must retain the above copyright
    99 * notice, this list of conditions and the following disclaimer.
    10  *     * Redistributions in binary form must reproduce the above
    11  * copyright notice, this list of conditions and the following disclaimer
    12  * in the documentation and/or other materials provided with the
    13  * distribution.
    1410 *     * Neither the name of Google Inc. nor the names of its
    1511 * contributors may be used to endorse or promote products derived from
     
    2925 */
    3026
    31 #ifndef ShadowContentElement_h
    32 #define ShadowContentElement_h
     27#include "config.h"
     28#include "ShadowContentSelector.h"
    3329
    34 #include "HTMLDivElement.h"
    35 #include "HTMLNames.h"
    36 #include <wtf/Forward.h>
     30#include "ShadowContentElement.h"
     31#include "ShadowRoot.h"
     32
    3733
    3834namespace WebCore {
    3935
    40 // NOTE: Current implementation doesn't support dynamic insertion/deletion of ShadowContentElement.
    41 // You should create ShadowContentElement during the host construction.
    42 class ShadowContentElement : public HTMLDivElement {
    43 public:
    44     ShadowContentElement(Document* document)
    45         : HTMLDivElement(HTMLNames::divTag, document)
    46     {
     36ShadowContentSelector* ShadowContentSelector::s_currentInstance = 0;
     37
     38ShadowContentSelector::ShadowContentSelector(ShadowRoot* shadowRoot)
     39    : m_parent(s_currentInstance)
     40    , m_shadowRoot(shadowRoot)
     41    , m_activeElement(0)
     42{
     43    s_currentInstance = this;
     44    for (Node* node = shadowRoot->shadowHost()->firstChild(); node; node = node->nextSibling())
     45        m_children.append(node);
     46}
     47
     48ShadowContentSelector::~ShadowContentSelector()
     49{
     50    ASSERT(s_currentInstance == this);
     51    s_currentInstance = m_parent;
     52}
     53
     54void ShadowContentSelector::attachChildrenFor(ShadowContentElement* contentElement)
     55{
     56    m_activeElement = contentElement;
     57
     58    for (size_t i = 0; i < m_children.size(); ++i) {
     59        Node* child = m_children[i].get();
     60        if (!child)
     61            continue;
     62        if (!contentElement->shouldInclude(child))
     63            continue;
     64
     65        child->forceReattach();
     66        m_children[i] = 0;
    4767    }
    4868
    49     virtual bool shouldInclude(Node*) = 0;
    50     virtual void attach();
    51 
    52 private:
    53     // FIXME: This should be replaced with tag-name checking once <content> is ready.
    54     // See also http://webkit.org/b/56973
    55     virtual bool isShadowBoundary() const { return true; }
    56     virtual bool rendererIsNeeded(RenderStyle*) { return false; }
    57     virtual RenderObject* createRenderer(RenderArena*, RenderStyle*) { return 0; }
    58 };
     69    m_activeElement = 0;
     70}
    5971
    6072}
    61 
    62 #endif
  • trunk/Source/WebCore/dom/ShadowContentSelector.h

    r86725 r86726  
    2929 */
    3030
    31 #ifndef ShadowContentElement_h
    32 #define ShadowContentElement_h
     31#ifndef ShadowContentSelector_h
     32#define ShadowContentSelector_h
    3333
    34 #include "HTMLDivElement.h"
    35 #include "HTMLNames.h"
    3634#include <wtf/Forward.h>
     35#include <wtf/Vector.h>
    3736
    3837namespace WebCore {
    3938
    40 // NOTE: Current implementation doesn't support dynamic insertion/deletion of ShadowContentElement.
    41 // You should create ShadowContentElement during the host construction.
    42 class ShadowContentElement : public HTMLDivElement {
     39class Element;
     40class Node;
     41class ShadowRoot;
     42class ShadowContentElement;
     43
     44class ShadowContentSelector {
     45    WTF_MAKE_NONCOPYABLE(ShadowContentSelector);
    4346public:
    44     ShadowContentElement(Document* document)
    45         : HTMLDivElement(HTMLNames::divTag, document)
    46     {
    47     }
     47    explicit ShadowContentSelector(ShadowRoot*);
     48    ~ShadowContentSelector();
    4849
    49     virtual bool shouldInclude(Node*) = 0;
    50     virtual void attach();
     50    void attachChildrenFor(ShadowContentElement*);
     51    ShadowRoot* shadowRoot() const { return m_shadowRoot; }
     52    Element* activeElement() const { return m_activeElement; }
     53
     54    static ShadowContentSelector* currentInstance() { return s_currentInstance; }
    5155
    5256private:
    53     // FIXME: This should be replaced with tag-name checking once <content> is ready.
    54     // See also http://webkit.org/b/56973
    55     virtual bool isShadowBoundary() const { return true; }
    56     virtual bool rendererIsNeeded(RenderStyle*) { return false; }
    57     virtual RenderObject* createRenderer(RenderArena*, RenderStyle*) { return 0; }
     57    ShadowContentSelector* m_parent;
     58    ShadowRoot* m_shadowRoot;
     59    Element* m_activeElement;
     60    Vector<RefPtr<Node> > m_children;
     61
     62    static ShadowContentSelector* s_currentInstance;
    5863};
    5964
  • trunk/Source/WebCore/dom/ShadowRoot.cpp

    r86521 r86726  
    3131#include "Document.h"
    3232#include "NodeRareData.h"
    33 // FIXME: This dependency might look strange. But it should be sane. See https://bugs.webkit.org/show_bug.cgi?id=59117
    34 #include "ShadowContentElement.h"
     33#include "ShadowContentSelector.h"
    3534
    3635namespace WebCore {
    37 
    38 static inline void forceReattach(Node* node)
    39 {
    40     if (!node->attached())
    41         return;
    42     node->detach();
    43     node->attach();
    44 }
    45 
    46 class ShadowContentSelector {
    47     WTF_MAKE_NONCOPYABLE(ShadowContentSelector);
    48 public:
    49     explicit ShadowContentSelector(ShadowRoot*);
    50     ~ShadowContentSelector();
    51 
    52     void attachChildrenFor(ShadowContentElement*);
    53     ShadowRoot* shadowRoot() const { return m_shadowRoot; }
    54     Element* activeElement() const { return m_activeElement; }
    55 
    56     static ShadowContentSelector* currentInstance() { return s_currentInstance; }
    57 
    58 private:
    59     ShadowContentSelector* m_parent;
    60     ShadowRoot* m_shadowRoot;
    61     Element* m_activeElement;
    62     Vector<RefPtr<Node> > m_children;
    63 
    64     static ShadowContentSelector* s_currentInstance;
    65 };
    66 
    67 ShadowContentSelector* ShadowContentSelector::s_currentInstance = 0;
    68 
    69 ShadowContentSelector::ShadowContentSelector(ShadowRoot* shadowRoot)
    70     : m_parent(s_currentInstance)
    71     , m_shadowRoot(shadowRoot)
    72     , m_activeElement(0)
    73 {
    74     s_currentInstance = this;
    75     for (Node* node = shadowRoot->shadowHost()->firstChild(); node; node = node->nextSibling())
    76         m_children.append(node);
    77 }
    78 
    79 ShadowContentSelector::~ShadowContentSelector()
    80 {
    81     ASSERT(s_currentInstance == this);
    82     s_currentInstance = m_parent;
    83 }
    84 
    85 void ShadowContentSelector::attachChildrenFor(ShadowContentElement* contentElement)
    86 {
    87     m_activeElement = contentElement;
    88 
    89     for (size_t i = 0; i < m_children.size(); ++i) {
    90         Node* child = m_children[i].get();
    91         if (!child)
    92             continue;
    93         if (!contentElement->shouldInclude(child))
    94             continue;
    95 
    96         forceReattach(child);
    97         m_children[i] = 0;
    98     }
    99 
    100     m_activeElement = 0;
    101 }
    102 
    103 // FIXME: Should have its own file. https://bugs.webkit.org/show_bug.cgi?id=59117 will fix this.
    104 void ShadowContentElement::attach()
    105 {
    106     ASSERT(!firstChild()); // Currently doesn't support any light child.
    107     HTMLDivElement::attach();
    108     if (ShadowContentSelector* selector = ShadowContentSelector::currentInstance())
    109         selector->attachChildrenFor(this);
    110 }
    11136
    11237ShadowRoot::ShadowRoot(Document* document)
     
    16085{
    16186    if (hasContentElement())
    162         forceReattach(this);
     87        forceReattach();
    16388    else {
    16489        for (Node* n = firstChild(); n; n = n->nextSibling())
  • trunk/Source/WebCore/html/HTMLDetailsElement.cpp

    r85644 r86726  
    4343private:
    4444    DetailsContentElement(Document* document)
    45         : ShadowContentElement(document)
     45        : ShadowContentElement(HTMLNames::divTag, document)
    4646    {
    4747    }
     
    6868private:
    6969    DetailsSummaryElement(Document* document)
    70         : ShadowContentElement(document)
     70        : ShadowContentElement(HTMLNames::divTag, document)
    7171    {
    7272    }
  • trunk/Source/WebCore/html/HTMLSummaryElement.cpp

    r85644 r86726  
    3131#include "RenderSummary.h"
    3232#include "ShadowContentElement.h"
     33
    3334#include "ShadowRoot.h"
    3435
     
    4344private:
    4445    SummaryContentElement(Document* document)
    45         : ShadowContentElement(document)
     46        : ShadowContentElement(HTMLNames::divTag, document)
    4647    {
    4748    }
Note: See TracChangeset for help on using the changeset viewer.