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

Already on GitHub? Sign in to your account

Why is the type attribute of source ignored? #13

Closed
mtolk opened this Issue Dec 5, 2012 · 3 comments

Comments

Projects
None yet
3 participants

mtolk commented Dec 5, 2012

In the spec under, Algorithm for deriving the source image, it says:
"To avoid complexity, the type attribute is all child source elements is ignored in this context."

If you want to download the smallest possible image that a browser can handle the type attribute can be very usefull.

Please see this example by David Newton in a picturefill fork.

Browser that support it can use the smaller webp. Other browsers can fall back to jpg.
This would also make the picture/source future-proof as it would allow for support of new imagetypes.

Maybe I'm missing something but is this really that complex?

Member

anselmh commented Dec 5, 2012

IMO this is a valid point. I would say the developer should be able to set type attr if he decides he wants to use this kind of differentiation.


Anselm

On 05.12.2012, at 10:02, Marco Tolk notifications@github.com wrote:

In the spec under, Algorithm for deriving the source image, it says:
"To avoid complexity, the type attribute is all child source elements is ignored in this context."

If you want to download the smallest possible image that a browser can handle the type attribute can be very usefull.

Please see this example by David Newton in a picturefill fork.

Browser that support it can use the smaller webp. Other browsers can fall back to jpg.
This would also make the picture/source future-proof as it would allow for support of new imagetypes.

Maybe I'm missing something but is this really that complex?


Reply to this email directly or view it on GitHub.

Owner

marcoscaceres commented Dec 5, 2012

@mtolk this was my fault. The described algorithm is currently just a strawman proposal and I was trying to avoid some complexity. I have now added some text that first checks the if the type is supported by the browser. The proposed algorithm is by no means robust, it's just a point for discussion. The document now says:

So, to derive the source image: ignoring any sources whose type is not supported by the browser, gather all the media queries from the source elements' media attributes into a "stylesheet", in document order.

@mtolk, if you are satisfied with the above change, please close the bug.

mtolk commented Dec 5, 2012

@marcoscaceres. Sounds great.

@mtolk mtolk closed this Dec 5, 2012

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