Frequent null-deref under TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded()
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Jan 2019 23:55:36 +0000 (23:55 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Jan 2019 23:55:36 +0000 (23:55 +0000)
https://bugs.webkit.org/show_bug.cgi?id=193468
<rdar://problem/38645869>

Reviewed by Beth Dakin.

* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded):
I'm not sure why this got *worse*, but we should null-check RenderView.
It's OK to bail from scaleViewToFitDocumentIfNeeded, we'll re-do it
the next time we paint (which will surely happen if we gain a RenderView).

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

Source/WebKit/ChangeLog
Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm

index 55c5143..ef8d41e 100644 (file)
@@ -1,3 +1,17 @@
+2019-01-15  Tim Horton  <timothy_horton@apple.com>
+
+        Frequent null-deref under TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded()
+        https://bugs.webkit.org/show_bug.cgi?id=193468
+        <rdar://problem/38645869>
+
+        Reviewed by Beth Dakin.
+
+        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+        (WebKit::TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded):
+        I'm not sure why this got *worse*, but we should null-check RenderView.
+        It's OK to bail from scaleViewToFitDocumentIfNeeded, we'll re-do it
+        the next time we paint (which will surely happen if we gain a RenderView).
+
 2019-01-15  Chris Dumez  <cdumez@apple.com>
 
         Unreviewed, rolling out r239993, r239995, r239997, and
index 91ad71a..5ee1f82 100644 (file)
@@ -312,6 +312,9 @@ void TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded()
     if (!m_shouldScaleViewToFitDocument)
         return;
 
+    if (!m_webPage.mainFrameView()->renderView())
+        return;
+
     LOG(Resize, "TiledCoreAnimationDrawingArea %p scaleViewToFitDocumentIfNeeded", this);
     m_webPage.layoutIfNeeded();