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

RESOLVED FIXED in mozilla36

Status

()

RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: remi+bugzilla, Assigned: johns)

Tracking

(Blocks: 1 bug, {testcase})

34 Branch
mozilla36
x86
Mac OS X
testcase
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite ?

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

4 years ago
Created attachment 8471563 [details]
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

Updated

4 years ago
Component: Untriaged → DOM
Product: Firefox → Core

Comment 1

4 years ago
John, can you have a look?
Blocks: 1018389
Flags: needinfo?(jschoenick)
Keywords: testcase
(Assignee)

Updated

4 years ago
Assignee: nobody → jschoenick
Flags: needinfo?(jschoenick)
(Assignee)

Updated

4 years ago
Blocks: 1017875
No longer blocks: 1018389
Status: UNCONFIRMED → ASSIGNED
Depends on: 1017878
Ever confirmed: true
Flags: in-testsuite?
(Assignee)

Comment 2

4 years ago
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
Attachment #8501374 - Flags: review?(jst)

Updated

4 years ago
Attachment #8501374 - Flags: review?(jst) → review+
(Assignee)

Updated

4 years ago
Blocks: 1017878
No longer depends on: 1017878
https://hg.mozilla.org/mozilla-central/rev/9b7fce122203
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
You need to log in before you can comment on or make changes to this bug.