mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
Bug 709920: Be more sensitive in checking for zero-size viewBox in nsSVGPatternFrame::ConstructCTM. r=longsonr a=khuey
This commit is contained in:
parent
ee2dd7102f
commit
135af01549
@ -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;
|
||||
}
|
||||
|
||||
|
23
layout/svg/crashtests/709920-1.svg
Normal file
23
layout/svg/crashtests/709920-1.svg
Normal 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 |
23
layout/svg/crashtests/709920-2.svg
Normal file
23
layout/svg/crashtests/709920-2.svg
Normal 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 |
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user