Title: [240379] branches/safari-607-branch/Source/WebKit
Revision
240379
Author
alanc...@apple.com
Date
2019-01-23 17:21:29 -0800 (Wed, 23 Jan 2019)

Log Message

Cherry-pick r240045. rdar://problem/47458249

    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.

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

Modified Paths

Diff

Modified: branches/safari-607-branch/Source/WebKit/ChangeLog (240378 => 240379)


--- branches/safari-607-branch/Source/WebKit/ChangeLog	2019-01-24 01:21:26 UTC (rev 240378)
+++ branches/safari-607-branch/Source/WebKit/ChangeLog	2019-01-24 01:21:29 UTC (rev 240379)
@@ -1,5 +1,38 @@
 2019-01-23  Alan Coon  <alanc...@apple.com>
 
+        Cherry-pick r240045. rdar://problem/47458249
+
+    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.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240045 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    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-23  Alan Coon  <alanc...@apple.com>
+
         Cherry-pick r240016. rdar://problem/47458249
 
     Frequent null-deref under TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded()

Modified: branches/safari-607-branch/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm (240378 => 240379)


--- branches/safari-607-branch/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm	2019-01-24 01:21:26 UTC (rev 240378)
+++ branches/safari-607-branch/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm	2019-01-24 01:21:29 UTC (rev 240379)
@@ -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