Re: Do we need the restrictions on the <base> element?

Henrik Dvergsdal wrote:
 > I can see how <base> is cheaper than xml:base because
> of problems related to reordering of nodes in the DOM tree. But, apart 
> from that, won't we have excactly the same problems with the current 
> <base> element?

The main performance issues come from base URI changes as nodes are moved in the 
DOM.  That problem does not exist with <base>.

> Furthermore xml:base seems to be a "normative part" of the spec already. 
> Does this mean that we have a base attribute? - at least in the XML 
> serialization

Effectively, yes.  Although you'll note that Firefox doesn't implement xml:base 
for XHTML... largely because we haven't figured out a good way to make it 
performant enough.

> And finally: Why must the <base> element occur only "In a head element, 
> after the meta element with the charset attribute, if any, but before 
> any other elements"? Does the sequencing of the elements in <head> 
> really matter?

Of course.  The <meta> comes first so the least amount of effort is wasted when 
you throw everything away and start parsing in the new encoding.  The <base> 
comes before anything with a URI attribute so you don't have to cancel a bunch 
of loads and start new ones.  Or worse yet, so you don't execute the wrong 
things, in the case of <script src="">.

-Boris

Received on Monday, 4 June 2007 07:12:55 UTC