Bug 142677 - Stop image from displaying when src attribute is removed or emptied
Summary: Stop image from displaying when src attribute is removed or emptied
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-13 13:06 PDT by Yoav Weiss
Modified: 2015-03-24 10:26 PDT (History)
6 users (show)

See Also:


Attachments
Patch (4.95 KB, patch)
2015-03-13 13:12 PDT, Yoav Weiss
no flags Details | Formatted Diff | Diff
Patch (7.57 KB, patch)
2015-03-13 13:18 PDT, Yoav Weiss
no flags Details | Formatted Diff | Diff
Patch (7.07 KB, patch)
2015-03-13 13:42 PDT, Yoav Weiss
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews105 for mac-mavericks-wk2 (625.68 KB, application/zip)
2015-03-13 14:06 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews100 for mac-mavericks (591.13 KB, application/zip)
2015-03-13 14:30 PDT, Build Bot
no flags Details
Patch (8.60 KB, patch)
2015-03-24 01:10 PDT, Yoav Weiss
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yoav Weiss 2015-03-13 13:06:59 PDT
Stop image from displaying when src attribute is removed or emptied
Comment 1 Yoav Weiss 2015-03-13 13:12:26 PDT
Created attachment 248601 [details]
Patch
Comment 2 Yoav Weiss 2015-03-13 13:18:08 PDT
Created attachment 248602 [details]
Patch
Comment 3 Chris Dumez 2015-03-13 13:35:25 PDT
Comment on attachment 248602 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=248602&action=review

r=me % nits.

> Source/WebCore/loader/ImageLoader.cpp:174
> +    if (!attr.isNull() && attr == m_failedLoadURL)

I would have a slight preference for if (!m_failedLoadURL.isEmpty() && m_failedLoadURL == attr), with a comment saying something like "Do not to reload an URL we already failed to load".

> LayoutTests/fast/dom/HTMLImageElement/image-empty-src-expected.html:3
> +<div id=result>75</div>

I don't think we need this, do we?

> LayoutTests/fast/dom/HTMLImageElement/image-empty-src.html:9
> +        result.innerHTML = img.width;

I don't think we need this, do we?

> LayoutTests/fast/dom/HTMLImageElement/image-empty-srcset-expected.html:3
> +<div id=result>75</div>

I don't think we need this, do we?

> LayoutTests/fast/dom/HTMLImageElement/image-empty-srcset.html:9
> +        result.innerHTML = img.width;

I don't think we need this, do we?

> LayoutTests/fast/dom/HTMLImageElement/image-remove-src.html:9
> +        result.innerHTML = img.width;

I don't think we need this, do we?

> LayoutTests/fast/dom/HTMLImageElement/image-remove-srcset-expected.html:3
> +<div id=result>75</div>

I don't think we need this, do we?

> LayoutTests/fast/dom/HTMLImageElement/image-remove-srcset.html:9
> +        result.innerHTML = img.width;

I don't think we need this, do we?
Comment 4 Yoav Weiss 2015-03-13 13:42:27 PDT
Created attachment 248605 [details]
Patch
Comment 5 Chris Dumez 2015-03-13 13:46:37 PDT
Hmm, these tests may be failing on EWS:
canvas/philip/tests/2d.drawImage.image.incomplete.omitted.html [ Failure ]
canvas/philip/tests/2d.pattern.image.incomplete.omitted.html [ Failure ]

PTAL.
Comment 6 Build Bot 2015-03-13 14:05:58 PDT
Comment on attachment 248605 [details]
Patch

Attachment 248605 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/6063795008962560

New failing tests:
canvas/philip/tests/2d.pattern.image.incomplete.omitted.html
canvas/philip/tests/2d.drawImage.image.incomplete.omitted.html
Comment 7 Build Bot 2015-03-13 14:06:06 PDT
Created attachment 248607 [details]
Archive of layout-test-results from ews105 for mac-mavericks-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews105  Port: mac-mavericks-wk2  Platform: Mac OS X 10.9.5
Comment 8 Chris Dumez 2015-03-13 14:19:47 PDT
(In reply to comment #5)
> Hmm, these tests may be failing on EWS:
> canvas/philip/tests/2d.drawImage.image.incomplete.omitted.html [ Failure ]
> canvas/philip/tests/2d.pattern.image.incomplete.omitted.html [ Failure ]
> 
> PTAL.

According to https://www.w3.org/Bugs/Public/show_bug.cgi?id=13768:
2d.drawImage.image.incomplete.empty.html
2d.drawImage.image.incomplete.omitted.html
2d.drawImage.incomplete.html

have been replaced with

2d.drawImage.incomplete.emptysrc.html
2d.drawImage.incomplete.immediate.html
2d.drawImage.incomplete.nosrc.html
2d.drawImage.incomplete.reload.html
2d.drawImage.incomplete.removedsrc.html

and

2d.pattern.image.incomplete.empty.html
2d.pattern.image.incomplete.html
2d.pattern.image.incomplete.omitted.html

with

2d.pattern.image.broken.html
2d.pattern.image.incomplete.emptysrc.html
2d.pattern.image.incomplete.immediate.html
2d.pattern.image.incomplete.nosrc.html
2d.pattern.image.incomplete.reload.html
2d.pattern.image.incomplete.removedsrc.html
Comment 9 Chris Dumez 2015-03-13 14:25:20 PDT
(In reply to comment #8)
> (In reply to comment #5)
> > Hmm, these tests may be failing on EWS:
> > canvas/philip/tests/2d.drawImage.image.incomplete.omitted.html [ Failure ]
> > canvas/philip/tests/2d.pattern.image.incomplete.omitted.html [ Failure ]
> > 
> > PTAL.
> 
> According to https://www.w3.org/Bugs/Public/show_bug.cgi?id=13768:
> 2d.drawImage.image.incomplete.empty.html
> 2d.drawImage.image.incomplete.omitted.html
> 2d.drawImage.incomplete.html
> 
> have been replaced with
> 
> 2d.drawImage.incomplete.emptysrc.html
> 2d.drawImage.incomplete.immediate.html
> 2d.drawImage.incomplete.nosrc.html
> 2d.drawImage.incomplete.reload.html
> 2d.drawImage.incomplete.removedsrc.html
> 
> and
> 
> 2d.pattern.image.incomplete.empty.html
> 2d.pattern.image.incomplete.html
> 2d.pattern.image.incomplete.omitted.html
> 
> with
> 
> 2d.pattern.image.broken.html
> 2d.pattern.image.incomplete.emptysrc.html
> 2d.pattern.image.incomplete.immediate.html
> 2d.pattern.image.incomplete.nosrc.html
> 2d.pattern.image.incomplete.reload.html
> 2d.pattern.image.incomplete.removedsrc.html

We may want to import the new ones from https://github.com/w3c/web-platform-tests/tree/master/2dcontext/fill-and-stroke-styles and remove the ones that were dropped.
Comment 10 Build Bot 2015-03-13 14:30:41 PDT
Comment on attachment 248605 [details]
Patch

Attachment 248605 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/5297795644784640

New failing tests:
canvas/philip/tests/2d.pattern.image.incomplete.omitted.html
canvas/philip/tests/2d.drawImage.image.incomplete.omitted.html
Comment 11 Build Bot 2015-03-13 14:30:45 PDT
Created attachment 248608 [details]
Archive of layout-test-results from ews100 for mac-mavericks

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews100  Port: mac-mavericks  Platform: Mac OS X 10.9.5
Comment 12 Yoav Weiss 2015-03-24 01:10:29 PDT
Created attachment 249320 [details]
Patch
Comment 13 WebKit Commit Bot 2015-03-24 10:26:13 PDT
Comment on attachment 249320 [details]
Patch

Clearing flags on attachment: 249320

Committed r181897: <http://trac.webkit.org/changeset/181897>
Comment 14 WebKit Commit Bot 2015-03-24 10:26:19 PDT
All reviewed patches have been landed.  Closing bug.