File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
src/nu/validator/htmlparser/impl Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -3360,14 +3360,15 @@ public final void endTag(ElementName elementName) throws SAXException {
3360
3360
}
3361
3361
}
3362
3362
eltPos = currentPtr ;
3363
+ int origPos = currentPtr ;
3363
3364
for (;;) {
3364
3365
if (eltPos == 0 ) {
3365
3366
assert fragment : "We can get this close to the root of the stack in foreign content only in the fragment case." ;
3366
3367
break endtagloop ;
3367
3368
}
3368
3369
if (stack [eltPos ].name == name ) {
3369
3370
while (currentPtr >= eltPos ) {
3370
- pop ( );
3371
+ popForeign ( origPos );
3371
3372
}
3372
3373
break endtagloop ;
3373
3374
}
@@ -5226,6 +5227,17 @@ private void pop() throws SAXException {
5226
5227
node .release (this );
5227
5228
}
5228
5229
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
+
5229
5241
private void silentPop () throws SAXException {
5230
5242
StackNode <T > node = stack [currentPtr ];
5231
5243
assert debugOnlyClearLastStackSlot ();
You can’t perform that action at this time.
0 commit comments