<!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" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { 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, #msg p { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul { overflow: auto; }
#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>
<title>[28778] trunk</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/28778">28778</a></dd>
<dt>Author</dt> <dd>bdakin@apple.com</dd>
<dt>Date</dt> <dd>2007-12-16 15:08:27 -0800 (Sun, 16 Dec 2007)</dd>
</dl>

<h3>Log Message</h3>
<pre>WebCore:

        Reviewed by Geoff.

        Make relative-size SVGs work in border-image.

        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::calculateBackgroundSize):
        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::paintBorderImage):

LayoutTests:

        Reviewed by Geoff.

        Tests for SVG as border-image.

        * fast/borders/resources/green-fixed-size-rect.svg: Added.
        * fast/borders/resources/green-relative-size-rect.svg: Added.
        * fast/borders/svg-as-border-image-2.html: Added.
        * fast/borders/svg-as-border-image.html: Added.
        * platform/mac/fast/borders/svg-as-border-image-2-expected.checksum: Added.
        * platform/mac/fast/borders/svg-as-border-image-2-expected.png: Added.
        * platform/mac/fast/borders/svg-as-border-image-2-expected.txt: Added.
        * platform/mac/fast/borders/svg-as-border-image-expected.checksum: Added.
        * platform/mac/fast/borders/svg-as-border-image-expected.png: Added.
        * platform/mac/fast/borders/svg-as-border-image-expected.txt: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkWebCoreChangeLog">trunk/WebCore/ChangeLog</a></li>
<li><a href="#trunkWebCorerenderingRenderBoxcpp">trunk/WebCore/rendering/RenderBox.cpp</a></li>
<li><a href="#trunkWebCorerenderingRenderObjectcpp">trunk/WebCore/rendering/RenderObject.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastbordersresourcesgreenfixedsizerectsvg">trunk/LayoutTests/fast/borders/resources/green-fixed-size-rect.svg</a></li>
<li><a href="#trunkLayoutTestsfastbordersresourcesgreenrelativesizerectsvg">trunk/LayoutTests/fast/borders/resources/green-relative-size-rect.svg</a></li>
<li><a href="#trunkLayoutTestsfastborderssvgasborderimage2html">trunk/LayoutTests/fast/borders/svg-as-border-image-2.html</a></li>
<li><a href="#trunkLayoutTestsfastborderssvgasborderimagehtml">trunk/LayoutTests/fast/borders/svg-as-border-image.html</a></li>
<li><a href="#trunkLayoutTestsplatformmacfastborderssvgasborderimage2expectedchecksum">trunk/LayoutTests/platform/mac/fast/borders/svg-as-border-image-2-expected.checksum</a></li>
<li><a href="#trunkLayoutTestsplatformmacfastborderssvgasborderimage2expectedpng">trunk/LayoutTests/platform/mac/fast/borders/svg-as-border-image-2-expected.png</a></li>
<li><a href="#trunkLayoutTestsplatformmacfastborderssvgasborderimage2expectedtxt">trunk/LayoutTests/platform/mac/fast/borders/svg-as-border-image-2-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacfastborderssvgasborderimageexpectedchecksum">trunk/LayoutTests/platform/mac/fast/borders/svg-as-border-image-expected.checksum</a></li>
<li><a href="#trunkLayoutTestsplatformmacfastborderssvgasborderimageexpectedpng">trunk/LayoutTests/platform/mac/fast/borders/svg-as-border-image-expected.png</a></li>
<li><a href="#trunkLayoutTestsplatformmacfastborderssvgasborderimageexpectedtxt">trunk/LayoutTests/platform/mac/fast/borders/svg-as-border-image-expected.txt</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (28777 => 28778)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2007-12-16 22:53:51 UTC (rev 28777)
+++ trunk/LayoutTests/ChangeLog        2007-12-16 23:08:27 UTC (rev 28778)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2007-12-16  Beth Dakin  &lt;bdakin@apple.com&gt;
+
+        Reviewed by Geoff.
+
+        Tests for SVG as border-image.
+
+        * fast/borders/resources/green-fixed-size-rect.svg: Added.
+        * fast/borders/resources/green-relative-size-rect.svg: Added.
+        * fast/borders/svg-as-border-image-2.html: Added.
+        * fast/borders/svg-as-border-image.html: Added.
+        * platform/mac/fast/borders/svg-as-border-image-2-expected.checksum: Added.
+        * platform/mac/fast/borders/svg-as-border-image-2-expected.png: Added.
+        * platform/mac/fast/borders/svg-as-border-image-2-expected.txt: Added.
+        * platform/mac/fast/borders/svg-as-border-image-expected.checksum: Added.
+        * platform/mac/fast/borders/svg-as-border-image-expected.png: Added.
+        * platform/mac/fast/borders/svg-as-border-image-expected.txt: Added.
+
</ins><span class="cx"> 2007-12-16  Andrew Wellington  &lt;proton@wiretapped.net&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Darin.
</span></span></pre></div>
<a id="trunkLayoutTestsfastbordersresourcesgreenfixedsizerectsvg"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/borders/resources/green-fixed-size-rect.svg (0 => 28778)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/borders/resources/green-fixed-size-rect.svg                                (rev 0)
+++ trunk/LayoutTests/fast/borders/resources/green-fixed-size-rect.svg        2007-12-16 23:08:27 UTC (rev 28778)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width='100px' height='100px'&gt;
+    &lt;rect fill='green' width='100px' height='100px' /&gt;
+&lt;/svg&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastbordersresourcesgreenrelativesizerectsvg"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/borders/resources/green-relative-size-rect.svg (0 => 28778)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/borders/resources/green-relative-size-rect.svg                                (rev 0)
+++ trunk/LayoutTests/fast/borders/resources/green-relative-size-rect.svg        2007-12-16 23:08:27 UTC (rev 28778)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width='100%' height='100%'&gt;
+    &lt;rect fill='green' width='100px' height='100px' /&gt;
+&lt;/svg&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastborderssvgasborderimage2html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/borders/svg-as-border-image-2.html (0 => 28778)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/borders/svg-as-border-image-2.html                                (rev 0)
+++ trunk/LayoutTests/fast/borders/svg-as-border-image-2.html        2007-12-16 23:08:27 UTC (rev 28778)
</span><span class="lines">@@ -0,0 +1,38 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;style&gt;
+    div {
+        border-width: 30px 30px 30px 30px;
+        height: 100px;
+        width: 100px;
+        margin: 10px;
+        display: inline-block;
+    }
+    
+    div.rr {
+        -webkit-border-image: url(&quot;resources/green-relative-size-rect.svg&quot;) 30 30 30 30 repeat repeat;
+    }
+    
+    div.rs {
+        -webkit-border-image: url(&quot;resources/green-relative-size-rect.svg&quot;) 30 30 30 30 repeat stretch;
+    }
+    
+    div.sr {
+        -webkit-border-image: url(&quot;resources/green-relative-size-rect.svg&quot;) 30 30 30 30 stretch repeat;
+    }
+    
+    div.ss {
+        -webkit-border-image: url(&quot;resources/green-relative-size-rect.svg&quot;) 30 30 30 30 stretch stretch;
+    }
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+
+    &lt;div class=&quot;rr&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;rs&quot;&gt;&lt;/div&gt;
+    &lt;br&gt;
+    &lt;div class=&quot;sr&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;ss&quot;&gt;&lt;/div&gt;
+
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastborderssvgasborderimagehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/borders/svg-as-border-image.html (0 => 28778)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/borders/svg-as-border-image.html                                (rev 0)
+++ trunk/LayoutTests/fast/borders/svg-as-border-image.html        2007-12-16 23:08:27 UTC (rev 28778)
</span><span class="lines">@@ -0,0 +1,38 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;style&gt;
+    div {
+        border-width: 30px 30px 30px 30px;
+        height: 100px;
+        width: 100px;
+        margin: 10px;
+        display: inline-block;
+    }
+    
+    div.rr {
+        -webkit-border-image: url(&quot;resources/green-fixed-size-rect.svg&quot;) 30 30 30 30 repeat repeat;
+    }
+    
+    div.rs {
+        -webkit-border-image: url(&quot;resources/green-fixed-size-rect.svg&quot;) 30 30 30 30 repeat stretch;
+    }
+    
+    div.sr {
+        -webkit-border-image: url(&quot;resources/green-fixed-size-rect.svg&quot;) 30 30 30 30 stretch repeat;
+    }
+    
+    div.ss {
+        -webkit-border-image: url(&quot;resources/green-fixed-size-rect.svg&quot;) 30 30 30 30 stretch stretch;
+    }
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+
+    &lt;div class=&quot;rr&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;rs&quot;&gt;&lt;/div&gt;
+    &lt;br&gt;
+    &lt;div class=&quot;sr&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;ss&quot;&gt;&lt;/div&gt;
+
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacfastborderssvgasborderimage2expectedchecksum"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/mac/fast/borders/svg-as-border-image-2-expected.checksum (0 => 28778)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/fast/borders/svg-as-border-image-2-expected.checksum                                (rev 0)
+++ trunk/LayoutTests/platform/mac/fast/borders/svg-as-border-image-2-expected.checksum        2007-12-16 23:08:27 UTC (rev 28778)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+06ecd0c2e20378429642fa56d97c8ec3
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacfastborderssvgasborderimage2expectedpng"></a>
<div class="binary"><h4>Added: trunk/LayoutTests/platform/mac/fast/borders/svg-as-border-image-2-expected.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/LayoutTests/platform/mac/fast/borders/svg-as-border-image-2-expected.png
</span><span class="cx">___________________________________________________________________
</span><span class="cx">Name: svn:mime-type
</span><span class="cx">   + application/octet-stream
</span><a id="trunkLayoutTestsplatformmacfastborderssvgasborderimage2expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/mac/fast/borders/svg-as-border-image-2-expected.txt (0 => 28778)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/fast/borders/svg-as-border-image-2-expected.txt                                (rev 0)
+++ trunk/LayoutTests/platform/mac/fast/borders/svg-as-border-image-2-expected.txt        2007-12-16 23:08:27 UTC (rev 28778)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderBlock {DIV} at (10,10) size 160x160 [border: (30px none #000000)]
+      RenderText {#text} at (180,166) size 4x18
+        text run at (180,166) width 4: &quot; &quot;
+      RenderBlock {DIV} at (194,10) size 160x160 [border: (30px none #000000)]
+      RenderText {#text} at (364,166) size 4x18
+        text run at (364,166) width 4: &quot; &quot;
+      RenderBR {BR} at (0,0) size 0x0
+      RenderBlock {DIV} at (10,194) size 160x160 [border: (30px none #000000)]
+      RenderText {#text} at (180,350) size 4x18
+        text run at (180,350) width 4: &quot; &quot;
+      RenderBlock {DIV} at (194,194) size 160x160 [border: (30px none #000000)]
+      RenderText {#text} at (0,0) size 0x0
+      RenderText {#text} at (0,0) size 0x0
+      RenderText {#text} at (0,0) size 0x0
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacfastborderssvgasborderimageexpectedchecksum"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/mac/fast/borders/svg-as-border-image-expected.checksum (0 => 28778)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/fast/borders/svg-as-border-image-expected.checksum                                (rev 0)
+++ trunk/LayoutTests/platform/mac/fast/borders/svg-as-border-image-expected.checksum        2007-12-16 23:08:27 UTC (rev 28778)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+06ecd0c2e20378429642fa56d97c8ec3
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacfastborderssvgasborderimageexpectedpng"></a>
<div class="binary"><h4>Added: trunk/LayoutTests/platform/mac/fast/borders/svg-as-border-image-expected.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/LayoutTests/platform/mac/fast/borders/svg-as-border-image-expected.png
</span><span class="cx">___________________________________________________________________
</span><span class="cx">Name: svn:mime-type
</span><span class="cx">   + application/octet-stream
</span><a id="trunkLayoutTestsplatformmacfastborderssvgasborderimageexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/mac/fast/borders/svg-as-border-image-expected.txt (0 => 28778)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/fast/borders/svg-as-border-image-expected.txt                                (rev 0)
+++ trunk/LayoutTests/platform/mac/fast/borders/svg-as-border-image-expected.txt        2007-12-16 23:08:27 UTC (rev 28778)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderBlock {DIV} at (10,10) size 160x160 [border: (30px none #000000)]
+      RenderText {#text} at (180,166) size 4x18
+        text run at (180,166) width 4: &quot; &quot;
+      RenderBlock {DIV} at (194,10) size 160x160 [border: (30px none #000000)]
+      RenderText {#text} at (364,166) size 4x18
+        text run at (364,166) width 4: &quot; &quot;
+      RenderBR {BR} at (0,0) size 0x0
+      RenderBlock {DIV} at (10,194) size 160x160 [border: (30px none #000000)]
+      RenderText {#text} at (180,350) size 4x18
+        text run at (180,350) width 4: &quot; &quot;
+      RenderBlock {DIV} at (194,194) size 160x160 [border: (30px none #000000)]
+      RenderText {#text} at (0,0) size 0x0
+      RenderText {#text} at (0,0) size 0x0
+      RenderText {#text} at (0,0) size 0x0
</ins></span></pre></div>
<a id="trunkWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/ChangeLog (28777 => 28778)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/ChangeLog        2007-12-16 22:53:51 UTC (rev 28777)
+++ trunk/WebCore/ChangeLog        2007-12-16 23:08:27 UTC (rev 28778)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2007-12-16  Beth Dakin  &lt;bdakin@apple.com&gt;
+
+        Reviewed by Geoff.
+
+        Make relative-size SVGs work in border-image.
+
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::calculateBackgroundSize):
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::paintBorderImage):
+
</ins><span class="cx"> 2007-12-16  Darin Adler  &lt;darin@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         - fix Tiger build (my fault it was broken)
</span></span></pre></div>
<a id="trunkWebCorerenderingRenderBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/rendering/RenderBox.cpp (28777 => 28778)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/rendering/RenderBox.cpp        2007-12-16 22:53:51 UTC (rev 28777)
+++ trunk/WebCore/rendering/RenderBox.cpp        2007-12-16 23:08:27 UTC (rev 28778)
</span><span class="lines">@@ -420,6 +420,7 @@
</span><span class="cx"> IntSize RenderBox::calculateBackgroundSize(const BackgroundLayer* bgLayer, int scaledWidth, int scaledHeight) const
</span><span class="cx"> {
</span><span class="cx">     CachedImage* bg = bgLayer-&gt;backgroundImage();
</span><ins>+    bg-&gt;setImageContainerSize(IntSize(m_width, m_height));
</ins><span class="cx"> 
</span><span class="cx">     if (bgLayer-&gt;isBackgroundSizeSet()) {
</span><span class="cx">         int w = scaledWidth;
</span><span class="lines">@@ -460,10 +461,8 @@
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx">         return IntSize(max(1, w), max(1, h));
</span><del>-    } else {
-        bg-&gt;setImageContainerSize(IntSize(m_width, m_height));
</del><ins>+    } else
</ins><span class="cx">         return bg-&gt;imageSize();
</span><del>-    }
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void RenderBox::imageChanged(CachedImage* image)
</span></span></pre></div>
<a id="trunkWebCorerenderingRenderObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/rendering/RenderObject.cpp (28777 => 28778)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/rendering/RenderObject.cpp        2007-12-16 22:53:51 UTC (rev 28777)
+++ trunk/WebCore/rendering/RenderObject.cpp        2007-12-16 23:08:27 UTC (rev 28778)
</span><span class="lines">@@ -1149,6 +1149,7 @@
</span><span class="cx">         clipped = true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    borderImage-&gt;setImageContainerSize(IntSize(w, h));
</ins><span class="cx">     int imageWidth = borderImage-&gt;image()-&gt;width();
</span><span class="cx">     int imageHeight = borderImage-&gt;image()-&gt;height();
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>