Title: [137529] trunk
Revision
137529
Author
e...@chromium.org
Date
2012-12-12 15:53:52 -0800 (Wed, 12 Dec 2012)

Log Message

REGRESSION (Subpixel layout): Gray vertical lines appear when moving insertion point to right on Mac
https://bugs.webkit.org/show_bug.cgi?id=102402

Reviewed by Simon Fraser.

Source/WebCore: 

Round paintOffset in CaretBase::paintCaret to ensure that caret is painted at an integer pixel boundary.

Test: fast/sub-pixel/input-caret-on-subpixel-bound.html

* editing/FrameSelection.cpp:
(WebCore::CaretBase::paintCaret): Round paintOffset to ensure it is on a pixel boundary.

LayoutTests: 

Add test for caret painting in input field with a subpixel position and padding.

* fast/sub-pixel/input-caret-on-subpixel-bound-expected.html: Added.
* fast/sub-pixel/input-caret-on-subpixel-bound.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (137528 => 137529)


--- trunk/LayoutTests/ChangeLog	2012-12-12 23:43:19 UTC (rev 137528)
+++ trunk/LayoutTests/ChangeLog	2012-12-12 23:53:52 UTC (rev 137529)
@@ -1,3 +1,15 @@
+2012-12-11  Emil A Eklund  <e...@chromium.org>
+
+        REGRESSION (Subpixel layout): Gray vertical lines appear when moving insertion point to right on Mac
+        https://bugs.webkit.org/show_bug.cgi?id=102402
+
+        Reviewed by Simon Fraser.
+
+        Add test for caret painting in input field with a subpixel position and padding.
+
+        * fast/sub-pixel/input-caret-on-subpixel-bound-expected.html: Added.
+        * fast/sub-pixel/input-caret-on-subpixel-bound.html: Added.
+
 2012-12-12  Elliott Sprehn  <espr...@gmail.com>
 
         REGRESSION(137336): Generated run-ins are not placed correctly

Added: trunk/LayoutTests/fast/sub-pixel/input-caret-on-subpixel-bound-expected.html (0 => 137529)


--- trunk/LayoutTests/fast/sub-pixel/input-caret-on-subpixel-bound-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/sub-pixel/input-caret-on-subpixel-bound-expected.html	2012-12-12 23:53:52 UTC (rev 137529)
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <style>
+      body {
+          font-size: 13px;
+          font-family: sans-serif;
+      }
+      table {
+          padding: 2px 3px 3px 2px;
+      }
+      input {
+          padding: 6px 5px 5px 6px;
+      }
+    </style>
+  </head>
+  <body>
+    <fieldset>
+      <table>
+        <tr>
+          <td>
+            <input type="text" value=""/>
+          </td>
+        </tr>
+      </table>
+    </fieldset>
+    <script>
+        var el = document.getElementsByTagName('input')[0];
+        el.focus();
+    </script>
+  </body>
+</html>

Added: trunk/LayoutTests/fast/sub-pixel/input-caret-on-subpixel-bound.html (0 => 137529)


--- trunk/LayoutTests/fast/sub-pixel/input-caret-on-subpixel-bound.html	                        (rev 0)
+++ trunk/LayoutTests/fast/sub-pixel/input-caret-on-subpixel-bound.html	2012-12-12 23:53:52 UTC (rev 137529)
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <style>
+      body {
+          font-size: 13px;
+          font-family: sans-serif;
+      }
+      table {
+          padding: 2.59px;
+      }
+      input {
+          padding: 5.5px;
+      }
+    </style>
+  </head>
+  <body>
+    <fieldset>
+      <table>
+        <tr>
+          <td>
+            <input type="text" value="Caret"/>
+          </td>
+        </tr>
+      </table>
+    </fieldset>
+    <script>
+        
+        if (window.testRunner)
+            testRunner.waitUntilDone();
+
+        function test()
+        {
+            var el = document.getElementsByTagName('input')[0];
+            el.focus();
+            var step = function() {
+                var value = el.value;
+                if (value) {
+                    el.value = value.substr(0, value.length - 1);
+                    window.setTimeout(step, 10);
+                }
+                else if (window.testRunner)
+                    testRunner.notifyDone();
+            };
+            step();
+        }
+        
+        test();
+    </script>
+  </body>
+</html>

Modified: trunk/LayoutTests/platform/chromium/TestExpectations (137528 => 137529)


--- trunk/LayoutTests/platform/chromium/TestExpectations	2012-12-12 23:43:19 UTC (rev 137528)
+++ trunk/LayoutTests/platform/chromium/TestExpectations	2012-12-12 23:53:52 UTC (rev 137529)
@@ -4217,3 +4217,6 @@
 webkit.org/b/104848 [ Linux XP SnowLeopard Lion Release ] fast/frames/sandboxed-iframe-attribute-parsing.html [ Pass Failure ]
 webkit.org/b/104848 [ SnowLeopard Debug ] fast/frames/sandboxed-iframe-attribute-parsing.html [ Pass Failure ]
 webkit.org/b/104848 [ Release ] fast/frames/sandboxed-iframe-parsing-space-characters.html [ Pass Failure ]
+
+# Rebaseline required after https://bugs.webkit.org/show_bug.cgi?id=102402
+webkit.org/b/102402 fast/repaint/delete-into-nested-block.html [ ImageOnlyFailure Pass ]

Modified: trunk/Source/WebCore/ChangeLog (137528 => 137529)


--- trunk/Source/WebCore/ChangeLog	2012-12-12 23:43:19 UTC (rev 137528)
+++ trunk/Source/WebCore/ChangeLog	2012-12-12 23:53:52 UTC (rev 137529)
@@ -1,3 +1,17 @@
+2012-12-11  Emil A Eklund  <e...@chromium.org>
+
+        REGRESSION (Subpixel layout): Gray vertical lines appear when moving insertion point to right on Mac
+        https://bugs.webkit.org/show_bug.cgi?id=102402
+
+        Reviewed by Simon Fraser.
+
+        Round paintOffset in CaretBase::paintCaret to ensure that caret is painted at an integer pixel boundary.
+
+        Test: fast/sub-pixel/input-caret-on-subpixel-bound.html
+
+        * editing/FrameSelection.cpp:
+        (WebCore::CaretBase::paintCaret): Round paintOffset to ensure it is on a pixel boundary.
+
 2012-12-12  Elliott Sprehn  <espr...@gmail.com>
 
         REGRESSION(137336): Generated run-ins are not placed correctly

Modified: trunk/Source/WebCore/editing/FrameSelection.cpp (137528 => 137529)


--- trunk/Source/WebCore/editing/FrameSelection.cpp	2012-12-12 23:43:19 UTC (rev 137528)
+++ trunk/Source/WebCore/editing/FrameSelection.cpp	2012-12-12 23:53:52 UTC (rev 137529)
@@ -1436,7 +1436,7 @@
     RenderObject* renderer = caretRenderer(node);
     if (renderer && renderer->isBox())
         toRenderBox(renderer)->flipForWritingMode(drawingRect);
-    drawingRect.moveBy(paintOffset);
+    drawingRect.moveBy(roundedIntPoint(paintOffset));
     LayoutRect caret = intersection(drawingRect, clipRect);
     if (caret.isEmpty())
         return;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to