W3C home > Mailing lists > Public > public-html@w3.org > June 2008

Re: In body other end tag handling convoluted to get at most one error

From: Henri Sivonen <hsivonen@iki.fi>
Date: Tue, 24 Jun 2008 14:21:04 +0300
Cc: HTML WG <public-html@w3.org>
Message-Id: <DEAFD0B9-7570-4076-9FFA-2D9295F13F77@iki.fi>
To: Ian Hickson <ian@hixie.ch>

On May 24, 2008, at 12:03, Ian Hickson wrote:

> On Fri, 4 Apr 2008, Henri Sivonen wrote:
>>>
>>> An end tag token not covered by the previous entries [...]
>>
>> I think the above formulation is confusing, because it runs through
>> complicated steps in the simple case: when the node on the stack  
>> indeed
>> matches the token.
>
> When the token matches the current node, the steps are:
[...]
> I guess that's mildly more complicated than necessary, but it's hardly
> "complicated steps". Still, UAs can trivially optimise it by adding:
>
>   If current node == token:
>      Pop node. Abort.
>
> ...to the top of the algorithm, without affecting black box  
> conformance in
> any way.

Done.

>> It seems to me that the whole purpose of the complication (searching
>> stack first and then batch-popping instead of popping as the search
>> proceeds) is to give on error about premature end tag instead of  
>> giving
>> many error one per each unclosed element.
>
> Partially, but it's also to avoid the bug your code has:
[...]
> What does your code do with this?:
>
>   <div><p>Hello</x> World

Fixed on trunk and test case added to html5lib repo.

Thanks.

-- 
Henri Sivonen
hsivonen@iki.fi
http://hsivonen.iki.fi/
Received on Tuesday, 24 June 2008 11:21:46 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 9 May 2012 00:16:18 GMT