[Webkit-unassigned] [Bug 25676] Problems navigating by caret in links whose text wraps onto subsequent lines
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Feb 9 08:55:40 PST 2010
https://bugs.webkit.org/show_bug.cgi?id=25676
--- Comment #17 from Enrica Casucci <enrica at apple.com> 2010-02-09 08:55:38 PST ---
(From update of attachment 48400)
> diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
> index 2d13e20..d9ea28b 100644
> --- a/LayoutTests/ChangeLog
> +++ b/LayoutTests/ChangeLog
> @@ -1,3 +1,16 @@
> +2010-02-09 Alejandro G. Castro <alex at igalia.com>
> +
> + Reviewed by NOBODY (OOPS!).
> +
> + Problems navigating by caret in links whose text wraps onto
> + subsequent lines.
> + https://bugs.webkit.org/show_bug.cgi?id=25676
> +
> + Added tests showing the problem.
> +
> + * fast/events/multiline-link-arrow-navigation.html
> + * fast/events/multiline-link-arrow-navigation-expected.txt
> +
> 2010-02-09 Zoltan Herczeg <zherczeg at inf.u-szeged.hu>
>
> Reviewed by Oliver Hunt.
> diff --git a/LayoutTests/fast/events/multiline-link-arrow-navigation-expected.txt b/LayoutTests/fast/events/multiline-link-arrow-navigation-expected.txt
> new file mode 100644
> index 0000000..6681480
> --- /dev/null
> +++ b/LayoutTests/fast/events/multiline-link-arrow-navigation-expected.txt
> @@ -0,0 +1,3 @@
> +This is a test of links which span multiple lines for various and sundry reasons.
> +
> +PASS
> diff --git a/LayoutTests/fast/events/multiline-link-arrow-navigation.html b/LayoutTests/fast/events/multiline-link-arrow-navigation.html
> new file mode 100644
> index 0000000..83d8441
> --- /dev/null
> +++ b/LayoutTests/fast/events/multiline-link-arrow-navigation.html
> @@ -0,0 +1,26 @@
> +<html><head>
> +<meta http-equiv="content-type" content="text/html; charset=UTF-8">
> +
> +<script>
> +if (window.layoutTestController) {
> + layoutTestController.overridePreference("WebKitEnableCaretBrowsing", true);
> + layoutTestController.dumpAsText();
> +}
> +
> +function runTest()
> +{
> + var para = document.getElementById("para");
> + window.getSelection().setPosition(para.childNodes.item(1).childNodes.item(0), 15);
> + eventSender.keyDown("rightArrow");
> + eventSender.keyDown("rightArrow");
> +
> + document.getElementById("result").innerText = getSelection().baseOffset == 17 ? "PASS" : "FAIL";
> +}
> +</script>
> +
> +<title>Test</title>
> +</head><body onLoad="runTest();">
> +<p id="para" style="-webkit-user-modify: read-write; width: 250px; height: 100px; border: 1px solid blue;">This is a test of <a href="https://bug-25676-attachments.webkit.org/foo.html">links which span multiple lines</a> for various and sundry reasons.</p>
> +
> +<p id="result"></p>
> +</body></html>
> diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
> index 9fdf2cf..21487a7 100644
> --- a/WebCore/ChangeLog
> +++ b/WebCore/ChangeLog
> @@ -1,3 +1,15 @@
> +2010-02-09 Alejandro G. Castro <alex at igalia.com>
> +
> + Reviewed by NOBODY (OOPS!).
> +
> + Problems navigating by caret in links whose text wraps onto
> + subsequent lines.
> + https://bugs.webkit.org/show_bug.cgi?id=25676
> +
> + We should not search ahead if we are not in the last element.
> +
> + * dom/Position.cpp:
> +
> 2010-02-08 Dominic Cooney <dominicc at google.com>
>
> Reviewed by Adam Barth.
> diff --git a/WebCore/dom/Position.cpp b/WebCore/dom/Position.cpp
> index 0126835..c0f6fa3 100644
> --- a/WebCore/dom/Position.cpp
> +++ b/WebCore/dom/Position.cpp
> @@ -1046,7 +1046,7 @@ void Position::getInlineBoxAndOffset(EAffinity affinity, TextDirection primaryDi
>
> candidate = box;
> }
> - if (candidate && !box && affinity == DOWNSTREAM) {
> + if (candidate && candidate == textRenderer->lastTextBox() && affinity == DOWNSTREAM) {
> box = searchAheadForBetterMatch(textRenderer);
> if (box)
> caretOffset = box->caretMinOffset();
This looks good to me. I'm assuming you've run all the layout tests and found
no errors.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list