[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.21-584-g1e41756

mitz at apple.com mitz at apple.com
Fri Feb 26 22:20:47 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit 5bf68f34101988c1f456c5821514e39e8cc01cf0
Author: mitz at apple.com <mitz at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Feb 16 04:19:04 2010 +0000

    WebCore: <rdar://problem/7645609> [webView selectionRect] API is broken for multicolumn layout
    
    Reviewed by Simon Fraser.
    
    Refine the fix for https://bugs.webkit.org/show_bug.cgi?id=34923 by using the center of
    a quad’s bounding box, rather than its top left, as the reference point passed to
    offsetFromContainer(). This ensures that if a sliver off the top of the selection rect is in
    one column, but most of it is on another column, the single rect we return will be for the
    second column.
    
    * platform/graphics/FloatRect.h:
    (WebCore::FloatRect::center): Added.
    * rendering/RenderObject.cpp:
    (WebCore::RenderObject::localToContainerQuad): Use the center instead of the top left.
    
    LayoutTests: Add test case for <rdar://problem/7645609> [webView selectionRect] API is broken for multicolumn layout
    
    Reviewed by Simon Fraser.
    
    * fast/multicol/client-rects-expected.checksum:
    * fast/multicol/client-rects-expected.png:
    * fast/multicol/client-rects-expected.txt:
    * fast/multicol/client-rects.html:
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54807 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 5d14877..3f3137a 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,14 @@
+2010-02-15  Dan Bernstein  <mitz at apple.com>
+
+        Reviewed by Simon Fraser.
+
+        Add test case for <rdar://problem/7645609> [webView selectionRect] API is broken for multicolumn layout
+
+        * fast/multicol/client-rects-expected.checksum:
+        * fast/multicol/client-rects-expected.png:
+        * fast/multicol/client-rects-expected.txt:
+        * fast/multicol/client-rects.html:
+
 2010-02-15  Brian Weinstein  <bweinstein at apple.com>
 
         Rubber-stamped by Dan Bernstein.
diff --git a/LayoutTests/fast/multicol/client-rects-expected.checksum b/LayoutTests/fast/multicol/client-rects-expected.checksum
index 355c14e..d7a1d7a 100644
--- a/LayoutTests/fast/multicol/client-rects-expected.checksum
+++ b/LayoutTests/fast/multicol/client-rects-expected.checksum
@@ -1 +1 @@
-515437ffe482058606a444eb132d1255
\ No newline at end of file
+1c8ed43123d516b27b3daa71edff1b9a
\ No newline at end of file
diff --git a/LayoutTests/fast/multicol/client-rects-expected.png b/LayoutTests/fast/multicol/client-rects-expected.png
index 61690e7..7adb54d 100644
Binary files a/LayoutTests/fast/multicol/client-rects-expected.png and b/LayoutTests/fast/multicol/client-rects-expected.png differ
diff --git a/LayoutTests/fast/multicol/client-rects-expected.txt b/LayoutTests/fast/multicol/client-rects-expected.txt
index 0080231..81dfaa1 100644
--- a/LayoutTests/fast/multicol/client-rects-expected.txt
+++ b/LayoutTests/fast/multicol/client-rects-expected.txt
@@ -1,9 +1,9 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
-  RenderBlock {HTML} at (0,0) size 800x600
-    RenderBody {BODY} at (8,8) size 784x582
-      RenderBlock {P} at (0,0) size 784x29
+layer at (0,0) size 785x695
+  RenderView at (0,0) size 785x600
+layer at (0,0) size 785x695
+  RenderBlock {HTML} at (0,0) size 785x695
+    RenderBody {BODY} at (8,8) size 769x677
+      RenderBlock {P} at (0,0) size 769x29
         RenderText {#text} at (0,11) size 421x18
           text run at (0,11) width 421: "The blue borders should coincide with light blue squares, like this: "
         RenderBlock {SPAN} at (421,0) size 25x25 [bgcolor=#ADD8E6] [border: (3px solid #0000FF7F)]
@@ -60,6 +60,11 @@ layer at (0,0) size 800x600
         RenderBlock {DIV} at (13,38) size 50x50
           RenderBR {BR} at (0,0) size 0x25
           RenderImage {IMG} at (0,25) size 25x25 [bgcolor=#ADD8E6]
+      RenderBlock {P} at (0,567) size 769x18
+        RenderText {#text} at (0,0) size 633x18
+          text run at (0,0) width 633: "Except here, where the blue border should be around the bigger slice of the blue square, on the right."
+      RenderBlock {DIV} at (0,601) size 136x76 [color=#ADD8E6] [border: (3px solid #000000)]
+        RenderBlock {DIV} at (13,53) size 25x25 [bgcolor=#ADD8E6]
 layer at (21,91) size 25x25
   RenderBlock (positioned) {DIV} at (21,91) size 25x25 [border: (3px solid #0000FF7F)]
 layer at (81,66) size 25x25
@@ -86,3 +91,5 @@ layer at (83,412) size 25x25
   RenderBlock (positioned) {DIV} at (83,412) size 25x25 [border: (3px solid #0000FF7F)]
 layer at (81,521) size 25x25
   RenderBlock (positioned) {DIV} at (81,521) size 25x25 [border: (3px solid #0000FF7F)]
+layer at (81,612) size 25x25
+  RenderBlock (positioned) {DIV} at (81,612) size 25x25 [border: (3px solid #0000FF7F)]
diff --git a/LayoutTests/fast/multicol/client-rects.html b/LayoutTests/fast/multicol/client-rects.html
index 70578ff..00426ad 100644
--- a/LayoutTests/fast/multicol/client-rects.html
+++ b/LayoutTests/fast/multicol/client-rects.html
@@ -61,6 +61,14 @@
     <br><div><br><img id="t6" style="width: 25px; height: 25px; background-color: lightblue;"></div>
 </div>
 
+<p>
+    Except here, where the blue border should be around the bigger slice of the blue square, on the right.
+</p>
+
+<div class="columns">
+    <div id="t7" style=" margin-top: 40px; width: 25px; height: 25px; background-color: lightblue;"></div>
+</div>
+
 <script>
     function placeMarker(clientRect)
     {
@@ -110,4 +118,8 @@
     var image = document.getElementById("t6");
     range.selectNode(image);
     placeMarkersForRange(range);
+
+    var div = document.getElementById("t7");
+    range.selectNode(div);
+    placeMarkersForRange(div);
 </script>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 38e82da..883ea72 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,20 @@
+2010-02-15  Dan Bernstein  <mitz at apple.com>
+
+        Reviewed by Simon Fraser.
+
+        <rdar://problem/7645609> [webView selectionRect] API is broken for multicolumn layout
+
+        Refine the fix for https://bugs.webkit.org/show_bug.cgi?id=34923 by using the center of
+        a quad’s bounding box, rather than its top left, as the reference point passed to
+        offsetFromContainer(). This ensures that if a sliver off the top of the selection rect is in
+        one column, but most of it is on another column, the single rect we return will be for the
+        second column.
+
+        * platform/graphics/FloatRect.h:
+        (WebCore::FloatRect::center): Added.
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::localToContainerQuad): Use the center instead of the top left.
+
 2010-02-15  MORITA Hajime  <morrita at gmail.com>
 
         Reviewed by Nikolas Zimmermann.
diff --git a/WebCore/platform/graphics/FloatRect.h b/WebCore/platform/graphics/FloatRect.h
index 74a6293..cb01d4f 100644
--- a/WebCore/platform/graphics/FloatRect.h
+++ b/WebCore/platform/graphics/FloatRect.h
@@ -99,6 +99,8 @@ public:
     float right() const { return x() + width(); }
     float bottom() const { return y() + height(); }
 
+    FloatPoint center() const { return IntPoint(x() + width() / 2, y() + height() / 2); }
+
     void move(const FloatSize& delta) { m_location += delta; } 
     void move(float dx, float dy) { m_location.move(dx, dy); } 
 
diff --git a/WebCore/rendering/RenderObject.cpp b/WebCore/rendering/RenderObject.cpp
index b99cd31..bc50c02 100644
--- a/WebCore/rendering/RenderObject.cpp
+++ b/WebCore/rendering/RenderObject.cpp
@@ -1823,7 +1823,9 @@ void RenderObject::getTransformFromContainer(const RenderObject* containerObject
 
 FloatQuad RenderObject::localToContainerQuad(const FloatQuad& localQuad, RenderBoxModelObject* repaintContainer, bool fixed) const
 {
-    TransformState transformState(TransformState::ApplyTransformDirection, localQuad.boundingBox().location(), &localQuad);
+    // Track the point at the center of the quad's bounding box. As mapLocalToContainer() calls offsetFromContainer(),
+    // it will use that point as the reference point to decide which column's transform to apply in multiple-column blocks.
+    TransformState transformState(TransformState::ApplyTransformDirection, localQuad.boundingBox().center(), &localQuad);
     mapLocalToContainer(repaintContainer, fixed, true, transformState);
     transformState.flatten();
     

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list