In a browser that supports x, but not w, (like, oh, iOS 8 Safari, or Safari 7.1), behavior is unspecified. I think it should be spec'd to mirror h; drop both srcset candidates and fall back to the src.
I think @yoavweiss already made this change in WebKit:
It occurs to me that maybe I should have titled this “Drop candidates with onlyw descriptors if w is unsupported”. Not that anyone should be writing stuff like srcset="a.jpg 2x 320w", but if they do, it probably makes sense to use the 2x & candidate (?)
Browsers shouldn't be partially implementing in the first place; they just need to support w descriptors properly. (But I'll comment on the other thread, where I have a more relevant opinion.)
diff --git a/source b/source
index 57121db..f5280c9 100644
--- a/source+++ b/source@@ -1738,6 +1738,16 @@ interface <dfn>HTMLImageElement</dfn> : <span>HTMLElement</span> {
<ol>
+ <li>++ <p>If the user agent does not support the <code data-x="attr-img-sizes">sizes</code> attribute,+ let <var>error</var> be <i>yes</i>.</p>++ <p class="note">A conforming user agent will support the <code data-x="attr-img-sizes">sizes</code> attribute.+ However, user agents typically implement and ship features in an incremental manner in practice.</p>++ </li>+
<li><p>If <var>width</var> and <var>density</var>
are not both <i>absent</i>,
then let <var>error</var> be <i>yes</i>.</p></li>
eeeps commentedSep 24, 2014
Per #239, given:
In a browser that doesn’t support
h
, we drop both candidates and thesrc
is picked.But given:
In a browser that supports
x
, but notw
, (like, oh, iOS 8 Safari, or Safari 7.1), behavior is unspecified. I think it should be spec'd to mirrorh
; drop bothsrcset
candidates and fall back to thesrc
.I think @yoavweiss already made this change in WebKit:
http://ircbot.responsiveimages.org/bot/log/respimg/2014-08-14#T86684
...shame it didn't make it into the released versions.
The text was updated successfully, but these errors were encountered: