File tree Expand file tree Collapse file tree
src/nu/validator/htmlparser/impl Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3360,14 +3360,15 @@ public final void endTag(ElementName elementName) throws SAXException {
33603360 }
33613361 }
33623362 eltPos = currentPtr ;
3363+ int origPos = currentPtr ;
33633364 for (;;) {
33643365 if (eltPos == 0 ) {
33653366 assert fragment : "We can get this close to the root of the stack in foreign content only in the fragment case." ;
33663367 break endtagloop ;
33673368 }
33683369 if (stack [eltPos ].name == name ) {
33693370 while (currentPtr >= eltPos ) {
3370- pop ( );
3371+ popForeign ( origPos );
33713372 }
33723373 break endtagloop ;
33733374 }
@@ -5226,6 +5227,17 @@ private void pop() throws SAXException {
52265227 node .release (this );
52275228 }
52285229
5230+ private void popForeign (int origPos ) throws SAXException {
5231+ StackNode <T > node = stack [currentPtr ];
5232+ if (origPos != currentPtr ) {
5233+ markMalformedIfScript (node .node );
5234+ }
5235+ assert debugOnlyClearLastStackSlot ();
5236+ currentPtr --;
5237+ elementPopped (node .ns , node .popName , node .node );
5238+ node .release (this );
5239+ }
5240+
52295241 private void silentPop () throws SAXException {
52305242 StackNode <T > node = stack [currentPtr ];
52315243 assert debugOnlyClearLastStackSlot ();
You can’t perform that action at this time.
0 commit comments