W3C home > Mailing lists > Public > public-html@w3.org > February 2009

Re: Drop foster-parented stuff on the floor if parent gone

From: Henri Sivonen <hsivonen@iki.fi>
Date: Mon, 23 Feb 2009 15:39:34 +0200
Cc: Jonas Sicking <jonas@sicking.cc>, HTMLWG WG <public-html@w3.org>
Message-Id: <81115C3E-BB1B-4613-BF5B-45F705DFB532@iki.fi>
To: Ian Hickson <ian@hixie.ch>
On Feb 1, 2009, at 10:52, Ian Hickson wrote:

> On Wed, 31 Dec 2008, Jonas Sicking wrote:
>>
>> An ideal algorithm would be something like this:
>> 1. Find the last table in the stack of open elements.
>> 2. Find the element in the stack of open elements that is right  
>> before
>> the last table in the stack of open elements. (this is generally the
>> parent of the table unless the DOM has been mutated)
>> 3. If an element was found in both 1 and 2, and the the table found  
>> in
>> 1 is a child of the element found in 2, insert the new node before  
>> the
>> table found in 1 and exit the algorithm.
>> 4. If an element was found in 2, append the new node to 2 and exit  
>> the
>> algorithm.
>> 5. Otherwise drop the node.
>
> Ok, I've done that instead.

I implemented this change.

It breaks compat with Firefox and Safari and it isn't consistent with  
IE8 or Opera, either.

The problem is this:
<a><table><a>
The second <a> removes the first from the stack before foster  
parenting runs, so the stack parent and the tree parent of table  
differ and the second <a> goes below the table instead of getting  
inserted above it.

-- 
Henri Sivonen
hsivonen@iki.fi
http://hsivonen.iki.fi/
Received on Monday, 23 February 2009 13:40:18 UTC

This archive was generated by hypermail 2.3.1 : Monday, 29 September 2014 09:39:01 UTC