why don't use picture and source elements instead of divs? #62

Closed
pocesar opened this Issue Mar 15, 2013 · 13 comments

8 participants

@pocesar

Since there is an already working draft for the picture and source elements, why not use these instead of divs?

http://www.w3.org/TR/2013/WD-html-picture-element-20130226/

Using the shiv for unsupported browsers that document.createElement('picture') and document.createElement('source') can make this future proof, even though the specification might change in the near future.

@scottjehl
Owner
@Zauberfisch

-1

[...] even though the specification might change in the near future.

that's the issue.
if the specifications change, we would have many websites out there using the tag in a wrong way
if you ask me, this is a bad idea at the moment.

@pocesar

most likely it won't change, they boast it in their group site http://responsiveimages.org/

@Wilto
Collaborator

+1 to Scott’s comment, on behalf of the RICG. It would be good to have the original markup working in a branch, but it’s too early to change it over altogether.

@scottjehl
Owner
@beep
Collaborator

I personally favor more conservative markup. +1 to @scottjehl’s suggestion of waiting a bit.

@scottjehl
Owner

A branch would be great.

Also, if we end up polyfilling the srcset attribute for that approach, we might want to keep it as a separate JS extension/file so it can be optionally included for those who want that syntactic sugar, as the more complete polyfills I've seen for that can be somewhat heavy, and a polyfill'd approach to srcset won't bring any benefits that I can think of over existing media attr. capabilities.

@Wilto
Collaborator

The TAG has requested that the RICG put together a web component version of Picturefill, intended to follow the spec to the letter using custom tags but with x- prefixed element names to prevent what @Zauberfisch describes. That might better solve the original issue.

That work is (just now) underway at https://github.com/ResponsiveImagesCG/picture-web-component

@tysonmatanich

We could also make the tag names configurable instead of having separate branches for each implementation. I like the idea of x- to bring it more in line with the spec while not causing future issues.

@scottjehl
Owner
@scottjehl
Owner

Thanks for your ideas here. We're closing this out as Picturefill moves to support the new standard markup landing in browsers. So, I guess that's kind of a fix! :) Thread here: #125

@scottjehl scottjehl closed this Feb 28, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment