Source/core/html/HTMLTableSectionElement.cpp
// these functions are rather slow, since we need to get the row at
// the index... but they aren't used during usual HTML parsing anyway
these functions are rather slow, since we need to get the row at
the index... but they aren't used during usual HTML parsing anyway
these functions are rather slow since we need to get the row at the index ... but they aren ' t used during usual HTML parsing anyway
PassRefPtrWillBeRawPtr<HTMLElement> HTMLTableSectionElement::insertRow(int index, ExceptionState& exceptionState)
{
    RefPtrWillBeRawPtr<HTMLCollection> children = rows();
    int numRows = children ? static_cast<int>(children->length()) : 0;
    if (index < -1 || index > numRows) {
        exceptionState.throwDOMException(IndexSizeError, "The provided index (" + String::number(index) + " is outside the range [-1, " + String::number(numRows) + "].");
        return nullptr;
    }
    RefPtrWillBeRawPtr<HTMLTableRowElement> row = HTMLTableRowElement::create(document());
    if (numRows == index || index == -1)
        appendChild(row, exceptionState);
    else
        insertBefore(row, children->item(index), exceptionState);
    return row.release();
}
PassRefPtrWillBeRawPtr < HTMLElement > HTMLTableSectionElement :: insertRow ( int index , ExceptionState & exceptionState ) { RefPtrWillBeRawPtr < HTMLCollection > children = rows ( ) ; int numRows = children ? static_cast < int > ( children -> length ( ) ) : 0 ; if ( index < -1 || index > numRows ) { exceptionState . throwDOMException ( IndexSizeError , " " + String :: number ( index ) + " " + String :: number ( numRows ) + " " ) ; return nullptr ; } RefPtrWillBeRawPtr < HTMLTableRowElement > row = HTMLTableRowElement :: create ( document ( ) ) ; if ( numRows == index || index == -1 ) appendChild ( row , exceptionState ) ; else insertBefore ( row , children -> item ( index ) , exceptionState ) ; return row . release ( ) ; }
these functions are rather slow, since we need to get the row at
the index... but they aren't used during usual HTML parsing anyway
these functions are rather slow since we need to get the row at the index ... but they aren ' t used during usual HTML parsing anyway