Last Comment Bug 1052417 - Default `sizes` attribute value for `srcset` should be 100vw
: Default `sizes` attribute value for `srcset` should be 100vw
: testcase
Product: Core
Classification: Components
Component: DOM (show other bugs)
: 34 Branch
: x86 macOS
-- normal (vote)
: mozilla36
Assigned To: John Schoenick [:johns]
: Hsin-Yi Tsai [:hsinyi]
Depends on:
Blocks: picture-prefon 1017878
  Show dependency treegraph
Reported: 2014-08-12 06:23 PDT by Remi
Modified: 2014-10-24 18:30 PDT (History)
6 users (show)
johns: in‑testsuite?
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

srcset-nosizes.html (596 bytes, text/html)
2014-08-12 06:23 PDT, Remi
no flags Details
Don't bailout of sizes selection if sizes wasn't provided (1012 bytes, patch)
2014-10-07 15:13 PDT, John Schoenick [:johns]
jst: review+
Details | Diff | Splinter Review

Description User image Remi 2014-08-12 06:23:24 PDT
Created attachment 8471563 [details]

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="" srcset=" 480w, 640w, 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
Comment 1 User image :Gijs (he/him) 2014-08-12 07:28:25 PDT
John, can you have a look?
Comment 2 User image John Schoenick [:johns] 2014-10-07 15:13:45 PDT
Created attachment 8501374 [details] [diff] [review]
Don't bailout of sizes selection if sizes wasn't provided

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
Comment 4 User image Wes Kocher (:KWierso) 2014-10-24 18:30:22 PDT

Note You need to log in before you can comment on or make changes to this bug.