New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop candidates with `w` descriptors if `w`is unsupported #244

Closed
eeeps opened this Issue Sep 24, 2014 · 3 comments

Comments

Projects
None yet
3 participants
@eeeps

eeeps commented Sep 24, 2014

Per #239, given:

<img src="fallback.jpg" srcset="a.jpg 100h, b.jpg 200h" />

In a browser that doesn’t support h, we drop both candidates and the src is picked.

But given:

<img src="fallback.jpg" srcset="a.jpg 100w, b.jpg 200w" />

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:

http://ircbot.responsiveimages.org/bot/log/respimg/2014-08-14#T86684

...shame it didn't make it into the released versions.

@eeeps

This comment has been minimized.

Show comment
Hide comment
@eeeps

eeeps Sep 24, 2014

It occurs to me that maybe I should have titled this “Drop candidates with only w 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 (?)

eeeps commented Sep 24, 2014

It occurs to me that maybe I should have titled this “Drop candidates with only w 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 (?)

@tabatkins

This comment has been minimized.

Show comment
Hide comment
@tabatkins

tabatkins Sep 24, 2014

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.)

tabatkins commented Sep 24, 2014

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.)

@zcorpan

This comment has been minimized.

Show comment
Hide comment
@zcorpan

zcorpan Sep 26, 2014

Proposed change:

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>

zcorpan commented Sep 26, 2014

Proposed change:

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>

@zcorpan zcorpan closed this in 0e65426 Sep 29, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment