W3C home > Mailing lists > Public > whatwg@whatwg.org > March 2008

[whatwg] Issues concerning the <base> element and xml:base

From: Maciej Stachowiak <mjs@apple.com>
Date: Sat, 1 Mar 2008 17:12:24 -0800
Message-ID: <FDA774F7-4085-46CA-B1A8-01B746782FF2@apple.com>

On Mar 1, 2008, at 4:20 PM, Jonas Sicking wrote:

> Anne van Kesteren wrote:
>> On Sat, 01 Mar 2008 13:29:41 +0100, Jonas Sicking  
>> <jonas at sicking.cc> wrote:
>>> Personally it's something I would be very reluctant to do. It  
>>> would add a whole lot of code for basically no benefit for web  
>>> developers. I have never heard of anyone that actually desired  
>>> changing the base uri for all or parts of a page dynamically.
>> Note that the new base URI would only take effect once you actually  
>> did something with a potentially affected object. For instance,  
>> <img> would not start loading a new image if the base URI changes.  
>> <img>.src = <img>.getAttribute("src") could start loading a new  
>> resource however if the base URI changed since the initial load.
> Well, that was my intention with the initial proposal. But Hixie  
> pointed out that "did something" is a very hard thing to define.

I'd propose that resolution is always done against the base in effect  
at the time the URI is resolved. So changing the base would never  
trigger a reload short of another action.

> For example on a <a href="...">, does the user hovering the node  
> count?

If you display an absolute URI to the user at this time it should get  
resolved against the current base, but since this is not a load, it  
should get resolved again when the user clicks the link, if the base  

> Does resizing the window count?

No, this does not resolve any URIs.

> Does removing the node from the DOM and reinserting it count?

For an <a> element this would not trigger any URI resolution. Nor for  
an <img> element, since their loading is independent of whether or not  
they are in the document. I'd guess it is the same for other elements  
that may trigger a load, but I haven't done a careful review.

Received on Saturday, 1 March 2008 17:12:24 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:01 UTC