Closed Bug 1052417 Opened 10 years ago Closed 10 years ago

Default `sizes` attribute value for `srcset` should be 100vw

Categories

(Core :: DOM: Core & HTML, defect)

34 Branch
x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla36

People

(Reporter: remi+bugzilla, Assigned: johns)

References

Details

(Keywords: testcase)

Attachments

(2 files)

Attached file srcset-nosizes.html
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36 Steps to reproduce: On the current version of Firefox Nightly (34.0a1), make sure to activate the flags for responsive images with `srcset`. (Go to about:config and set `dom.image.srcset.enabled` and `dom.image.picture.enabled` to true.) Open a page with an <img> with srcset attribute with various images. For example the following : <img src="http://i.imgur.com/pnUUCFQ.png" srcset="http://i.imgur.com/35cz49W.png 480w, http://i.imgur.com/X7vSnQV.png 640w, http://i.imgur.com/JqqqI8g.png 1440w" /> Actual results: No matter the window resolution, the first image of the `srcset` list is always shown. Other images of the `srcset` list are never visible. Expected results: Correct images depending of the window resolution should be shown. This actually works if you had a `sizes` attribute with a `100vw` value. But the specification clearly states that the default value for `sizes` is `100vw` and that in this case, the attribute could be omitted. See http://www.w3.org/html/wg/drafts/html/master/embedded-content.html#the-picture-element
Component: Untriaged → DOM
Product: Firefox → Core
John, can you have a look?
Flags: needinfo?(jschoenick)
Keywords: testcase
Assignee: nobody → jschoenick
Flags: needinfo?(jschoenick)
Blocks: picture-prefon
No longer blocks: srcset-prefon
Status: UNCONFIRMED → ASSIGNED
Depends on: 1017878
Ever confirmed: true
Flags: in-testsuite?
This was incompletely updated -- we use 100vw as a default, but reject sizes-using candidates if we had no attribute per an earlier spec. Just removing that bailout works as expected. The picture tests in Bug 1023519 will cover this
Attachment #8501374 - Flags: review?(jst)
Attachment #8501374 - Flags: review?(jst) → review+
Blocks: 1017878
No longer depends on: 1017878
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: