Changeset 86726 in webkit
- Timestamp:
- May 17, 2011 6:48:39 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 12 edited
- 3 copied
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/CMakeLists.txt
r86669 r86726 606 606 dom/SelectElement.cpp 607 607 dom/SelectorNodeList.cpp 608 dom/ShadowContentElement.cpp 609 dom/ShadowContentSelector.cpp 608 610 dom/ShadowRoot.cpp 609 611 dom/SpaceSplitString.cpp -
trunk/Source/WebCore/ChangeLog
r86725 r86726 1 2011-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 1 47 2011-05-17 Cris Neckar <cdn@chromium.org> 2 48 -
trunk/Source/WebCore/GNUmakefile.list.am
r86669 r86726 1235 1235 Source/WebCore/dom/SelectorNodeList.cpp \ 1236 1236 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 \ 1237 1241 Source/WebCore/dom/ShadowRoot.cpp \ 1238 1242 Source/WebCore/dom/ShadowRoot.h \ -
trunk/Source/WebCore/WebCore.gypi
r86669 r86726 549 549 'dom/ScriptRunner.h', 550 550 'dom/ShadowRoot.h', 551 'dom/ShadowContentElement.h', 551 552 'dom/SpaceSplitString.h', 552 553 'dom/StyledElement.h', … … 2544 2545 'dom/SelectorNodeList.cpp', 2545 2546 'dom/SelectorNodeList.h', 2547 'dom/ShadowContentElement.cpp', 2548 'dom/ShadowContentElement.h', 2549 'dom/ShadowContentSelector.cpp', 2550 'dom/ShadowContentSelector.h', 2546 2551 'dom/ShadowRoot.cpp', 2547 2552 'dom/ShadowRoot.h', … … 3171 3176 'html/shadow/ProgressShadowElement.cpp', 3172 3177 'html/shadow/ProgressShadowElement.h', 3173 'html/shadow/ShadowContentElement.h',3174 3178 'html/shadow/SliderThumbElement.cpp', 3175 3179 'html/shadow/SliderThumbElement.h', -
trunk/Source/WebCore/WebCore.pro
r86669 r86726 532 532 dom/SelectElement.cpp \ 533 533 dom/SelectorNodeList.cpp \ 534 dom/ShadowContentElement.cpp \ 535 dom/ShadowContentSelector.cpp \ 534 536 dom/ShadowRoot.cpp \ 535 537 dom/SpaceSplitString.cpp \ … … 1504 1506 dom/SelectElement.h \ 1505 1507 dom/SelectorNodeList.h \ 1508 dom/ShadowContentElement.h \ 1509 dom/ShadowContentSelector.h \ 1506 1510 dom/ShadowRoot.h \ 1507 1511 dom/SpaceSplitString.h \ -
trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj
r86669 r86726 46483 46483 </File> 46484 46484 <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" 46538 46706 > 46539 46707 </File> … … 56311 56479 <File 56312 56480 RelativePath="..\html\shadow\ProgressShadowElement.h" 56313 >56314 </File>56315 <File56316 RelativePath="..\html\shadow\ShadowContentElement.h"56317 56481 > 56318 56482 </File> -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r86669 r86726 3194 3194 A718760E0B2A120100A16ECE /* DragActions.h in Headers */ = {isa = PBXBuildFile; fileRef = A718760D0B2A120100A16ECE /* DragActions.h */; settings = {ATTRIBUTES = (Private, ); }; }; 3195 3195 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 */; }; 3196 3198 A73F95FE12C97BFE0031AAF9 /* RoundedIntRect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A73F95FC12C97BFE0031AAF9 /* RoundedIntRect.cpp */; }; 3197 3199 A73F95FF12C97BFE0031AAF9 /* RoundedIntRect.h in Headers */ = {isa = PBXBuildFile; fileRef = A73F95FD12C97BFE0031AAF9 /* RoundedIntRect.h */; settings = {ATTRIBUTES = (Private, ); }; }; 3198 A74 77538135FC56900937899 /* 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, ); }; }; 3199 3201 A75E497610752ACB00C9B896 /* SerializedScriptValue.h in Headers */ = {isa = PBXBuildFile; fileRef = A75E497410752ACB00C9B896 /* SerializedScriptValue.h */; settings = {ATTRIBUTES = (Private, ); }; }; 3200 3202 A75E497710752ACB00C9B896 /* SerializedScriptValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A75E497510752ACB00C9B896 /* SerializedScriptValue.cpp */; }; … … 3207 3209 A75E8B8E0E1DE2D6007F2481 /* FEComposite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A75E8B860E1DE2D6007F2481 /* FEComposite.cpp */; }; 3208 3210 A75E8B8F0E1DE2D6007F2481 /* FEComposite.h in Headers */ = {isa = PBXBuildFile; fileRef = A75E8B870E1DE2D6007F2481 /* FEComposite.h */; }; 3211 A766CF8C13810E0C0011A0B3 /* ShadowContentElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A766CF8B13810E0C0011A0B3 /* ShadowContentElement.cpp */; }; 3209 3212 A76E5F7F135E0DCF00A69837 /* RenderedDocumentMarker.h in Headers */ = {isa = PBXBuildFile; fileRef = A76E5F7E135E0DCF00A69837 /* RenderedDocumentMarker.h */; }; 3210 3213 A77979190D6B9D0C003851B9 /* ImageData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A77979130D6B9D0C003851B9 /* ImageData.cpp */; }; … … 9713 9716 A718788F0B2D04AC00A16ECE /* DragControllerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DragControllerMac.mm; sourceTree = "<group>"; }; 9714 9717 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>"; }; 9715 9720 A73F95FC12C97BFE0031AAF9 /* RoundedIntRect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RoundedIntRect.cpp; sourceTree = "<group>"; }; 9716 9721 A73F95FD12C97BFE0031AAF9 /* RoundedIntRect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RoundedIntRect.h; sourceTree = "<group>"; }; 9717 A74 77537135FC56900937899/* 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>"; }; 9718 9723 A75E497410752ACB00C9B896 /* SerializedScriptValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SerializedScriptValue.h; sourceTree = "<group>"; }; 9719 9724 A75E497510752ACB00C9B896 /* SerializedScriptValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SerializedScriptValue.cpp; sourceTree = "<group>"; }; … … 9726 9731 A75E8B860E1DE2D6007F2481 /* FEComposite.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FEComposite.cpp; path = filters/FEComposite.cpp; sourceTree = "<group>"; }; 9727 9732 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>"; }; 9728 9734 A76E5F7E135E0DCF00A69837 /* RenderedDocumentMarker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderedDocumentMarker.h; sourceTree = "<group>"; }; 9729 9735 A77979130D6B9D0C003851B9 /* ImageData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ImageData.cpp; sourceTree = "<group>"; }; … … 13457 13463 A715E650134BBBEC00D8E713 /* ProgressShadowElement.cpp */, 13458 13464 A715E651134BBBEC00D8E713 /* ProgressShadowElement.h */, 13459 A7477537135FC56900937899 /* ShadowContentElement.h */,13460 13465 4150F9F012B6E0E70008C860 /* SliderThumbElement.cpp */, 13461 13466 4150F9EF12B6E0E70008C860 /* SliderThumbElement.h */, … … 19161 19166 BC9462CB107A7A3900857193 /* BeforeLoadEvent.idl */, 19162 19167 5172204A11D2960500638B42 /* BeforeProcessEvent.cpp */, 19168 AB23A32509BBA7D00067CC53 /* BeforeTextInsertedEvent.cpp */, 19163 19169 51721FB911D2790700638B42 /* BeforeProcessEvent.h */, 19164 19170 51721FBA11D2790700638B42 /* BeforeProcessEvent.idl */, 19165 AB23A32509BBA7D00067CC53 /* BeforeTextInsertedEvent.cpp */,19166 19171 AB23A32609BBA7D00067CC53 /* BeforeTextInsertedEvent.h */, 19167 19172 85031B260A44EFC700F992E0 /* BeforeUnloadEvent.cpp */, … … 19405 19410 BC7FA6800D1F167900DB22A9 /* SelectorNodeList.cpp */, 19406 19411 BC7FA67F0D1F167900DB22A9 /* SelectorNodeList.h */, 19412 A766CF8B13810E0C0011A0B3 /* ShadowContentElement.cpp */, 19413 A74C2D3B13811E0D00F83572 /* ShadowContentElement.h */, 19414 A71C30B61381265E00DBC351 /* ShadowContentSelector.cpp */, 19415 A71C30B71381265E00DBC351 /* ShadowContentSelector.h */, 19407 19416 A6D169611346B49B000EB770 /* ShadowRoot.cpp */, 19408 19417 A6D169631346B4C1000EB770 /* ShadowRoot.h */, … … 22247 22256 498770E91242C535002226BA /* Shader.h in Headers */, 22248 22257 0F3DD45012F5EA1B000D9190 /* ShadowBlur.h in Headers */, 22249 A7477538135FC56900937899 /* ShadowContentElement.h in Headers */,22250 22258 BC5EB8C40E82031B00B25965 /* ShadowData.h in Headers */, 22259 A74C2D3C13811E0D00F83572 /* ShadowContentElement.h in Headers */, 22260 A71C30B91381265E00DBC351 /* ShadowContentSelector.h in Headers */, 22251 22261 A7F338A411C0EFCA00A320A7 /* ShadowElement.h in Headers */, 22252 22262 A6D169641346B4C1000EB770 /* ShadowRoot.h in Headers */, … … 25058 25068 0F3DD44F12F5EA1B000D9190 /* ShadowBlur.cpp in Sources */, 25059 25069 BC5EB8C30E82031B00B25965 /* ShadowData.cpp in Sources */, 25070 A766CF8C13810E0C0011A0B3 /* ShadowContentElement.cpp in Sources */, 25071 A71C30B81381265E00DBC351 /* ShadowContentSelector.cpp in Sources */, 25060 25072 A7F338A311C0EFCA00A320A7 /* ShadowElement.cpp in Sources */, 25061 25073 A6D169621346B49B000EB770 /* ShadowRoot.cpp in Sources */, -
trunk/Source/WebCore/dom/DOMAllInOne.cpp
r85998 r86726 109 109 #include "SelectElement.cpp" 110 110 #include "SelectorNodeList.cpp" 111 #include "ShadowContentElement.cpp" 112 #include "ShadowContentSelector.cpp" 111 113 #include "ShadowRoot.cpp" 112 114 #include "SpaceSplitString.cpp" -
trunk/Source/WebCore/dom/Node.h
r86491 r86726 447 447 virtual void detach(); 448 448 449 void forceReattach(); 450 449 451 virtual void willRemove(); 450 452 void createRendererIfNeeded(); … … 733 735 } 734 736 737 inline void Node::forceReattach() 738 { 739 if (!attached()) 740 return; 741 detach(); 742 attach(); 743 } 744 735 745 } //namespace 736 746 -
trunk/Source/WebCore/dom/ShadowContentElement.cpp
r86725 r86726 8 8 * * Redistributions of source code must retain the above copyright 9 9 * notice, this list of conditions and the following disclaimer. 10 * * Redistributions in binary form must reproduce the above11 * copyright notice, this list of conditions and the following disclaimer12 * in the documentation and/or other materials provided with the13 * distribution.14 10 * * Neither the name of Google Inc. nor the names of its 15 11 * contributors may be used to endorse or promote products derived from … … 29 25 */ 30 26 31 #i fndef ShadowContentElement_h32 # define ShadowContentElement_h27 #include "config.h" 28 #include "ShadowContentElement.h" 33 29 34 #include "HTMLDivElement.h" 35 #include "HTMLNames.h" 36 #include <wtf/Forward.h> 30 #include "ShadowContentSelector.h" 37 31 38 32 namespace WebCore { 39 33 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 }; 34 void 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 } 59 41 60 42 } 61 62 #endif -
trunk/Source/WebCore/dom/ShadowContentElement.h
r86725 r86726 32 32 #define ShadowContentElement_h 33 33 34 #include "HTMLDivElement.h" 35 #include "HTMLNames.h" 34 #include "StyledElement.h" 36 35 #include <wtf/Forward.h> 37 36 … … 40 39 // NOTE: Current implementation doesn't support dynamic insertion/deletion of ShadowContentElement. 41 40 // You should create ShadowContentElement during the host construction. 42 class ShadowContentElement : public HTMLDivElement {41 class ShadowContentElement : public StyledElement { 43 42 public: 44 ShadowContentElement( Document* document)45 : HTMLDivElement(HTMLNames::divTag, document)43 ShadowContentElement(const QualifiedName& name, Document* document) 44 : StyledElement(name, document, CreateHTMLElement) 46 45 { 47 46 } -
trunk/Source/WebCore/dom/ShadowContentSelector.cpp
r86725 r86726 8 8 * * Redistributions of source code must retain the above copyright 9 9 * notice, this list of conditions and the following disclaimer. 10 * * Redistributions in binary form must reproduce the above11 * copyright notice, this list of conditions and the following disclaimer12 * in the documentation and/or other materials provided with the13 * distribution.14 10 * * Neither the name of Google Inc. nor the names of its 15 11 * contributors may be used to endorse or promote products derived from … … 29 25 */ 30 26 31 #i fndef ShadowContentElement_h32 # define ShadowContentElement_h27 #include "config.h" 28 #include "ShadowContentSelector.h" 33 29 34 #include " HTMLDivElement.h"35 #include " HTMLNames.h"36 #include <wtf/Forward.h> 30 #include "ShadowContentElement.h" 31 #include "ShadowRoot.h" 32 37 33 38 34 namespace WebCore { 39 35 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 { 36 ShadowContentSelector* ShadowContentSelector::s_currentInstance = 0; 37 38 ShadowContentSelector::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 48 ShadowContentSelector::~ShadowContentSelector() 49 { 50 ASSERT(s_currentInstance == this); 51 s_currentInstance = m_parent; 52 } 53 54 void 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; 47 67 } 48 68 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 } 59 71 60 72 } 61 62 #endif -
trunk/Source/WebCore/dom/ShadowContentSelector.h
r86725 r86726 29 29 */ 30 30 31 #ifndef ShadowContent Element_h32 #define ShadowContent Element_h31 #ifndef ShadowContentSelector_h 32 #define ShadowContentSelector_h 33 33 34 #include "HTMLDivElement.h"35 #include "HTMLNames.h"36 34 #include <wtf/Forward.h> 35 #include <wtf/Vector.h> 37 36 38 37 namespace WebCore { 39 38 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 { 39 class Element; 40 class Node; 41 class ShadowRoot; 42 class ShadowContentElement; 43 44 class ShadowContentSelector { 45 WTF_MAKE_NONCOPYABLE(ShadowContentSelector); 43 46 public: 44 ShadowContentElement(Document* document) 45 : HTMLDivElement(HTMLNames::divTag, document) 46 { 47 } 47 explicit ShadowContentSelector(ShadowRoot*); 48 ~ShadowContentSelector(); 48 49 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; } 51 55 52 56 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; } 57 ShadowContentSelector* m_parent; 58 ShadowRoot* m_shadowRoot; 59 Element* m_activeElement; 60 Vector<RefPtr<Node> > m_children; 61 62 static ShadowContentSelector* s_currentInstance; 58 63 }; 59 64 -
trunk/Source/WebCore/dom/ShadowRoot.cpp
r86521 r86726 31 31 #include "Document.h" 32 32 #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" 35 34 36 35 namespace 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 }111 36 112 37 ShadowRoot::ShadowRoot(Document* document) … … 160 85 { 161 86 if (hasContentElement()) 162 forceReattach( this);87 forceReattach(); 163 88 else { 164 89 for (Node* n = firstChild(); n; n = n->nextSibling()) -
trunk/Source/WebCore/html/HTMLDetailsElement.cpp
r85644 r86726 43 43 private: 44 44 DetailsContentElement(Document* document) 45 : ShadowContentElement( document)45 : ShadowContentElement(HTMLNames::divTag, document) 46 46 { 47 47 } … … 68 68 private: 69 69 DetailsSummaryElement(Document* document) 70 : ShadowContentElement( document)70 : ShadowContentElement(HTMLNames::divTag, document) 71 71 { 72 72 } -
trunk/Source/WebCore/html/HTMLSummaryElement.cpp
r85644 r86726 31 31 #include "RenderSummary.h" 32 32 #include "ShadowContentElement.h" 33 33 34 #include "ShadowRoot.h" 34 35 … … 43 44 private: 44 45 SummaryContentElement(Document* document) 45 : ShadowContentElement( document)46 : ShadowContentElement(HTMLNames::divTag, document) 46 47 { 47 48 }
Note: See TracChangeset
for help on using the changeset viewer.