Bug 1212954 - Make BaseSize::IsEmpty return true for negative sizes to avoid NS_ERROR in VectorImage::GetFrameAtSize when root svg doesn't have intrinsic width or height. r=roc

This commit is contained in:
Tom Klein 2015-10-11 18:13:10 +02:00
parent 64ef92adbe
commit 9524cbb750
3 changed files with 18 additions and 1 deletions

View File

@ -27,7 +27,7 @@ struct BaseSize {
void SizeTo(T aWidth, T aHeight) { width = aWidth; height = aHeight; }
bool IsEmpty() const {
return width == 0 || height == 0;
return width <= 0 || height <= 0;
}
bool IsSquare() const {

View File

@ -0,0 +1,16 @@
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<filter id="f">
<!-- the image data is
<svg xmlns="http://www.w3.org/2000/svg" width="-5" height="1%" />
-->
<feImage xlink:href="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSItNSIgaGVpZ2h0
PSIxJSIgLz4K" />
</filter>
</defs>
<rect width="1" height="1" filter="url(#f)" />
</svg>

After

Width:  |  Height:  |  Size: 464 B

View File

@ -54,6 +54,7 @@ load invalid-disposal-method-2.gif
load invalid-disposal-method-3.gif
load 1205923-1.html
load 1212954-1.svg
# Ensure we handle ICO directory entries which specify the wrong size for the
# contained resource.