Title: [240045] trunk/Source/WebKit
Revision
240045
Author
timothy_hor...@apple.com
Date
2019-01-16 12:35:09 -0800 (Wed, 16 Jan 2019)

Log Message

Frequent null-deref under TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded()
https://bugs.webkit.org/show_bug.cgi?id=193468
<rdar://problem/38645869>

Reviewed by Zalan Bujtas.

* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded):
Adjust the null-check a bit; Zalan pointed out that the layout could
be responsible for the Frame/RenderView going away, so we should bail
*after* layout, not before.

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (240044 => 240045)


--- trunk/Source/WebKit/ChangeLog	2019-01-16 19:56:34 UTC (rev 240044)
+++ trunk/Source/WebKit/ChangeLog	2019-01-16 20:35:09 UTC (rev 240045)
@@ -1,3 +1,17 @@
+2019-01-16  Tim Horton  <timothy_hor...@apple.com>
+
+        Frequent null-deref under TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded()
+        https://bugs.webkit.org/show_bug.cgi?id=193468
+        <rdar://problem/38645869>
+
+        Reviewed by Zalan Bujtas.
+
+        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+        (WebKit::TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded):
+        Adjust the null-check a bit; Zalan pointed out that the layout could
+        be responsible for the Frame/RenderView going away, so we should bail
+        *after* layout, not before.
+
 2019-01-15  Fujii Hironori  <hironori.fu...@sony.com>
 
         Unreviewed WinCairo build fix.

Modified: trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm (240044 => 240045)


--- trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm	2019-01-16 19:56:34 UTC (rev 240044)
+++ trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm	2019-01-16 20:35:09 UTC (rev 240045)
@@ -312,12 +312,12 @@
     if (!m_shouldScaleViewToFitDocument)
         return;
 
-    if (!m_webPage.mainFrameView()->renderView())
-        return;
-
     LOG(Resize, "TiledCoreAnimationDrawingArea %p scaleViewToFitDocumentIfNeeded", this);
     m_webPage.layoutIfNeeded();
 
+    if (!m_webPage.mainFrameView() || !m_webPage.mainFrameView()->renderView())
+        return;
+
     int viewWidth = m_webPage.size().width();
     int documentWidth = m_webPage.mainFrameView()->renderView()->unscaledDocumentRect().width();
 
@@ -364,6 +364,9 @@
     m_webPage.setUseFixedLayout(false);
     m_webPage.layoutIfNeeded();
 
+    if (!m_webPage.mainFrameView() || !m_webPage.mainFrameView()->renderView())
+        return;
+
     IntSize documentSize = m_webPage.mainFrameView()->renderView()->unscaledDocumentRect().size();
     m_lastViewSizeForScaleToFit = m_webPage.size();
     m_lastDocumentSizeForScaleToFit = documentSize;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to