diff options
author | finnur@google.com <finnur@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-24 23:46:50 +0000 |
---|---|---|
committer | finnur@google.com <finnur@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-24 23:46:50 +0000 |
commit | 884db41554423ec017c57709f92cc2379e0cc02d (patch) | |
tree | 275e81e0c6ab0717912dd4864d91ad719bd2a55c /chrome | |
parent | 498c1a6b2dc98869e0703127565247830227d075 (diff) | |
download | chromium_src-884db41554423ec017c57709f92cc2379e0cc02d.zip chromium_src-884db41554423ec017c57709f92cc2379e0cc02d.tar.gz chromium_src-884db41554423ec017c57709f92cc2379e0cc02d.tar.bz2 |
Find now uses WebKit's TextMatch highlighting for Find-in-page.
This allows us to discard a bunch of code and plumbing related to
maintaining and passing around the tickmark vector.
WebKit now owns the drawing of the highlights for inactive matches and
we use the selection controller to draw the active highlight.
I also simplified the code by eliminating the separate FindNext
function, which has been merged into Find.
This change also requires minor changes to WebKit upstream (sold
seperately, void where prohibited).
It simply consists of adding one empty virtual paint function to
ScrollbarThemeComposite.h (paintTickmarks) and in
ScrollbarThemeComposite::paint call paintTickmarks().
This fixes/makes obsolete a slew of bugs:
BUG=1326399, 1241554,1143991, 1070190, 1023019, 984786, 893737, 868599
... and a couple of external ones as well. Full list:
1326399 Find highlighting disappears on ThinkPad x60s
1241554 Find doesn't highlight word inside blinky tag
1143991 Have find-in-page code use skia and have inspected node highlighting set the right xfermode
1070190 Find should begin searching from caret/selection
1023019 Find not highlighting correctly
984786 Find highlight drawing code causes ClearType text to look bad
893737 Find in page should search textareas
868599 Find in page tick marks incorrectly appear on nested scrollbars
298 Find-In-page should highlight elided entries
4389 Find-in-box is not highlighting all the instances of the search word
3908 Find in page highlighting and tickmarks are broken
Review URL: http://codereview.chromium.org/11364
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5946 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/renderer/render_view.cc | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc index 6b84f9f..4d4d4e9 100644 --- a/chrome/renderer/render_view.cc +++ b/chrome/renderer/render_view.cc @@ -2057,10 +2057,7 @@ void RenderView::OnFind(const FindInPageRequest& request) { bool result = false; do { - if (request.find_next) - result = search_frame->FindNext(request, wrap_within_frame); - else - result = search_frame->Find(request, wrap_within_frame, &selection_rect); + result = search_frame->Find(request, wrap_within_frame, &selection_rect); if (!result) { // don't leave text selected as you move to the next frame. @@ -2075,7 +2072,7 @@ void RenderView::OnFind(const FindInPageRequest& request) { webview()->GetPreviousFrameBefore(search_frame, true); } while (!search_frame->Visible() && search_frame != focused_frame); - // make sure selection doesn't affect the search operation in new frame. + // Make sure selection doesn't affect the search operation in new frame. search_frame->ClearSelection(); // If we have multiple frames and we have wrapped back around to the @@ -2084,11 +2081,8 @@ void RenderView::OnFind(const FindInPageRequest& request) { // reported matches, but no frames after the focused_frame contain a // match for the search word(s). if (multi_frame && search_frame == focused_frame) { - if (request.find_next) - result = search_frame->FindNext(request, true); // Force wrapping. - else - result = search_frame->Find(request, true, // Force wrapping. - &selection_rect); + result = search_frame->Find(request, true, // Force wrapping. + &selection_rect); } } |