feImage referencing a primitive draws incorrectly
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Nov 2011 19:53:28 +0000 (19:53 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Nov 2011 19:53:28 +0000 (19:53 +0000)
commitddea893bd952827df907a021add705c80fea1fa2
tree3caf84f9ebf9a7306608213a76b2f716e3c19aa9
parent7786c7f562d4141fabf86592c2816640a16cf421
feImage referencing a primitive draws incorrectly
https://bugs.webkit.org/show_bug.cgi?id=71731
<rdar://problem/10408178>

Reviewed by Simon Fraser.

If the target of an <feImage> appears to be a local fragment identifier, but
it hasn't resolved yet, defer resolution instead of loading a bogus image.

Invalidate <feImage> if the xlink:href attribute changes.

Don't attempt to render an <feImage> if the referenced element is of size 0x0.

Tests: svg/filters/feImage-reference-invalidation.svg
       svg/filters/feImage-reference-svg-primitive.svg
       svg/filters/feImage-zero-size-crash.svg

* svg/SVGFEImageElement.cpp:
(WebCore::SVGFEImageElement::parseMappedAttribute):
(WebCore::SVGFEImageElement::build):

Add a test (feImage-reference-svg-primitive) that ensures that having
an <feImage> referencing an SVG primitive which is declared after it
successfully paints the referenced object.

Add a test (feImage-zero-size-crash) to see if we crash when <feImage>
references an object with 0x0 size.

Add a test (feImage-reference-invalidation) that ensures that changing the
xlink:href on an <feImage> correctly invalidates the image.

* svg/filters/feImage-reference-invalidation-expected.png: Added.
* svg/filters/feImage-reference-invalidation-expected.txt: Added.
* svg/filters/feImage-reference-svg-primitive-expected.png: Added.
* svg/filters/feImage-reference-svg-primitive-expected.txt: Added.
* svg/filters/feImage-reference-invalidation.svg: Added.
* svg/filters/feImage-reference-svg-primitive.svg: Added.
* svg/filters/feImage-zero-size-crash-expected.txt: Added.
* svg/filters/feImage-zero-size-crash.svg: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@101542 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
LayoutTests/ChangeLog
LayoutTests/svg/filters/feImage-reference-invalidation-expected.png [new file with mode: 0644]
LayoutTests/svg/filters/feImage-reference-invalidation-expected.txt [new file with mode: 0644]
LayoutTests/svg/filters/feImage-reference-invalidation.svg [new file with mode: 0644]
LayoutTests/svg/filters/feImage-reference-svg-primitive-expected.png [new file with mode: 0644]
LayoutTests/svg/filters/feImage-reference-svg-primitive-expected.txt [new file with mode: 0644]
LayoutTests/svg/filters/feImage-reference-svg-primitive.svg [new file with mode: 0644]
LayoutTests/svg/filters/feImage-zero-size-crash-expected.txt [new file with mode: 0644]
LayoutTests/svg/filters/feImage-zero-size-crash.svg [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/svg/SVGFEImageElement.cpp
Source/WebCore/svg/SVGFEImageElement.h