Changeset 155292 in webkit
- Timestamp:
- Sep 8, 2013, 1:56:17 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 deleted
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/CMakeLists.txt
r155248 r155292 1123 1123 dom/ClipboardEvent.cpp 1124 1124 dom/Comment.cpp 1125 dom/ComposedShadowTreeWalker.cpp1126 1125 dom/CompositionEvent.cpp 1127 1126 dom/ContainerNode.cpp -
trunk/Source/WebCore/ChangeLog
r155289 r155292 1 2013-09-08 Antti Koivisto <antti@apple.com> 2 3 Remove ComposedShadowTreeWalker 4 https://bugs.webkit.org/show_bug.cgi?id=120997 5 6 Reviewed by Andreas Kling. 7 8 Move the code to NodeRenderingTraversal which is the only client besides Internals. 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 * dom/ComposedShadowTreeWalker.cpp: Removed. 17 * dom/ComposedShadowTreeWalker.h: Removed. 18 * dom/NodeRenderingTraversal.cpp: 19 (WebCore::NodeRenderingTraversal::nodeCanBeDistributed): 20 (WebCore::NodeRenderingTraversal::findFirstSiblingEnteringInsertionPoints): 21 (WebCore::NodeRenderingTraversal::findFirstEnteringInsertionPoints): 22 (WebCore::NodeRenderingTraversal::findFirstFromDistributedNode): 23 (WebCore::NodeRenderingTraversal::findLastSiblingEnteringInsertionPoints): 24 (WebCore::NodeRenderingTraversal::findLastEnteringInsertionPoints): 25 (WebCore::NodeRenderingTraversal::findLastFromDistributedNode): 26 (WebCore::NodeRenderingTraversal::traverseParent): 27 (WebCore::NodeRenderingTraversal::traverseFirstChild): 28 (WebCore::NodeRenderingTraversal::traverseLastChild): 29 (WebCore::NodeRenderingTraversal::traverseNextSibling): 30 (WebCore::NodeRenderingTraversal::traversePreviousSibling): 31 32 Make former members of ComposedShadowTreeWalker standalone functions in NodeRenderingTraversal. 33 34 (WebCore::NodeRenderingTraversal::parentSlow): 35 (WebCore::NodeRenderingTraversal::nextSiblingSlow): 36 (WebCore::NodeRenderingTraversal::previousSiblingSlow): 37 (WebCore::NodeRenderingTraversal::nextInScope): 38 (WebCore::NodeRenderingTraversal::previousInScope): 39 (WebCore::NodeRenderingTraversal::parentInScope): 40 (WebCore::NodeRenderingTraversal::lastChildInScope): 41 * testing/Internals.cpp: 42 * testing/Internals.h: 43 * testing/Internals.idl: 44 1 45 2013-09-08 Andreas Kling <akling@apple.com> 2 46 -
trunk/Source/WebCore/GNUmakefile.list.am
r155248 r155292 2798 2798 Source/WebCore/dom/Comment.cpp \ 2799 2799 Source/WebCore/dom/Comment.h \ 2800 Source/WebCore/dom/ComposedShadowTreeWalker.cpp \2801 Source/WebCore/dom/ComposedShadowTreeWalker.h \2802 2800 Source/WebCore/dom/CompositionEvent.cpp \ 2803 2801 Source/WebCore/dom/CompositionEvent.h \ -
trunk/Source/WebCore/Target.pri
r155211 r155292 371 371 dom/ClipboardEvent.cpp \ 372 372 dom/Comment.cpp \ 373 dom/ComposedShadowTreeWalker.cpp \374 373 dom/CompositionEvent.cpp \ 375 374 dom/ContainerNode.cpp \ … … 1584 1583 dom/Clipboard.h \ 1585 1584 dom/Comment.h \ 1586 dom/ComposedShadowTreeWalker.h \1587 1585 dom/ContainerNode.h \ 1588 1586 dom/ContainerNodeAlgorithms.h \ -
trunk/Source/WebCore/WebCore.exp.in
r155283 r155292 773 773 __ZN7WebCore23getHostnamesWithCookiesERKNS_21NetworkStorageSessionERN3WTF7HashSetINS3_6StringENS3_10StringHashENS3_10HashTraitsIS5_EEEE 774 774 __ZN7WebCore24CachedResourceHandleBase11setResourceEPNS_14CachedResourceE 775 __ZN7WebCore24ComposedShadowTreeWalker10firstChildEv776 __ZN7WebCore24ComposedShadowTreeWalker11nextSiblingEv777 __ZN7WebCore24ComposedShadowTreeWalker4nextEv778 __ZN7WebCore24ComposedShadowTreeWalker8previousEv779 __ZN7WebCore24ComposedShadowTreeWalker9lastChildEv780 775 __ZN7WebCore24DocumentMarkerController10markersForEPNS_4NodeENS_14DocumentMarker11MarkerTypesE 781 776 __ZN7WebCore24DocumentMarkerController13removeMarkersENS_14DocumentMarker11MarkerTypesE -
trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
r155226 r155292 12167 12167 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild> 12168 12168 </ClCompile> 12169 <ClCompile Include="..\dom\ComposedShadowTreeWalker.cpp" />12170 12169 <ClCompile Include="..\dom\CompositionEvent.cpp"> 12171 12170 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> … … 20265 20264 <ClInclude Include="..\dom\ClipboardEvent.h" /> 20266 20265 <ClInclude Include="..\dom\Comment.h" /> 20267 <ClInclude Include="..\dom\ComposedShadowTreeWalker.h" />20268 20266 <ClInclude Include="..\dom\CompositionEvent.h" /> 20269 20267 <ClInclude Include="..\dom\ContainerNode.h" /> -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r155229 r155292 1506 1506 4A5CB1C516C3A5FD00AB2886 /* EventRetargeter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A5CB1C316C3A5FD00AB2886 /* EventRetargeter.cpp */; }; 1507 1507 4A5CB1C616C3A5FD00AB2886 /* EventRetargeter.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A5CB1C416C3A5FD00AB2886 /* EventRetargeter.h */; }; 1508 4A6A0C5B15232F2400B09C6E /* ComposedShadowTreeWalker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A6A0C5915232F2400B09C6E /* ComposedShadowTreeWalker.cpp */; };1509 4A6A0C5C15232F2400B09C6E /* ComposedShadowTreeWalker.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A6A0C5A15232F2400B09C6E /* ComposedShadowTreeWalker.h */; };1510 1508 4A6E9FC313C17D1D0046A7F8 /* FontFeatureValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A6E9FC113C17D1D0046A7F8 /* FontFeatureValue.cpp */; }; 1511 1509 4A6E9FC413C17D1D0046A7F8 /* FontFeatureValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A6E9FC213C17D1D0046A7F8 /* FontFeatureValue.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 8022 8020 4A5CB1C316C3A5FD00AB2886 /* EventRetargeter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EventRetargeter.cpp; sourceTree = "<group>"; }; 8023 8021 4A5CB1C416C3A5FD00AB2886 /* EventRetargeter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventRetargeter.h; sourceTree = "<group>"; }; 8024 4A6A0C5915232F2400B09C6E /* ComposedShadowTreeWalker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ComposedShadowTreeWalker.cpp; sourceTree = "<group>"; };8025 4A6A0C5A15232F2400B09C6E /* ComposedShadowTreeWalker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ComposedShadowTreeWalker.h; sourceTree = "<group>"; };8026 8022 4A6E9FC113C17D1D0046A7F8 /* FontFeatureValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontFeatureValue.cpp; sourceTree = "<group>"; }; 8027 8023 4A6E9FC213C17D1D0046A7F8 /* FontFeatureValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontFeatureValue.h; sourceTree = "<group>"; }; … … 20630 20626 6550B698099DF0270090D781 /* Comment.h */, 20631 20627 85089CC70A98C22600A275AA /* Comment.idl */, 20632 4A6A0C5915232F2400B09C6E /* ComposedShadowTreeWalker.cpp */,20633 4A6A0C5A15232F2400B09C6E /* ComposedShadowTreeWalker.h */,20634 20628 79F2F59E1091939A000D87CB /* CompositionEvent.cpp */, 20635 20629 79F2F59F1091939A000D87CB /* CompositionEvent.h */, … … 21595 21589 979DC03716A7992E00807794 /* CompactHTMLToken.h in Headers */, 21596 21590 37C236111097EE7700EF9F72 /* ComplexTextController.h in Headers */, 21597 4A6A0C5C15232F2400B09C6E /* ComposedShadowTreeWalker.h in Headers */,21598 21591 316FE1160E6E1DA700BF6088 /* CompositeAnimation.h in Headers */, 21599 21592 93309DDD099E64920056E581 /* CompositeEditCommand.h in Headers */, … … 25103 25096 37C236101097EE7700EF9F72 /* ComplexTextController.cpp in Sources */, 25104 25097 37C238221098C84200EF9F72 /* ComplexTextControllerCoreText.mm in Sources */, 25105 4A6A0C5B15232F2400B09C6E /* ComposedShadowTreeWalker.cpp in Sources */,25106 25098 316FE1150E6E1DA700BF6088 /* CompositeAnimation.cpp in Sources */, 25107 25099 93309DDC099E64920056E581 /* CompositeEditCommand.cpp in Sources */, -
trunk/Source/WebCore/dom/NodeRenderingTraversal.cpp
r154541 r155292 1 1 /* 2 2 * Copyright (C) 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2013 Apple Inc. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 28 29 #include "NodeRenderingTraversal.h" 29 30 30 #include " ComposedShadowTreeWalker.h"31 #include "InsertionPoint.h" 31 32 #include "PseudoElement.h" 33 #include "ShadowRoot.h" 32 34 33 35 namespace WebCore { … … 35 37 namespace NodeRenderingTraversal { 36 38 39 static Node* findFirstSiblingEnteringInsertionPoints(const Node*); 40 static Node* findFirstEnteringInsertionPoints(const Node*); 41 static Node* findFirstFromDistributedNode(const Node*, const InsertionPoint*); 42 static Node* findLastSiblingEnteringInsertionPoints(const Node*); 43 static Node* findLastEnteringInsertionPoints(const Node*); 44 static Node* findLastFromDistributedNode(const Node*, const InsertionPoint*); 45 46 static inline bool nodeCanBeDistributed(const Node* node) 47 { 48 ASSERT(node); 49 Node* parent = parentNodeForDistribution(node); 50 if (!parent) 51 return false; 52 53 if (parent->isShadowRoot()) 54 return false; 55 56 if (parent->isElementNode() && toElement(parent)->shadowRoot()) 57 return true; 58 59 return false; 60 } 61 62 static Node* findFirstSiblingEnteringInsertionPoints(const Node* node) 63 { 64 for (const Node* sibling = node; sibling; sibling = sibling->nextSibling()) { 65 if (Node* found = findFirstEnteringInsertionPoints(sibling)) 66 return found; 67 } 68 return nullptr; 69 } 70 71 static Node* findFirstEnteringInsertionPoints(const Node* node) 72 { 73 ASSERT(node); 74 if (!isActiveInsertionPoint(node)) 75 return const_cast<Node*>(node); 76 const InsertionPoint* insertionPoint = toInsertionPoint(node); 77 if (Node* found = findFirstFromDistributedNode(insertionPoint->firstDistributed(), insertionPoint)) 78 return found; 79 return findFirstSiblingEnteringInsertionPoints(node->firstChild()); 80 } 81 82 static Node* findFirstFromDistributedNode(const Node* node, const InsertionPoint* insertionPoint) 83 { 84 for (const Node* next = node; next; next = insertionPoint->nextDistributedTo(next)) { 85 if (Node* found = findFirstEnteringInsertionPoints(next)) 86 return found; 87 } 88 return nullptr; 89 } 90 91 static Node* findLastSiblingEnteringInsertionPoints(const Node* node) 92 { 93 for (const Node* sibling = node; sibling; sibling = sibling->previousSibling()) { 94 if (Node* found = findLastEnteringInsertionPoints(sibling)) 95 return found; 96 } 97 return nullptr; 98 } 99 100 static Node* findLastEnteringInsertionPoints(const Node* node) 101 { 102 ASSERT(node); 103 if (!isActiveInsertionPoint(node)) 104 return const_cast<Node*>(node); 105 const InsertionPoint* insertionPoint = toInsertionPoint(node); 106 if (Node* found = findLastFromDistributedNode(insertionPoint->lastDistributed(), insertionPoint)) 107 return found; 108 return findLastSiblingEnteringInsertionPoints(node->lastChild()); 109 } 110 111 static Node* findLastFromDistributedNode(const Node* node, const InsertionPoint* insertionPoint) 112 { 113 for (const Node* next = node; next; next = insertionPoint->previousDistributedTo(next)) { 114 if (Node* found = findLastEnteringInsertionPoints(next)) 115 return found; 116 } 117 return nullptr; 118 } 119 120 enum ShadowRootCrossing { CrossShadowRoot, DontCrossShadowRoot }; 121 122 static ContainerNode* traverseParent(const Node* node, ShadowRootCrossing shadowRootCrossing) 123 { 124 if (node->isPseudoElement()) 125 return toPseudoElement(node)->hostElement(); 126 127 if (shadowRootCrossing == DontCrossShadowRoot && node->isShadowRoot()) 128 return 0; 129 130 if (nodeCanBeDistributed(node)) { 131 if (InsertionPoint* insertionPoint = findInsertionPointOf(node)) 132 return traverseParent(insertionPoint, shadowRootCrossing); 133 return nullptr; 134 } 135 ContainerNode* parent = node->parentNode(); 136 if (!parent) 137 return nullptr; 138 139 if (parent->isShadowRoot()) 140 return shadowRootCrossing == CrossShadowRoot ? toShadowRoot(parent)->hostElement() : parent; 141 142 if (parent->isInsertionPoint()) { 143 const InsertionPoint* insertionPoint = toInsertionPoint(parent); 144 if (insertionPoint->hasDistribution()) 145 return nullptr; 146 if (insertionPoint->isActive()) 147 return traverseParent(parent, shadowRootCrossing); 148 } 149 return parent; 150 } 151 152 static Node* traverseFirstChild(const Node* node, ShadowRootCrossing shadowRootCrossing) 153 { 154 ASSERT(node); 155 if (node->shadowRoot()) { 156 if (shadowRootCrossing == DontCrossShadowRoot) 157 return nullptr; 158 node = node->shadowRoot(); 159 } 160 return findFirstSiblingEnteringInsertionPoints(node->firstChild()); 161 } 162 163 static Node* traverseLastChild(const Node* node, ShadowRootCrossing shadowRootCrossing) 164 { 165 ASSERT(node); 166 if (node->shadowRoot()) { 167 if (shadowRootCrossing == DontCrossShadowRoot) 168 return nullptr; 169 node = node->shadowRoot(); 170 } 171 return findLastSiblingEnteringInsertionPoints(node->lastChild()); 172 } 173 174 static Node* traverseNextSibling(const Node* node) 175 { 176 ASSERT(node); 177 178 InsertionPoint* insertionPoint; 179 if (nodeCanBeDistributed(node) && (insertionPoint = findInsertionPointOf(node))) { 180 Node* found = findFirstFromDistributedNode(insertionPoint->nextDistributedTo(node), insertionPoint); 181 if (found) 182 return found; 183 return traverseNextSibling(insertionPoint); 184 } 185 186 for (const Node* sibling = node->nextSibling(); sibling; sibling = sibling->nextSibling()) { 187 if (Node* found = findFirstEnteringInsertionPoints(sibling)) 188 return found; 189 } 190 if (node->parentNode() && isActiveInsertionPoint(node->parentNode())) 191 return traverseNextSibling(node->parentNode()); 192 193 return nullptr; 194 } 195 196 static Node* traversePreviousSibling(const Node* node) 197 { 198 ASSERT(node); 199 200 InsertionPoint* insertionPoint; 201 if (nodeCanBeDistributed(node) && (insertionPoint = findInsertionPointOf(node))) { 202 Node* found = findLastFromDistributedNode(insertionPoint->previousDistributedTo(node), insertionPoint); 203 if (found) 204 return found; 205 return traversePreviousSibling(insertionPoint); 206 } 207 208 for (const Node* sibling = node->previousSibling(); sibling; sibling = sibling->previousSibling()) { 209 if (Node* found = findLastEnteringInsertionPoints(sibling)) 210 return found; 211 } 212 if (node->parentNode() && isActiveInsertionPoint(node->parentNode())) 213 return traversePreviousSibling(node->parentNode()); 214 215 return nullptr; 216 } 217 37 218 ContainerNode* parentSlow(const Node* node) 38 219 { 39 ComposedShadowTreeWalker walker(node, ComposedShadowTreeWalker::CrossUpperBoundary, ComposedShadowTreeWalker::CanStartFromShadowBoundary); 40 return toContainerNode(walker.traverseParent(walker.get())); 220 ASSERT(!node->isShadowRoot()); 221 222 return traverseParent(node, CrossShadowRoot); 41 223 } 42 224 43 225 Node* nextSiblingSlow(const Node* node) 44 226 { 45 ComposedShadowTreeWalker walker(node); 227 ASSERT(!node->isShadowRoot()); 228 229 // FIXME: Why do these functions deal with before/after when other code here doesn't? 230 Node* nextSibling = 0; 46 231 if (node->isBeforePseudoElement()) { 47 walker.parent();48 walker.firstChild();232 nextSibling = traverseParent(node, CrossShadowRoot); 233 nextSibling = traverseFirstChild(nextSibling, CrossShadowRoot); 49 234 } else 50 walker.nextSibling();51 52 if ( walker.get()|| node->isAfterPseudoElement())53 return walker.get();54 55 Node* parent = walker.traverseParent(node);235 nextSibling = traverseNextSibling(node); 236 237 if (nextSibling || node->isAfterPseudoElement()) 238 return nextSibling; 239 240 Node* parent = traverseParent(node, CrossShadowRoot); 56 241 if (parent && parent->isElementNode()) 57 242 return toElement(parent)->afterPseudoElement(); … … 62 247 Node* previousSiblingSlow(const Node* node) 63 248 { 64 ComposedShadowTreeWalker walker(node); 249 ASSERT(!node->isShadowRoot()); 250 251 Node* previousSibling = 0; 65 252 if (node->isAfterPseudoElement()) { 66 walker.parent();67 walker.lastChild();253 ContainerNode* parent = traverseParent(node, CrossShadowRoot); 254 previousSibling = traverseLastChild(parent, CrossShadowRoot); 68 255 } else 69 walker.previousSibling();70 71 if ( walker.get()|| node->isBeforePseudoElement())72 return walker.get();73 74 Node* parent = walker.traverseParent(node);256 previousSibling = traversePreviousSibling(node); 257 258 if (previousSibling || node->isBeforePseudoElement()) 259 return previousSibling; 260 261 ContainerNode* parent = traverseParent(node, CrossShadowRoot); 75 262 if (parent && parent->isElementNode()) 76 263 return toElement(parent)->beforePseudoElement(); … … 81 268 Node* nextInScope(const Node* node) 82 269 { 83 // FIXME: ComposedShadowTreeWalker shouldn't be used when !ENABLE(SHADOW_DOM) https://bugs.webkit.org/show_bug.cgi?id=103339 84 ComposedShadowTreeWalker walker = ComposedShadowTreeWalker(node, ComposedShadowTreeWalker::DoNotCrossUpperBoundary); 85 walker.next(); 86 return walker.get(); 270 ASSERT(!isActiveInsertionPoint(node)); 271 272 if (Node* next = traverseFirstChild(node, DontCrossShadowRoot)) 273 return next; 274 if (Node* next = traverseNextSibling(node)) 275 return next; 276 const Node* current = node; 277 while (current && !traverseNextSibling(current)) 278 current = traverseParent(current, DontCrossShadowRoot); 279 return current ? traverseNextSibling(current) : 0; 87 280 } 88 281 89 282 Node* previousInScope(const Node* node) 90 283 { 91 // FIXME: ComposedShadowTreeWalker shouldn't be used when !ENABLE(SHADOW_DOM) https://bugs.webkit.org/show_bug.cgi?id=103339 92 ComposedShadowTreeWalker walker = ComposedShadowTreeWalker(node, ComposedShadowTreeWalker::DoNotCrossUpperBoundary); 93 walker.previous(); 94 return walker.get(); 284 ASSERT(!isActiveInsertionPoint(node)); 285 286 if (Node* current = traversePreviousSibling(node)) { 287 while (Node* child = traverseLastChild(current, DontCrossShadowRoot)) 288 current = child; 289 return current; 290 } 291 return traverseParent(node, DontCrossShadowRoot); 95 292 } 96 293 97 294 Node* parentInScope(const Node* node) 98 295 { 99 // FIXME: ComposedShadowTreeWalker shouldn't be used when !ENABLE(SHADOW_DOM) https://bugs.webkit.org/show_bug.cgi?id=103339 100 ComposedShadowTreeWalker walker = ComposedShadowTreeWalker(node, ComposedShadowTreeWalker::DoNotCrossUpperBoundary); 101 walker.parent(); 102 return walker.get(); 296 ASSERT(!isActiveInsertionPoint(node)); 297 298 return traverseParent(node, DontCrossShadowRoot); 103 299 } 104 300 105 301 Node* lastChildInScope(const Node* node) 106 302 { 107 // FIXME: ComposedShadowTreeWalker shouldn't be used when !ENABLE(SHADOW_DOM) https://bugs.webkit.org/show_bug.cgi?id=103339 108 ComposedShadowTreeWalker walker = ComposedShadowTreeWalker(node, ComposedShadowTreeWalker::DoNotCrossUpperBoundary); 109 walker.lastChild(); 110 return walker.get(); 303 ASSERT(!isActiveInsertionPoint(node)); 304 305 return traverseLastChild(node, DontCrossShadowRoot); 111 306 } 112 307 -
trunk/Source/WebCore/testing/Internals.cpp
r155228 r155292 35 35 #include "ClientRect.h" 36 36 #include "ClientRectList.h" 37 #include "ComposedShadowTreeWalker.h"38 37 #include "ContentDistributor.h" 39 38 #include "Cursor.h" … … 511 510 } 512 511 513 Node* Internals::nextSiblingByWalker(Node* node, ExceptionCode& ec)514 {515 if (!node) {516 ec = INVALID_ACCESS_ERR;517 return 0;518 }519 ComposedShadowTreeWalker walker(node);520 walker.nextSibling();521 return walker.get();522 }523 524 Node* Internals::firstChildByWalker(Node* node, ExceptionCode& ec)525 {526 if (!node) {527 ec = INVALID_ACCESS_ERR;528 return 0;529 }530 ComposedShadowTreeWalker walker(node);531 walker.firstChild();532 return walker.get();533 }534 535 Node* Internals::lastChildByWalker(Node* node, ExceptionCode& ec)536 {537 if (!node) {538 ec = INVALID_ACCESS_ERR;539 return 0;540 }541 ComposedShadowTreeWalker walker(node);542 walker.lastChild();543 return walker.get();544 }545 546 Node* Internals::nextNodeByWalker(Node* node, ExceptionCode& ec)547 {548 if (!node) {549 ec = INVALID_ACCESS_ERR;550 return 0;551 }552 ComposedShadowTreeWalker walker(node);553 walker.next();554 return walker.get();555 }556 557 Node* Internals::previousNodeByWalker(Node* node, ExceptionCode& ec)558 {559 if (!node) {560 ec = INVALID_ACCESS_ERR;561 return 0;562 }563 ComposedShadowTreeWalker walker(node);564 walker.previous();565 return walker.get();566 }567 568 512 String Internals::elementRenderTreeAsText(Element* element, ExceptionCode& ec) 569 513 { -
trunk/Source/WebCore/testing/Internals.h
r154921 r155292 121 121 bool attached(Node*, ExceptionCode&); 122 122 123 // FIXME: Rename these functions if walker is prefered.124 Node* nextSiblingByWalker(Node*, ExceptionCode&);125 Node* firstChildByWalker(Node*, ExceptionCode&);126 Node* lastChildByWalker(Node*, ExceptionCode&);127 Node* nextNodeByWalker(Node*, ExceptionCode&);128 Node* previousNodeByWalker(Node*, ExceptionCode&);129 130 123 String visiblePlaceholder(Element*); 131 124 #if ENABLE(INPUT_TYPE_COLOR) -
trunk/Source/WebCore/testing/Internals.idl
r154921 r155292 70 70 [RaisesException] boolean pauseTransitionAtTimeOnPseudoElement(DOMString property, double pauseTime, Element element, DOMString pseudoId); 71 71 72 [RaisesException] Node nextSiblingByWalker(Node node);73 [RaisesException] Node firstChildByWalker(Node node);74 [RaisesException] Node lastChildByWalker(Node node);75 [RaisesException] Node nextNodeByWalker(Node node);76 [RaisesException] Node previousNodeByWalker(Node node);77 78 72 [RaisesException] boolean attached(Node node); 79 73
Note:
See TracChangeset
for help on using the changeset viewer.