[SCM] WebKit Debian packaging branch, debian/experimental, updated. debian/1.3.8-1-142-g786665c

commit-queue at webkit.org commit-queue at webkit.org
Mon Dec 27 16:29:01 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit e633539f494336a75c2a843aca51e4f72559df95
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Dec 22 03:44:54 2010 +0000

    2010-12-21  Benjamin Kalman  <kalman at chromium.org>
    
            Reviewed by Darin Adler.
    
            Shift-End does not select to the end of the line
            https://bugs.webkit.org/show_bug.cgi?id=50610
    
            Add regression test that shift-end selects to the end of the line for both LTR and RTL text.
            Rebaseline a test which assumed incorrect behaviour of shift-end not selecting to the end of
            the line, but rather moving cursor to the start of the line above.
    
            * editing/selection/extend-selection-home-end-expected.txt: New baseline.
            * editing/selection/extend-to-line-boundary-expected.txt: Added.
            * editing/selection/extend-to-line-boundary.html: Added.
            * platform/win/editing/selection/extend-selection-home-end-expected.txt: New baseline.
    2010-12-21  Benjamin Kalman  <kalman at chromium.org>
    
            Reviewed by Darin Adler.
    
            Shift-End does not select to the end of the line
            https://bugs.webkit.org/show_bug.cgi?id=50610
    
            Let the VisiblePosition affinity for end of line selection to be set by
            visibleEnd/visibleStart rather than using end/start and always using UPSTREAM.
    
            Test: editing/selection/extend-to-line-boundary.html
    
            * editing/SelectionController.cpp:
            (WebCore::SelectionController::positionForPlatform): Use visibleStart/visibleEnd rather than
            start/end.
            (WebCore::SelectionController::modifyExtendingForward): Don't explicitly use UPSTREAM affinity.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74452 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 56fdee6..d606998 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,19 @@
+2010-12-21  Benjamin Kalman  <kalman at chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Shift-End does not select to the end of the line
+        https://bugs.webkit.org/show_bug.cgi?id=50610
+
+        Add regression test that shift-end selects to the end of the line for both LTR and RTL text.
+        Rebaseline a test which assumed incorrect behaviour of shift-end not selecting to the end of
+        the line, but rather moving cursor to the start of the line above.
+
+        * editing/selection/extend-selection-home-end-expected.txt: New baseline.
+        * editing/selection/extend-to-line-boundary-expected.txt: Added.
+        * editing/selection/extend-to-line-boundary.html: Added.
+        * platform/win/editing/selection/extend-selection-home-end-expected.txt: New baseline.
+
 2010-12-21  Jan Erik Hanssen  <jhanssen at sencha.com>
 
         Reviewed by Simon Fraser.
diff --git a/LayoutTests/editing/selection/extend-selection-home-end-expected.txt b/LayoutTests/editing/selection/extend-selection-home-end-expected.txt
index ae52f6a..df0bf9f 100644
--- a/LayoutTests/editing/selection/extend-selection-home-end-expected.txt
+++ b/LayoutTests/editing/selection/extend-selection-home-end-expected.txt
@@ -124,14 +124,14 @@ Test 20, RTL:
   Extending backward:  "ABC abc DEF"[(0,11), (0,0)]
 Test 21, LTR:
   Extending forward: "abcdefg abcdefg abcdefg a abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg "[(0,0), (0,8)]
-  Extending backward:  "abcdefg abcdefg abcdefg a abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg "[(0,8)]
+  Extending backward:  "abcdefg abcdefg abcdefg a abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg "[(0,8), (0,0)]
 Test 21, RTL:
   Extending forward: "abcdefg abcdefg abcdefg a abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg "[(0,0), (0,8)]
-  Extending backward:  "abcdefg abcdefg abcdefg a abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg "[(0,8)]
+  Extending backward:  "abcdefg abcdefg abcdefg a abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg "[(0,8), (0,0)]
 Test 22, LTR:
   Extending forward: "abcdefg abcdefg abcdefg a abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg "[(0,0), (0,8)]
-  Extending backward:  "abcdefg abcdefg abcdefg a abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg "[(0,8)]
+  Extending backward:  "abcdefg abcdefg abcdefg a abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg "[(0,8), (0,0)]
 Test 22, RTL:
   Extending forward: "abcdefg abcdefg abcdefg a abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg "[(0,0), (0,8)]
-  Extending backward:  "abcdefg abcdefg abcdefg a abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg "[(0,8)]
+  Extending backward:  "abcdefg abcdefg abcdefg a abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg "[(0,8), (0,0)]
 
diff --git a/LayoutTests/editing/selection/extend-to-line-boundary-expected.txt b/LayoutTests/editing/selection/extend-to-line-boundary-expected.txt
new file mode 100644
index 0000000..7f5dc1b
--- /dev/null
+++ b/LayoutTests/editing/selection/extend-to-line-boundary-expected.txt
@@ -0,0 +1,5 @@
+PASS for LTR
+PASS for RTL
+
+the quick brown fox jumps the quick brown fox jumps the quick brown fox jumps
+שוּרה שוּרה שוּרה שוּרה שוּרה שוּרה שוּרה שוּרה שוּרה
diff --git a/LayoutTests/editing/selection/extend-to-line-boundary.html b/LayoutTests/editing/selection/extend-to-line-boundary.html
new file mode 100644
index 0000000..27261ff
--- /dev/null
+++ b/LayoutTests/editing/selection/extend-to-line-boundary.html
@@ -0,0 +1,70 @@
+<!DOCTYPE html>
+<body>
+<pre id="console"></pre>
+<script>
+function log(s) {
+    document.getElementById("console").innerHTML += s + "\n";
+}
+
+function createEditableMultilineDiv(text, numLines) {
+    // Put text in a span so that the width can be measured.
+    var span = document.createElement("span");
+    span.innerHTML = text;
+    document.body.appendChild(span);
+    var widthPx = span.offsetWidth;
+    document.body.removeChild(span);
+
+    // Make div with those dimensions so that the text wraps predictably regardless of platform.
+    var lines = text;
+    for (var i = 1; i < numLines; i++)
+        lines += " " + text;
+
+    var div = document.createElement("div");
+    div.setAttribute("style", "width: " + widthPx + "px");
+    div.contentEditable = true;
+    div.innerHTML = lines;
+
+    return div;
+}
+
+function selectSecondLine(element) {
+    getSelection().setPosition(element.childNodes[0], 0);
+    getSelection().modify("move", "forward", "line");
+    getSelection().modify("extend", "forward", "lineboundary");
+}
+
+function unescapeRtl(rtlText) {
+    var e = document.createElement("span");
+    e.innerHTML = rtlText;
+    return e.innerHTML;
+}
+
+ltrText = "the quick brown fox jumps";
+ltrTextContainer = createEditableMultilineDiv(ltrText, 3);
+document.body.appendChild(ltrTextContainer);
+selectSecondLine(ltrTextContainer);
+
+if (getSelection().toString() === ltrText + " ")
+    log("PASS for LTR");
+else
+    log("FAIL for LTR, selection is '" + getSelection() + "' but should be '" + ltrText + " '");
+
+rtlText = unescapeRtl("&#x05E9;&#x05D5;&#x05BC;&#x05E8;&#x05D4; " +
+                      "&#x05E9;&#x05D5;&#x05BC;&#x05E8;&#x05D4; " +
+                      "&#x05E9;&#x05D5;&#x05BC;&#x05E8;&#x05D4;");
+rtlTextContainer = createEditableMultilineDiv(rtlText, 3);
+rtlTextContainer.setAttribute("dir", "rtl");
+document.body.appendChild(rtlTextContainer);
+selectSecondLine(rtlTextContainer);
+
+if (getSelection().toString() === rtlText + " ")
+    log("PASS for RTL");
+else
+    log("FAIL for RTL, selection is '" + getSelection() + "' but should be '" + rtlText + " '");
+
+log("");
+
+if (window.layoutTestController)
+    layoutTestController.dumpAsText();
+</script>
+</body>
diff --git a/LayoutTests/platform/win/editing/selection/extend-selection-home-end-expected.txt b/LayoutTests/platform/win/editing/selection/extend-selection-home-end-expected.txt
index ae52f6a..df0bf9f 100644
--- a/LayoutTests/platform/win/editing/selection/extend-selection-home-end-expected.txt
+++ b/LayoutTests/platform/win/editing/selection/extend-selection-home-end-expected.txt
@@ -124,14 +124,14 @@ Test 20, RTL:
   Extending backward:  "ABC abc DEF"[(0,11), (0,0)]
 Test 21, LTR:
   Extending forward: "abcdefg abcdefg abcdefg a abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg "[(0,0), (0,8)]
-  Extending backward:  "abcdefg abcdefg abcdefg a abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg "[(0,8)]
+  Extending backward:  "abcdefg abcdefg abcdefg a abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg "[(0,8), (0,0)]
 Test 21, RTL:
   Extending forward: "abcdefg abcdefg abcdefg a abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg "[(0,0), (0,8)]
-  Extending backward:  "abcdefg abcdefg abcdefg a abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg "[(0,8)]
+  Extending backward:  "abcdefg abcdefg abcdefg a abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg "[(0,8), (0,0)]
 Test 22, LTR:
   Extending forward: "abcdefg abcdefg abcdefg a abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg "[(0,0), (0,8)]
-  Extending backward:  "abcdefg abcdefg abcdefg a abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg "[(0,8)]
+  Extending backward:  "abcdefg abcdefg abcdefg a abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg "[(0,8), (0,0)]
 Test 22, RTL:
   Extending forward: "abcdefg abcdefg abcdefg a abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg "[(0,0), (0,8)]
-  Extending backward:  "abcdefg abcdefg abcdefg a abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg "[(0,8)]
+  Extending backward:  "abcdefg abcdefg abcdefg a abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg "[(0,8), (0,0)]
 
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 4b61335..fecda50 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,20 @@
+2010-12-21  Benjamin Kalman  <kalman at chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Shift-End does not select to the end of the line
+        https://bugs.webkit.org/show_bug.cgi?id=50610
+
+        Let the VisiblePosition affinity for end of line selection to be set by
+        visibleEnd/visibleStart rather than using end/start and always using UPSTREAM.
+
+        Test: editing/selection/extend-to-line-boundary.html
+
+        * editing/SelectionController.cpp:
+        (WebCore::SelectionController::positionForPlatform): Use visibleStart/visibleEnd rather than
+        start/end.
+        (WebCore::SelectionController::modifyExtendingForward): Don't explicitly use UPSTREAM affinity.
+
 2010-12-21  Jan Erik Hanssen  <jhanssen at sencha.com>
 
         Reviewed by Simon Fraser.
diff --git a/WebCore/editing/SelectionController.cpp b/WebCore/editing/SelectionController.cpp
index 4fc6bbe..9cddf1d 100644
--- a/WebCore/editing/SelectionController.cpp
+++ b/WebCore/editing/SelectionController.cpp
@@ -302,19 +302,15 @@ TextDirection SelectionController::directionOfEnclosingBlock()
 
 VisiblePosition SelectionController::positionForPlatform(bool isGetStart) const
 {
-    Position pos;
     Settings* settings = m_frame ? m_frame->settings() : 0;
     if (settings && settings->editingBehaviorType() == EditingMacBehavior)
-        pos = isGetStart ? m_selection.start() : m_selection.end();
-    else {
-        // Linux and Windows always extend selections from the extent endpoint.
-        // FIXME: VisibleSelection should be fixed to ensure as an invariant that
-        // base/extent always point to the same nodes as start/end, but which points
-        // to which depends on the value of isBaseFirst. Then this can be changed
-        // to just return m_sel.extent().
-        pos = m_selection.isBaseFirst() ? m_selection.end() : m_selection.start();
-    }
-    return VisiblePosition(pos, m_selection.affinity());
+        return isGetStart ? m_selection.visibleStart() : m_selection.visibleEnd();
+    // Linux and Windows always extend selections from the extent endpoint.
+    // FIXME: VisibleSelection should be fixed to ensure as an invariant that
+    // base/extent always point to the same nodes as start/end, but which points
+    // to which depends on the value of isBaseFirst. Then this can be changed
+    // to just return m_sel.extent().
+    return m_selection.isBaseFirst() ? m_selection.visibleEnd() : m_selection.visibleStart();
 }
 
 VisiblePosition SelectionController::startForPlatform() const
@@ -385,9 +381,7 @@ VisiblePosition SelectionController::modifyExtendingForward(TextGranularity gran
         pos = endOfSentence(endForPlatform());
         break;
     case LineBoundary:
-        pos = endForPlatform();
-        pos.setAffinity(UPSTREAM);
-        pos = logicalEndOfLine(pos);
+        pos = logicalEndOfLine(endForPlatform());
         break;
     case ParagraphBoundary:
         pos = endOfParagraph(endForPlatform());

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list