<!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>[170646] 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/170646">170646</a></dd>
<dt>Author</dt> <dd>zalan@apple.com</dd>
<dt>Date</dt> <dd>2014-07-01 10:25:10 -0700 (Tue, 01 Jul 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Subpixel rendering: Pixel crack in breadcrumbs at devforums.apple.com.
https://bugs.webkit.org/show_bug.cgi?id=134491

Reviewed by Simon Fraser.

Do not early round geometry values, while computing background image position. It changes the final
subpixel values and that could lead to wrong snap positions.
pixelSnapBackgroundImageGeometryForPainting() takes care of geometry snapping.

Source/WebCore:
Test: fast/backgrounds/background-image-size-double-rounding.html

* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):

LayoutTests:
* fast/backgrounds/background-image-size-double-rounding-expected.html: Added.
* fast/backgrounds/background-image-size-double-rounding.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBoxModelObjectcpp">trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastbackgroundsbackgroundimagesizedoubleroundingexpectedhtml">trunk/LayoutTests/fast/backgrounds/background-image-size-double-rounding-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastbackgroundsbackgroundimagesizedoubleroundinghtml">trunk/LayoutTests/fast/backgrounds/background-image-size-double-rounding.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (170645 => 170646)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-07-01 17:14:35 UTC (rev 170645)
+++ trunk/LayoutTests/ChangeLog        2014-07-01 17:25:10 UTC (rev 170646)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2014-07-01  Zalan Bujtas  &lt;zalan@apple.com&gt;
+
+        Subpixel rendering: Pixel crack in breadcrumbs at devforums.apple.com.
+        https://bugs.webkit.org/show_bug.cgi?id=134491
+
+        Reviewed by Simon Fraser.
+
+        Do not early round geometry values, while computing background image position. It changes the final
+        subpixel values and that could lead to wrong snap positions.
+        pixelSnapBackgroundImageGeometryForPainting() takes care of geometry snapping.
+
+        * fast/backgrounds/background-image-size-double-rounding-expected.html: Added.
+        * fast/backgrounds/background-image-size-double-rounding.html: Added.
+
</ins><span class="cx"> 2014-06-30  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         All Indic text is rendered as boxes on iOS
</span></span></pre></div>
<a id="trunkLayoutTestsfastbackgroundsbackgroundimagesizedoubleroundingexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/backgrounds/background-image-size-double-rounding-expected.html (0 => 170646)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/backgrounds/background-image-size-double-rounding-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/backgrounds/background-image-size-double-rounding-expected.html        2014-07-01 17:25:10 UTC (rev 170646)
</span><span class="lines">@@ -0,0 +1,44 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;title&gt;This tests that background image size is rounded properly when no-repeat attribute is present.&lt;/title&gt;
+&lt;style&gt;
+  .outer {
+        position: absolute;
+    width: 10px;
+    height: 10px;
+        background-color: blue;
+  }
+
+  .inner {
+    height: 10px;
+    width: 10.5px;
+        background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACcAAAAaCAYAAAA0R0VGAAAAAXNSR0IArs4c6QAAAAlwSFlzAAAK6wAACusBgosNWgAAAq5pVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIgogICAgICAgICAgICB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iCiAgICAgICAgICAgIHhtbG5zOnRpZmY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vdGlmZi8xLjAvIj4KICAgICAgICAgPHhtcDpDcmVhdGVEYXRlPjIwMDgtMDktMjBUMTA6MTY6MjNaPC94bXA6Q3JlYXRlRGF0ZT4KICAgICAgICAgPHhtcDpDcmVhdG9yVG9vbD5BZG9iZSBGaXJld29ya3MgQ1MzPC94bXA6Q3JlYXRvclRvb2w+CiAgICAgICAgIDx4bXA6TW9kaWZ5RGF0ZT4yMDA4LTA5LTIwVDEzOjEyOjQ4WjwveG1wOk1vZGlmeURhdGU+CiAgICAgICAgIDxkYzpmb3JtYXQ+aW1hZ2UvcG5nPC9kYzpmb3JtYXQ+CiAgICAgICAgIDx0aWZmOk9yaWVudGF0aW9uPjE8L3RpZmY6T3JpZW50YXRpb24+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgqSlUo2AAAATUlEQVRIDe3SsQ3AMAwDQcf7j5o2dQx4hK9UnHoCxInP965/Db09tNetpVz9DjlyVaDmbI5cFag5myNXBWrO5shVgZqzOXJVoOZsrsodgj4DFBo/NegAAAAASUVORK5CYII=);
+  }
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;p id=&quot;container&quot;&gt;&lt;/p&gt;
+&lt;script&gt;
+  var container = document.getElementById(&quot;container&quot;);
+  adjustment = 0.1;
+  for (i = 0; i &lt; 20; ++i) {
+    adjustment += 0.1;
+    size = 8;
+    for (j = 0; j &lt; 20; ++j) {
+      size += 0.1;
+      var outer = document.createElement(&quot;div&quot;);
+      outer.className = &quot;outer&quot;;
+      outer.style.top = (20 * i + j * adjustment) + &quot;px&quot;;
+      outer.style.left = (20 * j + i * adjustment) + &quot;px&quot;;
+      
+      var inner = document.createElement(&quot;div&quot;);
+      inner.className = &quot;inner&quot;;
+      inner.style.width = size + &quot;px&quot;;
+      
+      outer.appendChild(inner);
+      container.appendChild(outer);
+    }
+  }
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastbackgroundsbackgroundimagesizedoubleroundinghtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/backgrounds/background-image-size-double-rounding.html (0 => 170646)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/backgrounds/background-image-size-double-rounding.html                                (rev 0)
+++ trunk/LayoutTests/fast/backgrounds/background-image-size-double-rounding.html        2014-07-01 17:25:10 UTC (rev 170646)
</span><span class="lines">@@ -0,0 +1,44 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;title&gt;This tests that background image size is rounded properly when no-repeat attribute is present.&lt;/title&gt;
+&lt;style&gt;
+  .outer {
+    position: absolute;
+    width: 10px;
+    height: 10px;
+        background-color: blue;
+  }
+
+  .inner {
+    height: 10px;
+    width: 10.5px;
+        background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACcAAAAaCAYAAAA0R0VGAAAAAXNSR0IArs4c6QAAAAlwSFlzAAAK6wAACusBgosNWgAAAq5pVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIgogICAgICAgICAgICB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iCiAgICAgICAgICAgIHhtbG5zOnRpZmY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vdGlmZi8xLjAvIj4KICAgICAgICAgPHhtcDpDcmVhdGVEYXRlPjIwMDgtMDktMjBUMTA6MTY6MjNaPC94bXA6Q3JlYXRlRGF0ZT4KICAgICAgICAgPHhtcDpDcmVhdG9yVG9vbD5BZG9iZSBGaXJld29ya3MgQ1MzPC94bXA6Q3JlYXRvclRvb2w+CiAgICAgICAgIDx4bXA6TW9kaWZ5RGF0ZT4yMDA4LTA5LTIwVDEzOjEyOjQ4WjwveG1wOk1vZGlmeURhdGU+CiAgICAgICAgIDxkYzpmb3JtYXQ+aW1hZ2UvcG5nPC9kYzpmb3JtYXQ+CiAgICAgICAgIDx0aWZmOk9yaWVudGF0aW9uPjE8L3RpZmY6T3JpZW50YXRpb24+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgqSlUo2AAAATUlEQVRIDe3SsQ3AMAwDQcf7j5o2dQx4hK9UnHoCxInP965/Db09tNetpVz9DjlyVaDmbI5cFag5myNXBWrO5shVgZqzOXJVoOZsrsodgj4DFBo/NegAAAAASUVORK5CYII=) no-repeat right;
+  }
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;p id=&quot;container&quot;&gt;&lt;/p&gt;
+&lt;script&gt;
+  var container = document.getElementById(&quot;container&quot;);
+  adjustment = 0.1;
+  for (i = 0; i &lt; 20; ++i) {
+    adjustment += 0.1;
+    size = 8;
+    for (j = 0; j &lt; 20; ++j) {
+      size += 0.1;
+      var outer = document.createElement(&quot;div&quot;);
+      outer.className = &quot;outer&quot;;
+      outer.style.top = (20 * i + j * adjustment) + &quot;px&quot;;
+      outer.style.left = (20 * j + i * adjustment) + &quot;px&quot;;
+      
+      var inner = document.createElement(&quot;div&quot;);
+      inner.className = &quot;inner&quot;;
+      inner.style.width = size + &quot;px&quot;;
+      
+      outer.appendChild(inner);
+      container.appendChild(outer);
+    }
+  }
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (170645 => 170646)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-07-01 17:14:35 UTC (rev 170645)
+++ trunk/Source/WebCore/ChangeLog        2014-07-01 17:25:10 UTC (rev 170646)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2014-07-01  Zalan Bujtas  &lt;zalan@apple.com&gt;
+
+        Subpixel rendering: Pixel crack in breadcrumbs at devforums.apple.com.
+        https://bugs.webkit.org/show_bug.cgi?id=134491
+
+        Reviewed by Simon Fraser.
+
+        Do not early round geometry values, while computing background image position. It changes the final
+        subpixel values and that could lead to wrong snap positions.
+        pixelSnapBackgroundImageGeometryForPainting() takes care of geometry snapping.
+
+        Test: fast/backgrounds/background-image-size-double-rounding.html
+
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
+
</ins><span class="cx"> 2014-07-01  Pratik Solanki  &lt;psolanki@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Create NSURLRequest lazily when USE(CFNETWORK) is enabled
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBoxModelObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp (170645 => 170646)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp        2014-07-01 17:14:35 UTC (rev 170645)
+++ trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp        2014-07-01 17:25:10 UTC (rev 170646)
</span><span class="lines">@@ -1149,7 +1149,7 @@
</span><span class="cx">     LayoutUnit availableWidth = positioningAreaSize.width() - geometry.tileSize().width();
</span><span class="cx">     LayoutUnit availableHeight = positioningAreaSize.height() - geometry.tileSize().height();
</span><span class="cx"> 
</span><del>-    LayoutUnit computedXPosition = minimumValueForLength(fillLayer-&gt;xPosition(), availableWidth, true);
</del><ins>+    LayoutUnit computedXPosition = minimumValueForLength(fillLayer-&gt;xPosition(), availableWidth, false);
</ins><span class="cx">     if (backgroundRepeatX == RoundFill &amp;&amp; positioningAreaSize.width() &gt; 0 &amp;&amp; fillTileSize.width() &gt; 0) {
</span><span class="cx">         int numTiles = std::max(1, roundToInt(positioningAreaSize.width() / fillTileSize.width()));
</span><span class="cx">         if (fillLayer-&gt;size().size.height().isAuto() &amp;&amp; backgroundRepeatY != RoundFill)
</span><span class="lines">@@ -1161,7 +1161,7 @@
</span><span class="cx">         geometry.setSpaceSize(LayoutSize());
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    LayoutUnit computedYPosition = minimumValueForLength(fillLayer-&gt;yPosition(), availableHeight, true);
</del><ins>+    LayoutUnit computedYPosition = minimumValueForLength(fillLayer-&gt;yPosition(), availableHeight, false);
</ins><span class="cx">     if (backgroundRepeatY == RoundFill &amp;&amp; positioningAreaSize.height() &gt; 0 &amp;&amp; fillTileSize.height() &gt; 0) {
</span><span class="cx">         int numTiles = std::max(1, roundToInt(positioningAreaSize.height() / fillTileSize.height()));
</span><span class="cx">         if (fillLayer-&gt;size().size.width().isAuto() &amp;&amp; backgroundRepeatX != RoundFill)
</span><span class="lines">@@ -1181,7 +1181,7 @@
</span><span class="cx">         LayoutUnit actualWidth = geometry.tileSize().width() + space;
</span><span class="cx"> 
</span><span class="cx">         if (space &gt;= 0) {
</span><del>-            computedXPosition = minimumValueForLength(Length(), availableWidth, true);
</del><ins>+            computedXPosition = minimumValueForLength(Length(), availableWidth, false);
</ins><span class="cx">             geometry.setSpaceSize(LayoutSize(space, 0));
</span><span class="cx">             geometry.setPhaseX(actualWidth ? actualWidth - fmodf((computedXPosition + left), actualWidth) : 0);
</span><span class="cx">         } else
</span><span class="lines">@@ -1201,7 +1201,7 @@
</span><span class="cx">         LayoutUnit actualHeight = geometry.tileSize().height() + space;
</span><span class="cx"> 
</span><span class="cx">         if (space &gt;= 0) {
</span><del>-            computedYPosition = minimumValueForLength(Length(), availableHeight, true);
</del><ins>+            computedYPosition = minimumValueForLength(Length(), availableHeight, false);
</ins><span class="cx">             geometry.setSpaceSize(LayoutSize(geometry.spaceSize().width(), space));
</span><span class="cx">             geometry.setPhaseY(actualHeight ? actualHeight - fmodf((computedYPosition + top), actualHeight) : 0);
</span><span class="cx">         } else
</span></span></pre>
</div>
</div>

</body>
</html>