[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75

eric at webkit.org eric at webkit.org
Thu Oct 29 20:47:29 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit 3f7c2863cfabef16ac88c6b7bb86b023a3cdc81b
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Oct 19 06:59:58 2009 +0000

    2009-10-18  Erik Arvidsson  <arv at chromium.org>
    
            Reviewed by Adam Barth.
    
            Fixes issue where doubleclicking a word could select following adjacent newlines.
            https://bugs.webkit.org/show_bug.cgi?id=30234
    
            * platform/mac/editing/selection/doubleclick-should-not-expand-across-lines-expected.txt: Added.
            * platform/mac/editing/selection/doubleclick-should-not-expand-across-lines.html: Added.
            * platform/mac/editing/selection/script-tests/TEMPLATE.html: Added.
            * platform/mac/editing/selection/script-tests/doubleclick-should-not-expand-across-lines.js: Added.
            (description.doubleClickOnElement):
            (doubleClickAt):
            (selectionShouldBe):
            * platform/win/editing/selection/doubleclick-should-not-expand-across-lines-expected.txt: Added.
            * platform/win/editing/selection/doubleclick-should-not-expand-across-lines.html: Added.
            * platform/win/editing/selection/script-tests/TEMPLATE.html: Added.
            * platform/win/editing/selection/script-tests/doubleclick-should-not-expand-across-lines.js: Added.
            (description.doubleClickOnElement):
            (doubleClickAt):
            (selectionShouldBe):
    2009-10-18  Erik Arvidsson  <arv at chromium.org>
    
            Reviewed by Adam Barth.
    
            Fixes issue where doubleclicking a word could select following adjacent newlines.
            https://bugs.webkit.org/show_bug.cgi?id=30234
    
            Tests: platform/mac/editing/selection/doubleclick-should-not-expand-across-lines.html
                   platform/mac/editing/selection/script-tests/TEMPLATE.html
                   platform/win/editing/selection/doubleclick-should-not-expand-across-lines.html
                   platform/win/editing/selection/script-tests/TEMPLATE.html
    
            * editing/VisibleSelection.cpp:
            (WebCore::VisibleSelection::appendTrailingWhitespace):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49767 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 30f372e..772d3d8 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,25 @@
+2009-10-18  Erik Arvidsson  <arv at chromium.org>
+
+        Reviewed by Adam Barth.
+
+        Fixes issue where doubleclicking a word could select following adjacent newlines.
+        https://bugs.webkit.org/show_bug.cgi?id=30234
+
+        * platform/mac/editing/selection/doubleclick-should-not-expand-across-lines-expected.txt: Added.
+        * platform/mac/editing/selection/doubleclick-should-not-expand-across-lines.html: Added.
+        * platform/mac/editing/selection/script-tests/TEMPLATE.html: Added.
+        * platform/mac/editing/selection/script-tests/doubleclick-should-not-expand-across-lines.js: Added.
+        (description.doubleClickOnElement):
+        (doubleClickAt):
+        (selectionShouldBe):
+        * platform/win/editing/selection/doubleclick-should-not-expand-across-lines-expected.txt: Added.
+        * platform/win/editing/selection/doubleclick-should-not-expand-across-lines.html: Added.
+        * platform/win/editing/selection/script-tests/TEMPLATE.html: Added.
+        * platform/win/editing/selection/script-tests/doubleclick-should-not-expand-across-lines.js: Added.
+        (description.doubleClickOnElement):
+        (doubleClickAt):
+        (selectionShouldBe):
+
 2009-10-18  Pavel Feldman  <pfeldman at chromium.org>
 
         Reviewed by Timothy Hatcher.
diff --git a/LayoutTests/platform/mac/editing/selection/doubleclick-should-not-expand-across-lines-expected.txt b/LayoutTests/platform/mac/editing/selection/doubleclick-should-not-expand-across-lines-expected.txt
new file mode 100644
index 0000000..9b8eafd
--- /dev/null
+++ b/LayoutTests/platform/mac/editing/selection/doubleclick-should-not-expand-across-lines-expected.txt
@@ -0,0 +1,12 @@
+Ensure that double clicking does not expand selection across new line boundaries.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS String(window.getSelection()) is "more"
+PASS String(window.getSelection()) is "more"
+PASS String(window.getSelection()) is "more"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/platform/mac/editing/selection/doubleclick-should-not-expand-across-lines.html b/LayoutTests/platform/mac/editing/selection/doubleclick-should-not-expand-across-lines.html
new file mode 100644
index 0000000..4e2b439
--- /dev/null
+++ b/LayoutTests/platform/mac/editing/selection/doubleclick-should-not-expand-across-lines.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link rel="stylesheet" href="../../../../fast/js/resources/js-test-style.css">
+<script src="../../../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/doubleclick-should-not-expand-across-lines.js"></script>
+<script src="../../../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/platform/mac/editing/selection/script-tests/TEMPLATE.html b/LayoutTests/platform/mac/editing/selection/script-tests/TEMPLATE.html
new file mode 100644
index 0000000..bcfeb6b
--- /dev/null
+++ b/LayoutTests/platform/mac/editing/selection/script-tests/TEMPLATE.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link rel="stylesheet" href="../../../fast/js/resources/js-test-style.css">
+<script src="../../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="YOUR_JS_FILE_HERE"></script>
+<script src="../../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/platform/mac/editing/selection/script-tests/doubleclick-should-not-expand-across-lines.js b/LayoutTests/platform/mac/editing/selection/script-tests/doubleclick-should-not-expand-across-lines.js
new file mode 100644
index 0000000..d8e753a
--- /dev/null
+++ b/LayoutTests/platform/mac/editing/selection/script-tests/doubleclick-should-not-expand-across-lines.js
@@ -0,0 +1,62 @@
+description("Ensure that double clicking does not expand selection across new line boundaries.")
+
+function doubleClickOnElement(el)
+{
+    var rect = el.getBoundingClientRect();
+    var x = rect.left + rect.width / 2;
+    var y = rect.top + rect.height / 2;
+    doubleClickAt(x, y);
+}
+
+function doubleClickAt(x, y)
+{
+    if (window.eventSender) {
+        eventSender.mouseMoveTo(x, y);
+        eventSender.mouseDown();
+        eventSender.mouseUp();
+        eventSender.mouseDown();
+        eventSender.mouseUp();
+    }
+}
+
+function selectionShouldBe(s)
+{
+    shouldBeEqualToString('String(window.getSelection())', s);
+}
+
+var div = document.createElement('div');
+document.body.appendChild(div);
+
+// DIV with br
+div.innerHTML = 'm<span>o</span>re &nbsp;<br>&nbsp;<br>text';
+doubleClickOnElement(div.firstElementChild);
+selectionShouldBe('more');
+
+// DIV with white-space pre
+div.style.whiteSpace = 'pre';
+div.innerHTML = 'm<span>o</span>re  \n \ntext';
+doubleClickOnElement(div.firstElementChild);
+selectionShouldBe('more');
+
+document.body.removeChild(div);
+
+// Textarea -- we cannot really get the position of the word we want so we use
+// a large font in a textarea and double click in the upper left corner
+
+var textarea = document.createElement('textarea');
+textarea.style.border = 0;
+textarea.style.padding = 0;
+textarea.style.fontSize = '30px';
+document.body.appendChild(textarea);
+
+var rect = textarea.getBoundingClientRect();
+var x = rect.left + 10;
+var y = rect.top + 10;
+
+textarea.value = 'more  \n \ntext';
+doubleClickAt(x, y);
+selectionShouldBe('more');
+
+document.body.removeChild(textarea);
+
+var successfullyParsed = true;
diff --git a/LayoutTests/platform/win/editing/selection/doubleclick-should-not-expand-across-lines-expected.txt b/LayoutTests/platform/win/editing/selection/doubleclick-should-not-expand-across-lines-expected.txt
new file mode 100644
index 0000000..c7ddaf1
--- /dev/null
+++ b/LayoutTests/platform/win/editing/selection/doubleclick-should-not-expand-across-lines-expected.txt
@@ -0,0 +1,12 @@
+Ensure that double clicking does not expand selection across new line boundaries.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS String(window.getSelection()) is "more  "
+PASS String(window.getSelection()) is "more  "
+PASS String(window.getSelection()) is "more  "
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/platform/win/editing/selection/doubleclick-should-not-expand-across-lines.html b/LayoutTests/platform/win/editing/selection/doubleclick-should-not-expand-across-lines.html
new file mode 100644
index 0000000..4e2b439
--- /dev/null
+++ b/LayoutTests/platform/win/editing/selection/doubleclick-should-not-expand-across-lines.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link rel="stylesheet" href="../../../../fast/js/resources/js-test-style.css">
+<script src="../../../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/doubleclick-should-not-expand-across-lines.js"></script>
+<script src="../../../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/platform/win/editing/selection/script-tests/TEMPLATE.html b/LayoutTests/platform/win/editing/selection/script-tests/TEMPLATE.html
new file mode 100644
index 0000000..bcfeb6b
--- /dev/null
+++ b/LayoutTests/platform/win/editing/selection/script-tests/TEMPLATE.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link rel="stylesheet" href="../../../fast/js/resources/js-test-style.css">
+<script src="../../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="YOUR_JS_FILE_HERE"></script>
+<script src="../../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/platform/win/editing/selection/script-tests/doubleclick-should-not-expand-across-lines.js b/LayoutTests/platform/win/editing/selection/script-tests/doubleclick-should-not-expand-across-lines.js
new file mode 100644
index 0000000..4146351
--- /dev/null
+++ b/LayoutTests/platform/win/editing/selection/script-tests/doubleclick-should-not-expand-across-lines.js
@@ -0,0 +1,62 @@
+description("Ensure that double clicking does not expand selection across new line boundaries.")
+
+function doubleClickOnElement(el)
+{
+    var rect = el.getBoundingClientRect();
+    var x = rect.left + rect.width / 2;
+    var y = rect.top + rect.height / 2;
+    doubleClickAt(x, y);
+}
+
+function doubleClickAt(x, y)
+{
+    if (window.eventSender) {
+        eventSender.mouseMoveTo(x, y);
+        eventSender.mouseDown();
+        eventSender.mouseUp();
+        eventSender.mouseDown();
+        eventSender.mouseUp();
+    }
+}
+
+function selectionShouldBe(s)
+{
+    shouldBeEqualToString('String(window.getSelection())', s);
+}
+
+var div = document.createElement('div');
+document.body.appendChild(div);
+
+// DIV with br
+div.innerHTML = 'm<span>o</span>re &nbsp;<br>&nbsp;<br>text';
+doubleClickOnElement(div.firstElementChild);
+selectionShouldBe('more \xa0');
+
+// DIV with white-space pre
+div.style.whiteSpace = 'pre';
+div.innerHTML = 'm<span>o</span>re  \n \ntext';
+doubleClickOnElement(div.firstElementChild);
+selectionShouldBe('more  ');
+
+document.body.removeChild(div);
+
+// Textarea -- we cannot really get the position of the word we want so we use
+// a large font in a textarea and double click in the upper left corner
+
+var textarea = document.createElement('textarea');
+textarea.style.border = 0;
+textarea.style.padding = 0;
+textarea.style.fontSize = '30px';
+document.body.appendChild(textarea);
+
+var rect = textarea.getBoundingClientRect();
+var x = rect.left + 10;
+var y = rect.top + 10;
+
+textarea.value = 'more  \n \ntext';
+doubleClickAt(x, y);
+selectionShouldBe('more  ');
+
+document.body.removeChild(textarea);
+
+var successfullyParsed = true;
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 027e9aa..4470cf0 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,18 @@
+2009-10-18  Erik Arvidsson  <arv at chromium.org>
+
+        Reviewed by Adam Barth.
+
+        Fixes issue where doubleclicking a word could select following adjacent newlines.
+        https://bugs.webkit.org/show_bug.cgi?id=30234
+
+        Tests: platform/mac/editing/selection/doubleclick-should-not-expand-across-lines.html
+               platform/mac/editing/selection/script-tests/TEMPLATE.html
+               platform/win/editing/selection/doubleclick-should-not-expand-across-lines.html
+               platform/win/editing/selection/script-tests/TEMPLATE.html
+
+        * editing/VisibleSelection.cpp:
+        (WebCore::VisibleSelection::appendTrailingWhitespace):
+
 2009-10-18  Kevin Ollivier  <kevino at theolliviers.com>
 
         CURL build fix, use proper header name.
diff --git a/WebCore/editing/VisibleSelection.cpp b/WebCore/editing/VisibleSelection.cpp
index 8adfd71..206de86 100644
--- a/WebCore/editing/VisibleSelection.cpp
+++ b/WebCore/editing/VisibleSelection.cpp
@@ -237,7 +237,7 @@ void VisibleSelection::appendTrailingWhitespace()
 
     for (; charIt.length(); charIt.advance(1)) {
         UChar c = charIt.characters()[0];
-        if (!isSpaceOrNewline(c) && c != noBreakSpace)
+        if (!isSpaceOrNewline(c) && c != noBreakSpace || c == '\n')
             break;
         m_end = charIt.range()->endPosition();
     }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list