diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2016-06-27 16:52:55 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@theqtcompany.com> | 2016-07-01 09:07:13 +0000 |
commit | 5b219fc20dbfe6090af45c1dbdb7ad50bc743ca1 (patch) | |
tree | f3a374d9b3a11dd5ef74e2ca90ef9d9587bbbf4f /src/core/web_contents_adapter.cpp | |
parent | f5ee1feeed2abbcbe6db2bf9757d692b38fcbcb1 (diff) |
Clear internal selected text when searching
Previously if a selection was made on a web page, and afterwards a find
operation is executed, the selection in the web page would be cleared,
but the call to selectedText() would still return the old selection.
Make sure selectedText() is always cleared, when starting a find
operation, as well as when stopping one.
Change-Id: If78f0fa1dd836a52184015e749ef5a84b9f784cd
Task-number: QTBUG-54071
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'src/core/web_contents_adapter.cpp')
-rw-r--r-- | src/core/web_contents_adapter.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp index c450768fa..709efe9b3 100644 --- a/src/core/web_contents_adapter.cpp +++ b/src/core/web_contents_adapter.cpp @@ -782,6 +782,9 @@ void WebContentsAdapter::stopFinding() { Q_D(WebContentsAdapter); d->webContentsDelegate->setLastSearchedString(QString()); + // Clear any previous selection, + // but keep the renderer blue rectangle selection just like Chromium does. + d->webContents->Unselect(); d->webContents->StopFinding(content::STOP_FIND_ACTION_KEEP_SELECTION); } |