Title: [181869] trunk/Source/WebKit2
Revision
181869
Author
[email protected]
Date
2015-03-23 13:52:28 -0700 (Mon, 23 Mar 2015)

Log Message

[iOS] WebContent crash attempting to select text with a gesture at RenderObject::absoluteBoundingBoxRect.
https://bugs.webkit.org/show_bug.cgi?id=142913
rdar://problem/16400033

Reviewed by Sam Weinig.

When looking for the best candidate range at the given position,
we should skip nodes that don't have a renderer.
This is a speculative fix.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::rangeForWebSelectionAtPosition):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (181868 => 181869)


--- trunk/Source/WebKit2/ChangeLog	2015-03-23 20:48:21 UTC (rev 181868)
+++ trunk/Source/WebKit2/ChangeLog	2015-03-23 20:52:28 UTC (rev 181869)
@@ -1,3 +1,18 @@
+2015-03-23  Enrica Casucci  <[email protected]>
+
+        [iOS] WebContent crash attempting to select text with a gesture at RenderObject::absoluteBoundingBoxRect.
+        https://bugs.webkit.org/show_bug.cgi?id=142913
+        rdar://problem/16400033
+
+        Reviewed by Sam Weinig.
+
+        When looking for the best candidate range at the given position,
+        we should skip nodes that don't have a renderer.
+        This is a speculative fix.
+
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::rangeForWebSelectionAtPosition):
+
 2015-03-23  Alexey Proskuryakov  <[email protected]>
 
         REGRESSION (Yosemite): WKView visibility notifications are messed up

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


--- trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm	2015-03-23 20:48:21 UTC (rev 181868)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm	2015-03-23 20:52:28 UTC (rev 181869)
@@ -835,11 +835,13 @@
 
     Node* bestChoice = currentNode;
     while (currentNode) {
-        boundingRectInScrollViewCoordinates = currentNode->renderer()->absoluteBoundingBoxRect(true);
-        boundingRectInScrollViewCoordinates.scale(m_page->pageScaleFactor());
-        if (boundingRectInScrollViewCoordinates.width() > m_blockSelectionDesiredSize.width() && boundingRectInScrollViewCoordinates.height() > m_blockSelectionDesiredSize.height())
-            break;
-        bestChoice = currentNode;
+        if (currentNode->renderer()) {
+            boundingRectInScrollViewCoordinates = currentNode->renderer()->absoluteBoundingBoxRect(true);
+            boundingRectInScrollViewCoordinates.scale(m_page->pageScaleFactor());
+            if (boundingRectInScrollViewCoordinates.width() > m_blockSelectionDesiredSize.width() && boundingRectInScrollViewCoordinates.height() > m_blockSelectionDesiredSize.height())
+                break;
+            bestChoice = currentNode;
+        }
         currentNode = currentNode->parentElement();
     }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to