[whatwg] Expected behaviour when a <base> is within an innerHTML fragment

Anne van Kesteren annevk at opera.com
Sun Feb 11 03:44:45 PST 2007

On Sun, 11 Feb 2007 12:37:50 +0100, Jorgen Horstink  
<mail at jorgenhorstink.nl> wrote:
>> To take this from a discussion last month on atom-syntax:
>> What is meant to happen if you set innerHTML of a <div> where the set  
>> value has both a <base> and an <a>?

There's an open issue on this: "Need to cope with second and subsequent  
base elements affecting subsequent elements magically."

> first of all the <base> element can only be inserted in HTML documents.  
> The spec states that there can only be one <base> element. The <base>  
> element must  be used before any elements that use relative URI's.
> If the insertion mode is "in body" handle the token as follows:
>        A start tag token whose tag name is one of: "base", "link",  
> "meta", "title"
>        Parse error. Process the token as if the insertion mode had been  
> "in head". [1]
> So inserting a <base> element in the body results in a parse error.

Well, it also tells you how to deal with this parse error.

> [1] http://www.whatwg.org/specs/web-apps/current-work/#how-to0

Anne van Kesteren

More information about the whatwg mailing list