Bug 906521. Part 9: Add tests for invalid glyph id values. r=jfkthame

--HG--
extra : rebase_source : 3ffd23c06a40cd51af30c83652ee701ae6057566
This commit is contained in:
Robert O'Callahan 2013-08-26 12:21:20 +12:00
parent 7353ff0cc7
commit ba9a70db15
6 changed files with 71 additions and 2 deletions

View File

@ -1,5 +1,6 @@
pref(gfx.font_rendering.opentype_svg.enabled,false) != svg-glyph-basic.svg svg-glyph-basic-ref.svg
pref(gfx.font_rendering.opentype_svg.enabled,true) fails-if(Android||B2G) == svg-glyph-basic.svg svg-glyph-basic-ref.svg # bug 872487
pref(gfx.font_rendering.opentype_svg.enabled,true) fails-if(Android||B2G) == svg-glyph-invalid-ids.svg svg-glyph-invalid-ids-ref.svg # bug 872487
pref(gfx.font_rendering.opentype_svg.enabled,false) != svg-glyph-positioning.svg svg-glyph-positioning-ref.svg
pref(gfx.font_rendering.opentype_svg.enabled,true) fails-if(Android||B2G) == svg-glyph-positioning.svg svg-glyph-positioning-ref.svg # bug 872487
pref(gfx.font_rendering.opentype_svg.enabled,true) fails-if(winWidget) == svg-glyph-html.html svg-glyph-html-ref.svg # bug 872486

View File

@ -6,5 +6,5 @@ not a valid SVG table so no SVG glyphs will be used.
nosvg.woff is derived from the "Liberation" font. It contains no SVG table.
svg.woff is nosvg.woff with an SVG table added. The
table contains the glyph documents glyphs-base.svg, glyphs-objectcolor.svg,
glyphs-objectopacity.svg and glyphs-objectstroke.svg.
table contains the glyph documents glyphs-base.svg, glyphs-invalid.svg,
glyphs-objectcolor.svg, glyphs-objectopacity.svg and glyphs-objectstroke.svg.

View File

@ -0,0 +1,40 @@
<svg xmlns="http://www.w3.org/2000/svg">
<!--
Test handling of invalid ids
-->
<!-- not valid: leading space not allowed -->
<g id="glyph 47">
<rect x="100" y="-900" width="800" height="800" stroke-width="50"
fill="red"/>
</g>
<!-- not valid: leading zero not allowed -->
<g id="glyph047">
<rect x="100" y="-900" width="800" height="800" stroke-width="50"
fill="red"/>
</g>
<!-- not valid: trailing garbage not allowed -->
<g id="glyph47xxx">
<rect x="100" y="-900" width="800" height="800" stroke-width="50"
fill="red"/>
</g>
<!-- not valid: trailing space not allowed -->
<g id="glyph47 ">
<rect x="100" y="-900" width="800" height="800" stroke-width="50"
fill="red"/>
</g>
<!-- not valid: floating point not allowed -->
<g id="glyph47.0">
<rect x="100" y="-900" width="800" height="800" stroke-width="50"
fill="red"/>
</g>
<!-- char = M -->
<g id="glyph47">
<rect x="100" y="-900" width="800" height="800" stroke-width="50"
fill="lime"/>
</g>
<!-- Ensure first glyph47 is picked -->
<g id="glyph47">
<rect x="100" y="-900" width="800" height="800" stroke-width="50"
fill="red"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -0,0 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg">
<g>
<rect x="20" y="20" width="160" height="160" stroke-width="10"
fill="lime" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 149 B

View File

@ -0,0 +1,22 @@
<svg xmlns="http://www.w3.org/2000/svg">
<style type="text/css">
<![CDATA[
@font-face {
font-family: "Liberation";
src:url(resources/svg.woff);
}
text
{
font-family: Liberation;
font-size: 200px;
}
]]>
</style>
<!--
Test that the right SVG glyph is picked from a document containing various
invalid glyph IDs.
-->
<text x="0" y="200">
M
</text>
</svg>

After

Width:  |  Height:  |  Size: 448 B