Skip to content

<img> setting src = "" should maybe be sync #2429

@zcorpan

Description

@zcorpan

https://html.spec.whatwg.org/#updating-the-image-data

If the element does not use srcset or picture, and it has a src attribute specified and its value is not the empty string, let selected source be the value of the element's src attribute, and selected pixel density be 1.0. Otherwise, let selected source be null and selected pixel density be undefined.

From web-platform-tests/wpt#5060

See http://software.hixie.ch/utilities/js/live-dom-viewer/saved/4936

It seems that in Chromium and Gecko this case is sync (doesn't await a stable state).

With picture: http://software.hixie.ch/utilities/js/live-dom-viewer/saved/4937

Chromium: still sync. Gecko awaits a stable state. Per spec updates shouldn't be sync if srcset or picture are used.

WebKit seems a bit weird for the case of setting src to empty string or removing the src attribute doesn't change .width or the rendered dimensions but it doesn't render the old image.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions