Title: [223633] trunk/Source/WebCore
Revision
223633
Author
za...@apple.com
Date
2017-10-18 15:27:55 -0700 (Wed, 18 Oct 2017)

Log Message

[FrameView::layout cleanup] Use SetForScope to protect m_needsFullRepaint's value on reentrancy
https://bugs.webkit.org/show_bug.cgi?id=178479
<rdar://problem/35056950>

Reviewed by Simon Fraser.

No change in functionality.

* page/FrameView.cpp:
(WebCore::FrameView::layout):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (223632 => 223633)


--- trunk/Source/WebCore/ChangeLog	2017-10-18 22:01:49 UTC (rev 223632)
+++ trunk/Source/WebCore/ChangeLog	2017-10-18 22:27:55 UTC (rev 223633)
@@ -1,5 +1,18 @@
 2017-10-18  Zalan Bujtas  <za...@apple.com>
 
+        [FrameView::layout cleanup] Use SetForScope to protect m_needsFullRepaint's value on reentrancy
+        https://bugs.webkit.org/show_bug.cgi?id=178479
+        <rdar://problem/35056950>
+
+        Reviewed by Simon Fraser.
+
+        No change in functionality.
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::layout):
+
+2017-10-18  Zalan Bujtas  <za...@apple.com>
+
         [FrameView::layout cleanup] Remove InPreLayoutStyleUpdate.
         https://bugs.webkit.org/show_bug.cgi?id=178483
         <rdar://problem/35058800>

Modified: trunk/Source/WebCore/page/FrameView.cpp (223632 => 223633)


--- trunk/Source/WebCore/page/FrameView.cpp	2017-10-18 22:01:49 UTC (rev 223632)
+++ trunk/Source/WebCore/page/FrameView.cpp	2017-10-18 22:27:55 UTC (rev 223633)
@@ -1517,12 +1517,10 @@
         m_subtreeLayoutRoot = nullptr;
         // Close block here to end the scope of changeSchedulingEnabled and SubtreeLayoutStateMaintainer.
     }
-
-    m_layoutPhase = InViewSizeAdjust;
-
-    bool neededFullRepaint = m_needsFullRepaint;
-
     if (!isSubtreeLayout && !downcast<RenderView>(*layoutRoot).printing()) {
+        // This is to protect m_needsFullRepaint's value when layout() is getting re-entered through adjustViewSize().
+        SetForScope<bool> needsFullRepaint(m_needsFullRepaint);
+        m_layoutPhase = InViewSizeAdjust;
         adjustViewSize();
         // FIXME: Firing media query callbacks synchronously on nested frames could produced a detached FrameView here by
         // navigating away from the current document (see webkit.org/b/173329).
@@ -1529,11 +1527,7 @@
         if (hasOneRef())
             return;
     }
-
     m_layoutPhase = InPostLayout;
-
-    m_needsFullRepaint = neededFullRepaint;
-
     // Now update the positions of all layers.
     if (m_needsFullRepaint)
         layoutRoot->view().repaintRootContents();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to