Skip to content
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

img srcset and picture #661

Closed
davidmarkclements opened this issue Aug 20, 2012 · 3 comments · Fixed by #1105
Closed

img srcset and picture #661

davidmarkclements opened this issue Aug 20, 2012 · 3 comments · Fixed by #1105

Comments

@davidmarkclements
Copy link

Apologies if this is sort of "non-issuey" but it will become an issue a some point.

I know it's a little early, as no browsers have implemented yet, but would anyone have an idea how to detect img srcset[1] functionality and the picture[2] element. I could probably work out the picture element with no problem, but how do you know if an attribute on the img element is meaningful to the browser?

[1] http://www.whatwg.org/specs/web-apps/current-work/multipage/embedded-content-1.html#attr-img-srcset

[2] http://lists.w3.org/Archives/Public/public-html/2012Jul/0123.html

@aFarkas
Copy link
Member

aFarkas commented Aug 20, 2012

@davidmarkclements

In most cases the content attribute is also reflected by a DOM property (often also called IDL attribute). You find this in the DOM interface section. In case of srcset, there is indeed a corresponding DOM property on the img object.

Your test could look like this:

Modernizr.addTest('srcset', ('srcset' in document.createElement('img')) );

@davidmarkclements
Copy link
Author

thanks aFarkas!

@patrickkettner
Copy link
Member

Should this issue be closed or are we waiting on an actual test?

patrickkettner added a commit to patrickkettner/Modernizr that referenced this issue Dec 2, 2013
patrickkettner added a commit to patrickkettner/Modernizr that referenced this issue Feb 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants