<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[172008] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/172008">172008</a></dd>
<dt>Author</dt> <dd>zalan@apple.com</dd>
<dt>Date</dt> <dd>2014-08-04 15:01:04 -0700 (Mon, 04 Aug 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Subpixel rendering: InlineTextBox mistakenly rounds offset value before painting.
https://bugs.webkit.org/show_bug.cgi?id=135470

Reviewed by Simon Fraser.

This patch removes the premature paint offset adjustment for inlines. Premature snapping
could alter the final painting coordinates and push content to wrong positions.

This patch also enforces WebCore's pixel snapping strategy (round) on text painting.
It ensures that text positioning is in sync with other painting related operations including
clipping, box decorations etc. Underlying graphics libraries can take different directions on
text snapping, for example CG ceils text coordinates vertically (in horizontal context,
with the current settings). It can lead to undesired side effects.

Source/WebCore:
Test: fast/inline/hidpi-inline-selection-leaves-gap.html

* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paint):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects): wrong direction used at <a href="http://trac.webkit.org/projects/webkit/changeset/171896">r171896</a>.
* rendering/SimpleLineLayoutFunctions.cpp: we don't paint vertical content here.
(WebCore::SimpleLineLayout::paintFlow):

LayoutTests:
* fast/inline/hidpi-inline-selection-leaves-gap-expected.html: Added.
* fast/inline/hidpi-inline-selection-leaves-gap.html: Added.
* fast/multicol/newmulticol/multicol-clip-rounded-corners-expected.html:
* fast/multicol/newmulticol/multicol-clip-rounded-corners.html: pixels are distributed properly.
No need to have the special 122px shortened width for col2.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastmulticolnewmulticolmulticolcliproundedcornersexpectedhtml">trunk/LayoutTests/fast/multicol/newmulticol/multicol-clip-rounded-corners-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastmulticolnewmulticolmulticolcliproundedcornershtml">trunk/LayoutTests/fast/multicol/newmulticol/multicol-clip-rounded-corners.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingInlineTextBoxcpp">trunk/Source/WebCore/rendering/InlineTextBox.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayercpp">trunk/Source/WebCore/rendering/RenderLayer.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingSimpleLineLayoutFunctionscpp">trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastinlinehidpiinlineselectionleavesgapexpectedhtml">trunk/LayoutTests/fast/inline/hidpi-inline-selection-leaves-gap-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastinlinehidpiinlineselectionleavesgaphtml">trunk/LayoutTests/fast/inline/hidpi-inline-selection-leaves-gap.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (172007 => 172008)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-08-04 21:58:13 UTC (rev 172007)
+++ trunk/LayoutTests/ChangeLog        2014-08-04 22:01:04 UTC (rev 172008)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2014-08-04  Zalan Bujtas  &lt;zalan@apple.com&gt;
+
+        Subpixel rendering: InlineTextBox mistakenly rounds offset value before painting.
+        https://bugs.webkit.org/show_bug.cgi?id=135470
+
+        Reviewed by Simon Fraser.
+
+        This patch removes the premature paint offset adjustment for inlines. Premature snapping
+        could alter the final painting coordinates and push content to wrong positions.
+
+        This patch also enforces WebCore's pixel snapping strategy (round) on text painting.
+        It ensures that text positioning is in sync with other painting related operations including
+        clipping, box decorations etc. Underlying graphics libraries can take different directions on
+        text snapping, for example CG ceils text coordinates vertically (in horizontal context,
+        with the current settings). It can lead to undesired side effects.
+
+        * fast/inline/hidpi-inline-selection-leaves-gap-expected.html: Added.
+        * fast/inline/hidpi-inline-selection-leaves-gap.html: Added.
+        * fast/multicol/newmulticol/multicol-clip-rounded-corners-expected.html:
+        * fast/multicol/newmulticol/multicol-clip-rounded-corners.html: pixels are distributed properly.
+        No need to have the special 122px shortened width for col2.
+
</ins><span class="cx"> 2014-08-04  Chris Fleizach  &lt;cfleizach@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         AX: isWordEndMatch should allow for multiple word selections
</span></span></pre></div>
<a id="trunkLayoutTestsfastinlinehidpiinlineselectionleavesgapexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/inline/hidpi-inline-selection-leaves-gap-expected.html (0 => 172008)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/inline/hidpi-inline-selection-leaves-gap-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/inline/hidpi-inline-selection-leaves-gap-expected.html        2014-08-04 22:01:04 UTC (rev 172008)
</span><span class="lines">@@ -0,0 +1,25 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;title&gt;This tests that inline text selection on subpixel position does not leave gaps at the inline boundary.&lt;/title&gt;
+&lt;style&gt;
+  body {
+    margin: 0px;
+    font-family: &quot;Ahem&quot;;
+    color: rgba(255, 255, 255, 0);
+  }
+
+  .bckg {
+    background: rgba(255, 0, 0, 0.9);
+    font-size: 16px;
+ }
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;div id=container&gt;
+  &lt;div style=&quot;position: absolute; height: 16px; width: 0.5px; background-color: white;&quot;&gt;&lt;/div&gt; 
+  &lt;div class=bckg style=&quot;text-indent: 0.4px; margin-left: 0.1px;&quot;&gt;foo&lt;/div&gt;
+  &lt;div class=bckg&gt;&amp;nbsp&lt;/div&gt;
+&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastinlinehidpiinlineselectionleavesgaphtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/inline/hidpi-inline-selection-leaves-gap.html (0 => 172008)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/inline/hidpi-inline-selection-leaves-gap.html                                (rev 0)
+++ trunk/LayoutTests/fast/inline/hidpi-inline-selection-leaves-gap.html        2014-08-04 22:01:04 UTC (rev 172008)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;title&gt;This tests that inline text selection on subpixel position does not leave gaps at the inline boundary.&lt;/title&gt;
+&lt;style&gt;
+  ::selection {
+    background: rgba(255, 0, 0, 0.9);
+  }
+  
+  body {
+    margin: 0px;
+    font-family: &quot;Ahem&quot;;
+    color: rgba(255, 255, 255, 0);
+  }
+
+  div {
+    font-size: 16px;
+  }
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;div id=container&gt;
+  &lt;div style=&quot;text-indent: 0.4px; margin-left: 0.1px;&quot;&gt;foo&lt;/div&gt;
+  &lt;div&gt;&amp;nbsp&lt;/div&gt;&lt;br&gt;
+&lt;/div&gt;
+&lt;script&gt;
+  var range = document.createRange(); 
+  range.selectNode(document.getElementById(&quot;container&quot;)); 
+  window.getSelection().addRange(range);
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmulticolnewmulticolmulticolcliproundedcornersexpectedhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/multicol/newmulticol/multicol-clip-rounded-corners-expected.html (172007 => 172008)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/multicol/newmulticol/multicol-clip-rounded-corners-expected.html        2014-08-04 21:58:13 UTC (rev 172007)
+++ trunk/LayoutTests/fast/multicol/newmulticol/multicol-clip-rounded-corners-expected.html        2014-08-04 22:01:04 UTC (rev 172008)
</span><span class="lines">@@ -3,7 +3,7 @@
</span><span class="cx">     &lt;head&gt;
</span><span class="cx">         &lt;style&gt;
</span><span class="cx">             #multicol {
</span><del>-                width: 400px;
</del><ins>+                width: 401px;
</ins><span class="cx">                 height: 200px;
</span><span class="cx">                 border: 5px solid black; 
</span><span class="cx">                 border-radius: 10%;
</span><span class="lines">@@ -22,7 +22,6 @@
</span><span class="cx">             }
</span><span class="cx"> 
</span><span class="cx">             #col2 {
</span><del>-                width: 122px;
</del><span class="cx">                 margin-left: 16px;
</span><span class="cx">             }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsfastmulticolnewmulticolmulticolcliproundedcornershtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/multicol/newmulticol/multicol-clip-rounded-corners.html (172007 => 172008)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/multicol/newmulticol/multicol-clip-rounded-corners.html        2014-08-04 21:58:13 UTC (rev 172007)
+++ trunk/LayoutTests/fast/multicol/newmulticol/multicol-clip-rounded-corners.html        2014-08-04 22:01:04 UTC (rev 172008)
</span><span class="lines">@@ -4,7 +4,7 @@
</span><span class="cx">         &lt;style&gt;
</span><span class="cx">             #multicol {
</span><span class="cx">                 -webkit-column-width: 100px;
</span><del>-                width: 400px;
</del><ins>+                width: 401px;
</ins><span class="cx">                 height: 200px;
</span><span class="cx">                 border: 5px solid black; 
</span><span class="cx">                 border-radius: 10%;
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (172007 => 172008)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-08-04 21:58:13 UTC (rev 172007)
+++ trunk/Source/WebCore/ChangeLog        2014-08-04 22:01:04 UTC (rev 172008)
</span><span class="lines">@@ -1,3 +1,28 @@
</span><ins>+2014-08-04  Zalan Bujtas  &lt;zalan@apple.com&gt;
+
+        Subpixel rendering: InlineTextBox mistakenly rounds offset value before painting.
+        https://bugs.webkit.org/show_bug.cgi?id=135470
+
+        Reviewed by Simon Fraser.
+
+        This patch removes the premature paint offset adjustment for inlines. Premature snapping
+        could alter the final painting coordinates and push content to wrong positions.
+
+        This patch also enforces WebCore's pixel snapping strategy (round) on text painting.
+        It ensures that text positioning is in sync with other painting related operations including
+        clipping, box decorations etc. Underlying graphics libraries can take different directions on
+        text snapping, for example CG ceils text coordinates vertically (in horizontal context,
+        with the current settings). It can lead to undesired side effects.
+
+        Test: fast/inline/hidpi-inline-selection-leaves-gap.html
+
+        * rendering/InlineTextBox.cpp:
+        (WebCore::InlineTextBox::paint):
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::calculateClipRects): wrong direction used at r171896.
+        * rendering/SimpleLineLayoutFunctions.cpp: we don't paint vertical content here.
+        (WebCore::SimpleLineLayout::paintFlow):
+
</ins><span class="cx"> 2014-08-04  Jer Noble  &lt;jer.noble@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r171992, r171995, &amp; r172000.
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingInlineTextBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/InlineTextBox.cpp (172007 => 172008)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/InlineTextBox.cpp        2014-08-04 21:58:13 UTC (rev 172007)
+++ trunk/Source/WebCore/rendering/InlineTextBox.cpp        2014-08-04 22:01:04 UTC (rev 172008)
</span><span class="lines">@@ -506,7 +506,7 @@
</span><span class="cx">     LayoutUnit paintEnd = isHorizontal() ? paintInfo.rect.maxX() : paintInfo.rect.maxY();
</span><span class="cx">     LayoutUnit paintStart = isHorizontal() ? paintInfo.rect.x() : paintInfo.rect.y();
</span><span class="cx">     
</span><del>-    FloatPoint adjustedPaintOffset = roundedForPainting(paintOffset, renderer().document().deviceScaleFactor());
</del><ins>+    FloatPoint localPaintOffset(paintOffset);
</ins><span class="cx">     
</span><span class="cx">     if (logicalStart &gt;= paintEnd || logicalStart + logicalExtent &lt;= paintStart)
</span><span class="cx">         return;
</span><span class="lines">@@ -532,7 +532,7 @@
</span><span class="cx">             LayoutUnit widthOfVisibleText = renderer().width(m_start, m_truncation, textPos(), isFirstLine());
</span><span class="cx">             LayoutUnit widthOfHiddenText = m_logicalWidth - widthOfVisibleText;
</span><span class="cx">             LayoutSize truncationOffset(isLeftToRightDirection() ? widthOfHiddenText : -widthOfHiddenText, 0);
</span><del>-            adjustedPaintOffset.move(isHorizontal() ? truncationOffset : truncationOffset.transposedSize());
</del><ins>+            localPaintOffset.move(isHorizontal() ? truncationOffset : truncationOffset.transposedSize());
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -540,10 +540,10 @@
</span><span class="cx"> 
</span><span class="cx">     const RenderStyle&amp; lineStyle = this-&gt;lineStyle();
</span><span class="cx">     
</span><del>-    adjustedPaintOffset.move(0, lineStyle.isHorizontalWritingMode() ? 0 : -logicalHeight());
</del><ins>+    localPaintOffset.move(0, lineStyle.isHorizontalWritingMode() ? 0 : -logicalHeight());
</ins><span class="cx"> 
</span><span class="cx">     FloatPoint boxOrigin = locationIncludingFlipping();
</span><del>-    boxOrigin.move(adjustedPaintOffset.x(), adjustedPaintOffset.y());
</del><ins>+    boxOrigin.moveBy(localPaintOffset);
</ins><span class="cx">     FloatRect boxRect(boxOrigin, FloatSize(logicalWidth(), logicalHeight()));
</span><span class="cx"> 
</span><span class="cx">     RenderCombineText* combinedText = lineStyle.hasTextCombine() &amp;&amp; renderer().isCombineText() &amp;&amp; toRenderCombineText(renderer()).isCombined() ? &amp;toRenderCombineText(renderer()) : 0;
</span><span class="lines">@@ -566,12 +566,6 @@
</span><span class="cx"> 
</span><span class="cx">     // Set our font.
</span><span class="cx">     const Font&amp; font = fontToUse(lineStyle, renderer());
</span><del>-
-    FloatPoint textOrigin = FloatPoint(boxOrigin.x(), boxOrigin.y() + font.fontMetrics().ascent());
-
-    if (combinedText)
-        combinedText-&gt;adjustTextOrigin(textOrigin, boxRect);
-
</del><span class="cx">     // 1. Paint backgrounds behind text if needed. Examples of such backgrounds include selection
</span><span class="cx">     // and composition underlines.
</span><span class="cx">     if (paintInfo.phase != PaintPhaseSelection &amp;&amp; paintInfo.phase != PaintPhaseTextClip &amp;&amp; !isPrinting) {
</span><span class="lines">@@ -636,6 +630,15 @@
</span><span class="cx"> 
</span><span class="cx">     const ShadowData* textShadow = paintInfo.forceBlackText() ? 0 : lineStyle.textShadow();
</span><span class="cx"> 
</span><ins>+    FloatPoint textOrigin(boxOrigin.x(), boxOrigin.y() + font.fontMetrics().ascent());
+    if (combinedText)
+        combinedText-&gt;adjustTextOrigin(textOrigin, boxRect);
+
+    if (isHorizontal())
+        textOrigin.setY(roundToDevicePixel(LayoutUnit(textOrigin.y()), renderer().document().deviceScaleFactor()));
+    else
+        textOrigin.setX(roundToDevicePixel(LayoutUnit(textOrigin.x()), renderer().document().deviceScaleFactor()));
+
</ins><span class="cx">     TextPainter textPainter(*context, paintSelectedTextOnly, paintSelectedTextSeparately, font, sPos, ePos, length, emphasisMark, combinedText, textRun, boxRect, textOrigin, emphasisMarkOffset, textShadow, selectionShadow, isHorizontal(), textPaintStyle, selectionPaintStyle);
</span><span class="cx">     textPainter.paintText();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (172007 => 172008)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayer.cpp        2014-08-04 21:58:13 UTC (rev 172007)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp        2014-08-04 22:01:04 UTC (rev 172008)
</span><span class="lines">@@ -6691,7 +6691,7 @@
</span><span class="cx"> 
</span><span class="cx">     LayoutSize subpixelAccumulation = moveOffset - toLayoutSize(LayoutPoint(adjustedPaintOffset));
</span><span class="cx">     paintDirtyRect.move(moveOffset);
</span><del>-    paint(context, paintDirtyRect, subpixelAccumulation, paintBehavior, nullptr, paintFlags | PaintLayerTemporaryClipRects);
</del><ins>+    paint(context, paintDirtyRect, LayoutSize(-subpixelAccumulation.width(), -subpixelAccumulation.height()), paintBehavior, nullptr, paintFlags | PaintLayerTemporaryClipRects);
</ins><span class="cx">     region-&gt;restoreRegionObjectsOriginalStyle();
</span><span class="cx">     context-&gt;restore();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingSimpleLineLayoutFunctionscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp (172007 => 172008)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp        2014-08-04 21:58:13 UTC (rev 172007)
+++ trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp        2014-08-04 22:01:04 UTC (rev 172008)
</span><span class="lines">@@ -79,10 +79,8 @@
</span><span class="cx">     GraphicsContextStateSaver stateSaver(context, textPaintStyle.strokeWidth &gt; 0);
</span><span class="cx"> 
</span><span class="cx">     updateGraphicsContext(context, textPaintStyle);
</span><del>-    LayoutPoint adjustedPaintOffset = LayoutPoint(roundedForPainting(paintOffset, flow.document().deviceScaleFactor()));
-
</del><span class="cx">     LayoutRect paintRect = paintInfo.rect;
</span><del>-    paintRect.moveBy(-adjustedPaintOffset);
</del><ins>+    paintRect.moveBy(-paintOffset);
</ins><span class="cx"> 
</span><span class="cx">     auto resolver = runResolver(flow, layout);
</span><span class="cx">     auto range = resolver.rangeForRect(paintRect);
</span><span class="lines">@@ -92,9 +90,11 @@
</span><span class="cx">             continue;
</span><span class="cx">         TextRun textRun(run.text());
</span><span class="cx">         textRun.setTabSize(!style.collapseWhiteSpace(), style.tabSize());
</span><del>-        context.drawText(font, textRun, run.baseline() + adjustedPaintOffset);
</del><ins>+        FloatPoint textOrigin = run.baseline() + paintOffset;
+        textOrigin.setY(roundToDevicePixel(LayoutUnit(textOrigin.y()), flow.document().deviceScaleFactor()));
+        context.drawText(font, textRun, textOrigin);
</ins><span class="cx">         if (debugBordersEnabled)
</span><del>-            paintDebugBorders(context, run.rect(), adjustedPaintOffset);
</del><ins>+            paintDebugBorders(context, run.rect(), paintOffset);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>