Title: [156308] trunk/Source/WebCore

Diff

Modified: trunk/Source/WebCore/ChangeLog (156307 => 156308)


--- trunk/Source/WebCore/ChangeLog	2013-09-23 23:53:28 UTC (rev 156307)
+++ trunk/Source/WebCore/ChangeLog	2013-09-23 23:55:20 UTC (rev 156308)
@@ -1,3 +1,12 @@
+2013-09-23  Andreas Kling  <[email protected]>
+
+        CTTE: RenderObject::container() should return a RenderElement*.
+        <https://webkit.org/b/121811>
+
+        Reviewed by Antti Koivisto.
+
+        The containing renderer is always a RenderElement.
+
 2013-09-23  Anders Carlsson  <[email protected]>
 
         Test the waters and begin using lambdas

Modified: trunk/Source/WebCore/rendering/LayoutState.cpp (156307 => 156308)


--- trunk/Source/WebCore/rendering/LayoutState.cpp	2013-09-23 23:53:28 UTC (rev 156307)
+++ trunk/Source/WebCore/rendering/LayoutState.cpp	2013-09-23 23:55:20 UTC (rev 156308)
@@ -57,7 +57,7 @@
         m_paintOffset = prev->m_paintOffset + offset;
 
     if (renderer->isOutOfFlowPositioned() && !fixed) {
-        if (RenderObject* container = renderer->container()) {
+        if (RenderElement* container = renderer->container()) {
             if (container->isInFlowPositioned() && container->isRenderInline())
                 m_paintOffset += toRenderInline(container)->offsetForInFlowPositionedInline(renderer);
         }
@@ -156,7 +156,7 @@
     , m_renderer(root)
 #endif
 {
-    RenderObject* container = root->container();
+    RenderElement* container = root->container();
     FloatPoint absContentPoint = container->localToAbsolute(FloatPoint(), UseTransforms);
     m_paintOffset = LayoutSize(absContentPoint.x(), absContentPoint.y());
 

Modified: trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp (156307 => 156308)


--- trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp	2013-09-23 23:53:28 UTC (rev 156307)
+++ trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp	2013-09-23 23:55:20 UTC (rev 156308)
@@ -990,7 +990,7 @@
 {
     // FIXME: The math here is actually not really right. It's a best-guess approximation that
     // will work for the common cases
-    RenderObject* containerBlock = child->container();
+    RenderElement* containerBlock = child->container();
     LayoutUnit blockHeight = block->logicalHeight();
     if (containerBlock->isRenderInline()) {
         // A relative positioned inline encloses us. In this case, we also have to determine our

Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (156307 => 156308)


--- trunk/Source/WebCore/rendering/RenderBox.cpp	2013-09-23 23:53:28 UTC (rev 156307)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp	2013-09-23 23:55:20 UTC (rev 156308)
@@ -1816,7 +1816,7 @@
     }
 
     bool containerSkipped;
-    RenderObject* o = container(repaintContainer, &containerSkipped);
+    RenderElement* o = container(repaintContainer, &containerSkipped);
     if (!o)
         return;
 
@@ -1865,7 +1865,7 @@
     ASSERT(ancestorToStopAt != this);
 
     bool ancestorSkipped;
-    RenderObject* container = this->container(ancestorToStopAt, &ancestorSkipped);
+    RenderElement* container = this->container(ancestorToStopAt, &ancestorSkipped);
     if (!container)
         return 0;
 
@@ -2072,7 +2072,7 @@
     }
 
     bool containerSkipped;
-    RenderObject* o = container(repaintContainer, &containerSkipped);
+    RenderElement* o = container(repaintContainer, &containerSkipped);
     if (!o)
         return;
 
@@ -3073,7 +3073,7 @@
     // FIXME: The static distance computation has not been patched for mixed writing modes yet.
     if (child->parent()->style()->direction() == LTR) {
         LayoutUnit staticPosition = child->layer()->staticInlinePosition() - containerBlock->borderLogicalLeft();
-        for (RenderObject* curr = child->parent(); curr && curr != containerBlock; curr = curr->container()) {
+        for (RenderElement* curr = child->parent(); curr && curr != containerBlock; curr = curr->container()) {
             if (curr->isBox()) {
                 staticPosition += toRenderBox(curr)->logicalLeft();
                 if (region && curr->isRenderBlock()) {
@@ -3089,7 +3089,7 @@
     } else {
         RenderBox* enclosingBox = child->parent()->enclosingBox();
         LayoutUnit staticPosition = child->layer()->staticInlinePosition() + containerLogicalWidth + containerBlock->borderLogicalLeft();
-        for (RenderObject* curr = enclosingBox; curr; curr = curr->container()) {
+        for (RenderElement* curr = enclosingBox; curr; curr = curr->container()) {
             if (curr->isBox()) {
                 if (curr != containerBlock)
                     staticPosition -= toRenderBox(curr)->logicalLeft();
@@ -3447,7 +3447,7 @@
     
     // FIXME: The static distance computation has not been patched for mixed writing modes.
     LayoutUnit staticLogicalTop = child->layer()->staticBlockPosition() - containerBlock->borderBefore();
-    for (RenderObject* curr = child->parent(); curr && curr != containerBlock; curr = curr->container()) {
+    for (RenderElement* curr = child->parent(); curr && curr != containerBlock; curr = curr->container()) {
         if (curr->isBox() && !curr->isTableRow())
             staticLogicalTop += toRenderBox(curr)->logicalTop();
     }

Modified: trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp (156307 => 156308)


--- trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp	2013-09-23 23:53:28 UTC (rev 156307)
+++ trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp	2013-09-23 23:55:20 UTC (rev 156308)
@@ -2734,7 +2734,7 @@
 
 void RenderBoxModelObject::mapAbsoluteToLocalPoint(MapCoordinatesFlags mode, TransformState& transformState) const
 {
-    RenderObject* o = container();
+    RenderElement* o = container();
     if (!o)
         return;
 

Modified: trunk/Source/WebCore/rendering/RenderInline.cpp (156307 => 156308)


--- trunk/Source/WebCore/rendering/RenderInline.cpp	2013-09-23 23:53:28 UTC (rev 156307)
+++ trunk/Source/WebCore/rendering/RenderInline.cpp	2013-09-23 23:55:20 UTC (rev 156308)
@@ -1105,7 +1105,7 @@
         return;
 
     bool containerSkipped;
-    RenderObject* o = container(repaintContainer, &containerSkipped);
+    RenderElement* o = container(repaintContainer, &containerSkipped);
     if (!o)
         return;
 
@@ -1185,7 +1185,7 @@
     }
 
     bool containerSkipped;
-    RenderObject* o = container(repaintContainer, &containerSkipped);
+    RenderElement* o = container(repaintContainer, &containerSkipped);
     if (!o)
         return;
 
@@ -1223,7 +1223,7 @@
     ASSERT(ancestorToStopAt != this);
 
     bool ancestorSkipped;
-    RenderObject* container = this->container(ancestorToStopAt, &ancestorSkipped);
+    RenderElement* container = this->container(ancestorToStopAt, &ancestorSkipped);
     if (!container)
         return 0;
 

Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (156307 => 156308)


--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2013-09-23 23:53:28 UTC (rev 156307)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2013-09-23 23:55:20 UTC (rev 156308)
@@ -2277,7 +2277,7 @@
     if (isSticky)
         return hasCoordinatedScrolling() && isViewportConstrainedFixedOrStickyLayer(layer);
 
-    RenderObject* container = renderer->container();
+    RenderElement* container = renderer->container();
     // If the renderer is not hooked up yet then we have to wait until it is.
     if (!container) {
         m_reevaluateCompositingAfterLayout = true;

Modified: trunk/Source/WebCore/rendering/RenderObject.cpp (156307 => 156308)


--- trunk/Source/WebCore/rendering/RenderObject.cpp	2013-09-23 23:53:28 UTC (rev 156307)
+++ trunk/Source/WebCore/rendering/RenderObject.cpp	2013-09-23 23:55:20 UTC (rev 156308)
@@ -657,7 +657,7 @@
     ASSERT(!scheduleRelayout || !newRoot);
     ASSERT(!isSetNeedsLayoutForbidden());
 
-    RenderObject* object = container();
+    RenderElement* object = container();
     RenderObject* last = this;
 
     bool simplifiedNormalFlowLayout = needsSimplifiedNormalFlowLayout() && !selfNeedsLayout() && !normalChildNeedsLayout();
@@ -670,7 +670,7 @@
 #endif
         // 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();
+        RenderElement* container = object->container();
         if (!container && !object->isRenderView())
             return;
         if (!last->isText() && last->style()->hasOutOfFlowPosition()) {
@@ -2250,7 +2250,7 @@
     LayoutPoint referencePoint;
     const RenderObject* currContainer = this;
     do {
-        RenderObject* nextContainer = currContainer->container();
+        RenderElement* nextContainer = currContainer->container();
         ASSERT(nextContainer);  // This means we reached the top without finding container.
         if (!nextContainer)
             break;
@@ -2326,7 +2326,7 @@
     return m_style->hasEntirelyFixedBackground();
 }
 
-RenderObject* RenderObject::container(const RenderLayerModelObject* repaintContainer, bool* repaintContainerSkipped) const
+RenderElement* RenderObject::container(const RenderLayerModelObject* repaintContainer, bool* repaintContainerSkipped) const
 {
     if (repaintContainerSkipped)
         *repaintContainerSkipped = false;
@@ -2340,7 +2340,7 @@
     // containingBlock() simply skips relpositioned inlines and lets an enclosing block handle
     // the layout of the positioned object.  This does mean that computePositionedLogicalWidth and
     // computePositionedLogicalHeight have to use container().
-    RenderObject* o = parent();
+    RenderElement* o = parent();
 
     if (isText())
         return o;

Modified: trunk/Source/WebCore/rendering/RenderObject.h (156307 => 156308)


--- trunk/Source/WebCore/rendering/RenderObject.h	2013-09-23 23:53:28 UTC (rev 156307)
+++ trunk/Source/WebCore/rendering/RenderObject.h	2013-09-23 23:55:20 UTC (rev 156308)
@@ -630,7 +630,7 @@
     // Returns the object containing this one. Can be different from parent for positioned elements.
     // If repaintContainer and repaintContainerSkipped are not null, on return *repaintContainerSkipped
     // is true if the renderer returned is an ancestor of repaintContainer.
-    RenderObject* container(const RenderLayerModelObject* repaintContainer = 0, bool* repaintContainerSkipped = 0) const;
+    RenderElement* container(const RenderLayerModelObject* repaintContainer = 0, bool* repaintContainerSkipped = 0) const;
 
     virtual RenderObject* hoverAncestor() const;
 

Modified: trunk/Source/WebCore/rendering/RenderThemeMac.mm (156307 => 156308)


--- trunk/Source/WebCore/rendering/RenderThemeMac.mm	2013-09-23 23:53:28 UTC (rev 156307)
+++ trunk/Source/WebCore/rendering/RenderThemeMac.mm	2013-09-23 23:55:20 UTC (rev 156308)
@@ -875,7 +875,7 @@
     FloatSize offsetFromInputRenderer;
     const RenderObject* renderer = partRenderer;
     while (renderer && renderer != inputRenderer) {
-        RenderObject* containingRenderer = renderer->container();
+        RenderElement* containingRenderer = renderer->container();
         offsetFromInputRenderer -= roundedIntSize(renderer->offsetFromContainer(containingRenderer, LayoutPoint()));
         renderer = containingRenderer;
     }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to