Join GitHub today
Treatment of fallback image on <img src=''> #3280
To my reading
In https://bugs.chromium.org/p/chromium/issues/detail?id=793206 we encountered interoperability issues because Blink now renders a fallback image in that case, rather then 'nothing' like other browsers.
As far as I can see Blink is following the spec here, unless src is not considered 'set' when src=''.
Have I misunderstood the meaning of 'set' in this case? And if not, should the spec be changed to allow rendering 'nothing' in this case as it is what all browsers do (apart from Blink since Chrome M63)? (Although FF is the only other browser that currently attempts to follow this part of the spec, and it seems to treat src='' as 'not set'.
Your understanding of "set" is correct. This is a bit more complex though, as it appears to depend on the width/height: https://jsbin.com/foyapuz/1/edit?html,output
Note that per the normative text in https://html.spec.whatwg.org/#update-the-image-data, src="" always causes a broken image. (Instead of, e.g., fetching the contents of the base URL after resolving the empty string against the page's base URL.)
Based on the above test case appear to be several behaviors in current browsers for broken images:
So I guess we should update the spec to point toward the first option here, revert the Chrome change, and file an Edge bug? What do you think?
Note that the
This was referenced
Dec 24, 2017
added a commit
Jan 2, 2018
Reopening so this feedback by @triple-underscore is considered: