Title: [171225] trunk/Source/WebKit2
- Revision
- 171225
- Author
- [email protected]
- Date
- 2014-07-18 10:21:20 -0700 (Fri, 18 Jul 2014)
Log Message
REGRESSION: Crash when typing into text field that clears itself on iOS
<https://bugs.webkit.org/show_bug.cgi?id=135044>
<rdar://problem/17640443>
Reviewed by Darin Adler.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::requestAutocorrectionData):
wordRangeFromPosition() returns null in some cases; null check range
before dereferencing it. Moved some variable declarations around to
better match our style.
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (171224 => 171225)
--- trunk/Source/WebKit2/ChangeLog 2014-07-18 17:14:38 UTC (rev 171224)
+++ trunk/Source/WebKit2/ChangeLog 2014-07-18 17:21:20 UTC (rev 171225)
@@ -1,3 +1,18 @@
+2014-07-18 Jon Honeycutt <[email protected]>
+
+ REGRESSION: Crash when typing into text field that clears itself on iOS
+
+ <https://bugs.webkit.org/show_bug.cgi?id=135044>
+ <rdar://problem/17640443>
+
+ Reviewed by Darin Adler.
+
+ * WebProcess/WebPage/ios/WebPageIOS.mm:
+ (WebKit::WebPage::requestAutocorrectionData):
+ wordRangeFromPosition() returns null in some cases; null check range
+ before dereferencing it. Moved some variable declarations around to
+ better match our style.
+
2014-07-18 Tim Horton <[email protected]>
[WK2] Provide a mechanism to grab the back-forward list for gesture navigation purposes from another WKWebView
Modified: trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (171224 => 171225)
--- trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm 2014-07-18 17:14:38 UTC (rev 171224)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm 2014-07-18 17:21:20 UTC (rev 171225)
@@ -1620,7 +1620,6 @@
void WebPage::requestAutocorrectionData(const String& textForAutocorrection, uint64_t callbackID)
{
- RefPtr<Range> range;
Frame& frame = m_page->focusController().focusedOrMainFrame();
if (!frame.selection().isCaret()) {
send(Messages::WebPageProxy::AutocorrectionDataCallback(Vector<FloatRect>(), String(), 0, 0, callbackID));
@@ -1628,9 +1627,12 @@
}
VisiblePosition position = frame.selection().selection().start();
- Vector<SelectionRect> selectionRects;
+ RefPtr<Range> range = wordRangeFromPosition(position);
+ if (!range) {
+ send(Messages::WebPageProxy::AutocorrectionDataCallback(Vector<FloatRect>(), String(), 0, 0, callbackID));
+ return;
+ }
- range = wordRangeFromPosition(position);
String textForRange = plainTextReplacingNoBreakSpace(range.get());
const unsigned maxSearchAttempts = 5;
for (size_t i = 0; i < maxSearchAttempts && textForRange != textForAutocorrection; ++i)
@@ -1641,6 +1643,8 @@
range = Range::create(*frame.document(), wordRangeFromPosition(position)->startPosition(), range->endPosition());
textForRange = plainTextReplacingNoBreakSpace(range.get());
}
+
+ Vector<SelectionRect> selectionRects;
if (textForRange == textForAutocorrection)
range->collectSelectionRects(selectionRects);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes