[Imps] <a><p>X<a>Y</a>Z</p></a> and # of errors in tree construction

Henri Sivonen hsivonen at iki.fi
Thu Jul 12 05:54:18 PDT 2007


html5lib test cases (tests1.dat) says
3: missing document type declaration
10: a element start tag implying a element end tag
10: mismatched a element end tag (misnested tags)
24: mismatched a element end tag (no matching start tag)

My reading of the spec and my impl say that there should be *three*  
errors on col 10.

1. First, you get the error from the start tag implying the end tag.

2. Then the implied end tag hits "Otherwise, there is a formatting  
element and that element is in the stack and is in scope. If the  
element is not the current node, this is a parse error."

3. Then the last step of the AAA jumps back to step #1 and the  
implied end tag hits "Otherwise, if there is such a node, but that  
node is not in the stack of open elements, then this is a parse  
error; remove the element from the list, and abort these steps."

Does this make sense?

(Whether it is a good idea that you can hit more than one error  
inside the AAA is another matter. :-)

-- 
Henri Sivonen
hsivonen at iki.fi
http://hsivonen.iki.fi/





More information about the Implementors mailing list