W3C home > Mailing lists > Public > whatwg@whatwg.org > February 2007

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

From: Jorgen Horstink <mail@jorgenhorstink.nl>
Date: Sun, 11 Feb 2007 12:37:50 +0100
Message-ID: <DABAA602-B430-44CC-989F-C5210D680B7E@jorgenhorstink.nl>

On Feb 11, 2007, at 12:01 PM, Geoffrey Sneddon 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>?

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.

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

> - Geoffrey Sneddon
Received on Sunday, 11 February 2007 03:37:50 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:52 UTC