LayoutTests:
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 26 Mar 2007 23:46:55 +0000 (23:46 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 26 Mar 2007 23:46:55 +0000 (23:46 +0000)
        Reviewed and landed by Darin.

        - pixel test for http://bugs.webkit.org/show_bug.cgi?id=13194
          REGRESSION: Selection rects are wrong for images in search results from images.google.com

        * fast/replaced/selection-rect-in-table-cell-expected.checksum: Added.
        * fast/replaced/selection-rect-in-table-cell-expected.png: Added.
        * fast/replaced/selection-rect-in-table-cell-expected.txt: Added.
        * fast/replaced/selection-rect-in-table-cell.html: Added.

WebCore:

        Reviewed and landed by Darin.

        - fix http://bugs.webkit.org/show_bug.cgi?id=13194
          <rdar://problem/5087738>
          REGRESSION: Selection rects are wrong for images in search results from images.google.com

        Test: fast/replaced/selection-rect-in-table-cell.html

        * rendering/RenderReplaced.cpp:
        (WebCore::RenderReplaced::selectionRect):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@20499 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/replaced/selection-rect-in-table-cell-expected.checksum [new file with mode: 0644]
LayoutTests/fast/replaced/selection-rect-in-table-cell-expected.png [new file with mode: 0644]
LayoutTests/fast/replaced/selection-rect-in-table-cell-expected.txt [new file with mode: 0644]
LayoutTests/fast/replaced/selection-rect-in-table-cell.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/rendering/RenderReplaced.cpp

index 221f770bf1831182c881a863d0437d861cdee9c5..cd73b3e5c7551862fc425d5b3ee660958c696413 100644 (file)
@@ -1,3 +1,15 @@
+2007-03-26  Mitz Pettel  <mitz@webkit.org>
+
+        Reviewed and landed by Darin.
+
+        - pixel test for http://bugs.webkit.org/show_bug.cgi?id=13194
+          REGRESSION: Selection rects are wrong for images in search results from images.google.com
+
+        * fast/replaced/selection-rect-in-table-cell-expected.checksum: Added.
+        * fast/replaced/selection-rect-in-table-cell-expected.png: Added.
+        * fast/replaced/selection-rect-in-table-cell-expected.txt: Added.
+        * fast/replaced/selection-rect-in-table-cell.html: Added.
+
 2007-03-26  Antti Koivisto  <antti@apple.com>
 
         Reviewed by Adam.
diff --git a/LayoutTests/fast/replaced/selection-rect-in-table-cell-expected.checksum b/LayoutTests/fast/replaced/selection-rect-in-table-cell-expected.checksum
new file mode 100644 (file)
index 0000000..b11f86c
--- /dev/null
@@ -0,0 +1 @@
+d022929f7866f939ca166b73fd06131c
\ No newline at end of file
diff --git a/LayoutTests/fast/replaced/selection-rect-in-table-cell-expected.png b/LayoutTests/fast/replaced/selection-rect-in-table-cell-expected.png
new file mode 100644 (file)
index 0000000..9cd5529
Binary files /dev/null and b/LayoutTests/fast/replaced/selection-rect-in-table-cell-expected.png differ
diff --git a/LayoutTests/fast/replaced/selection-rect-in-table-cell-expected.txt b/LayoutTests/fast/replaced/selection-rect-in-table-cell-expected.txt
new file mode 100644 (file)
index 0000000..90268d4
--- /dev/null
@@ -0,0 +1,28 @@
+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
+      RenderBlock {P} at (0,0) size 784x36
+        RenderText {#text} at (0,0) size 53x18
+          text run at (0,0) width 53: "Test for "
+        RenderInline {I} at (0,0) size 757x36
+          RenderInline {A} at (0,0) size 301x18 [color=#0000EE]
+            RenderText {#text} at (53,0) size 301x18
+              text run at (53,0) width 301: "http://bugs.webkit.org/show_bug.cgi?id=13194"
+          RenderText {#text} at (354,0) size 757x36
+            text run at (354,0) width 4: " "
+            text run at (358,0) width 399: "REGRESSION: Selection rects are wrong for images in search"
+            text run at (0,18) width 202: "results from images.google.com"
+        RenderText {#text} at (202,18) size 4x18
+          text run at (202,18) width 4: "."
+      RenderBlock {P} at (0,52) size 784x18
+        RenderText {#text} at (0,0) size 718x18
+          text run at (0,0) width 718: "Tests highlighting of replaced objects in table cells with extra height. You should see a dark green box and no red."
+      RenderTable {TABLE} at (0,86) size 56x104
+        RenderTableSection {TBODY} at (0,0) size 56x104
+          RenderTableRow {TR} at (0,2) size 56x100
+            RenderTableCell {TD} at (2,26) size 52x52 [r=0 c=0 rs=1 cs=1]
+              RenderImage {IMG} at (1,1) size 50x50 [bgcolor=#FF0000]
+selection start: position 0 of child 0 {IMG} of child 0 {TD} of child 0 {TR} of child 1 {TBODY} of child 5 {TABLE} of child 1 {BODY} of child 0 {HTML} of document
+selection end:   position 1 of child 0 {IMG} of child 0 {TD} of child 0 {TR} of child 1 {TBODY} of child 5 {TABLE} of child 1 {BODY} of child 0 {HTML} of document
diff --git a/LayoutTests/fast/replaced/selection-rect-in-table-cell.html b/LayoutTests/fast/replaced/selection-rect-in-table-cell.html
new file mode 100644 (file)
index 0000000..2b476ad
--- /dev/null
@@ -0,0 +1,26 @@
+<html>
+<head>
+    <title></title>
+    <style>
+        ::selection { background: green; }
+    </style>
+</head>
+<body>
+    <p>
+        Test for <i><a href="http://bugs.webkit.org/show_bug.cgi?id=13194">http://bugs.webkit.org/show_bug.cgi?id=13194</a>
+        REGRESSION: Selection rects are wrong for images in search results from images.google.com</i>.
+    </p>
+    <p>
+        Tests highlighting of replaced objects in table cells with extra height. You should see a dark green box and no red.
+    </p>
+    <table>
+        <tr>
+            <td id="target" style="height: 100px;"><img width="50" height="50" style="background: red;"></td>
+        </tr>
+    </table>
+    <script>
+        var target = document.getElementById("target");
+        getSelection().setBaseAndExtent(target, 0, target, 1);
+    </script>
+</body>
+</html>
index aae958ac70e5b72e275ebf4cd98ad76639fbac8c..ddbff44ab851912cb6ef8252e225cf0a938034c0 100644 (file)
@@ -1,3 +1,16 @@
+2007-03-26  Mitz Pettel  <mitz@webkit.org>
+
+        Reviewed and landed by Darin.
+
+        - fix http://bugs.webkit.org/show_bug.cgi?id=13194
+          <rdar://problem/5087738>
+          REGRESSION: Selection rects are wrong for images in search results from images.google.com
+
+        Test: fast/replaced/selection-rect-in-table-cell.html
+
+        * rendering/RenderReplaced.cpp:
+        (WebCore::RenderReplaced::selectionRect):
+
 2007-03-26  Geoffrey Garen  <ggaren@apple.com>
 
         Removed now-stale #includes of <assert.h>.
index 3d7969a8bdeb9ca0209d064e0a337e0dd3ac9a31..1ac6cd7205e2fb71f4fd77715c4020b1a04d11b9 100644 (file)
@@ -165,7 +165,7 @@ IntRect RenderReplaced::selectionRect()
     int selectionRight = xPos() + width();
     
     int absx, absy;
-    cb->absolutePosition(absx, absy);
+    cb->absolutePositionForContent(absx, absy);
     if (cb->hasOverflowClip())
         cb->layer()->subtractScrollOffset(absx, absy);