function aaObtainFurthestBlock(p, formattingElementEntry) {
    let furthestBlock = null;
    let idx = p.openElements.stackTop;
    for (; idx >= 0; idx--) {
        const element = p.openElements.items[idx];
        if (element === formattingElementEntry.element) {
            break;
        }
        if (p._isSpecialElement(element, p.openElements.tagIDs[idx])) {
            furthestBlock = element;
        }
    }
    if (!furthestBlock) {
        p.openElements.shortenToLength(idx < 0 ? 0 : idx);
        p.activeFormattingElements.removeEntry(formattingElementEntry);
    }
    return furthestBlock;
}
//Steps 9 and 10 of the algorithm
Steps 9 and 10 of the algorithm
Steps 9 and 10 of the algorithm
function aaObtainFurthestBlock(p, formattingElementEntry) {
    let furthestBlock = null;
    let idx = p.openElements.stackTop;
    for (; idx >= 0; idx--) {
        const element = p.openElements.items[idx];
        if (element === formattingElementEntry.element) {
            break;
        }
        if (p._isSpecialElement(element, p.openElements.tagIDs[idx])) {
            furthestBlock = element;
        }
    }
    if (!furthestBlock) {
        p.openElements.shortenToLength(idx < 0 ? 0 : idx);
        p.activeFormattingElements.removeEntry(formattingElementEntry);
    }
    return furthestBlock;
}
function aaObtainFurthestBlock ( p , formattingElementEntry ) { let furthestBlock = null ; let idx = p . openElements . stackTop ; for ( ; idx >= 0 ; idx -- ) { const element = p . openElements . items [ idx ] ; if ( element === formattingElementEntry . element ) { break ; } if ( p . _isSpecialElement ( element , p . openElements . tagIDs [ idx ] ) ) { furthestBlock = element ; } } if ( ! furthestBlock ) { p . openElements . shortenToLength ( idx < 0 ? 0 : idx ) ; p . activeFormattingElements . removeEntry ( formattingElementEntry ) ; } return furthestBlock ; }
Steps 9 and 10 of the algorithm
Steps 9 and 10 of the algorithm