W3C home > Mailing lists > Public > public-respimg@w3.org > November 2012

Re: Seeking use cases for knowing the currently selected source

From: Konopacki, Daniel <Daniel.Konopacki@disney.com>
Date: Fri, 30 Nov 2012 14:15:40 -0800
To: Marcos Caceres <w3c@marcosc.com>, Miguel Garcia <magarcia2@me.com>
CC: Scott Jehl <scott@scottjehl.com>, "public-respimg@w3.org" <public-respimg@w3.org>
Message-ID: <CCDE6F37.2522%daniel.konopacki@disney.com>
I asked within Disney and am hoping for some more responses. At the
moment, though, I did get this from ESPN:

"One use-case of needing the selected source URL from the <picture> tag is
if you wanted to create a responsive <canvas> where you are loading an
image and manipulating the data."

Similar in concept to this:

On 11/27/12 4:32 PM, "Marcos Caceres" <w3c@marcosc.com> wrote:

>Agreed 100%, but we need to check for conflicts (as we are redefining how
>an attribute works). There must be a reason why video has both src and
>currentSrc? Irrespective, we need a strong use case.
>Sent from my iPhone
>On 28 Nov 2012, at 00:23, Miguel Garcia <magarcia2@me.com> wrote:
>> As would I. This behavior not only makes the most sense, it provides
>>the greatest level of backward compatibility with current behavior.
>> Miguel Garcia II
>> On Nov 27, 2012, at 11:24 AM, Scott Jehl <scott@scottjehl.com> wrote:
>>> I would expect the src property (not attribute) to return the current
>>>image source href.
>>> On Nov 27, 2012, at 10:56 AM, Marcos Caceres wrote:
>>>> Hi,  
>>>> with the srcset attribute, there is currently no way for a developer
>>>>to determine what the currently selected source is for an element.
>>>> Apart from testing, can anyone thing of any good use cases for
>>>>accessing the current source?
>>>> If we can get some good use cases, then we make a case to add it a
>>>> What I envision is an IDL attribute that returns the resolved URL of
>>>>the current source.
>>>> so:
>>>> srcset="foo x2, bar 1x"
>>>> Where foo is selected. Then, in JS:
>>>> //read only
>>>> var url = element.currentSrc
>>>> would return: "http://example.com/foo"
>>>> I'm asking because Hixie said that the testing use case is not strong
>>>>enough to warrant adding the above attribute to the srcset spec. To
>>>>get the attribute added, we would need a strong use case(s) and
>>>>backing from a browser vendor.
>>>> Kind regards,
>>>> Marcos 
>>>> -- 
>>>> Marcos Caceres
Received on Friday, 30 November 2012 22:16:02 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:06:08 UTC