[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.19-706-ge5415e9

ojan at chromium.org ojan at chromium.org
Thu Feb 4 21:34:01 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit 035607edb8d105bf96b09339857a254af42acb5c
Author: ojan at chromium.org <ojan at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Feb 1 00:54:49 2010 +0000

    2010-01-28  Ojan Vafai  <ojan at chromium.org>
    
            Reviewed by Darin Adler.
    
            Implement CSSOM Range.getClientRects for collapsed selections
            https://bugs.webkit.org/show_bug.cgi?id=34239
    
            Adds two cases to getClientRects test.
    
            * fast/dom/Range/getClientRects-expected.txt:
            * fast/dom/Range/getClientRects.html:
    2010-01-28  Ojan Vafai  <ojan at chromium.org>
    
            Reviewed by Darin Adler.
    
            Implement CSSOM Range.getClientRects for collapsed selections
            https://bugs.webkit.org/show_bug.cgi?id=34239
    
            When getting the quads for a range on a text node, allow returning
            zero width quads. This leaves the case of collapsed selections inside
            elements still not fixed, but no worse.
    
            * rendering/InlineTextBox.cpp:
            (WebCore::InlineTextBox::selectionRect):
            * rendering/RenderText.cpp:
            (WebCore::RenderText::absoluteQuadsForRange):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54117 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 563e660..a9ee2c1 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
+2010-01-28  Ojan Vafai  <ojan at chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Implement CSSOM Range.getClientRects for collapsed selections
+        https://bugs.webkit.org/show_bug.cgi?id=34239
+
+        Adds two cases to getClientRects test. 
+
+        * fast/dom/Range/getClientRects-expected.txt:
+        * fast/dom/Range/getClientRects.html:
+
 2010-01-31  Oliver Hunt  <oliver at apple.com>
 
         Reviewed by Simon Fraser.
diff --git a/LayoutTests/fast/dom/Range/getClientRects-expected.txt b/LayoutTests/fast/dom/Range/getClientRects-expected.txt
index a08a2cf..a028cce 100644
--- a/LayoutTests/fast/dom/Range/getClientRects-expected.txt
+++ b/LayoutTests/fast/dom/Range/getClientRects-expected.txt
@@ -186,6 +186,18 @@ PASS rects[3].left is 76
 PASS rects[3].top is 1755
 PASS rects[3].width is 212
 PASS rects[3].height is 247
+Test 9
+FAIL rects.length should be 1. Was 0.
+FAIL rects[0].left should be 8. Threw exception TypeError: Result of expression 'rects[0]' [undefined] is not an object.
+FAIL rects[0].top should be 1903. Threw exception TypeError: Result of expression 'rects[0]' [undefined] is not an object.
+FAIL rects[0].width should be 0. Threw exception TypeError: Result of expression 'rects[0]' [undefined] is not an object.
+FAIL rects[0].height should be 18. Threw exception TypeError: Result of expression 'rects[0]' [undefined] is not an object.
+Test 9b
+PASS rects.length is 1
+PASS rects[0].left is 8
+PASS rects[0].top is 1903
+PASS rects[0].width is 0
+PASS rects[0].height is 18
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/LayoutTests/fast/dom/Range/getClientRects.html b/LayoutTests/fast/dom/Range/getClientRects.html
index d6de3f3..af104f0 100644
--- a/LayoutTests/fast/dom/Range/getClientRects.html
+++ b/LayoutTests/fast/dom/Range/getClientRects.html
@@ -69,6 +69,10 @@
 
 <div class="box" id="test8">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</div>
 
+<br><br>
+
+<div class="box" id="test9">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</div>
+
 </div>
 
 <script>
@@ -339,6 +343,29 @@
     shouldBe("rects[3].width", "212");
     shouldBe("rects[3].height", "247");
 
+    debug("Test 9");
+    var range9 = document.createRange();
+    // This case should match test 9b's results. Currently though getClientRects returns an empty list.
+    range9.setStart(document.getElementById('test9'), 0);
+    show(range9);
+    rects = range9.getClientRects();
+    shouldBe("rects.length", "1");
+    shouldBe("rects[0].left", "8");
+    shouldBe("rects[0].top", "1903");
+    shouldBe("rects[0].width", "0");
+    shouldBe("rects[0].height", "18");
+
+    debug("Test 9b");
+    var range9 = document.createRange();
+    range9.setStart(document.getElementById('test9').firstChild, 0);
+    show(range9);
+    rects = range9.getClientRects();
+    shouldBe("rects.length", "1");
+    shouldBe("rects[0].left", "8");
+    shouldBe("rects[0].top", "1903");
+    shouldBe("rects[0].width", "0");
+    shouldBe("rects[0].height", "18");
+
     if (window.layoutTestController) {
         var area = document.getElementById('testArea');
         area.parentNode.removeChild(area);
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index aabf53a..582db97 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2010-01-28  Ojan Vafai  <ojan at chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Implement CSSOM Range.getClientRects for collapsed selections
+        https://bugs.webkit.org/show_bug.cgi?id=34239
+
+        When getting the quads for a range on a text node, allow returning
+        zero width quads. This leaves the case of collapsed selections inside
+        elements still not fixed, but no worse.
+
+        * rendering/InlineTextBox.cpp:
+        (WebCore::InlineTextBox::selectionRect):
+        * rendering/RenderText.cpp:
+        (WebCore::RenderText::absoluteQuadsForRange):
+
 2010-01-31  Oliver Hunt  <oliver at apple.com>
 
         Reviewed by Simon Fraser.
diff --git a/WebCore/rendering/InlineTextBox.cpp b/WebCore/rendering/InlineTextBox.cpp
index 234bb18..b7e6de2 100644
--- a/WebCore/rendering/InlineTextBox.cpp
+++ b/WebCore/rendering/InlineTextBox.cpp
@@ -108,7 +108,7 @@ IntRect InlineTextBox::selectionRect(int tx, int ty, int startPos, int endPos)
     int sPos = max(startPos - m_start, 0);
     int ePos = min(endPos - m_start, (int)m_len);
     
-    if (sPos >= ePos)
+    if (sPos > ePos)
         return IntRect();
 
     RenderText* textObj = textRenderer();
diff --git a/WebCore/rendering/RenderText.cpp b/WebCore/rendering/RenderText.cpp
index 15ea496..2e696a9 100644
--- a/WebCore/rendering/RenderText.cpp
+++ b/WebCore/rendering/RenderText.cpp
@@ -288,7 +288,7 @@ void RenderText::absoluteQuadsForRange(Vector<FloatQuad>& quads, unsigned start,
         } else {
             unsigned realEnd = min(box->end() + 1, end);
             IntRect r = box->selectionRect(0, 0, start, realEnd);
-            if (!r.isEmpty()) {
+            if (r.height()) {
                 if (!useSelectionHeight) {
                     // change the height and y position because selectionRect uses selection-specific values
                     r.setHeight(box->height());

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list