Title: [171709] trunk/Source/WebKit2
Revision
171709
Author
benja...@webkit.org
Date
2014-07-28 16:47:09 -0700 (Mon, 28 Jul 2014)

Log Message

[iOS WK2] WKWebView sometime tries to change the size of a null DrawingAreaProxy
https://bugs.webkit.org/show_bug.cgi?id=135368
<rdar://problem/16988887>

Patch by Benjamin Poulain <bpoul...@apple.com> on 2014-07-28
Reviewed by Simon Fraser.

We should never assume DrawingAreaProxy exists in the API invoked by the clients
of WKWebView. There are at least two cases where the DrawingAreaProxy is null:
-In some path on initialization.
-After a crash.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _frameOrBoundsChanged]):
(-[WKWebView _beginAnimatedResizeWithUpdates:]):
We can safely null check and skip setting the size. If the call was skipped,
the size is set on DrawingAreaProxy initialization by querying the current
size through the page client.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (171708 => 171709)


--- trunk/Source/WebKit2/ChangeLog	2014-07-28 23:14:04 UTC (rev 171708)
+++ trunk/Source/WebKit2/ChangeLog	2014-07-28 23:47:09 UTC (rev 171709)
@@ -1,3 +1,23 @@
+2014-07-28  Benjamin Poulain  <bpoul...@apple.com>
+
+        [iOS WK2] WKWebView sometime tries to change the size of a null DrawingAreaProxy
+        https://bugs.webkit.org/show_bug.cgi?id=135368
+        <rdar://problem/16988887>
+
+        Reviewed by Simon Fraser.
+
+        We should never assume DrawingAreaProxy exists in the API invoked by the clients
+        of WKWebView. There are at least two cases where the DrawingAreaProxy is null:
+        -In some path on initialization.
+        -After a crash.
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView _frameOrBoundsChanged]):
+        (-[WKWebView _beginAnimatedResizeWithUpdates:]):
+        We can safely null check and skip setting the size. If the call was skipped,
+        the size is set on DrawingAreaProxy initialization by querying the current
+        size through the page client.
+
 2014-07-28  Roger Fong  <roger_f...@apple.com>
 
         Disable tagged strings for the plugin process.

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (171708 => 171709)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2014-07-28 23:14:04 UTC (rev 171708)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2014-07-28 23:47:09 UTC (rev 171709)
@@ -1351,7 +1351,8 @@
             _page->setViewportConfigurationMinimumLayoutSizeForMinimalUI(WebCore::FloatSize(bounds.size));
         if (!_overridesMaximumUnobscuredSize)
             _page->setMaximumUnobscuredSize(WebCore::FloatSize(bounds.size));
-        _page->drawingArea()->setSize(WebCore::IntSize(bounds.size), WebCore::IntSize(), WebCore::IntSize());
+        if (WebKit::DrawingAreaProxy* drawingArea = _page->drawingArea())
+            drawingArea->setSize(WebCore::IntSize(bounds.size), WebCore::IntSize(), WebCore::IntSize());
     }
 
     [_customContentView web_setMinimumSize:bounds.size];
@@ -2237,7 +2238,8 @@
     CGRect unobscuredRectInContentCoordinates = [self convertRect:futureUnobscuredRectInSelfCoordinates toView:_contentView.get()];
 
     _page->dynamicViewportSizeUpdate(newMinimumLayoutSize, newMinimumLayoutSizeForMinimalUI, newMaximumUnobscuredSize, visibleRectInContentCoordinates, unobscuredRectInContentCoordinates, futureUnobscuredRectInSelfCoordinates, targetScale, newOrientation);
-    _page->drawingArea()->setSize(WebCore::IntSize(newBounds.size), WebCore::IntSize(), WebCore::IntSize());
+    if (WebKit::DrawingAreaProxy* drawingArea = _page->drawingArea())
+        drawingArea->setSize(WebCore::IntSize(newBounds.size), WebCore::IntSize(), WebCore::IntSize());
 }
 
 - (void)_endAnimatedResize
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to