Support picture in the img complete getter steps#12629
Draft
johannesodland wants to merge 1 commit into
Draft
Conversation
8728a45 to
5956ead
Compare
Solves: whatwg#9346 The HTMLImageElement complete getter steps currently return true if the `src` and `srcset` attributes are omitted from the `img` element, regardless of any parent picture element and sibling source elements. As a result, the complete getter steps return true, even though there might be a current request with a state of `Unavailable` or `Partially available`. This will give an unexpected result for authors that have provided `source` elements for a `picture` element, but omitted `src` and `srcset` on the `img` element. This PR replaces the attribute based check with a check on the result of `selecting an image source`. There is a separate issue to remove the requirement for a `src` or `srcset` on the `img` element: whatwg#11313
5956ead to
9665a5b
Compare
johannesodland
added a commit
to johannesodland/wpt
that referenced
this pull request
Jul 1, 2026
This PR adds test for img.complete in two areas: - img src omitted srcset empty - picture parent with source siblings We lack interoperability in these two areas, and the current spec lack support for a picture parent. See: whatwg/html#9346 The expected results follow the suggested edit to the HTML spec, aligning with the WebKit and Blink implementation: whatwg/html#12629
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Solves: #9346
The HTMLImageElement complete getter steps currently return true if the
srcandsrcsetattributes are omitted from theimgelement, regardless of any parent picture element and sibling source elements. As a result,the complete getter steps return true, even though there might be a current request with a state of
UnavailableorPartially available.This will give an unexpected result for authors that have provided
sourceelements for apictureelement, but omittedsrcandsrcseton theimgelement.This PR replaces the attribute based check with a check on the result of
selecting an image source.There is a separate issue to remove the requirement for a
srcorsrcseton theimgelement: #11313(See WHATWG Working Mode: Changes for more details.)
/embedded-content.html ( diff )