Fix for 3785211. Make sure to do a layout with the old position before doing a layou...
[WebKit-https.git] / WebCore / khtml / rendering / render_object.cpp
index 74ba9bebde733dd01645f43d772fb9f3c18408ce..c5963aa1e3d6273703f6f78962a53d10fc8caaec 100644 (file)
@@ -1561,6 +1561,11 @@ void RenderObject::setStyle(RenderStyle *style)
              m_style->opacity() != style->opacity()))
             layer()->repaintIncludingDescendants();
 
+        // When a layout hint happens and an object's position style changes, we have to do a layout
+        // to dirty the render tree using the old position value now.
+        if (d == RenderStyle::Layout && m_parent && m_style->position() != style->position())
+            setNeedsLayoutAndMinMaxRecalc();
+        
         if (isFloating() && (m_style->floating() != style->floating()))
             // For changes in float styles, we need to conceivably remove ourselves
             // from the floating objects list.