Skip to content
This repository

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

Closed
pocesar opened this Issue · 13 comments

8 participants

Paulo Cesar Scott Jehl Chris Caloggero Donald Allen Mat Marquis beep Tyson Matanich
Paulo Cesar

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.

Scott Jehl
Owner
Donald Allen

+1

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

Paulo Cesar

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

Mat Marquis
Collaborator
Wilto commented

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

Scott Jehl
Owner
beep
Collaborator
beep commented

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

Scott Jehl
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.

Mat Marquis
Collaborator
Wilto commented

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

Tyson Matanich

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.

Scott Jehl
Owner
Scott Jehl
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.