Changeset 171225 in webkit


Ignore:
Timestamp:
Jul 18, 2014 10:21:20 AM (10 years ago)
Author:
jhoneycutt@apple.com
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.

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r171219 r171225  
     12014-07-18  Jon Honeycutt  <jhoneycutt@apple.com>
     2
     3        REGRESSION: Crash when typing into text field that clears itself on iOS
     4
     5        <https://bugs.webkit.org/show_bug.cgi?id=135044>
     6        <rdar://problem/17640443>
     7
     8        Reviewed by Darin Adler.
     9
     10        * WebProcess/WebPage/ios/WebPageIOS.mm:
     11        (WebKit::WebPage::requestAutocorrectionData):
     12        wordRangeFromPosition() returns null in some cases; null check range
     13        before dereferencing it. Moved some variable declarations around to
     14        better match our style.
     15
    1162014-07-18  Tim Horton  <timothy_horton@apple.com>
    217
  • trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm

    r171209 r171225  
    16211621void WebPage::requestAutocorrectionData(const String& textForAutocorrection, uint64_t callbackID)
    16221622{
    1623     RefPtr<Range> range;
    16241623    Frame& frame = m_page->focusController().focusedOrMainFrame();
    16251624    if (!frame.selection().isCaret()) {
     
    16291628
    16301629    VisiblePosition position = frame.selection().selection().start();
    1631     Vector<SelectionRect> selectionRects;
    1632 
    1633     range = wordRangeFromPosition(position);
     1630    RefPtr<Range> range = wordRangeFromPosition(position);
     1631    if (!range) {
     1632        send(Messages::WebPageProxy::AutocorrectionDataCallback(Vector<FloatRect>(), String(), 0, 0, callbackID));
     1633        return;
     1634    }
     1635
    16341636    String textForRange = plainTextReplacingNoBreakSpace(range.get());
    16351637    const unsigned maxSearchAttempts = 5;
     
    16421644        textForRange = plainTextReplacingNoBreakSpace(range.get());
    16431645    }
     1646
     1647    Vector<SelectionRect> selectionRects;
    16441648    if (textForRange == textForAutocorrection)
    16451649        range->collectSelectionRects(selectionRects);
Note: See TracChangeset for help on using the changeset viewer.