<!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>[193888] branches/safari-601.1.46-branch</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/193888">193888</a></dd>
<dt>Author</dt> <dd>simon.fraser@apple.com</dd>
<dt>Date</dt> <dd>2015-12-09 19:16:48 -0800 (Wed, 09 Dec 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/191590">r191590</a>. rdar://problem/23432368</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari601146branchLayoutTestsChangeLog">branches/safari-601.1.46-branch/LayoutTests/ChangeLog</a></li>
<li><a href="#branchessafari601146branchSourceWebCoreChangeLog">branches/safari-601.1.46-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari601146branchSourceWebCoreplatformgraphicsImagecpp">branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/Image.cpp</a></li>
<li><a href="#branchessafari601146branchSourceWebCoreplatformgraphicscgImageCGcpp">branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/cg/ImageCG.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#branchessafari601146branchLayoutTestsfastbordersborderimageroundexpectedhtml">branches/safari-601.1.46-branch/LayoutTests/fast/borders/border-image-round-expected.html</a></li>
<li><a href="#branchessafari601146branchLayoutTestsfastbordersborderimageroundhtml">branches/safari-601.1.46-branch/LayoutTests/fast/borders/border-image-round.html</a></li>
<li><a href="#branchessafari601146branchLayoutTestsfastbordersborderimagespaceexpectedhtml">branches/safari-601.1.46-branch/LayoutTests/fast/borders/border-image-space-expected.html</a></li>
<li><a href="#branchessafari601146branchLayoutTestsfastbordersborderimagespacehtml">branches/safari-601.1.46-branch/LayoutTests/fast/borders/border-image-space.html</a></li>
<li><a href="#branchessafari601146branchLayoutTestsfastbordersresourcesbigborderimagelinespng">branches/safari-601.1.46-branch/LayoutTests/fast/borders/resources/big-border-image-lines.png</a></li>
<li><a href="#branchessafari601146branchLayoutTestsfastbordersresourcesbigborderimagepng">branches/safari-601.1.46-branch/LayoutTests/fast/borders/resources/big-border-image.png</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari601146branchLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/LayoutTests/ChangeLog (193887 => 193888)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/LayoutTests/ChangeLog        2015-12-10 03:16:45 UTC (rev 193887)
+++ branches/safari-601.1.46-branch/LayoutTests/ChangeLog        2015-12-10 03:16:48 UTC (rev 193888)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2015-12-09  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
+        Merge r191590. rdar://problem/23432368
+
+    2015-10-26  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
+            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.
+
</ins><span class="cx"> 2015-12-09  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Merge r192639. rdar://problem/23814338
</span></span></pre></div>
<a id="branchessafari601146branchLayoutTestsfastbordersborderimageroundexpectedhtml"></a>
<div class="addfile"><h4>Added: branches/safari-601.1.46-branch/LayoutTests/fast/borders/border-image-round-expected.html (0 => 193888)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/LayoutTests/fast/borders/border-image-round-expected.html                                (rev 0)
+++ branches/safari-601.1.46-branch/LayoutTests/fast/borders/border-image-round-expected.html        2015-12-10 03:16:48 UTC (rev 193888)
</span><span class="lines">@@ -0,0 +1,43 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        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;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;div class=&quot;horizontal&quot; style=&quot;width: 159px; -webkit-clip-path: inset(2px 120px 2px 6px);&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;horizontal&quot; style=&quot;width: 239px; -webkit-clip-path: inset(2px 122px 2px 6px);&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;horizontal&quot; style=&quot;width: 319px; -webkit-clip-path: inset(2px 220px 2px 6px);&quot;&gt;&lt;/div&gt;
+
+    &lt;div class=&quot;vertical&quot; style=&quot;height: 159px; -webkit-clip-path: inset(4px 2px 4px 2px);&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;vertical&quot; style=&quot;height: 239px; -webkit-clip-path: inset(122px 2px 4px 2px);&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;vertical&quot; style=&quot;height: 319px; -webkit-clip-path: inset(220px 2px 6px 2px);&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="branchessafari601146branchLayoutTestsfastbordersborderimageroundhtml"></a>
<div class="addfile"><h4>Added: branches/safari-601.1.46-branch/LayoutTests/fast/borders/border-image-round.html (0 => 193888)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/LayoutTests/fast/borders/border-image-round.html                                (rev 0)
+++ branches/safari-601.1.46-branch/LayoutTests/fast/borders/border-image-round.html        2015-12-10 03:16:48 UTC (rev 193888)
</span><span class="lines">@@ -0,0 +1,44 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        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;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;!-- Clip to remove the black borders of the source image --&gt;
+    &lt;div class=&quot;horizontal&quot; style=&quot;width: 159px; -webkit-clip-path: inset(2px 120px 2px 6px);&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;horizontal&quot; style=&quot;width: 239px; -webkit-clip-path: inset(2px 122px 2px 6px);&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;horizontal&quot; style=&quot;width: 319px; -webkit-clip-path: inset(2px 220px 2px 6px);&quot;&gt;&lt;/div&gt;
+
+    &lt;div class=&quot;vertical&quot; style=&quot;height: 159px; -webkit-clip-path: inset(4px 2px 4px 2px);&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;vertical&quot; style=&quot;height: 239px; -webkit-clip-path: inset(122px 2px 4px 2px);&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;vertical&quot; style=&quot;height: 319px; -webkit-clip-path: inset(220px 2px 6px 2px);&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="branchessafari601146branchLayoutTestsfastbordersborderimagespaceexpectedhtml"></a>
<div class="addfile"><h4>Added: branches/safari-601.1.46-branch/LayoutTests/fast/borders/border-image-space-expected.html (0 => 193888)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/LayoutTests/fast/borders/border-image-space-expected.html                                (rev 0)
+++ branches/safari-601.1.46-branch/LayoutTests/fast/borders/border-image-space-expected.html        2015-12-10 03:16:48 UTC (rev 193888)
</span><span class="lines">@@ -0,0 +1,41 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        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;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;div class=&quot;horizontal&quot; style=&quot;width: 159px; -webkit-clip-path: inset(0 120px 0 0)&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;horizontal&quot; style=&quot;width: 239px; -webkit-clip-path: inset(0 110px 0 110px)&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;horizontal&quot; style=&quot;width: 319px; -webkit-clip-path: inset(0 200px 0 100px)&quot;&gt;&lt;/div&gt;
+
+    &lt;div class=&quot;vertical&quot; style=&quot;height: 159px; -webkit-clip-path: inset(0 0 130px 0)&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;vertical&quot; style=&quot;height: 239px; -webkit-clip-path: inset(112px 0 112px 0)&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;vertical&quot; style=&quot;height: 319px; -webkit-clip-path: inset(102px 0 206px 0)&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="branchessafari601146branchLayoutTestsfastbordersborderimagespacehtml"></a>
<div class="addfile"><h4>Added: branches/safari-601.1.46-branch/LayoutTests/fast/borders/border-image-space.html (0 => 193888)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/LayoutTests/fast/borders/border-image-space.html                                (rev 0)
+++ branches/safari-601.1.46-branch/LayoutTests/fast/borders/border-image-space.html        2015-12-10 03:16:48 UTC (rev 193888)
</span><span class="lines">@@ -0,0 +1,44 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        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;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;!-- Clip to reveal the gaps between the spaced imges --&gt;
+    &lt;div class=&quot;horizontal&quot; style=&quot;width: 159px; -webkit-clip-path: inset(0 120px 0 0)&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;horizontal&quot; style=&quot;width: 239px; -webkit-clip-path: inset(0 110px 0 110px)&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;horizontal&quot; style=&quot;width: 319px; -webkit-clip-path: inset(0 200px 0 100px)&quot;&gt;&lt;/div&gt;
+
+    &lt;div class=&quot;vertical&quot; style=&quot;height: 159px; -webkit-clip-path: inset(0 0 130px 0)&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;vertical&quot; style=&quot;height: 239px; -webkit-clip-path: inset(112px 0 112px 0)&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;vertical&quot; style=&quot;height: 319px; -webkit-clip-path: inset(102px 0 206px 0)&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="branchessafari601146branchLayoutTestsfastbordersresourcesbigborderimagelinespng"></a>
<div class="addfile"><h4>Added: branches/safari-601.1.46-branch/LayoutTests/fast/borders/resources/big-border-image-lines.png (0 => 193888)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/LayoutTests/fast/borders/resources/big-border-image-lines.png                                (rev 0)
+++ branches/safari-601.1.46-branch/LayoutTests/fast/borders/resources/big-border-image-lines.png        2015-12-10 03:16:48 UTC (rev 193888)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+\x89PNG
+
++IHDR\xBE\xB4*\xEF\x96\xFBgAMA\xB1\x8F \xFCa cHRMz&amp;\x80\x84\xFA\x80\xE8u0\xEA`:\x98p\x9C\xBAQ&lt;        pHYs  \x9A\x9C\xD5iTXtXML:com.adobe.xmp&lt;x:xmpmeta xmlns:x=&quot;adobe:ns:meta/&quot; x:xmptk=&quot;XMP Core 5.4.0&quot;&gt;
+   &lt;rdf:RDF xmlns:rdf=&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#&quot;&gt;
+      &lt;rdf:Description rdf:about=&quot;&quot;
+            xmlns:tiff=&quot;http://ns.adobe.com/tiff/1.0/&quot;&gt;
+         &lt;tiff:Compression&gt;5&lt;/tiff:Compression&gt;
+         &lt;tiff:Orientation&gt;1&lt;/tiff:Orientation&gt;
+         &lt;tiff:PhotometricInterpretation&gt;2&lt;/tiff:PhotometricInterpretation&gt;
+      &lt;/rdf:Description&gt;
+   &lt;/rdf:RDF&gt;
+&lt;/x:xmpmeta&gt;
+\x8BO\xB2hIDATx\xED\xDC1\xAAT\x85\xE1\xEF+\x803\xB0\x9C\x88(\x8EDk kA\x89(ND\xB0u\xC0&quot;IB`\xA7I\xB3ݞ\xF5\xA5\xC9\xE6䅽׿~.\xAF\xBA/\x8Fǫ'(#\xF0\xFC:\xEFˏw\xA6~\xFE\xEB\xDD]/\xDF+\xFE~/o\xEA}\xFA\xEC\x87\xF7\xFAO\xD7\xFF\xF0\xEF\xDF&gt;=}p}J8 \xFE\x8A\xA7\xFB        \xFF\xFE\x8E%&lt; \xFE\x8A\xA7\xFB        \xFF\xFE\x8E%&lt; \xFE\x8A\xA7\xFB        \xFF\xFE\x8E%&lt; \xFE\x8A\xA7\xFB        \xFF\xFE\x8E%&lt; \xFE\x8A\xA7\xFB        \xFF\xFE\x8E%&lt; \xFE\x8A\xA7\xFB        \xFF\xFE\x8E%&lt; \xFE\x8A\xA7\xFB        \xFF\xFE\x8E%&lt; \xFE\x8A\xA7\xFB        \xFF\xFE\x8E%&lt; \xFE\x8A\xA7\xFB        \xFF\xFE\x8E%&lt; \xFE\x8A\xA7\xFB        \xFF\xFE\x8E%&lt; \xFE\x8A\xA7\xFB        \xFF\xFE\x8E%&lt; \xFE\x8A\xA7\xFB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t;p\xF9U\xCF~\xF3\xF6\xC2/Z~\xE9\xF0y\xBF|\xFD\xE4\x98\xB9u;G\xAE&amp;@\
 xFCa\xE0\xD6\xED @\xFC=\xB8b\x98\xF1\x87\x81[\xB7\x83\xF1w\xF4\xE0\x8Aa\xC4n\xDD\xC4\xDFу+\x86        \xB8u;G\xAE&amp;@\xFCa\xE0\xD6\xED @\xFC=\xB8b\x98\xF1\x87\x81[\xB7\x83\xF1w\xF4\xE0\x8Aa\xC4n\xDD\xC4\xDFу+\x86        \xB8u;G\xAE&amp;@\xFCa\xE0\xD6\xED @\xFC=\xB8b\x98\xF1\x87\x81[\xB7\x83\xF1w\xF4\xE0\x8Aa\xC4n\xDD\xC4\xDFу+\x86        \xB8u;G\xAE&amp;@\xFCa\xE0\xD6\xED @\xFC=\xB8b\x98\xF1\x87\x81[\xB7\x83\xF1w\xF4\xE0\x8Aa\xC4n\xDD\xC4\xDFу+\x86        \xB8u;G\xAE&amp;@\xFCa\xE0\xD6\xED @\xFC=\xB8b\x98\xF1\x87\x81[\xB7\x83\xF1w\xF4\xE0\x8Aa\xC4n\xDD\xC4\xDFу+\x86        \xB8u;G\xAE&amp;@\xFCa\xE0\xD6\xED @\xFC=\xB8b\x98\xF1\x87\x81[\xB7\x83\xF1w\xF4\xE0\x8Aa\xC4n\xDD\xC4\xDFу+\x86        \xB8u;G\xAE&amp;@\xFCa\xE0\xD6\xED @\xFC=\xB8b\x98\xF1\x87\x81[\xB7\x83\xF1w\xF4\xE0\x8Aa\xC4n\xDD\xC4\xDFу+\x86        \xB8u;\xBCx&lt;\xAFv\x9C\xE2
+\xE6\xFC \xACO\x8B&gt;\xEA\xFD\xF2IEND\xAEB`\x82
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="branchessafari601146branchLayoutTestsfastbordersresourcesbigborderimagepng"></a>
<div class="addfile"><h4>Added: branches/safari-601.1.46-branch/LayoutTests/fast/borders/resources/big-border-image.png (0 => 193888)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/LayoutTests/fast/borders/resources/big-border-image.png                                (rev 0)
+++ branches/safari-601.1.46-branch/LayoutTests/fast/borders/resources/big-border-image.png        2015-12-10 03:16:48 UTC (rev 193888)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+\x89PNG
+
++IHDR\xBE\xB4*\xEF\x96\xFBsRGB\xAE\xCE\xE9        pHYs  \x9A\x9C&gt;iTXtXML:com.adobe.xmp&lt;x:xmpmeta xmlns:x=&quot;adobe:ns:meta/&quot; x:xmptk=&quot;XMP Core 5.4.0&quot;&gt;
+   &lt;rdf:RDF xmlns:rdf=&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#&quot;&gt;
+      &lt;rdf:Description rdf:about=&quot;&quot;
+            xmlns:tiff=&quot;http://ns.adobe.com/tiff/1.0/&quot;
+            xmlns:exif=&quot;http://ns.adobe.com/exif/1.0/&quot;&gt;
+         &lt;tiff:PhotometricInterpretation&gt;2&lt;/tiff:PhotometricInterpretation&gt;
+         &lt;tiff:Compression&gt;5&lt;/tiff:Compression&gt;
+         &lt;tiff:Orientation&gt;1&lt;/tiff:Orientation&gt;
+         &lt;exif:ColorSpace&gt;65535&lt;/exif:ColorSpace&gt;
+      &lt;/rdf:Description&gt;
+   &lt;/rdf:RDF&gt;
+&lt;/x:xmpmeta&gt;
+\xBF^\x88IDATx\xEDܱ\xADfD\xE1\xB7\x87.\x9A!\xC21Јc JC&quot;q\x8E        \xE9\x87gu\xF5m8\xCC\xCFm\xB8\x8F\xD7\xF7/\xAF/O\xFC\xF9\xE3ϧ~\xDE\x93\xFB\xF5\xB4\x9FO\xFF\xC6\xE2\x81o\x8AR\x9D\xD4\x88_/\xA0?!@\xFC\xBBҚ\xF1\xEB\xF4'\x88\x9F`WZ ~\xBD\x80\xFE\x84\xF1\xECJkįП ~\x82]iM\x80\xF8\xF5\xFA\xC4O\xB0+\xAD        \xBF^@B\x80\xF8        v\xA55\xE2\xD7 \xE8O?\xC1\xAE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P ~A]gN\xE0'v~3\xD5\xE4\xF75IEND\xAEB`\x82
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/ChangeLog (193887 => 193888)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/ChangeLog        2015-12-10 03:16:45 UTC (rev 193887)
+++ branches/safari-601.1.46-branch/Source/WebCore/ChangeLog        2015-12-10 03:16:48 UTC (rev 193888)
</span><span class="lines">@@ -1,5 +1,34 @@
</span><span class="cx"> 2015-12-09  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merge r191590. rdar://problem/23432368
+
+    2015-10-26  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
+            Implement 'round' and 'space' values for border-image
+            https://bugs.webkit.org/show_bug.cgi?id=14185
+
+            Reviewed by Tim Horton.
+        
+            Add support for &quot;round&quot; and &quot;space&quot; values for border-image-repeat.
+            Following &quot;stretch&quot; and &quot;repeat&quot;, the code is added to Image::drawTiled().
+        
+            For &quot;round&quot;, we compute an integral number of copies of the image that fit,
+            and then adjust the tile scale.
+        
+            For &quot;space&quot;, 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-12-09  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
</ins><span class="cx">         Merge r190914. rdar://problem/23432368
</span><span class="cx"> 
</span><span class="cx">     2015-10-12  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCoreplatformgraphicsImagecpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/Image.cpp (193887 => 193888)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/Image.cpp        2015-12-10 03:16:45 UTC (rev 193887)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/Image.cpp        2015-12-10 03:16:48 UTC (rev 193888)
</span><span class="lines">@@ -213,27 +213,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&lt;int&gt;(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 &amp; 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&lt;int&gt;(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 &amp; 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="branchessafari601146branchSourceWebCoreplatformgraphicscgImageCGcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/cg/ImageCG.cpp (193887 => 193888)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/cg/ImageCG.cpp        2015-12-10 03:16:45 UTC (rev 193887)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/cg/ImageCG.cpp        2015-12-10 03:16:48 UTC (rev 193888)
</span><span class="lines">@@ -137,9 +137,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 == size().width() &amp;&amp; h == size().height() &amp;&amp; !spacing.width() &amp;&amp; !spacing.height())
</del><ins>+    if (w == size().width() &amp;&amp; h == size().height() &amp;&amp; !spacing.width() &amp;&amp; !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></pre>
</div>
</div>

</body>
</html>