Bug 116251 - [wk2] didGetImageForFindMatch can return a null image
Summary: [wk2] didGetImageForFindMatch can return a null image
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tim Horton
Keywords: InRadar
Depends on:
Reported: 2013-05-16 16:29 PDT by Tim Horton
Modified: 2013-05-16 16:48 PDT (History)
4 users (show)

See Also:

patch (1.33 KB, patch)
2013-05-16 16:39 PDT, Tim Horton
simon.fraser: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Horton 2013-05-16 16:29:21 PDT
FindController::getFindIndicatorBitmapAndRect says:

// Selection rect can be empty for matches that are currently obscured from view.

And then returns a null handle. Which we then try to create a ShareableBitmap from, and then a WebImage from that. We end up getting a null ShareableBitmap in debug builds, or crashing when trying to use the WebImage in release builds (because m_bitmap is null).

We should not didGetImageForFindMatch if we didn't get an image for the find match...

Comment 1 Tim Horton 2013-05-16 16:39:50 PDT
Created attachment 201999 [details]
Comment 2 WebKit Commit Bot 2013-05-16 16:41:55 PDT
Attachment 201999 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebKit2/ChangeLog', u'Source/WebKit2/WebProcess/WebPage/FindController.cpp']" exit_code: 1
Source/WebKit2/ChangeLog:1:  ChangeLog entry has no bug number  [changelog/bugnumber] [5]
Total errors found: 1 in 2 files

If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Tim Horton 2013-05-16 16:43:40 PDT
Comment on attachment 201999 [details]

View in context: https://bugs.webkit.org/attachment.cgi?id=201999&action=review

> Source/WebKit2/ChangeLog:4
> +        https://bugs.webkit.org/process_bug.cgi

Comment 4 Simon Fraser (smfr) 2013-05-16 16:45:49 PDT
Comment on attachment 201999 [details]

r=me if you fix stuff.
Comment 5 Tim Horton 2013-05-16 16:48:35 PDT