Ticket #4690: 4690_2.patch
File 4690_2.patch, 1.7 KB (added by , 15 years ago) |
---|
-
_source/core/htmlparser/fragment.js
264 264 265 265 parser.onTagClose = function( tagName ) 266 266 { 267 var index = 0,267 var index = pendingInline.length - 1, 268 268 pendingAdd = [], 269 269 candidate = currentNode; 270 270 … … 273 273 // If this is an inline element, add it to the pending list, so 274 274 // it will continue after the closing tag. 275 275 if ( !candidate._.isBlockLike ) 276 { 277 pendingInline.unshift( candidate ); 276 pendingInline.push( candidate ); 278 277 279 // Increase the index, so it will not get checked again in280 // the pending list check that follows.281 index++;282 }283 284 278 // This node should be added to it's parent at this point. But, 285 279 // it should happen only if the closing tag is really closing 286 280 // one of the nodes. So, for now, we just cache it. … … 313 307 // The tag is not actually closing anything, thus we need invalidate 314 308 // the pending elements.(#3862) 315 309 else 316 { 317 pendingInline.splice( 0, index ); 318 index = 0; 319 } 310 pendingInline.length = index + 1; 320 311 321 // Check if there is anypending tag to be closed.322 for ( ; index < pendingInline.length ; index++)312 // Check if there is one pending tag to be closed. 313 for ( ; index >= 0 ; index-- ) 323 314 { 324 315 // If found, just remove it from the list. 325 316 if ( tagName == pendingInline[ index ].name ) 326 317 { 327 318 pendingInline.splice( index, 1 ); 328 329 // Decrease the index so we continue from the next one. 330 index--; 319 break; 331 320 } 332 321 } 333 322 };