Title: [98275] trunk/Source/WebCore
Revision
98275
Author
[email protected]
Date
2011-10-24 13:41:33 -0700 (Mon, 24 Oct 2011)

Log Message

Optimize Node::isInShadowTree to execute in constant-time
https://bugs.webkit.org/show_bug.cgi?id=67686

Reviewed by Dimitri Glazkov.

No expected change in behavior, so no new tests.

* dom/Node.cpp:
(WebCore::Node::isInShadowTree):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (98274 => 98275)


--- trunk/Source/WebCore/ChangeLog	2011-10-24 20:40:28 UTC (rev 98274)
+++ trunk/Source/WebCore/ChangeLog	2011-10-24 20:41:33 UTC (rev 98275)
@@ -1,3 +1,15 @@
+2011-10-24  Adam Klein  <[email protected]>
+
+        Optimize Node::isInShadowTree to execute in constant-time
+        https://bugs.webkit.org/show_bug.cgi?id=67686
+
+        Reviewed by Dimitri Glazkov.
+
+        No expected change in behavior, so no new tests.
+
+        * dom/Node.cpp:
+        (WebCore::Node::isInShadowTree):
+
 2011-10-24  Nat Duca  <[email protected]>
 
         [chromium] Expose WebThread::postDelayedTask to CCThread

Modified: trunk/Source/WebCore/dom/Node.cpp (98274 => 98275)


--- trunk/Source/WebCore/dom/Node.cpp	2011-10-24 20:40:28 UTC (rev 98274)
+++ trunk/Source/WebCore/dom/Node.cpp	2011-10-24 20:41:33 UTC (rev 98275)
@@ -1592,10 +1592,7 @@
 
 bool Node::isInShadowTree()
 {
-    for (Node* n = this; n; n = n->parentNode())
-        if (n->isShadowRoot())
-            return true;
-    return false;
+    return treeScope() != document();
 }
 
 Element* Node::parentOrHostElement() const
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to