Fold the invalidateVerticalPositions crawl into the bidi iteration.
This makes it more correct (since we won't drill into elements that
did not need to be reset) and cuts out an extra walk of all our children.
We're still O(n^2) as new content streams in, but this at least cuts
out one separate O(n^2) crawl.
Reviewed by olliej
* rendering/RenderObject.cpp:
* rendering/RenderObject.h:
(WebCore::RenderObject::invalidateVerticalPosition):
* rendering/bidi.cpp:
(WebCore::RenderBlock::layoutInlineChildren):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@21879 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/rendering/bidi.cpp b/WebCore/rendering/bidi.cpp
index 726fea3..1d5f011 100644
--- a/WebCore/rendering/bidi.cpp
+++ b/WebCore/rendering/bidi.cpp
@@ -1575,10 +1575,10 @@
bool useRepaintBounds = false;
+ invalidateVerticalPosition();
+
m_overflowHeight = 0;
-
- invalidateVerticalPositions();
-
+
m_height = borderTop() + paddingTop();
int toAdd = borderBottom() + paddingBottom() + horizontalScrollbarHeight();
@@ -1603,9 +1603,10 @@
if (firstChild()) {
// layout replaced elements
bool endOfInline = false;
- RenderObject *o = bidiFirst(this, bidi, false);
+ RenderObject* o = bidiFirst(this, bidi, false);
bool hasFloat = false;
while (o) {
+ o->invalidateVerticalPosition();
if (o->isReplaced() || o->isFloating() || o->isPositioned()) {
if (relayoutChildren || o->style()->width().isPercent() || o->style()->height().isPercent())
o->setChildNeedsLayout(true, false);