Title: [140913] trunk/Source/WebCore
Revision
140913
Author
[email protected]
Date
2013-01-26 11:29:18 -0800 (Sat, 26 Jan 2013)

Log Message

Text Autosizing: simplify and clean-up preOrderTraversal skipping containers
https://bugs.webkit.org/show_bug.cgi?id=107446

Patch by Tim Volodine <[email protected]> on 2013-01-26
Reviewed by Julien Chaffraix.

Simplify nextInPreOrderSkippingDescendantsOfContainers implementation
using RenderObject tree traversal methods.

No new tests because functionality is unchanged.

* rendering/TextAutosizer.cpp:
(WebCore::TextAutosizer::nextInPreOrderSkippingDescendantsOfContainers):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (140912 => 140913)


--- trunk/Source/WebCore/ChangeLog	2013-01-26 16:34:55 UTC (rev 140912)
+++ trunk/Source/WebCore/ChangeLog	2013-01-26 19:29:18 UTC (rev 140913)
@@ -1,3 +1,18 @@
+2013-01-26  Tim Volodine  <[email protected]>
+
+        Text Autosizing: simplify and clean-up preOrderTraversal skipping containers
+        https://bugs.webkit.org/show_bug.cgi?id=107446
+
+        Reviewed by Julien Chaffraix.
+
+        Simplify nextInPreOrderSkippingDescendantsOfContainers implementation
+        using RenderObject tree traversal methods.
+
+        No new tests because functionality is unchanged.
+
+        * rendering/TextAutosizer.cpp:
+        (WebCore::TextAutosizer::nextInPreOrderSkippingDescendantsOfContainers):
+
 2013-01-26  Dan Carney  <[email protected]>
 
         [v8] prepare SerializedScriptValue for transition to Latin-1

Modified: trunk/Source/WebCore/rendering/TextAutosizer.cpp (140912 => 140913)


--- trunk/Source/WebCore/rendering/TextAutosizer.cpp	2013-01-26 16:34:55 UTC (rev 140912)
+++ trunk/Source/WebCore/rendering/TextAutosizer.cpp	2013-01-26 19:29:18 UTC (rev 140913)
@@ -407,17 +407,8 @@
 RenderObject* TextAutosizer::nextInPreOrderSkippingDescendantsOfContainers(const RenderObject* current, const RenderObject* stayWithin)
 {
     if (current == stayWithin || !isAutosizingContainer(current))
-        for (RenderObject* child = current->firstChild(); child; child = child->nextSibling())
-            return child;
-
-    for (const RenderObject* ancestor = current; ancestor; ancestor = ancestor->parent()) {
-        if (ancestor == stayWithin)
-            return 0;
-        for (RenderObject* sibling = ancestor->nextSibling(); sibling; sibling = sibling->nextSibling())
-            return sibling;
-    }
-
-    return 0;
+        return current->nextInPreOrder(stayWithin);
+    return current->nextInPreOrderAfterChildren(stayWithin);
 }
 
 const RenderBlock* TextAutosizer::findDeepestBlockContainingAllText(const RenderBlock* cluster)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to