Re: Canonicalizing relative URLs seen in URL type properties?

On Thu, 20 Oct 2011 02:10:12 +0200, John Panzer <jpanzer@google.com> wrote:

> What are the rules for canonicalizing URLs seen in URL valued  
> properties?  I
> would guess that whether or not a value appears in an HTML URL attribute  
> or
> is encoded some other way with microdata, the rules should be the same.
>  Which implies paying attention to <base> tags etc.  Is this correct?

This is defined in  
<http://www.whatwg.org/specs/web-apps/current-work/multipage/microdata.html#concept-property-value>:

"The value is the absolute URL that results from resolving the value of  
the element's src/href attribute relative to the element at the time the  
attribute is set, or the empty string if there is no such attribute or if  
resolving it results in an error."

Following the references, you'll find that you need to resolve the URL by  
(basically) parsing it and then putting it back together while taking  
<base> into account.

-- 
Philip Jägenstedt
Core Developer
Opera Software

Received on Thursday, 20 October 2011 08:27:06 UTC