[whatwg] Question on Limits in Adaption Agency Algorithm

Ian Hickson ian at hixie.ch
Wed Jul 31 13:16:37 PDT 2013


On Mon, 1 Jul 2013, Ian Hickson wrote:
> 
> One option would be to remove from the stack of open elements any 
> elements that we are skipping when we bail out of the AAA.
> 
> Can anyone see a problem with doing that?

Since nobody raised any problems with this, I've now done this.

For background, this solves this case:

   <div><b><i><s><u><tt><p></b>123</p></tt></u></s>456

Before this fix, the output is "456 123", with the "123" covered by <s>, 
<u>, <tt>, and <b>, and the "123" covered by <b> and <i>. After the fix, 
the output is "123 456", with the "123" covered by <s>, <u>, and <b>, and 
the "456" covered by no formatting elements.

I could see an argument for leaving the elements in the list of formatting 
elements (so the output would be "123 456", with the "123" covered by <s>, 
<u>, and <b>, and the "456" covered by nothing, but with an <i> being 
reintroduced if you ended the whole thing with "<div>789"). Let me know if 
you think that's better.

This being a change to the parser, it's risky; in fact it could change the 
styles of nodes. However, I think getting the output of the parser to be 
in the same order as the input is something that is far more important 
than getting the exact formatting styles correct. This is not just moving 
nodes out of a <table>; the old parser rules here moved nodes way off into 
earlier parts of the DOM with no intuitive logic.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'



More information about the whatwg mailing list