Skip to content

Auto-sizes: parsing of auto in sizes is bogus #9649

@zcorpan

Description

@zcorpan

I noticed that https://html.spec.whatwg.org/multipage/images.html#parsing-a-sizes-attribute doesn't seem to do what I intended it to do, if there are items after auto:

sizes="auto, 200px"

Step 3.3 here says to return size i.e. the auto keyword. Steps 5 and 6, which translates auto to a length, is not reached, so it's undefined what it means.

Also, if there is a media condition before auto:

sizes="(min-width: 0) auto, 200px"

Then step 3.5 does not return, and also doesn't abort the loop, so the loop continues with the next /unparsed size/ and then returns 200px.

How to fix this might depend on #9648 and #9493

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