Title: [171576] trunk/Source/WebKit2
Revision
171576
Author
[email protected]
Date
2014-07-24 20:00:57 -0700 (Thu, 24 Jul 2014)

Log Message

[iOS][WK2] Do not try to hit test a null mainFrameRenderView on dynamicViewportSizeUpdate()
https://bugs.webkit.org/show_bug.cgi?id=135277
<rdar://problem/17804891>

Patch by Benjamin Poulain <[email protected]> on 2014-07-24
Reviewed by Tim Horton.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::dynamicViewportSizeUpdate):
There is no guarantee that the main frame have its root view when performing a dynamicViewportSizeUpdate(),
we should not attempt to use the layer without null checking it first.

The odd part for me is <rdar://problem/17804891> is a little too frequent. In the vast majority of cases,
there is a RenderView, it seems actually pretty hard not to have one on dynamicViewportSizeUpdate().

Skipping hit testing is safe because it is a completely optional part of this algorithm.
When the hit test is not done, the new position is computed based on the relative position prior to
the size change.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (171575 => 171576)


--- trunk/Source/WebKit2/ChangeLog	2014-07-25 02:26:34 UTC (rev 171575)
+++ trunk/Source/WebKit2/ChangeLog	2014-07-25 03:00:57 UTC (rev 171576)
@@ -1,3 +1,23 @@
+2014-07-24  Benjamin Poulain  <[email protected]>
+
+        [iOS][WK2] Do not try to hit test a null mainFrameRenderView on dynamicViewportSizeUpdate()
+        https://bugs.webkit.org/show_bug.cgi?id=135277
+        <rdar://problem/17804891>
+
+        Reviewed by Tim Horton.
+
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::dynamicViewportSizeUpdate):
+        There is no guarantee that the main frame have its root view when performing a dynamicViewportSizeUpdate(),
+        we should not attempt to use the layer without null checking it first.
+
+        The odd part for me is <rdar://problem/17804891> is a little too frequent. In the vast majority of cases,
+        there is a RenderView, it seems actually pretty hard not to have one on dynamicViewportSizeUpdate().
+
+        Skipping hit testing is safe because it is a completely optional part of this algorithm.
+        When the hit test is not done, the new position is computed based on the relative position prior to
+        the size change.
+
 2014-07-24  Dan Bernstein  <[email protected]>
 
         WebKit2 part of <rdar://problem/17593701> Assertion failure in WebPage::reload (!m_pendingNavigationID) when reloading after a same-document back navigation

Modified: trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (171575 => 171576)


--- trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm	2014-07-25 02:26:34 UTC (rev 171575)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm	2014-07-25 03:00:57 UTC (rev 171576)
@@ -2216,11 +2216,12 @@
         visibleHorizontalFraction = frameView.unobscuredContentSize().width() / oldContentSize.width();
         IntPoint unobscuredContentRectCenter = frameView.unobscuredContentRect().center();
 
-        HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::DisallowShadowContent);
         HitTestResult hitTestResult = HitTestResult(unobscuredContentRectCenter);
 
-        RenderView* mainFrameRenderView = frameView.renderView();
-        mainFrameRenderView->hitTest(request, hitTestResult);
+        if (RenderView* mainFrameRenderView = frameView.renderView()) {
+            HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::DisallowShadowContent);
+            mainFrameRenderView->hitTest(request, hitTestResult);
+        }
 
         if (Node* node = hitTestResult.innerNode()) {
             if (RenderObject* renderer = node->renderer()) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to