[iOS] ERROR: post-layout: dirty renderer(s) in WebCore::RenderTreeNeedsLayoutChecker...
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 5 Jan 2019 00:08:28 +0000 (00:08 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 5 Jan 2019 00:08:28 +0000 (00:08 +0000)
https://bugs.webkit.org/show_bug.cgi?id=189608
<rdar://problem/44473299>

Reviewed by Simon Fraser.

When a frameset/iframe is hidden and we skip layout, clear the dirty flag on its subtree as well.

Covered by fast/frames/invalid-frameset.html.

* rendering/RenderFrameSet.cpp:
(WebCore::clearSiblingSubtrees):
(WebCore::RenderFrameSet::positionFrames):
(WebCore::RenderFrameSet::positionFramesWithFlattening):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239645 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderFrameSet.cpp

index d76382d..ffb5d36 100644 (file)
@@ -1,3 +1,20 @@
+2019-01-04  Zalan Bujtas  <zalan@apple.com>
+
+        [iOS] ERROR: post-layout: dirty renderer(s) in WebCore::RenderTreeNeedsLayoutChecker::~RenderTreeNeedsLayoutChecker()
+        https://bugs.webkit.org/show_bug.cgi?id=189608
+        <rdar://problem/44473299>
+
+        Reviewed by Simon Fraser.
+
+        When a frameset/iframe is hidden and we skip layout, clear the dirty flag on its subtree as well.
+
+        Covered by fast/frames/invalid-frameset.html.
+
+        * rendering/RenderFrameSet.cpp:
+        (WebCore::clearSiblingSubtrees):
+        (WebCore::RenderFrameSet::positionFrames):
+        (WebCore::RenderFrameSet::positionFramesWithFlattening):
+
 2019-01-04  Youenn Fablet  <youenn@apple.com>
 
         [Fetch API] Implement abortable fetch
index 2d413b6..4c31677 100644 (file)
@@ -494,6 +494,18 @@ void RenderFrameSet::layout()
     clearNeedsLayout();
 }
 
+static void resetFrameRendererAndDescendents(RenderBox* frameSetChild, RenderFrameSet& parentFrameSet)
+{
+    if (!frameSetChild)
+        return;
+
+    for (auto* descendant = frameSetChild; descendant; descendant = downcast<RenderBox>(RenderObjectTraversal::next(*descendant, &parentFrameSet))) {
+        descendant->setWidth(0);
+        descendant->setHeight(0);
+        descendant->clearNeedsLayout();
+    }
+}
+
 void RenderFrameSet::positionFrames()
 {
     RenderBox* child = firstChildBox();
@@ -534,12 +546,7 @@ void RenderFrameSet::positionFrames()
         yPos += height + borderThickness;
     }
 
-    // all the remaining frames are hidden to avoid ugly spurious unflowed frames
-    for (auto* descendant = child; descendant; descendant = downcast<RenderBox>(RenderObjectTraversal::next(*descendant, this))) {
-        descendant->setWidth(0);
-        descendant->setHeight(0);
-        descendant->clearNeedsLayout();
-    }
+    resetFrameRendererAndDescendents(child, *this);
 }
 
 void RenderFrameSet::positionFramesWithFlattening()
@@ -642,12 +649,7 @@ void RenderFrameSet::positionFramesWithFlattening()
     if (repaintNeeded)
         repaint();
 
-    // all the remaining frames are hidden to avoid ugly spurious unflowed frames
-    for (; child; child = child->nextSiblingBox()) {
-        child->setWidth(0);
-        child->setHeight(0);
-        child->clearNeedsLayout();
-    }
+    resetFrameRendererAndDescendents(child, *this);
 }
 
 bool RenderFrameSet::flattenFrameSet() const