Stop image from displaying when src attribute is removed or emptied
authoryoav@yoav.ws <yoav@yoav.ws@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Mar 2015 17:25:31 +0000 (17:25 +0000)
committeryoav@yoav.ws <yoav@yoav.ws@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Mar 2015 17:25:31 +0000 (17:25 +0000)
commitcb5abd20657ab43bd21c377e66d736cbb8a7cf92
treecc9384b7623abd02c62565415ff16f043d344e5b
parent92f4d7afa4db902f071701461656e607b5ad0cd0
Stop image from displaying when src attribute is removed or emptied
https://bugs.webkit.org/show_bug.cgi?id=142677

Reviewed by Chris Dumez.

Source/WebCore:

Previously, we ignored empty attribute as failed URL, and didn't update the
renderer when an image was removed. This patch fixes that.

Tests: fast/dom/HTMLImageElement/image-empty-src.html
       fast/dom/HTMLImageElement/image-remove-src.html

* loader/ImageLoader.cpp:
(WebCore::ImageLoader::updateFromElement):

LayoutTests:

* fast/dom/HTMLImageElement/image-empty-src-expected.html: Added.
* fast/dom/HTMLImageElement/image-empty-src.html: Added.
* fast/dom/HTMLImageElement/image-remove-src-expected.html: Added.
* fast/dom/HTMLImageElement/image-remove-src.html: Added.
* fast/dom/HTMLImageElement/image-empty-srcset-expected.html: Added.
* fast/dom/HTMLImageElement/image-empty-srcset.html: Added.
* fast/dom/HTMLImageElement/image-remove-srcset-expected.html: Added.
* fast/dom/HTMLImageElement/image-remove-srcset.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@181897 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
LayoutTests/ChangeLog
LayoutTests/TestExpectations
LayoutTests/canvas/philip/tests/2d.drawImage.image.incomplete.omitted-expected.txt
LayoutTests/fast/dom/HTMLImageElement/image-empty-src-expected.html [new file with mode: 0644]
LayoutTests/fast/dom/HTMLImageElement/image-empty-src.html [new file with mode: 0644]
LayoutTests/fast/dom/HTMLImageElement/image-empty-srcset-expected.html [new file with mode: 0644]
LayoutTests/fast/dom/HTMLImageElement/image-empty-srcset.html [new file with mode: 0644]
LayoutTests/fast/dom/HTMLImageElement/image-remove-src-expected.html [new file with mode: 0644]
LayoutTests/fast/dom/HTMLImageElement/image-remove-src.html [new file with mode: 0644]
LayoutTests/fast/dom/HTMLImageElement/image-remove-srcset-expected.html [new file with mode: 0644]
LayoutTests/fast/dom/HTMLImageElement/image-remove-srcset.html [new file with mode: 0644]
LayoutTests/platform/mac/canvas/philip/tests/2d.drawImage.image.incomplete.omitted-expected.txt [deleted file]
Source/WebCore/ChangeLog
Source/WebCore/loader/ImageLoader.cpp