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
Родитель 724e8623c9
Коммит a52e52dfb5
3 изменённых файлов: 18 добавлений и 1 удалений

Просмотреть файл

@ -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 {

Просмотреть файл

@ -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>

После

Ширина:  |  Высота:  |  Размер: 464 B

Просмотреть файл

@ -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.