⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 245915 in webkit


Ignore:
Timestamp:
May 30, 2019, 5:29:35 PM (7 years ago)
Author:
Alan Coon
Message:

Cherry-pick r244781. rdar://problem/51264871

Long-standing rare crash under -[WKWebView _web_immediateActionAnimationControllerForHitTestResultInternal...]
https://bugs.webkit.org/show_bug.cgi?id=197404
<rdar://problem/24589331>

Reviewed by Wenson Hsieh.

  • UIProcess/mac/WKImmediateActionController.mm: (-[WKImmediateActionController _updateImmediateActionItem]): (-[WKImmediateActionController menuItem:previewItemAtPoint:]): (-[WKImmediateActionController menuItem:itemFrameForPoint:]): (-[WKImmediateActionController _animationControllerForDataDetectedLink]): Add some null checks; _webHitTestResult can be null if we (somehow) get an immediate action gesture without having previously gotten a mouseDidMoveOverElement from the Web Content process. Cover all our bases.

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

Location:
branches/safari-607-branch/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-607-branch/Source/WebKit/ChangeLog

    r245356 r245915  
     12019-05-30  Kocsen Chung  <kocsen_chung@apple.com>
     2
     3        Cherry-pick r244781. rdar://problem/51264871
     4
     5    Long-standing rare crash under -[WKWebView _web_immediateActionAnimationControllerForHitTestResultInternal...]
     6    https://bugs.webkit.org/show_bug.cgi?id=197404
     7    <rdar://problem/24589331>
     8   
     9    Reviewed by Wenson Hsieh.
     10   
     11    * UIProcess/mac/WKImmediateActionController.mm:
     12    (-[WKImmediateActionController _updateImmediateActionItem]):
     13    (-[WKImmediateActionController menuItem:previewItemAtPoint:]):
     14    (-[WKImmediateActionController menuItem:itemFrameForPoint:]):
     15    (-[WKImmediateActionController _animationControllerForDataDetectedLink]):
     16    Add some null checks; _webHitTestResult can be null if we (somehow) get
     17    an immediate action gesture without having previously gotten a
     18    mouseDidMoveOverElement from the Web Content process. Cover all our bases.
     19   
     20   
     21    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244781 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     22
     23    2019-04-30  Tim Horton  <timothy_horton@apple.com>
     24
     25            Long-standing rare crash under -[WKWebView _web_immediateActionAnimationControllerForHitTestResultInternal...]
     26            https://bugs.webkit.org/show_bug.cgi?id=197404
     27            <rdar://problem/24589331>
     28
     29            Reviewed by Wenson Hsieh.
     30
     31            * UIProcess/mac/WKImmediateActionController.mm:
     32            (-[WKImmediateActionController _updateImmediateActionItem]):
     33            (-[WKImmediateActionController menuItem:previewItemAtPoint:]):
     34            (-[WKImmediateActionController menuItem:itemFrameForPoint:]):
     35            (-[WKImmediateActionController _animationControllerForDataDetectedLink]):
     36            Add some null checks; _webHitTestResult can be null if we (somehow) get
     37            an immediate action gesture without having previously gotten a
     38            mouseDidMoveOverElement from the Web Content process. Cover all our bases.
     39
    1402019-05-14  Kocsen Chung  <kocsen_chung@apple.com>
    241
  • branches/safari-607-branch/Source/WebKit/UIProcess/mac/WKImmediateActionController.mm

    r238771 r245915  
    329329
    330330    RefPtr<API::HitTestResult> hitTestResult = [self _webHitTestResult];
     331    if (!hitTestResult) {
     332        [self _cancelImmediateAction];
     333        return;
     334    }
     335
    331336    id customClientAnimationController = _page->immediateActionAnimationControllerForHitTestResult(hitTestResult, _type, _userData);
    332337    if (customClientAnimationController == [NSNull null]) {
     
    354359
    355360    RefPtr<API::HitTestResult> hitTestResult = [self _webHitTestResult];
     361    if (!hitTestResult)
     362        return nil;
     363
    356364    return [NSURL _web_URLWithWTFString:hitTestResult->absoluteLinkURL()];
    357365}
     
    373381
    374382    RefPtr<API::HitTestResult> hitTestResult = [self _webHitTestResult];
     383    if (!hitTestResult)
     384        return NSZeroRect;
     385
    375386    return [_view convertRect:hitTestResult->elementBoundingBox() toView:nil];
    376387}
     
    450461
    451462    RefPtr<API::HitTestResult> hitTestResult = [self _webHitTestResult];
     463    if (!hitTestResult)
     464        return nil;
     465
    452466    NSArray *menuItems = [[getDDActionsManagerClass() sharedManager] menuItemsForTargetURL:hitTestResult->absoluteLinkURL() actionContext:_currentActionContext.get()];
    453467
Note: See TracChangeset for help on using the changeset viewer.