Open Bug 1400410 Opened 2 years ago Updated 1 year ago

img tag sizes attribute doesn't support all media condition forms

Categories

(Core :: Layout: Images, Video, and HTML Frames, defect, P3)

55 Branch
defect

Tracking

()

UNCONFIRMED
Tracking Status
firefox57 --- wontfix

People

(Reporter: bart, Unassigned)

References

Details

Attachments

(1 file)

Attached file test.html
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0
Build ID: 20170816210634

Steps to reproduce:

Load the attached test case. Resize the browser narrower and wider than 600px. Observe the images.

The test case has three img tags with the same srcset but different sizes parameters. The first uses "(min-width: 601px)" to choose the 1200x600 image. The second uses "not (max-width: 600px)". The third uses "(width > 600px)". I believe all are valid media conditions.

See https://html.spec.whatwg.org/multipage/images.html#sizes-attribute
See https://drafts.csswg.org/mediaqueries/#typedef-media-condition


Actual results:

The first image switches between sources. The second and third display only the 600x200 source at all viewport sizes.


Expected results:

All three images should behave the same way.

Chrome (with a clear cache, loading the page with a narrow viewport) supports all three. (Resizing larger and then narrower again keeps the larger image visible in Chrome -- see https://stackoverflow.com/a/28368483/496046)
Component: Untriaged → Layout: Images
Product: Firefox → Core
This sounds a lot like: https://bugzilla.mozilla.org/show_bug.cgi?id=1149357#c24
Depends on: 1149357
Priority: -- → P3
It really doesn't look like the same thing to me, but I don't know much about browser internals.

Given that the first test case is working fine but the other two are not leads me to believe this issue is separate, and it's simply that media conditions of those two forms aren't yet understood by Firefox.
Yes, I believe that's correct. This may therefore be a duplicate of that or https://bugzilla.mozilla.org/show_bug.cgi?id=1312621
Product: Core → Core Graveyard
Product: Core Graveyard → Core
You need to log in before you can comment on or make changes to this bug.