[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198
commit-queue at webkit.org
commit-queue at webkit.org
Sun Feb 20 22:57:07 UTC 2011
The following commit has been merged in the webkit-1.3 branch:
commit ae28aca0e60d33c6c8143879d84b2132e70f26ea
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Jan 14 10:24:51 2011 +0000
2011-01-14 Finnur Thorarinsson <finnur.webkit at gmail.com>
Reviewed by Ojan Vafai.
Address some user-select-none issues better in our Find in page scoping
function.
The scoping function is in part based on Editor::countMatchesForText
(formerly Frame::markAllMatchesForText), but was rewritten with
asychronous search and interruptability in mind. At the time the
function was written, countMatchesForText didn't work well with
user-select-none style but that has now changed. While
investigating http://crbug.com/68494 I noticed WebKit had fixed this
very problem in the countMatchesForText and I believe we should make
the same changes in our platform code. Therefore, this changelist
adopts the same approach by integrating:
https://bugs.webkit.org/show_bug.cgi?id=33508
(r53142: handling user-select-none better) and
https://bugs.webkit.org/show_bug.cgi?id=51623
(r74886: handling match within textfield better).
For more details see those changelists.
This changelist, however, is tracked here:
https://bugs.webkit.org/show_bug.cgi?id=52367
The original changelists did not come with layout tests, but I'm adding
a test on the Chromium side for this.
* src/WebFrameImpl.cpp:
(WebKit::WebFrameImpl::scopeStringMatches):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75784 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 49579ce..6fb6706 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,34 @@
+2011-01-14 Finnur Thorarinsson <finnur.webkit at gmail.com>
+
+ Reviewed by Ojan Vafai.
+
+ Address some user-select-none issues better in our Find in page scoping
+ function.
+
+ The scoping function is in part based on Editor::countMatchesForText
+ (formerly Frame::markAllMatchesForText), but was rewritten with
+ asychronous search and interruptability in mind. At the time the
+ function was written, countMatchesForText didn't work well with
+ user-select-none style but that has now changed. While
+ investigating http://crbug.com/68494 I noticed WebKit had fixed this
+ very problem in the countMatchesForText and I believe we should make
+ the same changes in our platform code. Therefore, this changelist
+ adopts the same approach by integrating:
+ https://bugs.webkit.org/show_bug.cgi?id=33508
+ (r53142: handling user-select-none better) and
+ https://bugs.webkit.org/show_bug.cgi?id=51623
+ (r74886: handling match within textfield better).
+ For more details see those changelists.
+
+ This changelist, however, is tracked here:
+ https://bugs.webkit.org/show_bug.cgi?id=52367
+
+ The original changelists did not come with layout tests, but I'm adding
+ a test on the Chromium side for this.
+
+ * src/WebFrameImpl.cpp:
+ (WebKit::WebFrameImpl::scopeStringMatches):
+
2011-01-14 Pavel Feldman <pfeldman at chromium.org>
Not reviewed: build fix.
diff --git a/WebKit/chromium/src/WebFrameImpl.cpp b/WebKit/chromium/src/WebFrameImpl.cpp
index 0d0c401..f44da9e 100644
--- a/WebKit/chromium/src/WebFrameImpl.cpp
+++ b/WebKit/chromium/src/WebFrameImpl.cpp
@@ -154,7 +154,6 @@
#include <algorithm>
#include <wtf/CurrentTime.h>
-
#if OS(DARWIN)
#include "LocalCurrentGraphicsContext.h"
#endif
@@ -1541,6 +1540,9 @@ void WebFrameImpl::scopeStringMatches(int identifier,
}
}
+ Node* originalEndContainer = searchRange->endContainer();
+ int originalEndOffset = searchRange->endOffset();
+
// This timeout controls how long we scope before releasing control. This
// value does not prevent us from running for longer than this, but it is
// periodically checked to see if we have exceeded our allocated time.
@@ -1563,29 +1565,16 @@ void WebFrameImpl::scopeStringMatches(int identifier,
if (!resultRange->startContainer()->isInShadowTree())
break;
- searchRange = rangeOfContents(frame()->document());
searchRange->setStartAfter(
resultRange->startContainer()->shadowAncestorNode(), ec);
+ searchRange->setEnd(originalEndContainer, originalEndOffset, ec);
continue;
}
- // A non-collapsed result range can in some funky whitespace cases still not
- // advance the range's start position (4509328). Break to avoid infinite
- // loop. (This function is based on the implementation of
- // Frame::markAllMatchesForText, which is where this safeguard comes from).
- VisiblePosition newStart = endVisiblePosition(resultRange.get(), DOWNSTREAM);
- if (newStart == startVisiblePosition(searchRange.get(), DOWNSTREAM))
- break;
-
// Only treat the result as a match if it is visible
if (frame()->editor()->insideVisibleArea(resultRange.get())) {
++matchCount;
- setStart(searchRange.get(), newStart);
- Node* shadowTreeRoot = searchRange->shadowTreeRootNode();
- if (searchRange->collapsed(ec) && shadowTreeRoot)
- searchRange->setEnd(shadowTreeRoot, shadowTreeRoot->childNodeCount(), ec);
-
// Catch a special case where Find found something but doesn't know what
// the bounding box for it is. In this case we set the first match we find
// as the active rect.
@@ -1622,6 +1611,16 @@ void WebFrameImpl::scopeStringMatches(int identifier,
addMarker(resultRange.get(), foundActiveMatch);
}
+ // Set the new start for the search range to be the end of the previous
+ // result range. There is no need to use a VisiblePosition here,
+ // since findPlainText will use a TextIterator to go over the visible
+ // text nodes.
+ searchRange->setStart(resultRange->endContainer(ec), resultRange->endOffset(ec), ec);
+
+ Node* shadowTreeRoot = searchRange->shadowTreeRootNode();
+ if (searchRange->collapsed(ec) && shadowTreeRoot)
+ searchRange->setEnd(shadowTreeRoot, shadowTreeRoot->childNodeCount(), ec);
+
m_resumeScopingFromRange = resultRange;
timedOut = (currentTime() - startTime) >= maxScopingDuration;
} while (!timedOut);
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list