Bug 920621 (Part 2) - Tests for zoom with the svg:image element. r=dholbert

--HG--
rename : layout/reftests/svg/pass.svg => layout/reftests/svg/image/lime-no-dimensions.svg
This commit is contained in:
Seth Fowler 2013-10-02 19:04:33 -07:00
parent a640994d6d
commit 1728f0da97
14 changed files with 176 additions and 13 deletions

View File

@ -0,0 +1,8 @@
<html>
<body style="margin: 0">
<svg xmlns="http://www.w3.org/2000/svg">
<rect x="0" y="0" width="15" height="30" fill="lime"/>
<rect x="15" y="0" width="15" height="30" fill="blue"/>
</svg>
</body>
</html>

View File

@ -0,0 +1,16 @@
<html reftest-zoom="1.5">
<!-- Test to make sure svg:image is painted correctly when its containing SVG
is included inline in a zoomed webpage and it has a transformation
applied, as is often used for SVG sprites. -->
<body style="margin: 0">
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
style="shape-rendering: crispEdges">
<clipPath id="clip"><rect x="0" y="0" width="20" height="20"/></clipPath>
<!-- Translate and clip-path are used to pull a sprite out of the otherwise red image. -->
<g clip-path="url(#clip)">
<image xlink:href="sprite.svg" width="200" height="200" transform="translate(0, -100)"/>
</g>
</svg>
</body>
</html>

View File

@ -0,0 +1,15 @@
<html reftest-zoom="1.5">
<!-- Test to make sure svg:image is painted correctly when its containing SVG
is included inline in a zoomed webpage and it has a transformation
applied, as is often used for SVG sprites. -->
<body style="margin: 0; image-rendering: -moz-crisp-edges">
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<clipPath id="clip"><rect x="0" y="0" width="20" height="20"/></clipPath>
<!-- Translate and clip-path are used to pull a sprite out of the otherwise red image. -->
<g clip-path="url(#clip)">
<image xlink:href="sprite.png" width="200" height="200" transform="translate(0, -100)"/>
</g>
</svg>
</body>
</html>

View File

@ -0,0 +1,8 @@
<html>
<body style="margin: 0">
<svg xmlns="http://www.w3.org/2000/svg">
<rect x="0" y="0" width="5" height="10" fill="lime"/>
<rect x="5" y="0" width="5" height="10" fill="blue"/>
</svg>
</body>
</html>

View File

@ -0,0 +1,16 @@
<html reftest-zoom="0.5">
<!-- Test to make sure svg:image is painted correctly when its containing SVG
is included inline in a zoomed webpage and it has a transformation
applied, as is often used for SVG sprites. -->
<body style="margin: 0">
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
style="shape-rendering: crispEdges">
<clipPath id="clip"><rect x="0" y="0" width="20" height="20"/></clipPath>
<!-- Translate and clip-path are used to pull a sprite out of the otherwise red image. -->
<g clip-path="url(#clip)">
<image xlink:href="sprite.svg" width="200" height="200" transform="translate(0, -100)"/>
</g>
</svg>
</body>
</html>

View File

@ -0,0 +1,15 @@
<html reftest-zoom="0.5">
<!-- Test to make sure svg:image is painted correctly when its containing SVG
is included inline in a zoomed webpage and it has a transformation
applied, as is often used for SVG sprites. -->
<body style="margin: 0; image-rendering: -moz-crisp-edges">
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<clipPath id="clip"><rect x="0" y="0" width="20" height="20"/></clipPath>
<!-- Translate and clip-path are used to pull a sprite out of the otherwise red image. -->
<g clip-path="url(#clip)">
<image xlink:href="sprite.png" width="200" height="200" transform="translate(0, -100)"/>
</g>
</svg>
</body>
</html>

View File

@ -0,0 +1,17 @@
<html reftest-zoom="1.5">
<!-- Test to make sure svg:image is painted correctly when its containing SVG
is included inline in a zoomed webpage. -->
<body style="background: lime">
<!-- 100x100 red div -->
<div style="background: red;
margin-left: 30px; margin-top: 30px;
width: 100px; height: 100px;">
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
style="shape-rendering: crispEdges">
<!-- SVG with no intrinsic dimensions -->
<image xlink:href="lime-no-dimensions.svg" width="100%" height="100%"/>
</svg>
</div>
</body>
</html>

View File

@ -0,0 +1,16 @@
<html reftest-zoom="1.5">
<!-- Test to make sure svg:image is painted correctly when its containing SVG
is included inline in a zoomed webpage. -->
<body style="background: lime">
<!-- 100x100 red div -->
<div style="background: red;
margin-left: 30px; margin-top: 30px;
width: 100px; height: 100px;">
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- 1x1 lime PNG, scaled to 100x100 -->
<image xlink:href="data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%01%00%00%00%01%08%02%00%00%00%90wS%DE%00%00%00%01sRGB%00%AE%CE%1C%E9%00%00%00%0CIDAT%08%D7c%60%F8%CF%00%00%02%02%01%00%AA*%9E'%00%00%00%00IEND%AEB%60%82" width="100" height="100"/>
</svg>
</div>
</body>
</html>

View File

@ -0,0 +1,16 @@
<html reftest-zoom="0.5">
<!-- Test to make sure svg:image is painted correctly when its containing SVG
is included inline in a zoomed webpage. -->
<body style="background: lime">
<!-- 100x100 red div -->
<div style="background: red;
margin-left: 30px; margin-top: 30px;
width: 100px; height: 100px;">
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- SVG with no intrinsic dimensions -->
<image xlink:href="lime-no-dimensions.svg" width="100%" height="100%"/>
</svg>
</div>
</body>
</html>

View File

@ -0,0 +1,16 @@
<html reftest-zoom="0.5">
<!-- Test to make sure svg:image is painted correctly when its containing SVG
is included inline in a zoomed webpage. -->
<body style="background: lime">
<!-- 100x100 red div -->
<div style="background: red;
margin-left: 30px; margin-top: 30px;
width: 100px; height: 100px;">
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- 1x1 lime PNG, scaled to 100x100 -->
<image xlink:href="data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%01%00%00%00%01%08%02%00%00%00%90wS%DE%00%00%00%01sRGB%00%AE%CE%1C%E9%00%00%00%0CIDAT%08%D7c%60%F8%CF%00%00%02%02%01%00%AA*%9E'%00%00%00%00IEND%AEB%60%82" width="100" height="100"/>
</svg>
</div>
</body>
</html>

View File

@ -0,0 +1,7 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" style="shape-rendering: crispEdges">
<rect width="100%" height="100%" fill="lime"/>
</svg>

After

Width:  |  Height:  |  Size: 265 B

View File

@ -11,6 +11,14 @@ fuzzy-if(Android,4,34) == image-opacity-02.svg image-opacity-02-ref.svg # Bug 77
== image-scaling-01.svg ../pass.svg == image-scaling-01.svg ../pass.svg
== image-scaling-02.svg ../pass.svg == image-scaling-02.svg ../pass.svg
== image-svg-inline-01.html ../pass.svg == image-svg-inline-01.html ../pass.svg
== image-svg-inline-zoom-in-01a.html ../pass.svg
== image-svg-inline-zoom-in-01b.html ../pass.svg
== image-svg-inline-zoom-out-01a.html ../pass.svg
== image-svg-inline-zoom-out-01b.html ../pass.svg
== image-svg-inline-sprite-zoom-in-01a.html image-svg-inline-sprite-zoom-in-01-ref.html
== image-svg-inline-sprite-zoom-in-01b.html image-svg-inline-sprite-zoom-in-01-ref.html
== image-svg-inline-sprite-zoom-out-01a.html image-svg-inline-sprite-zoom-out-01-ref.html
== image-svg-inline-sprite-zoom-out-01b.html image-svg-inline-sprite-zoom-out-01-ref.html
== image-translate-01.svg image-translate-01-ref.svg == image-translate-01.svg image-translate-01-ref.svg
== image-x-01.svg image-x-01-ref.svg == image-x-01.svg image-x-01-ref.svg
== image-xy-01.svg image-xy-01-ref.svg == image-xy-01.svg image-xy-01-ref.svg

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

@ -0,0 +1,5 @@
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="200" height="200" style="shape-rendering: crispEdges">
<rect x="0" y="0" width="200" height="200" fill="red"/>
<rect x="-1" y="99" width="11" height="22" fill="lime"/>
<rect x="10" y="99" width="11" height="22" fill="blue"/>
</svg>

After

Width:  |  Height:  |  Size: 293 B