<!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>[191590] 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/191590">191590</a></dd>
<dt>Author</dt> <dd>simon.fraser@apple.com</dd>
<dt>Date</dt> <dd>2015-10-26 11:39:05 -0700 (Mon, 26 Oct 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Implement 'round' and 'space' values for border-image
https://bugs.webkit.org/show_bug.cgi?id=14185
Reviewed by Tim Horton.
Source/WebCore:
Add support for "round" and "space" values for border-image-repeat.
Following "stretch" and "repeat", the code is added to Image::drawTiled().
For "round", we compute an integral number of copies of the image that fit,
and then adjust the tile scale.
For "space", we also compute an integral number N of copies that will fit,
and then divide the remaining space amongst N+1 gaps, adjusting the tiling
phase so that with an even number of images, a gap is centered.
Tests: fast/borders/border-image-round.html
fast/borders/border-image-space.html
* platform/graphics/Image.cpp:
(WebCore::Image::drawTiled):
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::drawPattern):
LayoutTests:
Ref tests that clip, leaving relevant parts of the images.
* fast/borders/border-image-round-expected.html: Added.
* fast/borders/border-image-round.html: Added.
* fast/borders/border-image-space-expected.html: Added.
* fast/borders/border-image-space.html: Added.
* fast/borders/resources/big-border-image-lines.png: Added.
* fast/borders/resources/big-border-image.png: 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="#trunkSourceWebCoreplatformgraphicsImagecpp">trunk/Source/WebCore/platform/graphics/Image.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgGraphicsContextCGcpp">trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastbordersborderimageroundexpectedhtml">trunk/LayoutTests/fast/borders/border-image-round-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastbordersborderimageroundhtml">trunk/LayoutTests/fast/borders/border-image-round.html</a></li>
<li><a href="#trunkLayoutTestsfastbordersborderimagespaceexpectedhtml">trunk/LayoutTests/fast/borders/border-image-space-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastbordersborderimagespacehtml">trunk/LayoutTests/fast/borders/border-image-space.html</a></li>
<li><a href="#trunkLayoutTestsfastbordersresourcesbigborderimagelinespng">trunk/LayoutTests/fast/borders/resources/big-border-image-lines.png</a></li>
<li><a href="#trunkLayoutTestsfastbordersresourcesbigborderimagepng">trunk/LayoutTests/fast/borders/resources/big-border-image.png</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (191589 => 191590)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-10-26 18:26:48 UTC (rev 191589)
+++ trunk/LayoutTests/ChangeLog        2015-10-26 18:39:05 UTC (rev 191590)
</span><span class="lines">@@ -1,5 +1,21 @@
</span><span class="cx"> 2015-10-26 Simon Fraser <simon.fraser@apple.com>
</span><span class="cx">
</span><ins>+ Implement 'round' and 'space' values for border-image
+ https://bugs.webkit.org/show_bug.cgi?id=14185
+
+ Reviewed by Tim Horton.
+
+ Ref tests that clip, leaving relevant parts of the images.
+
+ * fast/borders/border-image-round-expected.html: Added.
+ * fast/borders/border-image-round.html: Added.
+ * fast/borders/border-image-space-expected.html: Added.
+ * fast/borders/border-image-space.html: Added.
+ * fast/borders/resources/big-border-image-lines.png: Added.
+ * fast/borders/resources/big-border-image.png: Added.
+
+2015-10-26 Simon Fraser <simon.fraser@apple.com>
+
</ins><span class="cx"> Incorrect repeated background-size behavior in keyframes
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=150309
</span><span class="cx">
</span></span></pre></div>
<a id="trunkLayoutTestsfastbordersborderimageroundexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/borders/border-image-round-expected.html (0 => 191590)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/borders/border-image-round-expected.html         (rev 0)
+++ trunk/LayoutTests/fast/borders/border-image-round-expected.html        2015-10-26 18:39:05 UTC (rev 191590)
</span><span class="lines">@@ -0,0 +1,43 @@
</span><ins>+<html>
+<head>
+ <style>
+ div {
+ border-width: 50px 0 0 0;
+ margin: 10px;
+ width: 50px;
+ height: 50px;
+ box-sizing: border-box;
+ background-color: gray;
+ border-image: url('resources/big-border-image-lines.png') 30 70 60 40;
+ border-image-repeat: stretch;
+ }
+
+ .one {
+ width: 159px;
+ }
+
+ .two {
+ width: 239px;
+ }
+
+ .three {
+ width: 319px;
+ }
+
+ .vertical {
+ border-width: 0 50px 0 0;
+ width: 50px;
+ display: inline-block;
+ }
+ </style>
+</head>
+<body>
+ <div class="horizontal" style="width: 159px; -webkit-clip-path: inset(2px 120px 2px 6px);"></div>
+ <div class="horizontal" style="width: 239px; -webkit-clip-path: inset(2px 122px 2px 6px);"></div>
+ <div class="horizontal" style="width: 319px; -webkit-clip-path: inset(2px 220px 2px 6px);"></div>
+
+ <div class="vertical" style="height: 159px; -webkit-clip-path: inset(4px 2px 4px 2px);"></div>
+ <div class="vertical" style="height: 239px; -webkit-clip-path: inset(122px 2px 4px 2px);"></div>
+ <div class="vertical" style="height: 319px; -webkit-clip-path: inset(220px 2px 6px 2px);"></div>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastbordersborderimageroundhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/borders/border-image-round.html (0 => 191590)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/borders/border-image-round.html         (rev 0)
+++ trunk/LayoutTests/fast/borders/border-image-round.html        2015-10-26 18:39:05 UTC (rev 191590)
</span><span class="lines">@@ -0,0 +1,44 @@
</span><ins>+<html>
+<head>
+ <style>
+ div {
+ border-width: 50px 0 0 0;
+ margin: 10px;
+ width: 50px;
+ height: 50px;
+ box-sizing: border-box;
+ background-color: gray;
+ border-image: url('resources/big-border-image-lines.png') 30 70 60 40;
+ border-image-repeat: round;
+ }
+
+ .one {
+ width: 159px;
+ }
+
+ .two {
+ width: 239px;
+ }
+
+ .three {
+ width: 319px;
+ }
+
+ .vertical {
+ border-width: 0 50px 0 0;
+ width: 50px;
+ display: inline-block;
+ }
+ </style>
+</head>
+<body>
+ <!-- Clip to remove the black borders of the source image -->
+ <div class="horizontal" style="width: 159px; -webkit-clip-path: inset(2px 120px 2px 6px);"></div>
+ <div class="horizontal" style="width: 239px; -webkit-clip-path: inset(2px 122px 2px 6px);"></div>
+ <div class="horizontal" style="width: 319px; -webkit-clip-path: inset(2px 220px 2px 6px);"></div>
+
+ <div class="vertical" style="height: 159px; -webkit-clip-path: inset(4px 2px 4px 2px);"></div>
+ <div class="vertical" style="height: 239px; -webkit-clip-path: inset(122px 2px 4px 2px);"></div>
+ <div class="vertical" style="height: 319px; -webkit-clip-path: inset(220px 2px 6px 2px);"></div>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastbordersborderimagespaceexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/borders/border-image-space-expected.html (0 => 191590)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/borders/border-image-space-expected.html         (rev 0)
+++ trunk/LayoutTests/fast/borders/border-image-space-expected.html        2015-10-26 18:39:05 UTC (rev 191590)
</span><span class="lines">@@ -0,0 +1,41 @@
</span><ins>+<html>
+<head>
+ <style>
+ div {
+ border-width: 50px 0 0 0;
+ margin: 10px;
+ width: 50px;
+ height: 50px;
+ box-sizing: border-box;
+ background-color: gray;
+ }
+
+ .one {
+ width: 159px;
+ }
+
+ .two {
+ width: 239px;
+ }
+
+ .three {
+ width: 319px;
+ }
+
+ .vertical {
+ border-width: 0 50px 0 0;
+ width: 50px;
+ display: inline-block;
+ }
+ </style>
+</head>
+<body>
+ <div class="horizontal" style="width: 159px; -webkit-clip-path: inset(0 120px 0 0)"></div>
+ <div class="horizontal" style="width: 239px; -webkit-clip-path: inset(0 110px 0 110px)"></div>
+ <div class="horizontal" style="width: 319px; -webkit-clip-path: inset(0 200px 0 100px)"></div>
+
+ <div class="vertical" style="height: 159px; -webkit-clip-path: inset(0 0 130px 0)"></div>
+ <div class="vertical" style="height: 239px; -webkit-clip-path: inset(112px 0 112px 0)"></div>
+ <div class="vertical" style="height: 319px; -webkit-clip-path: inset(102px 0 206px 0)"></div>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastbordersborderimagespacehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/borders/border-image-space.html (0 => 191590)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/borders/border-image-space.html         (rev 0)
+++ trunk/LayoutTests/fast/borders/border-image-space.html        2015-10-26 18:39:05 UTC (rev 191590)
</span><span class="lines">@@ -0,0 +1,44 @@
</span><ins>+<html>
+<head>
+ <style>
+ div {
+ border-width: 50px 0 0 0;
+ margin: 10px;
+ width: 50px;
+ height: 50px;
+ box-sizing: border-box;
+ background-color: gray;
+ border-image: url('resources/big-border-image.png') 30 70 60 40;
+ border-image-repeat: space;
+ }
+
+ .one {
+ width: 159px;
+ }
+
+ .two {
+ width: 239px;
+ }
+
+ .three {
+ width: 319px;
+ }
+
+ .vertical {
+ border-width: 0 50px 0 0;
+ width: 50px;
+ display: inline-block;
+ }
+ </style>
+</head>
+<body>
+ <!-- Clip to reveal the gaps between the spaced imges -->
+ <div class="horizontal" style="width: 159px; -webkit-clip-path: inset(0 120px 0 0)"></div>
+ <div class="horizontal" style="width: 239px; -webkit-clip-path: inset(0 110px 0 110px)"></div>
+ <div class="horizontal" style="width: 319px; -webkit-clip-path: inset(0 200px 0 100px)"></div>
+
+ <div class="vertical" style="height: 159px; -webkit-clip-path: inset(0 0 130px 0)"></div>
+ <div class="vertical" style="height: 239px; -webkit-clip-path: inset(112px 0 112px 0)"></div>
+ <div class="vertical" style="height: 319px; -webkit-clip-path: inset(102px 0 206px 0)"></div>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastbordersresourcesbigborderimagelinespng"></a>
<div class="binary"><h4>Added: trunk/LayoutTests/fast/borders/resources/big-border-image-lines.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/LayoutTests/fast/borders/resources/big-border-image-lines.png
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkLayoutTestsfastbordersresourcesbigborderimagepng"></a>
<div class="binary"><h4>Added: trunk/LayoutTests/fast/borders/resources/big-border-image.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/LayoutTests/fast/borders/resources/big-border-image.png
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (191589 => 191590)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-10-26 18:26:48 UTC (rev 191589)
+++ trunk/Source/WebCore/ChangeLog        2015-10-26 18:39:05 UTC (rev 191590)
</span><span class="lines">@@ -1,5 +1,30 @@
</span><span class="cx"> 2015-10-26 Simon Fraser <simon.fraser@apple.com>
</span><span class="cx">
</span><ins>+ Implement 'round' and 'space' values for border-image
+ https://bugs.webkit.org/show_bug.cgi?id=14185
+
+ Reviewed by Tim Horton.
+
+ Add support for "round" and "space" values for border-image-repeat.
+ Following "stretch" and "repeat", the code is added to Image::drawTiled().
+
+ For "round", we compute an integral number of copies of the image that fit,
+ and then adjust the tile scale.
+
+ For "space", we also compute an integral number N of copies that will fit,
+ and then divide the remaining space amongst N+1 gaps, adjusting the tiling
+ phase so that with an even number of images, a gap is centered.
+
+ Tests: fast/borders/border-image-round.html
+ fast/borders/border-image-space.html
+
+ * platform/graphics/Image.cpp:
+ (WebCore::Image::drawTiled):
+ * platform/graphics/cg/GraphicsContextCG.cpp:
+ (WebCore::GraphicsContext::drawPattern):
+
+2015-10-26 Simon Fraser <simon.fraser@apple.com>
+
</ins><span class="cx"> Incorrect repeated background-size behavior in keyframes
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=150309
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsImagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/Image.cpp (191589 => 191590)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/Image.cpp        2015-10-26 18:26:48 UTC (rev 191589)
+++ trunk/Source/WebCore/platform/graphics/Image.cpp        2015-10-26 18:39:05 UTC (rev 191590)
</span><span class="lines">@@ -214,27 +214,73 @@
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- // FIXME: We do not support 'round' or 'space' yet. For now just map them to 'repeat'.
- if (hRule == RoundTile || hRule == SpaceTile)
- hRule = RepeatTile;
- if (vRule == RoundTile || vRule == SpaceTile)
- vRule = RepeatTile;
</del><ins>+ FloatSize tileScale = tileScaleFactor;
+ FloatSize spacing;
+
+ // FIXME: These rules follow CSS border-image rules, but they should not be down here in Image.
+ bool centerOnGapHorizonally = false;
+ bool centerOnGapVertically = false;
+ switch (hRule) {
+ case RoundTile: {
+ int numItems = std::max<int>(floorf(dstRect.width() / srcRect.width()), 1);
+ tileScale.setWidth(dstRect.width() / (srcRect.width() * numItems));
+ break;
+ }
+ case SpaceTile: {
+ int numItems = floorf(dstRect.width() / srcRect.width());
+ if (!numItems)
+ return;
+ spacing.setWidth((dstRect.width() - srcRect.width() * numItems) / (numItems + 1));
+ tileScale.setWidth(1);
+ centerOnGapHorizonally = !(numItems & 1);
+ break;
+ }
+ case StretchTile:
+ case RepeatTile:
+ break;
+ }
</ins><span class="cx">
</span><del>- AffineTransform patternTransform = AffineTransform().scaleNonUniform(tileScaleFactor.width(), tileScaleFactor.height());
</del><ins>+ switch (vRule) {
+ case RoundTile: {
+ int numItems = std::max<int>(floorf(dstRect.height() / srcRect.height()), 1);
+ tileScale.setHeight(dstRect.height() / (srcRect.height() * numItems));
+ break;
+ }
+ case SpaceTile: {
+ int numItems = floorf(dstRect.height() / srcRect.height());
+ if (!numItems)
+ return;
+ spacing.setHeight((dstRect.height() - srcRect.height() * numItems) / (numItems + 1));
+ tileScale.setHeight(1);
+ centerOnGapVertically = !(numItems & 1);
+ break;
+ }
+ case StretchTile:
+ case RepeatTile:
+ break;
+ }
</ins><span class="cx">
</span><ins>+ AffineTransform patternTransform = AffineTransform().scaleNonUniform(tileScale.width(), tileScale.height());
+
</ins><span class="cx"> // We want to construct the phase such that the pattern is centered (when stretch is not
</span><span class="cx"> // set for a particular rule).
</span><del>- float hPhase = tileScaleFactor.width() * srcRect.x();
- float vPhase = tileScaleFactor.height() * srcRect.y();
- float scaledTileWidth = tileScaleFactor.width() * srcRect.width();
- float scaledTileHeight = tileScaleFactor.height() * srcRect.height();
- if (hRule == Image::RepeatTile)
</del><ins>+ float hPhase = tileScale.width() * srcRect.x();
+ float vPhase = tileScale.height() * srcRect.y();
+ float scaledTileWidth = tileScale.width() * srcRect.width();
+ float scaledTileHeight = tileScale.height() * srcRect.height();
+
+ if (centerOnGapHorizonally)
+ hPhase -= spacing.width();
+ else if (hRule == Image::RepeatTile || hRule == Image::SpaceTile)
</ins><span class="cx"> hPhase -= (dstRect.width() - scaledTileWidth) / 2;
</span><del>- if (vRule == Image::RepeatTile)
- vPhase -= (dstRect.height() - scaledTileHeight) / 2;
</del><ins>+
+ if (centerOnGapVertically)
+ vPhase -= spacing.height();
+ else if (vRule == Image::RepeatTile || vRule == Image::SpaceTile)
+ vPhase -= (dstRect.height() - scaledTileHeight) / 2;
+
</ins><span class="cx"> FloatPoint patternPhase(dstRect.x() - hPhase, dstRect.y() - vPhase);
</span><del>-
- drawPattern(ctxt, srcRect, patternTransform, patternPhase, FloatSize(), styleColorSpace, op, dstRect);
</del><ins>+ drawPattern(ctxt, srcRect, patternTransform, patternPhase, spacing, styleColorSpace, op, dstRect);
</ins><span class="cx">
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> startAnimation(DoNotCatchUp);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgGraphicsContextCGcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp (191589 => 191590)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp        2015-10-26 18:26:48 UTC (rev 191589)
+++ trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp        2015-10-26 18:39:05 UTC (rev 191590)
</span><span class="lines">@@ -327,9 +327,11 @@
</span><span class="cx"> // fall back to the less efficient CGPattern-based mechanism.
</span><span class="cx"> float scaledTileWidth = tileRect.width() * narrowPrecisionToFloat(patternTransform.a());
</span><span class="cx"> float w = CGImageGetWidth(tileImage);
</span><del>- if (w == image.size().width() && h == image.size().height() && !spacing.width() && !spacing.height())
</del><ins>+ if (w == image.size().width() && h == image.size().height() && !spacing.width() && !spacing.height()) {
+ // FIXME: CG seems to snap the images to integral sizes. When we care (e.g. with border-image-repeat: round),
+ // we should tile all but the last, and stetch the last image to fit.
</ins><span class="cx"> CGContextDrawTiledImage(context, FloatRect(adjustedX, adjustedY, scaledTileWidth, scaledTileHeight), subImage.get());
</span><del>- else {
</del><ins>+ } else {
</ins><span class="cx"> static const CGPatternCallbacks patternCallbacks = { 0, drawPatternCallback, patternReleaseCallback };
</span><span class="cx"> CGAffineTransform matrix = CGAffineTransformMake(narrowPrecisionToCGFloat(patternTransform.a()), 0, 0, narrowPrecisionToCGFloat(patternTransform.d()), adjustedX, adjustedY);
</span><span class="cx"> matrix = CGAffineTransformConcat(matrix, CGContextGetCTM(context));
</span><span class="lines">@@ -358,7 +360,7 @@
</span><span class="cx"> CGContextSetPatternPhase(context, CGSizeZero);
</span><span class="cx">
</span><span class="cx"> CGContextSetFillColorWithColor(context, color.get());
</span><del>- CGContextFillRect(context, CGContextGetClipBoundingBox(context));
</del><ins>+ CGContextFillRect(context, CGContextGetClipBoundingBox(context)); // FIXME: we know the clip; we set it above.
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>