W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2009

Re: [widgets] Widgets URI scheme... it's baaaack!

From: Arve Bersvendsen <arveb@opera.com>
Date: Fri, 22 May 2009 21:40:47 +0200
To: "William Edney" <bedney@technicalpursuit.com>
Cc: "Mark Baker" <distobj@acm.org>, marcosc@opera.com, public-webapps <public-webapps@w3.org>
Message-ID: <op.uucjl9fmbyn2jm@galactica>
On Fri, 22 May 2009 21:31:11 +0200, William Edney  
<bedney@technicalpursuit.com> wrote:

> Arve -
>
> Getting the value of 'src' here using  
> 'document.images[0].getAttribute("src")' should return the relative path.
>
> The Microsoft guys made a big deal out of the fact that IE8 (in IE8  
> 'strict standards' mode) will now properly return the relative path when  
> 'getAttribute()' is used, but the full path (as you state), when the  
> 'property access' version of the call is used. In IE < 8, some extra JS  
> to determine base path and then relativize the value would be necessary  
> in those browsers.

What Microsoft is doing here is fairly irrelevant. Gecko, Webkit and  
Presto all return the absolute URI for my exact example.  What you might  
be thinking of is getAttribute, which does return the raw contents of the  
attribute, but this is, afaict, not what browsers use to actually resolve  
the URI.


> Cheers,
>
> - Bill
>
> On May 22, 2009, at 2:22 PM, Arve Bersvendsen wrote:
>
>> On Fri, 22 May 2009 20:21:56 +0200, Mark Baker <distobj@acm.org> wrote:
>>
>>> I thought he had (somewhat grudgingly) accepted that way (the use of
>>> relative references) forward, as IIRC, the widget: scheme idea was
>>> dropped about that time.  Has some new requirement emerged since then
>>> that makes relative references an undesirable option?
>>
>> The problem here is that no user agent implementation I am aware of  
>> uses 'relative' URIs when resolving nodes.  If you provide <img  
>> src="foo/bar/baz.png" /> - they all compose an absolute URI from the  
>> string representing the relative URI, and expose that when you query  
>> for the attribute value, so putting my markup fragment into a document  
>> at the root of http://example.com/:
>>
>> <html>
>> <img src="foo/bar/baz.png" />
>> <script>
>> // The following Outputs http://example.com/foo/bar/baz.png
>> alert(document.images[0].src);
>> </script>
>> --Arve Bersvendsen
>>
>> Opera Software ASA, http://www.opera.com/
>>
>


-- 
Arve Bersvendsen

Opera Software ASA, http://www.opera.com/
Received on Friday, 22 May 2009 19:41:35 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:31 GMT