Bug 709920: Be more sensitive in checking for zero-size viewBox in nsSVGPatternFrame::ConstructCTM. r=longsonr a=khuey

This commit is contained in:
Daniel Holbert 2011-12-13 12:12:36 -08:00
parent ee2dd7102f
commit 135af01549
4 changed files with 49 additions and 1 deletions

View File

@ -581,7 +581,7 @@ nsSVGPatternFrame::ConstructCTM(const gfxRect &callerBBox,
const nsSVGViewBoxRect viewBox = GetViewBox().GetAnimValue();
if (viewBox.height <= 0.0f && viewBox.width <= 0.0f) {
if (viewBox.height <= 0.0f || viewBox.width <= 0.0f) {
return tCTM;
}

View File

@ -0,0 +1,23 @@
<svg xmlns="http://www.w3.org/2000/svg"
class="reftest-wait">
<!-- Test to be sure that a zero-sized-in-one-dimension viewBox doesn't
make us fail assertions. -->
<script>
document.addEventListener("MozReftestInvalidate", waitAndFinish, false);
function waitAndFinish() {
// Sadly, MozReftestInvalidate fires sooner than PaintPattern here, so
// we need to wait a little bit to give PaintPattern a chance to hit
// this bug.
setTimeout(finish, 100);
}
function finish() {
document.documentElement.removeAttribute("class");
}
</script>
<pattern id="test" viewBox="0 0 1 0">
<rect/>
</pattern>
<rect width="200" height="200" fill="url(#test)"/>
</svg>

After

Width:  |  Height:  |  Size: 730 B

View File

@ -0,0 +1,23 @@
<svg xmlns="http://www.w3.org/2000/svg"
class="reftest-wait">
<!-- Test to be sure that a zero-sized-in-one-dimension viewBox doesn't
make us fail assertions. -->
<script>
document.addEventListener("MozReftestInvalidate", waitAndFinish, false);
function waitAndFinish() {
// Sadly, MozReftestInvalidate fires sooner than PaintPattern here, so
// we need to wait a little bit to give PaintPattern a chance to hit
// this bug.
setTimeout(finish, 100);
}
function finish() {
document.documentElement.removeAttribute("class");
}
</script>
<pattern id="test" viewBox="0 0 0 1">
<rect/>
</pattern>
<rect width="200" height="200" fill="url(#test)"/>
</svg>

After

Width:  |  Height:  |  Size: 730 B

View File

@ -119,3 +119,5 @@ load 682411-1.svg
load 692203-1.svg
load 692203-2.svg
load 693424-1.svg
load 709920-1.svg
load 709920-2.svg