Changeset 139273 in webkit
- Timestamp:
- Jan 9, 2013 6:51:59 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r139269 r139273 1 2013-01-09 Elliott Sprehn <esprehn@gmail.com> 2 3 Node::containingShadowRoot should be constant time 4 https://bugs.webkit.org/show_bug.cgi?id=106494 5 6 Reviewed by Dimitri Glazkov. 7 8 There's no reason to traverse up the tree to find the containing 9 ShadowRoot when we already know if we're in a ShadowRoot by looking at 10 the treeScope(). 11 12 No new tests, just refactoring. 13 14 * dom/Node.cpp: 15 (WebCore::Node::containingShadowRoot): 16 1 17 2013-01-09 Hajime Morrita <morrita@google.com> 2 18 -
trunk/Source/WebCore/dom/Node.cpp
r138811 r139273 1243 1243 ShadowRoot* Node::containingShadowRoot() const 1244 1244 { 1245 Node* root = const_cast<Node*>(this); 1246 while (root) { 1247 if (root->isShadowRoot()) 1248 return toShadowRoot(root); 1249 root = root->parentNodeGuaranteedHostFree(); 1250 } 1251 return 0; 1245 Node* root = treeScope()->rootNode(); 1246 return root && root->isShadowRoot() ? toShadowRoot(root) : 0; 1252 1247 } 1253 1248
Note: See TracChangeset
for help on using the changeset viewer.