Bug 48736 - [Qt] Short-circuit QWebPage::selectedText() if frame has no selection
Summary: [Qt] Short-circuit QWebPage::selectedText() if frame has no selection
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Qt (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: QtWebKit Unassigned
URL:
Keywords: Performance, Qt, QtTriaged
Depends on:
Blocks:
 
Reported: 2010-10-31 12:49 PDT by Andreas Kling
Modified: 2010-10-31 19:43 PDT (History)
0 users

See Also:


Attachments
Proposed patch (1.32 KB, patch)
2010-10-31 12:51 PDT, Andreas Kling
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Kling 2010-10-31 12:49:15 PDT
As mentioned on bug 48722, QWebPage::selectedText() could do an early return if the frame's selection is empty.
Comment 1 Andreas Kling 2010-10-31 12:51:58 PDT
Created attachment 72471 [details]
Proposed patch
Comment 2 Andreas Kling 2010-10-31 13:42:34 PDT
Comment on attachment 72471 [details]
Proposed patch

Clearing flags on attachment: 72471

Committed r70999: <http://trac.webkit.org/changeset/70999>
Comment 3 Andreas Kling 2010-10-31 13:42:43 PDT
All reviewed patches have been landed.  Closing bug.
Comment 4 Antonio Gomes 2010-10-31 19:43:30 PDT
Comment on attachment 72471 [details]
Proposed patch

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

> WebKit/qt/Api/qwebpage.cpp:2422
> +    if (frame->selection()->selection().selectionType() == VisibleSelection::NoSelection)

This is a bad internal API =/ : 5 "selection"s for this single simple statement, being on of them "selection()->selection()"

Nice shortcut though!