Bug 608653 - lacuna pattern width/height should be zero r+a=roc

This commit is contained in:
Robert Longson 2010-11-03 22:35:00 +00:00
parent 5f4593ff3d
commit 785fa4398d
9 changed files with 30 additions and 7 deletions

View File

@ -50,8 +50,8 @@ nsSVGElement::LengthInfo nsSVGPatternElement::sLengthInfo[4] =
{
{ &nsGkAtoms::x, 0, nsIDOMSVGLength::SVG_LENGTHTYPE_PERCENTAGE, nsSVGUtils::X },
{ &nsGkAtoms::y, 0, nsIDOMSVGLength::SVG_LENGTHTYPE_PERCENTAGE, nsSVGUtils::Y },
{ &nsGkAtoms::width, 100, nsIDOMSVGLength::SVG_LENGTHTYPE_PERCENTAGE, nsSVGUtils::X },
{ &nsGkAtoms::height, 100, nsIDOMSVGLength::SVG_LENGTHTYPE_PERCENTAGE, nsSVGUtils::Y },
{ &nsGkAtoms::width, 0, nsIDOMSVGLength::SVG_LENGTHTYPE_PERCENTAGE, nsSVGUtils::X },
{ &nsGkAtoms::height, 0, nsIDOMSVGLength::SVG_LENGTHTYPE_PERCENTAGE, nsSVGUtils::Y },
};
nsSVGElement::EnumInfo nsSVGPatternElement::sEnumInfo[2] =

View File

@ -9,7 +9,7 @@
<!-- From https://bugzilla.mozilla.org/show_bug.cgi?id=338596 -->
<defs>
<pattern id="test" patternUnits="objectBoundingBox" patternContentUnits="objectBoundingBox">
<pattern id="test" width="100%" height="100%" patternUnits="objectBoundingBox" patternContentUnits="objectBoundingBox">
<rect x="0" y="0" width="1" height="1" fill="lime"/>
</pattern>
</defs>

Before

Width:  |  Height:  |  Size: 599 B

After

Width:  |  Height:  |  Size: 626 B

View File

@ -9,7 +9,7 @@
<!-- From https://bugzilla.mozilla.org/show_bug.cgi?id=377399 -->
<defs>
<pattern id="test" viewBox="0 0 40 40" patternContentUnits="objectBoundingBox">
<pattern id="test" width="100%" height="100%" viewBox="0 0 40 40" patternContentUnits="objectBoundingBox">
<rect x="0" y="0" width="40" height="40" fill="lime" />
</pattern>
</defs>

Before

Width:  |  Height:  |  Size: 637 B

After

Width:  |  Height:  |  Size: 664 B

View File

@ -9,7 +9,7 @@
<!-- From https://bugzilla.mozilla.org/show_bug.cgi?id=377399 -->
<defs>
<pattern id="test" viewBox="0 0 40 40" patternContentUnits="objectBoundingBox">
<pattern id="test" width="100%" height="100%" viewBox="0 0 40 40" patternContentUnits="objectBoundingBox">
<rect x="0" y="0" width="40" height="40" fill="lime" />
</pattern>
</defs>

Before

Width:  |  Height:  |  Size: 646 B

After

Width:  |  Height:  |  Size: 673 B

View File

@ -0,0 +1,8 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/licenses/publicdomain/
-->
<svg xmlns="http://www.w3.org/2000/svg">
<title>Reference that pattern without width/height does not display</title>
<rect width="100%" height="100%" fill="black"/>
</svg>

After

Width:  |  Height:  |  Size: 294 B

View File

@ -0,0 +1,14 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/licenses/publicdomain/
-->
<svg xmlns="http://www.w3.org/2000/svg">
<title>Testcase for pattern with no width/height is not displayed</title>
<defs>
<pattern id="p">
<rect width="100%" height="100%" fill="red"/>
</pattern>
</defs>
<rect width="100%" height="100%" fill="black"/>
<rect width="100%" height="100%" fill="url(#p)"/>
</svg>

After

Width:  |  Height:  |  Size: 451 B

View File

@ -126,6 +126,7 @@ random-if(gtk2Widget) == objectBoundingBox-and-fePointLight-01.svg objectBoundin
== polyline-points-invalid-01.svg pass.svg
== path-01.svg path-01-ref.svg
== path-02.svg pass.svg
== pattern-invalid-01.svg pattern-invalid-01-ref.svg
== pattern-live-01a.svg pattern-live-01-ref.svg
== pattern-live-01b.svg pattern-live-01-ref.svg
== pattern-live-01c.svg pattern-live-01-ref.svg

View File

@ -9,7 +9,7 @@
window.addEventListener("MozReftestInvalidate", doTest, false);
</script>
<defs>
<pattern id="pat" width="50">
<pattern id="pat" width="50" height="100%">
<rect x="0" y="0" width="50" height="100%" fill="red"/>
<rect x="50" y="0" width="50" height="100%" fill="lime"/>
<animateTransform attributeName="patternTransform" type="translate" dur="1s"

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -674,7 +674,7 @@ nsSVGPatternFrame::GetPaintServerPattern(nsIFrame *aSource,
nsRefPtr<gfxPattern> pattern = new gfxPattern(surface);
if (!pattern || pattern->CairoStatus())
return PR_FALSE;
return nsnull;
pattern->SetMatrix(pMatrix);
pattern->SetExtend(gfxPattern::EXTEND_REPEAT);