Skip to content

Conversation

@jakearchibald
Copy link
Collaborator

@jakearchibald jakearchibald commented May 19, 2021

Fixes #6633 by allowing sizes data to come from the <img> if a particular sibling <source> doesn't have a sizes attribute.

(See WHATWG Working Mode: Changes for more details.)


/images.html ( diff )
/infrastructure.html ( diff )


/embedded-content.html ( diff )
/images.html ( diff )

@jakearchibald
Copy link
Collaborator Author

I'll create the implementation bugs if folks are happy with this.

@jakearchibald
Copy link
Collaborator Author

Open question, should the return of source.sizes reflect this change?

@zcorpan
Copy link
Member

zcorpan commented Aug 18, 2025

Open question, should the return of source.sizes reflect this change?

I think no. It's less surprising if it more closely reflects getAttribute(). We also don't do anything special for width and height IDL attributes.

@jakearchibald jakearchibald requested a review from zcorpan August 18, 2025 08:53
@jakearchibald jakearchibald requested a review from zcorpan August 18, 2025 12:54
Copy link
Member

@zcorpan zcorpan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The document conformance requirements should be changed to allow specifying sizes on img (maybe unconditionally for simplicity). And require sizes on img if one of the sources uses w and omits sizes.

@jakearchibald
Copy link
Collaborator Author

TODO: Simplify sizes just to cases where it must be there. It 'may' be there in other cases. Update tests too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Allow <source> to use <img>'s sizes data as a fallback

4 participants