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

Re: Seeking use cases for knowing the currently selected source

From: Scott Jehl <scott@scottjehl.com>
Date: Tue, 27 Nov 2012 11:24:04 -0600
Message-Id: <C1046C63-7E36-4949-A08B-1395554C931B@scottjehl.com>
To: public-respimg@w3.org
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 feature.
> 
> 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 Tuesday, 27 November 2012 17:24:30 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:12:39 UTC