Changeset 70999 in webkit


Ignore:
Timestamp:
Oct 31, 2010 1:42:25 PM (13 years ago)
Author:
andreas.kling@nokia.com
Message:

2010-10-31 Andreas Kling <kling@webkit.org>

Reviewed by Kenneth Rohde Christiansen.

[Qt] Short-circuit QWebPage::selectedText() if frame has no selection
https://bugs.webkit.org/show_bug.cgi?id=48736

Do an early return if the selection is empty.

No new tests, this is covered by tst_QWebPage::findText().

  • Api/qwebpage.cpp: (QWebPage::selectedText):
Location:
trunk/WebKit/qt
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/qt/Api/qwebpage.cpp

    r70982 r70999  
    24192419{
    24202420    d->createMainFrame();
    2421     return d->page->focusController()->focusedOrMainFrame()->editor()->selectedText();
     2421    WebCore::Frame* frame = d->page->focusController()->focusedOrMainFrame();
     2422    if (frame->selection()->selection().selectionType() == VisibleSelection::NoSelection)
     2423        return QString();
     2424    return frame->editor()->selectedText();
    24222425}
    24232426
  • trunk/WebKit/qt/ChangeLog

    r70982 r70999  
     12010-10-31  Andreas Kling  <kling@webkit.org>
     2
     3        Reviewed by Kenneth Rohde Christiansen.
     4
     5        [Qt] Short-circuit QWebPage::selectedText() if frame has no selection
     6        https://bugs.webkit.org/show_bug.cgi?id=48736
     7
     8        Do an early return if the selection is empty.
     9
     10        No new tests, this is covered by tst_QWebPage::findText().
     11
     12        * Api/qwebpage.cpp:
     13        (QWebPage::selectedText):
     14
    1152010-10-30  Andreas Kling  <kling@webkit.org>
    216
Note: See TracChangeset for help on using the changeset viewer.