Lines Matching refs:cell

59 static inline void updateLogicalHeightForCell(RenderTableSection::RowStruct& row, const RenderTableCell* cell)
62 if (cell->rowSpan() != 1)
65 Length logicalHeight = cell->style()->logicalHeight();
146 // If beforeChild is inside an anonymous cell/row, insert into the cell or into
198 void RenderTableSection::addCell(RenderTableCell* cell, RenderTableRow* row)
200 // We don't insert the cell if we need cell recalc as our internal columns' representation
206 unsigned rSpan = cell->rowSpan();
207 unsigned cSpan = cell->colSpan();
213 // (see the annotation on table cell layouting in the CSS specs and the testcase below:
221 updateLogicalHeightForCell(m_grid[insertionRow], cell);
228 // tell the cell where it is
242 ASSERT(cell);
243 c.cells.append(cell);
254 cell->setCol(table()->effColToCol(col));
267 // Empty cell is not a valid cell so it is not a rowspan cell.
278 void RenderTableSection::populateSpanningRowsHeightFromCell(RenderTableCell* cell, struct SpanningRowsHeight& spanningRowsHeight)
280 const unsigned rowSpan = cell->rowSpan();
281 const unsigned rowIndex = cell->rowIndex();
283 spanningRowsHeight.spanningCellHeightIgnoringBorderSpacing = cell->logicalHeightForRowSizing();
301 void RenderTableSection::distributeExtraRowSpanHeightToPercentRows(RenderTableCell* cell, int totalPercent, int& extraRowSpanningHeight, Vector<int>& rowsHeight)
306 const unsigned rowSpan = cell->rowSpan();
307 const unsigned rowIndex = cell->rowIndex();
331 void RenderTableSection::distributeExtraRowSpanHeightToAutoRows(RenderTableCell* cell, int totalAutoRowsHeight, int& extraRowSpanningHeight, Vector<int>& rowsHeight)
336 const unsigned rowSpan = cell->rowSpan();
337 const unsigned rowIndex = cell->rowIndex();
342 // So extra height distributed in auto spanning rows based on their weight in spanning cell.
365 void RenderTableSection::distributeExtraRowSpanHeightToRemainingRows(RenderTableCell* cell, int totalRemainingRowsHeight, int& extraRowSpanningHeight, Vector<int>& rowsHeight)
370 const unsigned rowSpan = cell->rowSpan();
371 const unsigned rowIndex = cell->rowIndex();
376 // So extra height distribution in remaining spanning rows based on their weight in spanning cell.
407 // Sorting bigger height cell first if cells are at same index with same span because we will skip smaller
408 // height cell to distribute it's extra height.
411 // Sorting inner most cell first because if inner spanning cell'e extra height is distributed then outer
412 // spanning cell's extra height will adjust accordingly. In reverse order, there is more chances that outer
413 // spanning cell's height will exceed than defined by user.
416 // Sorting lower row index first because first we need to apply the extra height of spanning cell which
435 RenderTableCell* cell = rowSpanCell.cells[0];
436 const unsigned rowIndex = cell->rowIndex();
437 const unsigned rowSpan = cell->rowSpan();
446 if (totalRowSpanCellHeight < cell->logicalHeightForRowSizing())
474 void RenderTableSection::updateRowsHeightHavingOnlySpanningCells(RenderTableCell* cell, struct SpanningRowsHeight& spanningRowsHeight)
479 const unsigned rowSpan = cell->rowSpan();
480 const unsigned rowIndex = cell->rowIndex();
496 // Distribute rowSpan cell height in rows those comes in rowSpan cell based on the ratio of row's height if
497 // 1. RowSpan cell height is greater then the total height of rows in rowSpan cell
503 // Arrange row spanning cell in the order in which we need to process first.
511 RenderTableCell* cell = rowSpanCells[i];
513 unsigned rowIndex = cell->rowIndex();
515 unsigned rowSpan = cell->rowSpan();
520 // Only heightest spanning cell will distribute it's extra height in row if more then one spanning cells
528 // cell updates position of the last row so getting the original position of the last row in second spanning
529 // cell need to reduce the height changed by first spanning cell.
543 populateSpanningRowsHeightFromCell(cell, spanningRowsHeight);
546 updateRowsHeightHavingOnlySpanningCells(cell, spanningRowsHeight);
557 // FIXME: Inner spanning cell height should not change if it have fixed height when it's parent spanning cell
572 distributeExtraRowSpanHeightToPercentRows(cell, totalPercent, extraRowSpanningHeight, spanningRowsHeight.rowHeight);
573 distributeExtraRowSpanHeightToAutoRows(cell, totalAutoRowsHeight, extraRowSpanningHeight, spanningRowsHeight.rowHeight);
574 distributeExtraRowSpanHeightToRemainingRows(cell, totalRemainingRowsHeight, extraRowSpanningHeight, spanningRowsHeight.rowHeight);
589 // Find out the baseline of the cell
590 // If the cell's baseline is more then the row's baseline then the cell's baseline become the row's baseline
592 void RenderTableSection::updateBaselineForCell(RenderTableCell* cell, unsigned row, LayoutUnit& baselineDescent)
594 if (!cell->isBaselineAligned())
599 LayoutUnit baselinePosition = cell->cellBaselinePosition() - cell->intrinsicPaddingBefore();
600 if (baselinePosition > cell->borderBefore() + (cell->paddingBefore() - cell->intrinsicPaddingBefore())) {
604 if (cell->rowSpan() == 1) {
605 baselineDescent = max(baselineDescent, cell->logicalHeightForRowSizing() - baselinePosition);
620 RenderTableCell* cell;
652 cell = current.cells[i];
653 if (current.inColSpan && cell->rowSpan() == 1)
657 if (cell->rowSpan() > 1) {
659 if (lastRowSpanCell != cell && cell->rowIndex() == r) {
661 ASSERT(!uniqueCells.contains(cell));
662 uniqueCells.add(cell);
665 rowSpanCells.append(cell);
666 lastRowSpanCell = cell;
669 updateBaselineForCell(cell, r, baselineDescent);
674 ASSERT(cell->rowSpan() == 1);
679 if ((cell->rowIndex() + cell->rowSpan() - 1) != r)
683 if (cell->hasOverrideHeight()) {
689 cell->clearIntrinsicPadding();
690 cell->clearOverrideSize();
691 cell->forceChildLayout();
695 m_rowPos[r + 1] = max(m_rowPos[r + 1], m_rowPos[r] + cell->logicalHeightForRowSizing());
698 updateBaselineForCell(cell, r, baselineDescent);
701 unsigned cellStartRow = cell->rowIndex();
703 m_rowPos[r + 1] = max(m_rowPos[r + 1], m_rowPos[cellStartRow] + cell->logicalHeightForRowSizing());
706 updateBaselineForCell(cell, cellStartRow, baselineDescent);
752 RenderTableCell* cell = current.primaryCell();
753 if (!cell || current.inColSpan)
757 unsigned cspan = cell->colSpan();
764 cell->setCellLogicalWidth(tableLayoutLogicalWidth, layouter);
908 RenderTableCell* cell = cs.primaryCell();
910 if (!cell || cs.inColSpan)
913 int rowIndex = cell->rowIndex();
914 int rHeight = m_rowPos[rowIndex + cell->rowSpan()] - m_rowPos[rowIndex] - vspacing;
917 // This will cause these children to grow to fill the cell.
922 // new height of the cell (thus letting the percentages cause growth one
930 bool flexAllChildren = cell->style()->logicalHeight().isFixed()
931 || (!table()->style()->logicalHeight().isAuto() && rHeight != cell->logicalHeight());
933 for (RenderObject* child = cell->firstChild(); child; child = child->nextSibling()) {
943 if (TrackedRendererListHashSet* percentHeightDescendants = cell->percentHeightDescendants()) {
955 // Alignment within a cell is based off the calculated
956 // height, which becomes irrelevant once the cell has
958 cell->setOverrideLogicalContentHeightFromRowHeight(rHeight);
959 cell->forceChildLayout();
962 if (cell->isBaselineAligned()) {
963 LayoutUnit baseline = cell->cellBaselinePosition();
964 if (baseline > cell->borderBefore() + cell->paddingBefore())
969 SubtreeLayoutScope layouter(cell);
970 cell->computeIntrinsicPadding(rHeight, layouter);
972 LayoutRect oldCellRect = cell->frameRect();
974 setLogicalPositionForCell(cell, c);
976 if (!cell->needsLayout() && view()->layoutState()->pageLogicalHeight() && view()->layoutState()->pageLogicalOffset(cell, cell->logicalTop()) != cell->pageLogicalOffset())
977 layouter.setChildNeedsLayout(cell);
979 cell->layoutIfNeeded();
982 if (view()->layoutState()->pageLogicalHeight() && cell->logicalHeight() != rHeight) {
983 // FIXME: Pagination might have made us change size. For now just shrink or grow the cell to fit without doing a relayout.
984 // We'll also do a basic increase of the row height to accommodate the cell if it's bigger, but this isn't quite right
986 if (cell->logicalHeight() > rHeight)
987 rowHeightIncreaseForPagination = max<int>(rowHeightIncreaseForPagination, cell->logicalHeight() - rHeight);
988 cell->setLogicalHeight(rHeight);
991 LayoutSize childOffset(cell->location() - oldCellRect.location());
998 if (!table()->selfNeedsLayout() && cell->checkForRepaintDuringLayout())
999 cell->repaintDuringLayoutIfMoved(oldCellRect);
1041 RenderTableCell* cell = cs.primaryCell();
1042 if (!cell || cs.inColSpan)
1044 if (r < totalRows - 1 && cell == primaryCellAt(r + 1, c))
1046 addOverflowFromChild(cell);
1048 hasOverflowingCell |= cell->hasVisualOverflow();
1050 if (cell->hasVisualOverflow() && !m_forceSlowPaintPathWithOverflowingCell) {
1051 m_overflowingCells.add(cell);
1194 // FIXME: Don't repeat for the same cell
1238 // FIXME: Don't repeat for the same cell
1276 const RenderTableCell* cell = cs.primaryCell();
1278 if (cell && cell->contentLogicalHeight())
1279 firstLineBaseline = max<int>(firstLineBaseline, cell->logicalTop() + cell->paddingBefore() + cell->borderBefore() + cell->contentLogicalHeight());
1327 void RenderTableSection::paintCell(RenderTableCell* cell, PaintInfo& paintInfo, const LayoutPoint& paintOffset)
1329 LayoutPoint cellPoint = flipForWritingModeForChild(cell, paintOffset);
1331 RenderTableRow* row = toRenderTableRow(cell->parent());
1335 // the column group, column, row group, row, and then the cell.
1336 RenderTableCol* column = table()->colElement(cell->col());
1342 // Note that we deliberately ignore whether or not the cell has a layer, since these backgrounds paint "behind" the
1343 // cell.
1344 cell->paintBackgroundsBehindCell(paintInfo, cellPoint, columnGroup);
1345 cell->paintBackgroundsBehindCell(paintInfo, cellPoint, column);
1348 cell->paintBackgroundsBehindCell(paintInfo, cellPoint, this);
1351 // painting the row background for the cell.
1353 cell->paintBackgroundsBehindCell(paintInfo, cellPoint, row);
1355 if ((!cell->hasSelfPaintingLayer() && !row->hasSelfPaintingLayer()))
1356 cell->paint(paintInfo, cellPoint);
1440 // cell on the logical top/left.
1441 // upper_bound on the other hand properly returns the cell on the logical bottom/right, which also
1481 // due to cell position is respected.
1487 RenderTableCell* cell = current.primaryCell();
1488 if (!cell || (row > dirtiedRows.start() && primaryCellAt(row - 1, col) == cell) || (col > dirtiedColumns.start() && primaryCellAt(row, col - 1) == cell))
1490 LayoutPoint cellPoint = flipForWritingModeForChild(cell, paintOffset);
1491 cell->paintCollapsedBorders(paintInfo, cellPoint);
1502 RenderTableCell* cell = current.primaryCell();
1503 if (!cell || (r > dirtiedRows.start() && primaryCellAt(r - 1, c) == cell) || (c > dirtiedColumns.start() && primaryCellAt(r, c - 1) == cell))
1505 paintCell(cell, paintInfo, paintOffset);
1594 for (RenderObject* cell = row->firstChild(); cell; cell = cell->nextSibling()) {
1595 if (!cell->isTableCell())
1598 RenderTableCell* tableCell = toRenderTableCell(cell);
1616 for (RenderObject* cell = m_grid[rowIndex].rowRenderer->firstChild(); cell; cell = cell->nextSibling()) {
1617 if (!cell->isTableCell())
1620 updateLogicalHeightForCell(m_grid[rowIndex], toRenderTableCell(cell));
1637 const CellStruct& cell = cellAt(r, c);
1638 if (cell.hasCells() || cell.inColSpan)
1646 const BorderValue& RenderTableSection::borderAdjoiningStartCell(const RenderTableCell* cell) const
1648 ASSERT(cell->isFirstOrLastCellInRow());
1649 return hasSameDirectionAs(cell) ? style()->borderStart() : style()->borderEnd();
1652 const BorderValue& RenderTableSection::borderAdjoiningEndCell(const RenderTableCell* cell) const
1654 ASSERT(cell->isFirstOrLastCellInRow());
1655 return hasSameDirectionAs(cell) ? style()->borderEnd() : style()->borderStart();
1689 RenderTableCell* cell = r[pos].primaryCell();
1690 ASSERT(cell);
1691 ASSERT(cell->colSpan() >= (r[pos].inColSpan ? 1u : 0));
1692 unsigned colleft = cell->colSpan() - r[pos].inColSpan;
1748 // If the cell is empty, there's nothing to do
1754 RenderTableCell* cell = current.cells[i];
1755 LayoutPoint cellPoint = flipForWritingModeForChild(cell, adjustedLocation);
1756 if (static_cast<RenderObject*>(cell)->nodeAtPoint(request, result, locationInContainer, cellPoint, action)) {
1771 void RenderTableSection::removeCachedCollapsedBorders(const RenderTableCell* cell)
1777 m_cellsCollapsedBorders.remove(make_pair(cell, side));
1780 void RenderTableSection::setCachedCollapsedBorder(const RenderTableCell* cell, CollapsedBorderSide side, CollapsedBorderValue border)
1783 m_cellsCollapsedBorders.set(make_pair(cell, side), border);
1786 CollapsedBorderValue& RenderTableSection::cachedCollapsedBorder(const RenderTableCell* cell, CollapsedBorderSide side)
1789 HashMap<pair<const RenderTableCell*, int>, CollapsedBorderValue>::iterator it = m_cellsCollapsedBorders.find(make_pair(cell, side));
1803 void RenderTableSection::setLogicalPositionForCell(RenderTableCell* cell, unsigned effectiveColumn) const
1805 LayoutPoint oldCellLocation = cell->location();
1807 LayoutPoint cellLocation(0, m_rowPos[cell->rowIndex()]);
1812 cellLocation.setX(table()->columnPositions()[table()->numEffCols()] - table()->columnPositions()[table()->colToEffCol(cell->col() + cell->colSpan())] + horizontalBorderSpacing);
1816 cell->setLogicalLocation(cellLocation);
1817 view()->addLayoutDelta(oldCellLocation - cell->location());