Reviewed by harrison
<http://bugzilla.opendarwin.org/show_bug.cgi?id=9456>
REGRESSION (417.9.2-420+): Cmd-G doesn't work in Safari after double-click and Cmd-E
* editing/execCommand/findString-2-expected.checksum: Added.
* editing/execCommand/findString-2-expected.png: Added.
* editing/execCommand/findString-2-expected.txt: Added.
* editing/execCommand/findString-2.html: Added.
WebCore:
Reviewed by harrison
<http://bugzilla.opendarwin.org/show_bug.cgi?id=9456>
REGRESSION (417.9.2-420+): Cmd-G doesn't work in Safari after double-click and Cmd-E
* page/Frame.cpp:
(WebCore::Frame::findString): When comparing the found range with
what's currently selected a) build a selection with the found
range to remove collapsed whitespace and b) compare ranges
instead of selection objects to ignore the way that the
current selection was made (to ignore the base and extent).
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@14877
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-06-15 Justin Garcia <justin.garcia@apple.com>
+
+ Reviewed by harrison
+
+ <http://bugzilla.opendarwin.org/show_bug.cgi?id=9456>
+ REGRESSION (417.9.2-420+): Cmd-G doesn't work in Safari after double-click and Cmd-E
+
+ * editing/execCommand/findString-2-expected.checksum: Added.
+ * editing/execCommand/findString-2-expected.png: Added.
+ * editing/execCommand/findString-2-expected.txt: Added.
+ * editing/execCommand/findString-2.html: Added.
+
2006-06-14 Justin Garcia <justin.garcia@apple.com>
Reviewed by levi
--- /dev/null
+cfa8686340a7caf631f9b91a6e139fd4
\ No newline at end of file
--- /dev/null
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 1 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > SPAN > DIV > BODY > HTML > #document to 3 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+ RenderBlock {HTML} at (0,0) size 800x600
+ RenderBody {BODY} at (8,8) size 784x584
+ RenderBlock {P} at (0,0) size 784x36
+ RenderText {#text} at (0,0) size 765x36
+ text run at (0,0) width 765: "This tests to see if Find will get stuck when searching for a word that is currently selected, and was selected with a double"
+ text run at (0,18) width 34: "click."
+ RenderBlock {DIV} at (0,52) size 784x18
+ RenderText {#text} at (0,0) size 25x18
+ text run at (0,0) width 25: "foo "
+ RenderInline {SPAN} at (0,0) size 20x18
+ RenderText {#text} at (25,0) size 20x18
+ text run at (25,0) width 20: "bar"
+ RenderText {#text} at (45,0) size 101x18
+ text run at (45,0) width 101: " baz foo bar baz"
+selection start: position 9 of child 2 {#text} of child 2 {DIV} of child 0 {BODY} of child 0 {HTML} of document
+selection end: position 12 of child 2 {#text} of child 2 {DIV} of child 0 {BODY} of child 0 {HTML} of document
--- /dev/null
+<p>This tests to see if Find will get stuck when searching for a word that is currently selected, and was selected with a double click.</p>
+
+<div>foo <span id="selectme">bar</span> baz foo bar baz</div>
+
+<script>
+if (window.layoutTestController) {
+ var e = document.getElementById("selectme");
+ var x = e.offsetParent.offsetLeft + e.offsetLeft + e.offsetWidth / 2;
+ var y = e.offsetParent.offsetTop + e.offsetTop + e.offsetHeight / 2;
+ eventSender.mouseMoveTo(x, y);
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+
+ document.execCommand("FindString", false, "bar");
+}
+</script>
\ No newline at end of file
+2006-06-15 Justin Garcia <justin.garcia@apple.com>
+
+ Reviewed by harrison
+
+ <http://bugzilla.opendarwin.org/show_bug.cgi?id=9456>
+ REGRESSION (417.9.2-420+): Cmd-G doesn't work in Safari after double-click and Cmd-E
+
+ * page/Frame.cpp:
+ (WebCore::Frame::findString): When comparing the found range with
+ what's currently selected a) build a selection with the found
+ range to remove collapsed whitespace and b) compare ranges
+ instead of selection objects to ignore the way that the
+ current selection was made (to ignore the base and extent).
+
2006-06-15 David Kilzer <ddkilzer@kilzer.net>
Reviewed by mjs.
}
RefPtr<Range> resultRange(findPlainText(searchRange.get(), target, forward, caseFlag));
Selection sel = selection().selection();
- // If the found range is one that's already selected, find again.
- if (!sel.isNone() && Selection(resultRange.get()) == sel) {
+ // If the found range is already selected, find again.
+ // Build a selection with the found range to remove collapsed whitespace.
+ // Compare ranges instead of selection objects to ignore the way that the current selection was made.
+ if (!sel.isNone() && *Selection(resultRange.get()).toRange() == *sel.toRange()) {
searchRange = rangeOfContents(document());
if (forward)
setStart(searchRange.get(), VisiblePosition(sel.end(), sel.affinity()));