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

xji at chromium.org xji at chromium.org
Mon Dec 27 16:26:01 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit e39e1560676789ce7415d34bf4d6139adf18be2e
Author: xji at chromium.org <xji at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Dec 21 04:13:27 2010 +0000

    2010-12-20  Xiaomei Ji  <xji at chromium.org>
    
            Reviewed by Dan Bernstein.
    
            Fix move left/right by character hang.
            https://bugs.webkit.org/show_bug.cgi?id=51344
    
            Test: editing/selection/51344.html
    
            * editing/VisiblePosition.cpp:
            (WebCore::VisiblePosition::leftVisuallyDistinctCandidate):
            (WebCore::VisiblePosition::rightVisuallyDistinctCandidate):
    2010-12-20  Xiaomei Ji  <xji at chromium.org>
    
            Reviewed by Dan Bernstein.
    
            Fix move left/right by character hang.
            https://bugs.webkit.org/show_bug.cgi?id=51344
    
            * editing/selection/51344-expected.txt: Added.
            * editing/selection/51344.html: Added.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74385 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index dea8f44..5d071b3 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2010-12-20  Xiaomei Ji  <xji at chromium.org>
+
+        Reviewed by Dan Bernstein.
+
+        Fix move left/right by character hang.
+        https://bugs.webkit.org/show_bug.cgi?id=51344
+
+        * editing/selection/51344-expected.txt: Added.
+        * editing/selection/51344.html: Added.
+
 2010-12-20  Tony Gentilcore  <tonyg at chromium.org>
 
         Unreviewed build fix.
diff --git a/LayoutTests/editing/selection/51344-expected.txt b/LayoutTests/editing/selection/51344-expected.txt
new file mode 100644
index 0000000..da55156
--- /dev/null
+++ b/LayoutTests/editing/selection/51344-expected.txt
@@ -0,0 +1,4 @@
+Test for bug 51344: move left/right by character should not hang.
+
+Success
+Success
diff --git a/LayoutTests/editing/selection/51344.html b/LayoutTests/editing/selection/51344.html
new file mode 100644
index 0000000..fee6fad
--- /dev/null
+++ b/LayoutTests/editing/selection/51344.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>Test for bug 51344: move left/right by character should not hang.</title>
+</head>
+<body>
+<p>Test for bug 51344: move left/right by character should not hang.
+<div id="test" dir="ltr" contenteditable>١١123مارس</div>
+<div id="test_rtl" dir="rtl" contenteditable>&#1494;&#1495; &#x202a;&#1491;&#1492;&#x202a;car &#1493;&#x202c;&#x202c;  </div> 
+
+<ul id="console"></ul>
+
+<script>
+if (window.layoutTestController)
+    layoutTestController.dumpAsText();
+
+function log(str) {
+    var li = document.createElement("li");
+    li.appendChild(document.createTextNode(str));
+    var console = document.getElementById("console");
+    console.appendChild(li);
+}
+
+function assert(bool) {
+    if (!bool)
+        log("Failure");
+    else
+        log("Success");
+}
+
+var test = document.getElementById('test');
+var selection = window.getSelection();
+selection.setPosition(test.firstChild, 6);
+selection.modify('move', 'right', 'character');
+var offset = selection.anchorOffset;
+assert(offset == 1);
+test.style.display = "none";
+
+test = document.getElementById('test_rtl');
+selection = window.getSelection();
+selection.setPosition(test.firstChild, 3);
+selection.modify('move', 'left', 'character');
+offset = selection.anchorOffset;
+assert(offset == 4);
+test.style.display = "none";
+
+</script>
+</body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index df63150..ebe1fc7 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2010-12-20  Xiaomei Ji  <xji at chromium.org>
+
+        Reviewed by Dan Bernstein.
+
+        Fix move left/right by character hang.
+        https://bugs.webkit.org/show_bug.cgi?id=51344
+
+        Test: editing/selection/51344.html
+
+        * editing/VisiblePosition.cpp:
+        (WebCore::VisiblePosition::leftVisuallyDistinctCandidate):
+        (WebCore::VisiblePosition::rightVisuallyDistinctCandidate):
+
 2010-12-20  Steve Lacey  <sjl at chromium.org>
 
         Reviewed by David Levin.
diff --git a/WebCore/editing/VisiblePosition.cpp b/WebCore/editing/VisiblePosition.cpp
index 760c68c..adfead1 100644
--- a/WebCore/editing/VisiblePosition.cpp
+++ b/WebCore/editing/VisiblePosition.cpp
@@ -183,7 +183,7 @@ Position VisiblePosition::leftVisuallyDistinctCandidate() const
                 offset = box->caretRightmostOffset();
                 if (box->bidiLevel() > level) {
                     do {
-                        prevBox = box->prevLeafChild();
+                        prevBox = prevBox->prevLeafChild();
                     } while (prevBox && prevBox->bidiLevel() > level);
 
                     if (!prevBox || prevBox->bidiLevel() < level)
@@ -320,7 +320,7 @@ Position VisiblePosition::rightVisuallyDistinctCandidate() const
                 offset = box->caretLeftmostOffset();
                 if (box->bidiLevel() > level) {
                     do {
-                        nextBox = box->nextLeafChild();
+                        nextBox = nextBox->nextLeafChild();
                     } while (nextBox && nextBox->bidiLevel() > level);
 
                     if (!nextBox || nextBox->bidiLevel() < level)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list