<!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>[190883] 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/190883">190883</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2015-10-12 12:51:11 -0700 (Mon, 12 Oct 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>REGRESSION(<a href="http://trac.webkit.org/projects/webkit/changeset/184895">r184895</a>): border-image should always slice the SVG image to nine pieces when drawing it in the container element
https://bugs.webkit.org/show_bug.cgi?id=149901
&lt;rdar://problem/21995596&gt;

Patch by Said Abou-Hallawa &lt;sabouhallawa@apple.com&gt; on 2015-10-12
Reviewed by Darin Adler.

Source/WebCore:

The nine-pieces algorithm should be applied to the border-image regardless
whether the image has an intrinsic size or not. It is not guaranteed to have
a meaningful border-image in all the cases of non-intrinsic size images. But
it should work as expected in most of the cases.

* rendering/RenderBoxModelObject.cpp:
* rendering/RenderBoxModelObject.h:
(WebCore::RenderBoxModelObject::calculateImageIntrinsicDimensions):
Revert the changes which were added to return whether the image has
intrinsic size or not.

(WebCore::RenderBoxModelObject::calculateFillTileSize):
(WebCore::RenderBoxModelObject::paintNinePieceImage):
Size of the image is now the return value of calculateImageIntrinsicDimensions().

* rendering/RenderListMarker.cpp:
(WebCore::RenderListMarker::updateContent):
* rendering/shapes/ShapeOutsideInfo.cpp:
(WebCore::ShapeOutsideInfo::createShapeForImage):
Size of the image is now the return value of calculateImageIntrinsicDimensions().

* rendering/style/NinePieceImage.cpp:
* rendering/style/NinePieceImage.h:
(WebCore::NinePieceImage::paint):
Delete the logic for the non-intrinsic case. Both intrinsic and non-intrinsic
cases will be treated the same.

(WebCore::NinePieceImage::computeNineRects):
(WebCore::NinePieceImage::computeSideTileScale):
(WebCore::NinePieceImage::computeMiddleTileScale):
(WebCore::NinePieceImage::computeTileScales):
(WebCore::NinePieceImage::computeIntrinsicRects): Deleted.
(WebCore::NinePieceImage::computeIntrinsicSideTileScale): Deleted.
(WebCore::NinePieceImage::computeIntrinsicMiddleTileScale): Deleted.
(WebCore::NinePieceImage::computeIntrinsicTileScales): Deleted.
Remove *Intrinsic* from the name of the functions.

(WebCore::NinePieceImage::computeNonIntrinsicRects): Deleted.
(WebCore::NinePieceImage::computeNonIntrinsicTileScales): Deleted.
Delete the *NonIntrinsic* functions.

LayoutTests:

* fast/borders/border-image-fill-no-intrinsic-size-expected.html:
* fast/borders/border-image-fill-no-intrinsic-size.html:
* fast/borders/resources/svg-border-100x100-relative.svg: Added.
* fast/borders/resources/svg-border-100x100-viewbox.svg: Added.
* fast/borders/resources/svg-border-140x140-intrinsic.svg:
New test cases for relative lengths border images were added. The relative
lengths can be specified by using percentage lengths or adding viewBox to
the root element.

One of the non-intrinsic image-borders must be removed from this test.
The SVG image in the expected file has to be scaled by (100 / 140), which
can be done. But run-webkit-tests found a very slight difference between
the actual and the result files.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastbordersborderimagefillnointrinsicsizeexpectedhtml">trunk/LayoutTests/fast/borders/border-image-fill-no-intrinsic-size-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastbordersborderimagefillnointrinsicsizehtml">trunk/LayoutTests/fast/borders/border-image-fill-no-intrinsic-size.html</a></li>
<li><a href="#trunkLayoutTestsfastbordersresourcessvgborder140x140intrinsicsvg">trunk/LayoutTests/fast/borders/resources/svg-border-140x140-intrinsic.svg</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBoxModelObjectcpp">trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBoxModelObjecth">trunk/Source/WebCore/rendering/RenderBoxModelObject.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderListMarkercpp">trunk/Source/WebCore/rendering/RenderListMarker.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingshapesShapeOutsideInfocpp">trunk/Source/WebCore/rendering/shapes/ShapeOutsideInfo.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleNinePieceImagecpp">trunk/Source/WebCore/rendering/style/NinePieceImage.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleNinePieceImageh">trunk/Source/WebCore/rendering/style/NinePieceImage.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastbordersresourcessvgborder100x100relativesvg">trunk/LayoutTests/fast/borders/resources/svg-border-100x100-relative.svg</a></li>
<li><a href="#trunkLayoutTestsfastbordersresourcessvgborder100x100viewboxsvg">trunk/LayoutTests/fast/borders/resources/svg-border-100x100-viewbox.svg</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (190882 => 190883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-10-12 19:44:52 UTC (rev 190882)
+++ trunk/LayoutTests/ChangeLog        2015-10-12 19:51:11 UTC (rev 190883)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2015-10-12  Said Abou-Hallawa  &lt;sabouhallawa@apple.com&gt;
+
+        REGRESSION(r184895): border-image should always slice the SVG image to nine pieces when drawing it in the container element
+        https://bugs.webkit.org/show_bug.cgi?id=149901
+        &lt;rdar://problem/21995596&gt;
+
+        Reviewed by Darin Adler.
+
+        * fast/borders/border-image-fill-no-intrinsic-size-expected.html:
+        * fast/borders/border-image-fill-no-intrinsic-size.html:
+        * fast/borders/resources/svg-border-100x100-relative.svg: Added.
+        * fast/borders/resources/svg-border-100x100-viewbox.svg: Added.
+        * fast/borders/resources/svg-border-140x140-intrinsic.svg:
+        New test cases for relative lengths border images were added. The relative
+        lengths can be specified by using percentage lengths or adding viewBox to
+        the root element.
+        
+        One of the non-intrinsic image-borders must be removed from this test.
+        The SVG image in the expected file has to be scaled by (100 / 140), which
+        can be done. But run-webkit-tests found a very slight difference between
+        the actual and the result files.        
+
</ins><span class="cx"> 2015-10-12  Brent Fulgham  &lt;bfulgham@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Win] Unreviewed gardening
</span></span></pre></div>
<a id="trunkLayoutTestsfastbordersborderimagefillnointrinsicsizeexpectedhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/borders/border-image-fill-no-intrinsic-size-expected.html (190882 => 190883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/borders/border-image-fill-no-intrinsic-size-expected.html        2015-10-12 19:44:52 UTC (rev 190882)
+++ trunk/LayoutTests/fast/borders/border-image-fill-no-intrinsic-size-expected.html        2015-10-12 19:51:11 UTC (rev 190883)
</span><span class="lines">@@ -4,13 +4,19 @@
</span><span class="cx">     .box {
</span><span class="cx">       height: 100px;
</span><span class="cx">       width: 100px;
</span><del>-      margin: 10px;
</del><span class="cx">       display: inline-block;
</span><span class="cx">       background-color: red;
</span><span class="cx">     }
</span><del>-    .border {
</del><ins>+    .border-20 {
</ins><span class="cx">       border: 20px solid;
</span><span class="cx">     }
</span><ins>+    .border-40 {
+      border: solid;
+      border-top: 0px;
+      border-right: 40px;
+      border-bottom: 40px;
+      border-left: 0px;      
+    }
</ins><span class="cx">     .no-border {
</span><span class="cx">       border: 0px none;
</span><span class="cx">     }
</span><span class="lines">@@ -20,6 +26,9 @@
</span><span class="cx">     .border-image-100-intrinsic-slice {
</span><span class="cx">        border-image: url('resources/svg-border-100x100-intrinsic.svg') 20 fill;
</span><span class="cx">     }
</span><ins>+    .border-image-140-intrinsic {
+       border-image: url('resources/svg-border-140x140-intrinsic.svg') 0 fill;
+    }
</ins><span class="cx">     .border-image-140-intrinsic-slice {
</span><span class="cx">        border-image: url('resources/svg-border-140x140-intrinsic.svg') 20 fill;
</span><span class="cx">     }
</span><span class="lines">@@ -27,12 +36,22 @@
</span><span class="cx"> &lt;/head&gt;
</span><span class="cx"> &lt;body&gt;
</span><span class="cx">   &lt;div class=&quot;box no-border border-image-100-intrinsic&quot;&gt;&lt;/div&gt;
</span><del>-  &lt;div class=&quot;box border    border-image-100-intrinsic&quot;&gt;&lt;/div&gt;
</del><ins>+  &lt;div class=&quot;box border-20 border-image-100-intrinsic&quot;&gt;&lt;/div&gt;
</ins><span class="cx">   &lt;div class=&quot;box no-border border-image-100-intrinsic-slice&quot;&gt;&lt;/div&gt;
</span><del>-  &lt;div class=&quot;box border    border-image-100-intrinsic-slice&quot;&gt;&lt;/div&gt;
</del><ins>+  &lt;div class=&quot;box border-20 border-image-100-intrinsic-slice&quot;&gt;&lt;/div&gt;
</ins><span class="cx">   &lt;br&gt;
</span><span class="cx">   &lt;div class=&quot;box no-border border-image-100-intrinsic&quot;&gt;&lt;/div&gt;
</span><del>-  &lt;div class=&quot;box border    border-image-100-intrinsic&quot;&gt;&lt;/div&gt;
</del><ins>+  &lt;div class=&quot;box border-20 border-image-100-intrinsic&quot;&gt;&lt;/div&gt;
+  &lt;div class=&quot;box no-border border-image-100-intrinsic-slice&quot;&gt;&lt;/div&gt;
+  &lt;div class=&quot;box border-20 border-image-140-intrinsic-slice&quot;&gt;&lt;/div&gt;
+  &lt;br&gt;
</ins><span class="cx">   &lt;div class=&quot;box no-border border-image-100-intrinsic&quot;&gt;&lt;/div&gt;
</span><del>-  &lt;div class=&quot;box border    border-image-140-intrinsic-slice&quot;&gt;&lt;/div&gt;
</del><ins>+  &lt;div class=&quot;box border-20 border-image-100-intrinsic&quot;&gt;&lt;/div&gt;
+  &lt;div class=&quot;box no-border border-image-100-intrinsic-slice&quot;&gt;&lt;/div&gt;
+  &lt;div class=&quot;box border-20 border-image-140-intrinsic-slice&quot;&gt;&lt;/div&gt;
+  &lt;br&gt;
+  &lt;div class=&quot;box no-border border-image-100-intrinsic&quot;&gt;&lt;/div&gt;
+  &lt;div class=&quot;box border-20&quot;&gt;&lt;/div&gt;
+  &lt;div class=&quot;box no-border border-image-100-intrinsic-slice&quot;&gt;&lt;/div&gt;
+  &lt;div class=&quot;box border-40 border-image-100-intrinsic&quot;&gt;&lt;/div&gt;
</ins><span class="cx"> &lt;/body&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsfastbordersborderimagefillnointrinsicsizehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/borders/border-image-fill-no-intrinsic-size.html (190882 => 190883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/borders/border-image-fill-no-intrinsic-size.html        2015-10-12 19:44:52 UTC (rev 190882)
+++ trunk/LayoutTests/fast/borders/border-image-fill-no-intrinsic-size.html        2015-10-12 19:51:11 UTC (rev 190883)
</span><span class="lines">@@ -4,11 +4,10 @@
</span><span class="cx">     .box {
</span><span class="cx">       height: 100px;
</span><span class="cx">       width: 100px;
</span><del>-      margin: 10px;
</del><span class="cx">       display: inline-block;
</span><span class="cx">       background-color: red;
</span><span class="cx">     }
</span><del>-    .border {
</del><ins>+    .border-20 {
</ins><span class="cx">       border: 20px solid;
</span><span class="cx">     }
</span><span class="cx">     .no-border {
</span><span class="lines">@@ -20,6 +19,18 @@
</span><span class="cx">     .border-image-100-intrinsic-slice {
</span><span class="cx">        border-image: url('resources/svg-border-100x100-intrinsic.svg') 20 fill;
</span><span class="cx">     }
</span><ins>+    .border-image-100-viewbox {
+       border-image: url('resources/svg-border-100x100-viewbox.svg') 0 fill;
+    }
+    .border-image-100-viewbox-slice {
+       border-image: url('resources/svg-border-100x100-viewbox.svg') 20 fill;
+    }
+    .border-image-100-relative {
+       border-image: url('resources/svg-border-100x100-relative.svg') 0 fill;
+    }
+    .border-image-100-relative-slice {
+       border-image: url('resources/svg-border-100x100-relative.svg') 20 fill;
+    }
</ins><span class="cx">     .border-image-no-intrinsic {
</span><span class="cx">        border-image: url('resources/svg-border-no-intrinsic.svg') 0 fill;
</span><span class="cx">     }
</span><span class="lines">@@ -30,12 +41,22 @@
</span><span class="cx"> &lt;/head&gt;
</span><span class="cx"> &lt;body&gt;
</span><span class="cx">   &lt;div class=&quot;box no-border border-image-100-intrinsic&quot;&gt;&lt;/div&gt;
</span><del>-  &lt;div class=&quot;box border    border-image-100-intrinsic&quot;&gt;&lt;/div&gt;
</del><ins>+  &lt;div class=&quot;box border-20 border-image-100-intrinsic&quot;&gt;&lt;/div&gt;
</ins><span class="cx">   &lt;div class=&quot;box no-border border-image-100-intrinsic-slice&quot;&gt;&lt;/div&gt;
</span><del>-  &lt;div class=&quot;box border    border-image-100-intrinsic-slice&quot;&gt;&lt;/div&gt;
</del><ins>+  &lt;div class=&quot;box border-20 border-image-100-intrinsic-slice&quot;&gt;&lt;/div&gt;
</ins><span class="cx">   &lt;br&gt;
</span><ins>+  &lt;div class=&quot;box no-border border-image-100-viewbox&quot;&gt;&lt;/div&gt;
+  &lt;div class=&quot;box border-20 border-image-100-viewbox&quot;&gt;&lt;/div&gt;
+  &lt;div class=&quot;box no-border border-image-100-viewbox-slice&quot;&gt;&lt;/div&gt;
+  &lt;div class=&quot;box border-20 border-image-100-viewbox-slice&quot;&gt;&lt;/div&gt;
+  &lt;br&gt;
+  &lt;div class=&quot;box no-border border-image-100-relative&quot;&gt;&lt;/div&gt;
+  &lt;div class=&quot;box border-20 border-image-100-relative&quot;&gt;&lt;/div&gt;
+  &lt;div class=&quot;box no-border border-image-100-relative-slice&quot;&gt;&lt;/div&gt;
+  &lt;div class=&quot;box border-20 border-image-100-relative-slice&quot;&gt;&lt;/div&gt;
+  &lt;br&gt;
</ins><span class="cx">   &lt;div class=&quot;box no-border border-image-no-intrinsic&quot;&gt;&lt;/div&gt;
</span><del>-  &lt;div class=&quot;box border    border-image-no-intrinsic&quot;&gt;&lt;/div&gt;
</del><ins>+  &lt;div class=&quot;box border-20&quot;&gt;&lt;/div&gt;
</ins><span class="cx">   &lt;div class=&quot;box no-border border-image-no-intrinsic-slice&quot;&gt;&lt;/div&gt;
</span><del>-  &lt;div class=&quot;box border    border-image-no-intrinsic-slice&quot;&gt;&lt;/div&gt;
</del><ins>+  &lt;div class=&quot;box border-20 border-image-no-intrinsic-slice&quot;&gt;&lt;/div&gt;
</ins><span class="cx"> &lt;/body&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsfastbordersresourcessvgborder100x100relativesvg"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/borders/resources/svg-border-100x100-relative.svg (0 => 190883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/borders/resources/svg-border-100x100-relative.svg                                (rev 0)
+++ trunk/LayoutTests/fast/borders/resources/svg-border-100x100-relative.svg        2015-10-12 19:51:11 UTC (rev 190883)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; version=&quot;1.1&quot;&gt;
+  &lt;rect width=&quot;100%&quot; height=&quot;100%&quot; fill=&quot;lime&quot;/&gt;
+  &lt;rect x=&quot;10%&quot; y=&quot;10%&quot; width=&quot;80%&quot; height=&quot;80%&quot; fill=&quot;none&quot; stroke=&quot;black&quot; stroke-width=&quot;4%&quot;/&gt;
+&lt;/svg&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsfastbordersresourcessvgborder100x100viewboxsvg"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/borders/resources/svg-border-100x100-viewbox.svg (0 => 190883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/borders/resources/svg-border-100x100-viewbox.svg                                (rev 0)
+++ trunk/LayoutTests/fast/borders/resources/svg-border-100x100-viewbox.svg        2015-10-12 19:51:11 UTC (rev 190883)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; version=&quot;1.1&quot; viewBox=&quot;0 0 100 100&quot;&gt;
+  &lt;rect width=&quot;100&quot; height=&quot;100&quot; fill=&quot;lime&quot;/&gt;
+  &lt;rect x=&quot;10&quot; y=&quot;10&quot; width=&quot;80&quot; height=&quot;80&quot; fill=&quot;none&quot; stroke=&quot;black&quot; stroke-width=&quot;4px&quot;/&gt;
+&lt;/svg&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsfastbordersresourcessvgborder140x140intrinsicsvg"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/borders/resources/svg-border-140x140-intrinsic.svg (190882 => 190883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/borders/resources/svg-border-140x140-intrinsic.svg        2015-10-12 19:44:52 UTC (rev 190882)
+++ trunk/LayoutTests/fast/borders/resources/svg-border-140x140-intrinsic.svg        2015-10-12 19:51:11 UTC (rev 190883)
</span><span class="lines">@@ -1,52 +1,4 @@
</span><del>-&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot; version=&quot;1.1&quot; width=&quot;140&quot; height=&quot;140&quot;&gt;
-  &lt;defs&gt;
-    &lt;g id=&quot;border-image&quot;&gt;
-      &lt;rect width=&quot;100&quot; height=&quot;100&quot; fill=&quot;lime&quot;/&gt;
-      &lt;rect x=&quot;10&quot; y=&quot;10&quot; width=&quot;80&quot; height=&quot;80&quot; fill=&quot;none&quot; stroke=&quot;black&quot; stroke-width=&quot;4px&quot;/&gt;
-    &lt;/g&gt;
-    &lt;clipPath id=&quot;top-left&quot;&gt;
-      &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;20&quot; height=&quot;20&quot;/&gt;
-    &lt;/clipPath&gt;
-    &lt;clipPath id=&quot;left&quot;&gt;
-      &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;20&quot; height=&quot;100&quot;/&gt;
-    &lt;/clipPath&gt;
-    &lt;clipPath id=&quot;bottom-left&quot;&gt;
-      &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;20&quot; height=&quot;20&quot;/&gt;
-    &lt;/clipPath&gt;
-    &lt;clipPath id=&quot;top-right&quot;&gt;
-      &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;20&quot; height=&quot;20&quot;/&gt;
-    &lt;/clipPath&gt;
-    &lt;clipPath id=&quot;right&quot;&gt;
-      &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;20&quot; height=&quot;100&quot;/&gt;
-    &lt;/clipPath&gt;
-    &lt;clipPath id=&quot;bottom-right&quot;&gt;
-      &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;20&quot; height=&quot;20&quot;/&gt;
-    &lt;/clipPath&gt;
-    &lt;clipPath id=&quot;top&quot;&gt;
-      &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;100&quot; height=&quot;20&quot;/&gt;
-    &lt;/clipPath&gt;
-    &lt;clipPath id=&quot;bottom&quot;&gt;
-      &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;100&quot; height=&quot;20&quot;/&gt;
-    &lt;/clipPath&gt;
-    &lt;clipPath id=&quot;middle&quot;&gt;
-      &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;100&quot; height=&quot;100&quot;/&gt;
-    &lt;/clipPath&gt;
-  &lt;/defs&gt;
-  
-  &lt;!-- draw left side --&gt;
-  &lt;use x=&quot;0&quot; y=&quot;0&quot; xlink:href=&quot;#border-image&quot; clip-path=&quot;url(#top-left)&quot;/&gt;
-  &lt;use x=&quot;0&quot; y=&quot;20&quot; xlink:href=&quot;#border-image&quot; clip-path=&quot;url(#left)&quot;/&gt;
-  &lt;use x=&quot;0&quot; y=&quot;120&quot; xlink:href=&quot;#border-image&quot; clip-path=&quot;url(#bottom-left)&quot;/&gt;
-  
-  &lt;!-- draw right side --&gt;
-  &lt;use x=&quot;120&quot; y=&quot;0&quot; xlink:href=&quot;#border-image&quot; clip-path=&quot;url(#top-right)&quot;/&gt;
-  &lt;use x=&quot;120&quot; y=&quot;20&quot; xlink:href=&quot;#border-image&quot; clip-path=&quot;url(#right)&quot;/&gt;
-  &lt;use x=&quot;120&quot; y=&quot;120&quot; xlink:href=&quot;#border-image&quot; clip-path=&quot;url(#bottom-right)&quot;/&gt;
-  
-  &lt;!-- draw top and bottom sides --&gt;
-  &lt;use x=&quot;20&quot; y=&quot;0&quot; xlink:href=&quot;#border-image&quot; clip-path=&quot;url(#top)&quot;/&gt;
-  &lt;use x=&quot;20&quot; y=&quot;120&quot; xlink:href=&quot;#border-image&quot; clip-path=&quot;url(#bottom)&quot;/&gt;
-  
-  &lt;!-- draw middle --&gt;
-  &lt;use x=&quot;20&quot; y=&quot;20&quot; xlink:href=&quot;#border-image&quot; clip-path=&quot;url(#middle)&quot;/&gt;
-&lt;/svg&gt;
</del><span class="cx">\ No newline at end of file
</span><ins>+&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; version=&quot;1.1&quot; width=&quot;140&quot; height=&quot;140&quot;&gt;
+  &lt;rect width=&quot;100%&quot; height=&quot;100%&quot; fill=&quot;lime&quot;/&gt;
+  &lt;rect x=&quot;10%&quot; y=&quot;10%&quot; width=&quot;80%&quot; height=&quot;80%&quot; fill=&quot;none&quot; stroke=&quot;black&quot; stroke-width=&quot;4%&quot;/&gt;
+&lt;/svg&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (190882 => 190883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-10-12 19:44:52 UTC (rev 190882)
+++ trunk/Source/WebCore/ChangeLog        2015-10-12 19:51:11 UTC (rev 190883)
</span><span class="lines">@@ -1,3 +1,52 @@
</span><ins>+2015-10-12  Said Abou-Hallawa  &lt;sabouhallawa@apple.com&gt;
+
+        REGRESSION(r184895): border-image should always slice the SVG image to nine pieces when drawing it in the container element
+        https://bugs.webkit.org/show_bug.cgi?id=149901
+        &lt;rdar://problem/21995596&gt;
+
+        Reviewed by Darin Adler.
+
+        The nine-pieces algorithm should be applied to the border-image regardless
+        whether the image has an intrinsic size or not. It is not guaranteed to have
+        a meaningful border-image in all the cases of non-intrinsic size images. But
+        it should work as expected in most of the cases. 
+
+        * rendering/RenderBoxModelObject.cpp:
+        * rendering/RenderBoxModelObject.h:
+        (WebCore::RenderBoxModelObject::calculateImageIntrinsicDimensions):
+        Revert the changes which were added to return whether the image has
+        intrinsic size or not.
+        
+        (WebCore::RenderBoxModelObject::calculateFillTileSize):
+        (WebCore::RenderBoxModelObject::paintNinePieceImage):
+        Size of the image is now the return value of calculateImageIntrinsicDimensions().
+        
+        * rendering/RenderListMarker.cpp:
+        (WebCore::RenderListMarker::updateContent):
+        * rendering/shapes/ShapeOutsideInfo.cpp:
+        (WebCore::ShapeOutsideInfo::createShapeForImage):
+        Size of the image is now the return value of calculateImageIntrinsicDimensions().
+        
+        * rendering/style/NinePieceImage.cpp:
+        * rendering/style/NinePieceImage.h:
+        (WebCore::NinePieceImage::paint):
+        Delete the logic for the non-intrinsic case. Both intrinsic and non-intrinsic
+        cases will be treated the same.
+
+        (WebCore::NinePieceImage::computeNineRects):
+        (WebCore::NinePieceImage::computeSideTileScale):
+        (WebCore::NinePieceImage::computeMiddleTileScale):
+        (WebCore::NinePieceImage::computeTileScales):
+        (WebCore::NinePieceImage::computeIntrinsicRects): Deleted.
+        (WebCore::NinePieceImage::computeIntrinsicSideTileScale): Deleted.
+        (WebCore::NinePieceImage::computeIntrinsicMiddleTileScale): Deleted.
+        (WebCore::NinePieceImage::computeIntrinsicTileScales): Deleted.
+        Remove *Intrinsic* from the name of the functions.
+
+        (WebCore::NinePieceImage::computeNonIntrinsicRects): Deleted.
+        (WebCore::NinePieceImage::computeNonIntrinsicTileScales): Deleted.
+        Delete the *NonIntrinsic* functions.
+
</ins><span class="cx"> 2015-10-12  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Clip-path transitions sometimes trigger endless animation timers
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBoxModelObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp (190882 => 190883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp        2015-10-12 19:44:52 UTC (rev 190882)
+++ trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp        2015-10-12 19:51:11 UTC (rev 190883)
</span><span class="lines">@@ -897,13 +897,11 @@
</span><span class="cx">     return LayoutSize(size.width(), solutionHeight);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool RenderBoxModelObject::calculateImageIntrinsicDimensions(StyleImage* image, const LayoutSize&amp; positioningAreaSize, ScaleByEffectiveZoomOrNot shouldScaleOrNot, LayoutSize&amp; imageSize) const
</del><ins>+LayoutSize RenderBoxModelObject::calculateImageIntrinsicDimensions(StyleImage* image, const LayoutSize&amp; positioningAreaSize, ScaleByEffectiveZoomOrNot shouldScaleOrNot) const
</ins><span class="cx"> {
</span><span class="cx">     // A generated image without a fixed size, will always return the container size as intrinsic size.
</span><del>-    if (image-&gt;isGeneratedImage() &amp;&amp; image-&gt;usesImageContainerSize()) {
-        imageSize = LayoutSize(positioningAreaSize.width(), positioningAreaSize.height());
-        return true;
-    }
</del><ins>+    if (image-&gt;isGeneratedImage() &amp;&amp; image-&gt;usesImageContainerSize())
+        return LayoutSize(positioningAreaSize.width(), positioningAreaSize.height());
</ins><span class="cx"> 
</span><span class="cx">     Length intrinsicWidth;
</span><span class="cx">     Length intrinsicHeight;
</span><span class="lines">@@ -913,36 +911,29 @@
</span><span class="cx">     ASSERT(!intrinsicWidth.isPercentOrCalculated());
</span><span class="cx">     ASSERT(!intrinsicHeight.isPercentOrCalculated());
</span><span class="cx"> 
</span><del>-    imageSize = LayoutSize(intrinsicWidth.value(), intrinsicHeight.value());
-    LayoutSize minimumSize(imageSize.width() &gt; 0 ? 1 : 0, imageSize.height() &gt; 0 ? 1 : 0);
</del><ins>+    LayoutSize resolvedSize(intrinsicWidth.value(), intrinsicHeight.value());
+    LayoutSize minimumSize(resolvedSize.width() &gt; 0 ? 1 : 0, resolvedSize.height() &gt; 0 ? 1 : 0);
+
</ins><span class="cx">     if (shouldScaleOrNot == ScaleByEffectiveZoom)
</span><del>-        imageSize.scale(style().effectiveZoom());
-    imageSize.clampToMinimumSize(minimumSize);
</del><ins>+        resolvedSize.scale(style().effectiveZoom());
+    resolvedSize.clampToMinimumSize(minimumSize);
</ins><span class="cx"> 
</span><del>-    if (!imageSize.isEmpty())
-        return true;
-
</del><span class="cx">     // If the image has one of either an intrinsic width or an intrinsic height:
</span><span class="cx">     // * and an intrinsic aspect ratio, then the missing dimension is calculated from the given dimension and the ratio.
</span><span class="cx">     // * and no intrinsic aspect ratio, then the missing dimension is assumed to be the size of the rectangle that
</span><span class="cx">     //   establishes the coordinate system for the 'background-position' property.
</span><del>-    if (imageSize.width() &gt; 0 || imageSize.height() &gt; 0) {
-        imageSize = resolveAgainstIntrinsicWidthOrHeightAndRatio(positioningAreaSize, intrinsicRatio, imageSize.width(), imageSize.height());
-        return true;
-    }
</del><ins>+    if (resolvedSize.width() &gt; 0 || resolvedSize.height() &gt; 0)
+        return resolveAgainstIntrinsicWidthOrHeightAndRatio(positioningAreaSize, intrinsicRatio, resolvedSize.width(), resolvedSize.height());
</ins><span class="cx"> 
</span><span class="cx">     // If the image has no intrinsic dimensions and has an intrinsic ratio the dimensions must be assumed to be the
</span><span class="cx">     // largest dimensions at that ratio such that neither dimension exceeds the dimensions of the rectangle that
</span><span class="cx">     // establishes the coordinate system for the 'background-position' property.
</span><del>-    if (!intrinsicRatio.isEmpty()) {
-        imageSize = resolveAgainstIntrinsicRatio(positioningAreaSize, intrinsicRatio);
-        return false;
-    }
</del><ins>+    if (!intrinsicRatio.isEmpty())
+        return resolveAgainstIntrinsicRatio(positioningAreaSize, intrinsicRatio);
</ins><span class="cx"> 
</span><span class="cx">     // If the image has no intrinsic ratio either, then the dimensions must be assumed to be the rectangle that
</span><span class="cx">     // establishes the coordinate system for the 'background-position' property.
</span><del>-    imageSize = positioningAreaSize;
-    return false;
</del><ins>+    return positioningAreaSize;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> LayoutSize RenderBoxModelObject::calculateFillTileSize(const FillLayer&amp; fillLayer, const LayoutSize&amp; positioningAreaSize) const
</span><span class="lines">@@ -952,7 +943,7 @@
</span><span class="cx"> 
</span><span class="cx">     LayoutSize imageIntrinsicSize;
</span><span class="cx">     if (image) {
</span><del>-        calculateImageIntrinsicDimensions(image, positioningAreaSize, ScaleByEffectiveZoom, imageIntrinsicSize);
</del><ins>+        imageIntrinsicSize = calculateImageIntrinsicDimensions(image, positioningAreaSize, ScaleByEffectiveZoom);
</ins><span class="cx">         imageIntrinsicSize.scale(1 / image-&gt;imageScaleFactor(), 1 / image-&gt;imageScaleFactor());
</span><span class="cx">     } else
</span><span class="cx">         imageIntrinsicSize = positioningAreaSize;
</span><span class="lines">@@ -1263,13 +1254,12 @@
</span><span class="cx">     rectWithOutsets.expand(style.imageOutsets(ninePieceImage));
</span><span class="cx">     LayoutRect destination = LayoutRect(snapRectToDevicePixels(rectWithOutsets, deviceScaleFactor));
</span><span class="cx"> 
</span><del>-    LayoutSize source;
-    bool intrinsicSource = calculateImageIntrinsicDimensions(styleImage, destination.size(), DoNotScaleByEffectiveZoom, source);
</del><ins>+    LayoutSize source = calculateImageIntrinsicDimensions(styleImage, destination.size(), DoNotScaleByEffectiveZoom);
</ins><span class="cx"> 
</span><span class="cx">     // If both values are ‘auto’ then the intrinsic width and/or height of the image should be used, if any.
</span><span class="cx">     styleImage-&gt;setContainerSizeForRenderer(this, source, style.effectiveZoom());
</span><span class="cx"> 
</span><del>-    ninePieceImage.paint(graphicsContext, this, style, destination, source, intrinsicSource, deviceScaleFactor, op);
</del><ins>+    ninePieceImage.paint(graphicsContext, this, style, destination, source, deviceScaleFactor, op);
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBoxModelObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBoxModelObject.h (190882 => 190883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBoxModelObject.h        2015-10-12 19:44:52 UTC (rev 190882)
+++ trunk/Source/WebCore/rendering/RenderBoxModelObject.h        2015-10-12 19:51:11 UTC (rev 190883)
</span><span class="lines">@@ -293,7 +293,7 @@
</span><span class="cx">     void moveChildrenTo(RenderBoxModelObject* toBoxModelObject, RenderObject* startChild, RenderObject* endChild, RenderObject* beforeChild, bool fullRemoveInsert = false);
</span><span class="cx"> 
</span><span class="cx">     enum ScaleByEffectiveZoomOrNot { ScaleByEffectiveZoom, DoNotScaleByEffectiveZoom };
</span><del>-    bool calculateImageIntrinsicDimensions(StyleImage*, const LayoutSize&amp; scaledPositioningAreaSize, ScaleByEffectiveZoomOrNot, LayoutSize&amp; imageSize) const;
</del><ins>+    LayoutSize calculateImageIntrinsicDimensions(StyleImage*, const LayoutSize&amp; scaledPositioningAreaSize, ScaleByEffectiveZoomOrNot) const;
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     LayoutUnit computedCSSPadding(const Length&amp;) const;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderListMarkercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderListMarker.cpp (190882 => 190883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderListMarker.cpp        2015-10-12 19:44:52 UTC (rev 190882)
+++ trunk/Source/WebCore/rendering/RenderListMarker.cpp        2015-10-12 19:51:11 UTC (rev 190883)
</span><span class="lines">@@ -1426,8 +1426,7 @@
</span><span class="cx">         // until we support the CSS3 marker pseudoclass to allow control over the width and height of the marker box.
</span><span class="cx">         LayoutUnit bulletWidth = style().fontMetrics().ascent() / LayoutUnit(2);
</span><span class="cx">         LayoutSize defaultBulletSize(bulletWidth, bulletWidth);
</span><del>-        LayoutSize imageSize;
-        calculateImageIntrinsicDimensions(m_image.get(), defaultBulletSize, DoNotScaleByEffectiveZoom, imageSize);
</del><ins>+        LayoutSize imageSize = calculateImageIntrinsicDimensions(m_image.get(), defaultBulletSize, DoNotScaleByEffectiveZoom);
</ins><span class="cx">         m_image-&gt;setContainerSizeForRenderer(this, imageSize, style().effectiveZoom());
</span><span class="cx">         return;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingshapesShapeOutsideInfocpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/shapes/ShapeOutsideInfo.cpp (190882 => 190883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/shapes/ShapeOutsideInfo.cpp        2015-10-12 19:44:52 UTC (rev 190882)
+++ trunk/Source/WebCore/rendering/shapes/ShapeOutsideInfo.cpp        2015-10-12 19:51:11 UTC (rev 190883)
</span><span class="lines">@@ -148,8 +148,7 @@
</span><span class="cx"> 
</span><span class="cx"> std::unique_ptr&lt;Shape&gt; ShapeOutsideInfo::createShapeForImage(StyleImage* styleImage, float shapeImageThreshold, WritingMode writingMode, float margin) const
</span><span class="cx"> {
</span><del>-    LayoutSize imageSize;
-    m_renderer.calculateImageIntrinsicDimensions(styleImage, m_referenceBoxLogicalSize, RenderImage::ScaleByEffectiveZoom, imageSize);
</del><ins>+    LayoutSize imageSize = m_renderer.calculateImageIntrinsicDimensions(styleImage, m_referenceBoxLogicalSize, RenderImage::ScaleByEffectiveZoom);
</ins><span class="cx">     styleImage-&gt;setContainerSizeForRenderer(&amp;m_renderer, imageSize, m_renderer.style().effectiveZoom());
</span><span class="cx"> 
</span><span class="cx">     const LayoutRect&amp; marginRect = getShapeImageMarginRect(m_renderer, m_referenceBoxLogicalSize);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleNinePieceImagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/NinePieceImage.cpp (190882 => 190883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/NinePieceImage.cpp        2015-10-12 19:44:52 UTC (rev 190882)
+++ trunk/Source/WebCore/rendering/style/NinePieceImage.cpp        2015-10-12 19:51:11 UTC (rev 190883)
</span><span class="lines">@@ -113,7 +113,7 @@
</span><span class="cx">     return destinationRects[piece].isEmpty() || sourceRects[piece].isEmpty();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Vector&lt;FloatRect&gt; NinePieceImage::computeIntrinsicRects(const FloatRect&amp; outer, const LayoutBoxExtent&amp; slices, float deviceScaleFactor)
</del><ins>+Vector&lt;FloatRect&gt; NinePieceImage::computeNineRects(const FloatRect&amp; outer, const LayoutBoxExtent&amp; slices, float deviceScaleFactor)
</ins><span class="cx"> {
</span><span class="cx">     FloatRect inner = outer;
</span><span class="cx">     inner.move(slices.left(), slices.top());
</span><span class="lines">@@ -137,21 +137,8 @@
</span><span class="cx">     return rects;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Vector&lt;FloatRect&gt; NinePieceImage::computeNonIntrinsicRects(const Vector&lt;FloatRect&gt;&amp; intrinsicRects, const LayoutBoxExtent&amp; slices)
</del><ins>+FloatSize NinePieceImage::computeSideTileScale(ImagePiece piece, const Vector&lt;FloatRect&gt;&amp; destinationRects, const Vector&lt;FloatRect&gt;&amp; sourceRects)
</ins><span class="cx"> {
</span><del>-    Vector&lt;FloatRect&gt; rects(MaxPiece);
-
-    for (ImagePiece piece = MinPiece; piece &lt; MaxPiece; ++piece) {
-        if (isEmptyPieceRect(piece, slices))
-            continue;
-        rects[piece] = FloatRect(FloatPoint(), intrinsicRects[piece].size());
-    }
-
-    return rects;
-}
-
-FloatSize NinePieceImage::computeIntrinsicSideTileScale(ImagePiece piece, const Vector&lt;FloatRect&gt;&amp; destinationRects, const Vector&lt;FloatRect&gt;&amp; sourceRects)
-{
</del><span class="cx">     ASSERT(!isCornerPiece(piece) &amp;&amp; !isMiddlePiece(piece));
</span><span class="cx">     if (isEmptyPieceRect(piece, destinationRects, sourceRects))
</span><span class="cx">         return FloatSize(1, 1);
</span><span class="lines">@@ -165,7 +152,7 @@
</span><span class="cx">     return FloatSize(scale, scale);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-FloatSize NinePieceImage::computeIntrinsicMiddleTileScale(const Vector&lt;FloatSize&gt;&amp; scales, const Vector&lt;FloatRect&gt;&amp; destinationRects, const Vector&lt;FloatRect&gt;&amp; sourceRects, ENinePieceImageRule hRule, ENinePieceImageRule vRule)
</del><ins>+FloatSize NinePieceImage::computeMiddleTileScale(const Vector&lt;FloatSize&gt;&amp; scales, const Vector&lt;FloatRect&gt;&amp; destinationRects, const Vector&lt;FloatRect&gt;&amp; sourceRects, ENinePieceImageRule hRule, ENinePieceImageRule vRule)
</ins><span class="cx"> {
</span><span class="cx">     FloatSize scale(1, 1);
</span><span class="cx">     if (isEmptyPieceRect(MiddlePiece, destinationRects, sourceRects))
</span><span class="lines">@@ -190,26 +177,21 @@
</span><span class="cx">     return scale;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Vector&lt;FloatSize&gt; NinePieceImage::computeIntrinsicTileScales(const Vector&lt;FloatRect&gt;&amp; destinationRects, const Vector&lt;FloatRect&gt;&amp; sourceRects, ENinePieceImageRule hRule, ENinePieceImageRule vRule)
</del><ins>+Vector&lt;FloatSize&gt; NinePieceImage::computeTileScales(const Vector&lt;FloatRect&gt;&amp; destinationRects, const Vector&lt;FloatRect&gt;&amp; sourceRects, ENinePieceImageRule hRule, ENinePieceImageRule vRule)
</ins><span class="cx"> {
</span><span class="cx">     Vector&lt;FloatSize&gt; scales(MaxPiece, FloatSize(1, 1));
</span><span class="cx"> 
</span><del>-    scales[TopPiece]    = computeIntrinsicSideTileScale(TopPiece,    destinationRects, sourceRects);
-    scales[RightPiece]  = computeIntrinsicSideTileScale(RightPiece,  destinationRects, sourceRects);
-    scales[BottomPiece] = computeIntrinsicSideTileScale(BottomPiece, destinationRects, sourceRects);
-    scales[LeftPiece]   = computeIntrinsicSideTileScale(LeftPiece,   destinationRects, sourceRects);
</del><ins>+    scales[TopPiece]    = computeSideTileScale(TopPiece,    destinationRects, sourceRects);
+    scales[RightPiece]  = computeSideTileScale(RightPiece,  destinationRects, sourceRects);
+    scales[BottomPiece] = computeSideTileScale(BottomPiece, destinationRects, sourceRects);
+    scales[LeftPiece]   = computeSideTileScale(LeftPiece,   destinationRects, sourceRects);
</ins><span class="cx"> 
</span><del>-    scales[MiddlePiece] = computeIntrinsicMiddleTileScale(scales, destinationRects, sourceRects, hRule, vRule);
</del><ins>+    scales[MiddlePiece] = computeMiddleTileScale(scales, destinationRects, sourceRects, hRule, vRule);
</ins><span class="cx">     return scales;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Vector&lt;FloatSize&gt; NinePieceImage::computeNonIntrinsicTileScales()
</del><ins>+void NinePieceImage::paint(GraphicsContext&amp; graphicsContext, RenderElement* renderer, const RenderStyle&amp; style, const LayoutRect&amp; destination, const LayoutSize&amp; source, float deviceScaleFactor, CompositeOperator op) const
</ins><span class="cx"> {
</span><del>-    return Vector&lt;FloatSize&gt;(MaxPiece, FloatSize(1, 1));
-}
-
-void NinePieceImage::paint(GraphicsContext&amp; graphicsContext, RenderElement* renderer, const RenderStyle&amp; style, const LayoutRect&amp; destination, const LayoutSize&amp; source,  bool intrinsicSource, float deviceScaleFactor, CompositeOperator op) const
-{
</del><span class="cx">     StyleImage* styleImage = image();
</span><span class="cx">     ASSERT(styleImage &amp;&amp; styleImage-&gt;isLoaded());
</span><span class="cx"> 
</span><span class="lines">@@ -218,18 +200,10 @@
</span><span class="cx"> 
</span><span class="cx">     scaleSlicesIfNeeded(destination.size(), destinationSlices, deviceScaleFactor);
</span><span class="cx"> 
</span><del>-    Vector&lt;FloatRect&gt; destinationRects = computeIntrinsicRects(destination, destinationSlices, deviceScaleFactor);
-    Vector&lt;FloatRect&gt; sourceRects;
-    Vector&lt;FloatSize&gt; tileScales;
</del><ins>+    Vector&lt;FloatRect&gt; destinationRects = computeNineRects(destination, destinationSlices, deviceScaleFactor);
+    Vector&lt;FloatRect&gt; sourceRects = computeNineRects(FloatRect(FloatPoint(), source), sourceSlices, deviceScaleFactor);
+    Vector&lt;FloatSize&gt; tileScales = computeTileScales(destinationRects, sourceRects, horizontalRule(), verticalRule());
</ins><span class="cx"> 
</span><del>-    if (intrinsicSource) {
-        sourceRects = computeIntrinsicRects(FloatRect(FloatPoint(), source), sourceSlices, deviceScaleFactor);
-        tileScales = computeIntrinsicTileScales(destinationRects, sourceRects, horizontalRule(), verticalRule());
-    } else {
-        sourceRects = computeNonIntrinsicRects(destinationRects, sourceSlices);
-        tileScales = computeNonIntrinsicTileScales();
-    }
-
</del><span class="cx">     RefPtr&lt;Image&gt; image = styleImage-&gt;image(renderer, source);
</span><span class="cx">     ColorSpace colorSpace = style.colorSpace();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleNinePieceImageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/NinePieceImage.h (190882 => 190883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/NinePieceImage.h        2015-10-12 19:44:52 UTC (rev 190882)
+++ trunk/Source/WebCore/rendering/style/NinePieceImage.h        2015-10-12 19:51:11 UTC (rev 190883)
</span><span class="lines">@@ -196,17 +196,15 @@
</span><span class="cx">     static bool isEmptyPieceRect(ImagePiece, const LayoutBoxExtent&amp; slices);
</span><span class="cx">     static bool isEmptyPieceRect(ImagePiece, const Vector&lt;FloatRect&gt;&amp; destinationRects, const Vector&lt;FloatRect&gt;&amp; sourceRects);
</span><span class="cx"> 
</span><del>-    static Vector&lt;FloatRect&gt; computeIntrinsicRects(const FloatRect&amp; outer, const LayoutBoxExtent&amp; slices, float deviceScaleFactor);
-    static Vector&lt;FloatRect&gt; computeNonIntrinsicRects(const Vector&lt;FloatRect&gt;&amp; intrinsicRects, const LayoutBoxExtent&amp; slices);
</del><ins>+    static Vector&lt;FloatRect&gt; computeNineRects(const FloatRect&amp; outer, const LayoutBoxExtent&amp; slices, float deviceScaleFactor);
</ins><span class="cx"> 
</span><span class="cx">     static void scaleSlicesIfNeeded(const LayoutSize&amp;, LayoutBoxExtent&amp; slices, float deviceScaleFactor);
</span><span class="cx"> 
</span><del>-    static FloatSize computeIntrinsicSideTileScale(ImagePiece, const Vector&lt;FloatRect&gt;&amp; destinationRects, const Vector&lt;FloatRect&gt;&amp; sourceRects);
-    static FloatSize computeIntrinsicMiddleTileScale(const Vector&lt;FloatSize&gt;&amp; scales, const Vector&lt;FloatRect&gt;&amp; destinationRects, const Vector&lt;FloatRect&gt;&amp; sourceRects, ENinePieceImageRule hRule, ENinePieceImageRule vRule);
-    static Vector&lt;FloatSize&gt; computeIntrinsicTileScales(const Vector&lt;FloatRect&gt;&amp; destinationRects, const Vector&lt;FloatRect&gt;&amp; sourceRects, ENinePieceImageRule hRule, ENinePieceImageRule vRule);
-    static Vector&lt;FloatSize&gt; computeNonIntrinsicTileScales();
</del><ins>+    static FloatSize computeSideTileScale(ImagePiece, const Vector&lt;FloatRect&gt;&amp; destinationRects, const Vector&lt;FloatRect&gt;&amp; sourceRects);
+    static FloatSize computeMiddleTileScale(const Vector&lt;FloatSize&gt;&amp; scales, const Vector&lt;FloatRect&gt;&amp; destinationRects, const Vector&lt;FloatRect&gt;&amp; sourceRects, ENinePieceImageRule hRule, ENinePieceImageRule vRule);
+    static Vector&lt;FloatSize&gt; computeTileScales(const Vector&lt;FloatRect&gt;&amp; destinationRects, const Vector&lt;FloatRect&gt;&amp; sourceRects, ENinePieceImageRule hRule, ENinePieceImageRule vRule);
</ins><span class="cx"> 
</span><del>-    void paint(GraphicsContext&amp;, RenderElement*, const RenderStyle&amp;, const LayoutRect&amp; destination, const LayoutSize&amp; source, bool intrinsicSource, float deviceScaleFactor, CompositeOperator) const;
</del><ins>+    void paint(GraphicsContext&amp;, RenderElement*, const RenderStyle&amp;, const LayoutRect&amp; destination, const LayoutSize&amp; source, float deviceScaleFactor, CompositeOperator) const;
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     DataRef&lt;NinePieceImageData&gt; m_data;
</span></span></pre>
</div>
</div>

</body>
</html>