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

Ian Hickson ian at hixie.ch
Tue Feb 12 17:15:07 PST 2008


On Mon, 13 Aug 2007, Jonas Sicking wrote:
> Ian Hickson wrote:
> > > Also, if we're going to be inconsistent in how current browsers and web
> > > pages handle multiple <base>s, why not simply use the first <base> for
> > > both href="" and target=""?
> > 
> > Done.
> 
> I realized another limitation. It is very hard for implementations to 
> 'correctly' deal with dynamic modifications to bases. Ideally all 
> external resources, such as <iframe>s, <img>s, css backgrounds, 
> <svg:use> elements and css @imports should be updated to potentially use 
> new URIs. This can happen when <base> elements and xml:base attributes 
> are inserted or mutated. So far no UA that I know of does this, and it 
> would be very hard to implement.

I completely agree with you that this is an area that is problematic.


> What I suggest is that we add similar language as the XBL spec does for 
> xmlns attributes and xbl:attr attributes. Say that dynamic modifications 
> are allowed, but that the implementation is not expected to update the 
> resolved URI unless the URI is explicitly touched.

Unfortunately it's unclear when that would be. At least with xbl:attr we 
have a somewhat well-defined set of steps for when things happen. Here 
it's far less clear. For example, clicking a link is likely to reresolve 
the URI relative to the base URI. Maybe even hovering it might. Or maybe 
even just a repaint in general.

I'm not sure what to do here. It seems like UAs should support a 
notification mechanism so that when a base URI is changed, all URIs in the 
document (for <base>) or in that subtree (for xml:base) get reresolved. 
That actually seems relatively simple and has little (no) overhead in the 
common case of nothing being changed.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'



More information about the whatwg mailing list