[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

mitz at apple.com mitz at apple.com
Thu Apr 8 00:27:59 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 33289316fc8e7a39a3d88ea2661f3c16bd4d115b
Author: mitz at apple.com <mitz at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Dec 8 17:37:11 2009 +0000

    WebCore: Fixed block selection gap repainting in table cells
    
    Reviewed by John Sullivan.
    
    Test: fast/repaint/block-selection-gap-in-table-cell.html
    
    This recently-introduced regression exposed the fact that
    RenderTableCell did not override offsetFromContainer() to adjust for
    the fact that table cells’ coordinates are relative to the table
    section, not the table row. With this fixed, RenderTableCell no longer
    needs to override mapLocalToContainer() and mapAbsoluteToLocalPoint(),
    since the base class implementations of those use offsetFromContainer().
    
    * rendering/RenderTableCell.cpp:
    (WebCore::RenderTableCell::offsetFromContainer):
    * rendering/RenderTableCell.h:
    
    LayoutTests: Added a test of block selection gap repainting in table cells
    
    Reviewed by John Sullivan.
    
    * fast/repaint/block-selection-gap-in-table-cell.html: Added.
    * platform/mac/fast/repaint/block-selection-gap-in-table-cell-expected.checksum: Added.
    * platform/mac/fast/repaint/block-selection-gap-in-table-cell-expected.png: Added.
    * platform/mac/fast/repaint/block-selection-gap-in-table-cell-expected.txt: Added.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51864 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index a13f14e..485d731 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,14 @@
+2009-12-08  Dan Bernstein  <mitz at apple.com>
+
+        Reviewed by John Sullivan.
+
+        Added a test of block selection gap repainting in table cells
+
+        * fast/repaint/block-selection-gap-in-table-cell.html: Added.
+        * platform/mac/fast/repaint/block-selection-gap-in-table-cell-expected.checksum: Added.
+        * platform/mac/fast/repaint/block-selection-gap-in-table-cell-expected.png: Added.
+        * platform/mac/fast/repaint/block-selection-gap-in-table-cell-expected.txt: Added.
+
 2009-12-08  Nikolas Zimmermann  <nzimmermann at rim.com>
 
         Rubber-stamped by Maciej Stachowiak.
diff --git a/LayoutTests/fast/repaint/block-selection-gap-in-table-cell.html b/LayoutTests/fast/repaint/block-selection-gap-in-table-cell.html
new file mode 100644
index 0000000..4231f33
--- /dev/null
+++ b/LayoutTests/fast/repaint/block-selection-gap-in-table-cell.html
@@ -0,0 +1,21 @@
+<head>
+    <style>
+        ::selection { background-color: red; }
+    </style>
+    <script src="resources/repaint.js" type="text/javascript" charset="utf-8"></script>
+    <script type="text/javascript" charset="utf-8">
+    function repaintTest()
+    {
+        sel.empty();
+    }
+    </script>
+</head>
+<body onload="runRepaintTest()">
+<table><tr><td style="width: 100px; height: 100px;"></td></tr><tr><td style="background-color: green;">&nbsp;<div id="target" style="display: inline-block; height: 100px; width: 10px;"></div></td></tr></table>
+<script>
+    var sel = getSelection();
+    var target = document.getElementById("target");
+
+    sel.setBaseAndExtent(target.previousSibling, 1, target.parentElement.parentElement, 1);
+    document.body.offsetTop;
+</script>
diff --git a/LayoutTests/platform/mac/fast/repaint/block-selection-gap-in-table-cell-expected.checksum b/LayoutTests/platform/mac/fast/repaint/block-selection-gap-in-table-cell-expected.checksum
new file mode 100644
index 0000000..66448e6
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/repaint/block-selection-gap-in-table-cell-expected.checksum
@@ -0,0 +1 @@
+6ef3699ce2a7ca22c9a2a7467d160d79
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/repaint/block-selection-gap-in-table-cell-expected.png b/LayoutTests/platform/mac/fast/repaint/block-selection-gap-in-table-cell-expected.png
new file mode 100644
index 0000000..663382b
Binary files /dev/null and b/LayoutTests/platform/mac/fast/repaint/block-selection-gap-in-table-cell-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/repaint/block-selection-gap-in-table-cell-expected.txt b/LayoutTests/platform/mac/fast/repaint/block-selection-gap-in-table-cell-expected.txt
new file mode 100644
index 0000000..3d601f4
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/repaint/block-selection-gap-in-table-cell-expected.txt
@@ -0,0 +1,14 @@
+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 784x584
+      RenderTable {TABLE} at (0,0) size 106x212
+        RenderTableSection {TBODY} at (0,0) size 106x212
+          RenderTableRow {TR} at (0,2) size 106x100
+            RenderTableCell {TD} at (2,51) size 102x2 [r=0 c=0 rs=1 cs=1]
+          RenderTableRow {TR} at (0,104) size 106x106
+            RenderTableCell {TD} at (2,104) size 102x106 [bgcolor=#008000] [r=1 c=0 rs=1 cs=1]
+              RenderText {#text} at (1,87) size 4x18
+                text run at (1,87) width 4: " "
+              RenderBlock {DIV} at (5,1) size 10x100
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 155639b..7787aff 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,22 @@
+2009-12-08  Dan Bernstein  <mitz at apple.com>
+
+        Reviewed by John Sullivan.
+
+        Fixed block selection gap repainting in table cells
+
+        Test: fast/repaint/block-selection-gap-in-table-cell.html
+
+        This recently-introduced regression exposed the fact that
+        RenderTableCell did not override offsetFromContainer() to adjust for
+        the fact that table cells’ coordinates are relative to the table
+        section, not the table row. With this fixed, RenderTableCell no longer
+        needs to override mapLocalToContainer() and mapAbsoluteToLocalPoint(),
+        since the base class implementations of those use offsetFromContainer().
+
+        * rendering/RenderTableCell.cpp:
+        (WebCore::RenderTableCell::offsetFromContainer):
+        * rendering/RenderTableCell.h:
+
 2009-12-08  Nikolas Zimmermann  <nzimmermann at rim.com>
 
         Not reviewed. Sane way to force a rebuild on all win slaves, according to Adam Roben.
diff --git a/WebCore/rendering/RenderTableCell.cpp b/WebCore/rendering/RenderTableCell.cpp
index 8dc9145..bbad605 100644
--- a/WebCore/rendering/RenderTableCell.cpp
+++ b/WebCore/rendering/RenderTableCell.cpp
@@ -154,6 +154,17 @@ void RenderTableCell::setOverrideSize(int size)
     RenderBlock::setOverrideSize(size);
 }
 
+IntSize RenderTableCell::offsetFromContainer(RenderObject* o) const
+{
+    ASSERT(o == container());
+
+    IntSize offset = RenderBlock::offsetFromContainer(o);
+    if (parent())
+        offset.expand(-parentBox()->x(), -parentBox()->y());
+
+    return offset;
+}
+
 IntRect RenderTableCell::clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer)
 {
     // If the table grid is dirty, we cannot get reliable information about adjoining cells,
@@ -217,30 +228,6 @@ void RenderTableCell::computeRectForRepaint(RenderBoxModelObject* repaintContain
     RenderBlock::computeRectForRepaint(repaintContainer, r, fixed);
 }
 
-void RenderTableCell::mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool fixed, bool useTransforms, TransformState& transformState) const
-{
-    if (repaintContainer == this)
-        return;
-
-    RenderView* v = view();
-    if ((!v || !v->layoutStateEnabled()) && parent()) {
-        // Rows are in the same coordinate space, so don't add their offset in.
-        // FIXME: this is wrong with transforms
-        transformState.move(-parentBox()->x(), -parentBox()->y());
-    }
-    RenderBlock::mapLocalToContainer(repaintContainer, fixed, useTransforms, transformState);
-}
-
-void RenderTableCell::mapAbsoluteToLocalPoint(bool fixed, bool useTransforms, TransformState& transformState) const
-{
-    RenderBlock::mapAbsoluteToLocalPoint(fixed, useTransforms, transformState);
-    if (parent()) {
-        // Rows are in the same coordinate space, so add their offset back in.
-        // FIXME: this is wrong with transforms
-        transformState.move(parentBox()->x(), parentBox()->y());
-    }
-}
-
 int RenderTableCell::baselinePosition(bool firstLine, bool isRootLineBox) const
 {
     if (isRootLineBox)
diff --git a/WebCore/rendering/RenderTableCell.h b/WebCore/rendering/RenderTableCell.h
index 8855dff..cf03eea 100644
--- a/WebCore/rendering/RenderTableCell.h
+++ b/WebCore/rendering/RenderTableCell.h
@@ -103,9 +103,6 @@ protected:
     virtual void styleWillChange(StyleDifference, const RenderStyle* newStyle);
     virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
 
-    virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool useTransforms, bool fixed, TransformState&) const;
-    virtual void mapAbsoluteToLocalPoint(bool fixed, bool useTransforms, TransformState&) const;
-
 private:
     virtual const char* renderName() const { return isAnonymous() ? "RenderTableCell (anonymous)" : "RenderTableCell"; }
 
@@ -120,6 +117,7 @@ private:
     virtual void paintBoxDecorations(PaintInfo&, int tx, int ty);
     virtual void paintMask(PaintInfo&, int tx, int ty);
 
+    virtual IntSize offsetFromContainer(RenderObject*) const;
     virtual IntRect clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer);
     virtual void computeRectForRepaint(RenderBoxModelObject* repaintContainer, IntRect&, bool fixed = false);
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list