本文整理汇总了C++中RenderTable类的典型用法代码示例。如果您正苦于以下问题:C++ RenderTable类的具体用法?C++ RenderTable怎么用?C++ RenderTable使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了RenderTable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: toRenderTableCell
void AccessibilityTableCell::rowIndexRange(std::pair<unsigned, unsigned>& rowRange)
{
if (!m_renderer || !m_renderer->isTableCell())
return;
RenderTableCell* renderCell = toRenderTableCell(m_renderer);
rowRange.first = renderCell->rowIndex();
rowRange.second = renderCell->rowSpan();
// since our table might have multiple sections, we have to offset our row appropriately
RenderTableSection* section = renderCell->section();
RenderTable* table = renderCell->table();
if (!table || !section)
return;
RenderTableSection* tableSection = table->topSection();
unsigned rowOffset = 0;
while (tableSection) {
if (tableSection == section)
break;
rowOffset += tableSection->numRows();
tableSection = table->sectionBelow(tableSection, SkipEmptySections);
}
rowRange.first += rowOffset;
}
示例2: toRenderTableCell
void AccessibilityTableCell::rowIndexRange(pair<int, int>& rowRange)
{
if (!m_renderer || !m_renderer->isTableCell())
return;
RenderTableCell* renderCell = toRenderTableCell(m_renderer);
rowRange.first = renderCell->rowIndex();
rowRange.second = renderCell->rowSpan();
// since our table might have multiple sections, we have to offset our row appropriately
RenderTableSection* section = renderCell->section();
RenderTable* table = renderCell->table();
if (!table || !section)
return;
// FIXME: This will skip a table with just a tfoot. Should fix by using RenderTable::topSection.
RenderTableSection* tableSection = table->header();
if (!tableSection)
tableSection = table->firstBody();
unsigned rowOffset = 0;
while (tableSection) {
if (tableSection == section)
break;
rowOffset += tableSection->numRows();
tableSection = table->sectionBelow(tableSection, SkipEmptySections);
}
rowRange.first += rowOffset;
}
示例3: toRenderTableCell
void AccessibilityTableCell::rowIndexRange(std::pair<unsigned, unsigned>& rowRange)
{
if (!m_renderer || !m_renderer->isTableCell())
return;
RenderTableCell* renderCell = toRenderTableCell(m_renderer);
rowRange.first = renderCell->rowIndex();
rowRange.second = renderCell->rowSpan();
// since our table might have multiple sections, we have to offset our row appropriately
RenderTableSection* section = renderCell->section();
RenderTable* table = renderCell->table();
if (!table || !section)
return;
RenderTableSection* footerSection = table->footer();
unsigned rowOffset = 0;
for (RenderTableSection* tableSection = table->topSection(); tableSection; tableSection = table->sectionBelow(tableSection, SkipEmptySections)) {
// Don't add row offsets for bottom sections that are placed in before the body section.
if (tableSection == footerSection)
continue;
if (tableSection == section)
break;
rowOffset += tableSection->numRows();
}
rowRange.first += rowOffset;
}
示例4: if
void RenderTableCol::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
{
RenderBox::styleDidChange(diff, oldStyle);
// If border was changed, notify table.
if (parent()) {
RenderTable* table = this->table();
if (table && !table->selfNeedsLayout() && !table->normalChildNeedsLayout() && oldStyle && oldStyle->border() != style().border())
table->invalidateCollapsedBorders();
else if (oldStyle->width() != style().width()) {
for (auto& section : childrenOfType<RenderTableSection>(*table)) {
unsigned nEffCols = table->numEffCols();
for (unsigned j = 0; j < nEffCols; j++) {
unsigned rowCount = section.numRows();
for (unsigned i = 0; i < rowCount; i++) {
RenderTableCell* cell = section.primaryCellAt(i, j);
if (!cell)
continue;
cell->setPreferredLogicalWidthsDirty(true);
}
}
}
}
}
}
示例5: rowIndexRange
void AccessibilityTableCell::rowIndexRange(pair<int, int>& rowRange)
{
if (!m_renderer)
return;
RenderTableCell* renderCell = static_cast<RenderTableCell*>(m_renderer);
rowRange.first = renderCell->row();
rowRange.second = renderCell->rowSpan();
// since our table might have multiple sections, we have to offset our row appropriately
RenderTableSection* section = renderCell->section();
RenderTable* table = renderCell->table();
if (!table || !section)
return;
RenderTableSection* tableSection = table->header();
if (!tableSection)
tableSection = table->firstBody();
unsigned rowOffset = 0;
while (tableSection) {
if (tableSection == section)
break;
rowOffset += tableSection->numRows();
tableSection = table->sectionBelow(tableSection, true);
}
rowRange.first += rowOffset;
}
示例6: paintBoxDecorationBackground
void TableCellPainter::paintBoxDecorationBackground(const PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
if (!paintInfo.shouldPaintWithinRoot(&m_renderTableCell))
return;
RenderTable* tableElt = m_renderTableCell.table();
if (!tableElt->collapseBorders() && m_renderTableCell.style()->emptyCells() == HIDE && !m_renderTableCell.firstChild())
return;
LayoutRect paintRect = paintBounds(paintOffset, DoNotAddOffsetFromParent);
RenderDrawingRecorder recorder(paintInfo.context, m_renderTableCell, paintInfo.phase, pixelSnappedIntRect(paintRect));
if (recorder.canUseCachedDrawing())
return;
BoxPainter::paintBoxShadow(paintInfo, paintRect, m_renderTableCell.style(), Normal);
// Paint our cell background.
paintBackgroundsBehindCell(paintInfo, paintOffset, &m_renderTableCell);
BoxPainter::paintBoxShadow(paintInfo, paintRect, m_renderTableCell.style(), Inset);
if (!m_renderTableCell.style()->hasBorder() || tableElt->collapseBorders())
return;
BoxPainter::paintBorder(m_renderTableCell, paintInfo, paintRect, m_renderTableCell.style());
}
示例7: paintBackgroundsBehindCell
void TableCellPainter::paintBackgroundsBehindCell(const PaintInfo& paintInfo, const LayoutPoint& paintOffset, RenderObject* backgroundObject)
{
if (!paintInfo.shouldPaintWithinRoot(&m_renderTableCell))
return;
if (!backgroundObject)
return;
if (m_renderTableCell.style()->visibility() != VISIBLE)
return;
RenderTable* tableElt = m_renderTableCell.table();
if (!tableElt->collapseBorders() && m_renderTableCell.style()->emptyCells() == HIDE && !m_renderTableCell.firstChild())
return;
Color c = backgroundObject->resolveColor(CSSPropertyBackgroundColor);
const FillLayer& bgLayer = backgroundObject->style()->backgroundLayers();
LayoutRect paintRect = paintBounds(paintOffset, backgroundObject != &m_renderTableCell ? AddOffsetFromParent : DoNotAddOffsetFromParent);
if (bgLayer.hasImage() || c.alpha()) {
// We have to clip here because the background would paint
// on top of the borders otherwise. This only matters for cells and rows.
bool shouldClip = backgroundObject->hasLayer() && (backgroundObject == &m_renderTableCell || backgroundObject == m_renderTableCell.parent()) && tableElt->collapseBorders();
GraphicsContextStateSaver stateSaver(*paintInfo.context, shouldClip);
if (shouldClip) {
LayoutRect clipRect(paintRect.location(), m_renderTableCell.size());
clipRect.expand(m_renderTableCell.borderInsets());
paintInfo.context->clip(clipRect);
}
BoxPainter(m_renderTableCell).paintFillLayers(paintInfo, c, bgLayer, paintRect, BackgroundBleedNone, CompositeSourceOver, backgroundObject);
}
}
示例8: PLATFORM
void RenderTableCell::paintBoxDecorations(PaintInfo& paintInfo, int tx, int ty)
{
#if PLATFORM(WKC)
CRASH_IF_STACK_OVERFLOW(WKC_STACK_MARGIN_DEFAULT);
#endif
RenderTable* tableElt = table();
if (!tableElt->collapseBorders() && style()->emptyCells() == HIDE && !firstChild())
return;
int w = width();
int h = height();
if (style()->boxShadow())
paintBoxShadow(paintInfo.context, tx, ty, w, h, style(), Normal);
// Paint our cell background.
paintBackgroundsBehindCell(paintInfo, tx, ty, this);
if (style()->boxShadow())
paintBoxShadow(paintInfo.context, tx, ty, w, h, style(), Inset);
if (!style()->hasBorder() || tableElt->collapseBorders())
return;
paintBorder(paintInfo.context, tx, ty, w, h, style());
}
示例9: ASSERT
void RenderTableRow::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
{
ASSERT(style()->display() == TABLE_ROW);
RenderBox::styleDidChange(diff, oldStyle);
propagateStyleToAnonymousChildren();
if (section() && oldStyle && style()->logicalHeight() != oldStyle->logicalHeight())
section()->rowLogicalHeightChanged(rowIndex());
// If border was changed, notify table.
if (parent()) {
RenderTable* table = this->table();
if (table && !table->selfNeedsLayout() && !table->normalChildNeedsLayout() && oldStyle && oldStyle->border() != style()->border())
table->invalidateCollapsedBorders();
if (table && oldStyle && diff == StyleDifferenceLayout && needsLayout() && table->collapseBorders() && borderWidthChanged(oldStyle, style())) {
// If the border width changes on a row, we need to make sure the cells in the row know to lay out again.
// This only happens when borders are collapsed, since they end up affecting the border sides of the cell
// itself.
for (RenderBox* childBox = firstChildBox(); childBox; childBox = childBox->nextSiblingBox()) {
if (!childBox->isTableCell())
continue;
childBox->setChildNeedsLayout(true, MarkOnlyThis);
}
}
}
}
示例10: table
IntRect RenderTableRow::getAbsoluteRepaintRect()
{
// For now, just repaint the whole table.
// FIXME: Find a better way to do this, e.g., need to repaint all the cells that we
// might have propagated a background color into.
RenderTable* parentTable = table();
if (parentTable)
return parentTable->getAbsoluteRepaintRect();
else
return IntRect();
}
示例11: styleDidChange
void RenderTableCol::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
{
RenderBox::styleDidChange(diff, oldStyle);
// If border was changed, notify table.
if (parent()) {
RenderTable* table = this->table();
if (table && !table->selfNeedsLayout() && !table->normalChildNeedsLayout() && oldStyle && oldStyle->border() != style()->border())
table->invalidateCollapsedBorders();
}
}
示例12: table
void RenderTableCell::paintMask(PaintInfo& paintInfo, IntSize paintOffset)
{
if (style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask)
return;
RenderTable* tableElt = table();
if (!tableElt->collapseBorders() && style()->emptyCells() == HIDE && !firstChild())
return;
paintMaskImages(paintInfo, IntRect(toPoint(paintOffset), size()));
}
示例13: paintMask
void TableCellPainter::paintMask(const PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
if (m_renderTableCell.style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask)
return;
RenderTable* tableElt = m_renderTableCell.table();
if (!tableElt->collapseBorders() && m_renderTableCell.style()->emptyCells() == HIDE && !m_renderTableCell.firstChild())
return;
BoxPainter(m_renderTableCell).paintMaskImages(paintInfo, paintBounds(paintOffset, DoNotAddOffsetFromParent));
}
示例14: table
LayoutRect RenderTableCol::clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const
{
// For now, just repaint the whole table.
// FIXME: Find a better way to do this, e.g., need to repaint all the cells that we
// might have propagated a background color or borders into.
// FIXME: check for repaintContainer each time here?
RenderTable* parentTable = table();
if (!parentTable)
return LayoutRect();
return parentTable->clippedOverflowRectForRepaint(repaintContainer);
}
示例15: shouldEmitTabBeforeNode
static bool shouldEmitTabBeforeNode(Node* node)
{
RenderObject* r = node->renderer();
// Table cells are delimited by tabs.
if (!r || !isTableCell(node))
return false;
// Want a tab before every cell other than the first one
RenderTableCell* rc = static_cast<RenderTableCell*>(r);
RenderTable* t = rc->table();
return t && (t->cellBefore(rc) || t->cellAbove(rc));
}