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

[whatwg] overlap and Browser DOMs

From: James Graham <jg307@cam.ac.uk>
Date: Fri, 02 Feb 2007 18:17:00 +0000
Message-ID: <45C3801C.10205@cam.ac.uk>
Anne van Kesteren wrote:
> On Fri, 02 Feb 2007 19:04:37 +0100, Elliotte Harold 
> <elharo at metalab.unc.edu> wrote:
>> Consider the following markup:
>>
>> <div>
>> <p>...foo<strong id='s1'>...</p>
>> <p>...bar</strong> </p>
>> </div>
>>
>> Notice that the string element starts in one p and finished in the 
>> next. This is of course malformed and violates the tree structure.
>>
>> Has anyone documented how different browsers handle this in their 
>> respective DOMs? e.g. creating three separate strong elements or 
>> creating one that is a child of three parents?
> 
> http://whatwg.org/specs/web-apps/current-work/#parsing
> 
> html5lib |python parse.py -x "<div><p>foo<strong 
> id=x>...</p><p>bar</strong>...</p>| gives:

FWIW the spec/html5lib closely matches the behaviour of Firefox but not Opera (I 
don't have anything else to test). Also, I have no idea where you got the number 
three from... a typo?


-- 
"Eternity's a terrible thought. I mean, where's it all going to end?"
  -- Tom Stoppard, Rosencrantz and Guildenstern are Dead
Received on Friday, 2 February 2007 10:17:00 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:32 UTC