Null dereference performing a "TapAndAHalf" gesture in Google search field
authorjhoneycutt@apple.com <jhoneycutt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Dec 2014 01:10:02 +0000 (01:10 +0000)
committerjhoneycutt@apple.com <jhoneycutt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Dec 2014 01:10:02 +0000 (01:10 +0000)
<https://bugs.webkit.org/show_bug.cgi?id=139506>
<rdar://problem/19028828>

Reviewed by Darin Adler.

.:

* ManualTests/ios/tap-and-a-half-gesture-in-empty-text-field.html: Added.

Source/WebKit2:

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::selectWithGesture):
Add a null check in the case that there is no word range for the
current position.

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

ChangeLog
ManualTests/ios/tap-and-a-half-gesture-in-empty-text-field.html [new file with mode: 0644]
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm

index b7158f3..aa9303f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2014-12-10  Jon Honeycutt  <jhoneycutt@apple.com>
+
+        Null dereference performing a "TapAndAHalf" gesture in Google search field
+
+        <https://bugs.webkit.org/show_bug.cgi?id=139506>
+        <rdar://problem/19028828>
+
+        Reviewed by Darin Adler.
+
+        * ManualTests/ios/tap-and-a-half-gesture-in-empty-text-field.html: Added.
+
 2014-12-10  Dean Jackson  <dino@apple.com>
 
         Blur filter performance test doesn't provide results
diff --git a/ManualTests/ios/tap-and-a-half-gesture-in-empty-text-field.html b/ManualTests/ios/tap-and-a-half-gesture-in-empty-text-field.html
new file mode 100644 (file)
index 0000000..6e2df8b
--- /dev/null
@@ -0,0 +1,6 @@
+This tests that performing a tap and a half gesture in a text field with no nearby text does not crash.
+WebKit bug #<a href="https://bugs.webkit.org/show_bug.cgi?id=139506">139506</a>.
+
+<br><br>
+
+<input size="40" placeholder="Perform a tap and a half gesture in this field">
\ No newline at end of file
index 0c26121..ed8cf77 100644 (file)
@@ -1,3 +1,17 @@
+2014-12-09  Jon Honeycutt  <jhoneycutt@apple.com>
+
+        Null dereference performing a "TapAndAHalf" gesture in Google search field
+
+        <https://bugs.webkit.org/show_bug.cgi?id=139506>
+        <rdar://problem/19028828>
+
+        Reviewed by Darin Adler.
+
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::selectWithGesture):
+        Add a null check in the case that there is no word range for the
+        current position.
+
 2014-12-10  Beth Dakin  <bdakin@apple.com>
 
         Speculative build fix.
index cdb256c..4526fc8 100644 (file)
@@ -889,7 +889,7 @@ void WebPage::selectWithGesture(const IntPoint& point, uint32_t granularity, uin
         switch (wkGestureState) {
         case GestureRecognizerState::Began:
             range = wordRangeFromPosition(position);
-            m_currentWordRange = Range::create(*frame.document(), range->startPosition(), range->endPosition());
+            m_currentWordRange = range ? Range::create(*frame.document(), range->startPosition(), range->endPosition()) : nullptr;
             break;
         case GestureRecognizerState::Changed:
             if (!m_currentWordRange)