static _createCellsForRow()

in resources/perf.webkit.org/public/v3/components/analysis-results-viewer.js [334:361]


    static _createCellsForRow(columns, rowIndex)
    {
        const element = ComponentBase.createElement;
        const link = ComponentBase.createLink;

        const crateEmptyCell = (rowspan) => element('td', {rowspan: rowspan, class: 'stacking-block'}, '');

        const cells = [element('td', {class: 'stacking-block'}, '')];
        for (const blocksInColumn of columns) {
            if (!rowIndex && blocksInColumn[0].startRowIndex()) {
                cells.push(crateEmptyCell(blocksInColumn[0].startRowIndex()));
                continue;
            }
            for (let i = 0; i < blocksInColumn.length; i++) {
                const block = blocksInColumn[i];
                if (block.startRowIndex() == rowIndex) {
                    cells.push(block.createStackingCell());
                    break;
                }
                const rowCount = i + 1 < blocksInColumn.length ? blocksInColumn[i + 1].startRowIndex() : this._rowCount;
                const remainingRows = rowCount - block.endRowIndex() - 1;
                if (rowIndex == block.endRowIndex() + 1 && rowIndex < rowCount)
                    cells.push(crateEmptyCell(remainingRows));
            }
        }

        return cells;
    }