Title: [95598] trunk/Source/WebCore
Revision
95598
Author
[email protected]
Date
2011-09-20 22:38:48 -0700 (Tue, 20 Sep 2011)

Log Message

Move RenderObject::markContainingBlocksForLayout() to RenderObject.cpp.
https://bugs.webkit.org/show_bug.cgi?id=67989

Reviewed by Ryosuke Niwa.

No new tests because of no behavior change.

* rendering/RenderObject.cpp:
(WebCore::objectIsRelayoutBoundary): Moved from RenderObject.h.
(WebCore::RenderObject::markContainingBlocksForLayout): Moved from RenderObject.h
* rendering/RenderObject.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (95597 => 95598)


--- trunk/Source/WebCore/ChangeLog	2011-09-21 05:23:13 UTC (rev 95597)
+++ trunk/Source/WebCore/ChangeLog	2011-09-21 05:38:48 UTC (rev 95598)
@@ -1,3 +1,17 @@
+2011-09-20  Kent Tamura  <[email protected]>
+
+        Move RenderObject::markContainingBlocksForLayout() to RenderObject.cpp.
+        https://bugs.webkit.org/show_bug.cgi?id=67989
+
+        Reviewed by Ryosuke Niwa.
+
+        No new tests because of no behavior change.
+
+        * rendering/RenderObject.cpp:
+        (WebCore::objectIsRelayoutBoundary): Moved from RenderObject.h.
+        (WebCore::RenderObject::markContainingBlocksForLayout): Moved from RenderObject.h
+        * rendering/RenderObject.h:
+
 2011-09-20  Rachel Blum  <[email protected]>
 
         Support for multiple <link rel="icon"> favicon elements.

Modified: trunk/Source/WebCore/rendering/RenderObject.cpp (95597 => 95598)


--- trunk/Source/WebCore/rendering/RenderObject.cpp	2011-09-21 05:23:13 UTC (rev 95597)
+++ trunk/Source/WebCore/rendering/RenderObject.cpp	2011-09-21 05:38:48 UTC (rev 95598)
@@ -599,6 +599,69 @@
     return 0;
 }
 
+static inline bool objectIsRelayoutBoundary(const RenderObject* object)
+{
+    // FIXME: In future it may be possible to broaden this condition in order to improve performance.
+    // Table cells are excluded because even when their CSS height is fixed, their height()
+    // may depend on their contents.
+    return object->isTextControl()
+#if ENABLE(SVG)
+        || object->isSVGRoot()
+#endif
+        || (object->hasOverflowClip() && !object->style()->width().isIntrinsicOrAuto() && !object->style()->height().isIntrinsicOrAuto() && !object->style()->height().isPercent() && !object->isTableCell());
+}
+
+void RenderObject::markContainingBlocksForLayout(bool scheduleRelayout, RenderObject* newRoot)
+{
+    ASSERT(!scheduleRelayout || !newRoot);
+
+    RenderObject* object = container();
+    RenderObject* last = this;
+
+    bool simplifiedNormalFlowLayout = needsSimplifiedNormalFlowLayout() && !selfNeedsLayout() && !normalChildNeedsLayout();
+
+    while (object) {
+        // Don't mark the outermost object of an unrooted subtree. That object will be
+        // marked when the subtree is added to the document.
+        RenderObject* container = object->container();
+        if (!container && !object->isRenderView())
+            return;
+        if (!last->isText() && (last->style()->position() == FixedPosition || last->style()->position() == AbsolutePosition)) {
+            bool willSkipRelativelyPositionedInlines = !object->isRenderBlock();
+            while (object && !object->isRenderBlock()) // Skip relatively positioned inlines and get to the enclosing RenderBlock.
+                object = object->container();
+            if (!object || object->m_posChildNeedsLayout)
+                return;
+            if (willSkipRelativelyPositionedInlines)
+                container = object->container();
+            object->m_posChildNeedsLayout = true;
+            simplifiedNormalFlowLayout = true;
+            ASSERT(!object->isSetNeedsLayoutForbidden());
+        } else if (simplifiedNormalFlowLayout) {
+            if (object->m_needsSimplifiedNormalFlowLayout)
+                return;
+            object->m_needsSimplifiedNormalFlowLayout = true;
+            ASSERT(!object->isSetNeedsLayoutForbidden());
+        } else {
+            if (object->m_normalChildNeedsLayout)
+                return;
+            object->m_normalChildNeedsLayout = true;
+            ASSERT(!object->isSetNeedsLayoutForbidden());
+        }
+
+        if (object == newRoot)
+            return;
+
+        last = object;
+        if (scheduleRelayout && objectIsRelayoutBoundary(last))
+            break;
+        object = container;
+    }
+
+    if (scheduleRelayout)
+        last->scheduleRelayout();
+}
+
 void RenderObject::setPreferredLogicalWidthsDirty(bool b, bool markParents)
 {
     bool alreadyDirty = m_preferredLogicalWidthsDirty;

Modified: trunk/Source/WebCore/rendering/RenderObject.h (95597 => 95598)


--- trunk/Source/WebCore/rendering/RenderObject.h	2011-09-21 05:23:13 UTC (rev 95597)
+++ trunk/Source/WebCore/rendering/RenderObject.h	2011-09-21 05:38:48 UTC (rev 95598)
@@ -1003,70 +1003,6 @@
     }
 }
 
-inline bool objectIsRelayoutBoundary(const RenderObject *obj) 
-{
-    // FIXME: In future it may be possible to broaden this condition in order to improve performance.
-    // Table cells are excluded because even when their CSS height is fixed, their height()
-    // may depend on their contents.
-    return obj->isTextControl()
-        || (obj->hasOverflowClip() && !obj->style()->width().isIntrinsicOrAuto() && !obj->style()->height().isIntrinsicOrAuto() && !obj->style()->height().isPercent() && !obj->isTableCell())
-#if ENABLE(SVG)
-           || obj->isSVGRoot()
-#endif
-           ;
-}
-
-inline void RenderObject::markContainingBlocksForLayout(bool scheduleRelayout, RenderObject* newRoot)
-{
-    ASSERT(!scheduleRelayout || !newRoot);
-
-    RenderObject* o = container();
-    RenderObject* last = this;
-
-    bool simplifiedNormalFlowLayout = needsSimplifiedNormalFlowLayout() && !selfNeedsLayout() && !normalChildNeedsLayout();
-
-    while (o) {
-        // Don't mark the outermost object of an unrooted subtree. That object will be 
-        // marked when the subtree is added to the document.
-        RenderObject* container = o->container();
-        if (!container && !o->isRenderView())
-            return;
-        if (!last->isText() && (last->style()->position() == FixedPosition || last->style()->position() == AbsolutePosition)) {
-            bool willSkipRelativelyPositionedInlines = !o->isRenderBlock();
-            while (o && !o->isRenderBlock()) // Skip relatively positioned inlines and get to the enclosing RenderBlock.
-                o = o->container();
-            if (!o || o->m_posChildNeedsLayout)
-                return;
-            if (willSkipRelativelyPositionedInlines)
-                container = o->container();
-            o->m_posChildNeedsLayout = true;
-            simplifiedNormalFlowLayout = true;
-            ASSERT(!o->isSetNeedsLayoutForbidden());
-        } else if (simplifiedNormalFlowLayout) {
-            if (o->m_needsSimplifiedNormalFlowLayout)
-                return;
-            o->m_needsSimplifiedNormalFlowLayout = true;
-            ASSERT(!o->isSetNeedsLayoutForbidden());
-        } else {
-            if (o->m_normalChildNeedsLayout)
-                return;
-            o->m_normalChildNeedsLayout = true;
-            ASSERT(!o->isSetNeedsLayoutForbidden());
-        }
-
-        if (o == newRoot)
-            return;
-
-        last = o;
-        if (scheduleRelayout && objectIsRelayoutBoundary(last))
-            break;
-        o = container;
-    }
-
-    if (scheduleRelayout)
-        last->scheduleRelayout();
-}
-
 inline bool RenderObject::preservesNewline() const
 {
 #if ENABLE(SVG)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to