本文整理汇总了C++中LayoutTableCell::setPreferredLogicalWidthsDirty方法的典型用法代码示例。如果您正苦于以下问题:C++ LayoutTableCell::setPreferredLogicalWidthsDirty方法的具体用法?C++ LayoutTableCell::setPreferredLogicalWidthsDirty怎么用?C++ LayoutTableCell::setPreferredLogicalWidthsDirty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LayoutTableCell
的用法示例。
在下文中一共展示了LayoutTableCell::setPreferredLogicalWidthsDirty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: styleDidChange
void LayoutTableCol::styleDidChange(StyleDifference diff, const ComputedStyle* oldStyle)
{
LayoutBox::styleDidChange(diff, oldStyle);
// If border was changed, notify table.
if (parent()) {
LayoutTable* table = this->table();
if (table && !table->selfNeedsLayout() && !table->normalChildNeedsLayout() && oldStyle && oldStyle->border() != style()->border()) {
table->invalidateCollapsedBorders();
} else if (oldStyle && oldStyle->logicalWidth() != style()->logicalWidth()) {
// FIXME : setPreferredLogicalWidthsDirty is done for all cells as of now.
// Need to find a better way so that only the cells which are changed by
// the col width should have preferred logical widths recomputed.
for (LayoutObject* child = table->children()->firstChild(); child; child = child->nextSibling()) {
if (!child->isTableSection())
continue;
LayoutTableSection* section = toLayoutTableSection(child);
for (LayoutTableRow* row = section->firstRow(); row; row = row->nextRow()) {
for (LayoutTableCell* cell = row->firstCell(); cell; cell = cell->nextCell())
cell->setPreferredLogicalWidthsDirty();
}
}
}
}
}
示例2: willChangeTableLayout
void TableLayoutAlgorithmFixed::willChangeTableLayout()
{
// When switching table layout algorithm, we need to dirty the preferred
// logical widths as we cleared the bits without computing them.
// (see calcWidthArray above.) This optimization is preferred to always
// computing the logical widths we never intended to use.
m_table->recalcSectionsIfNeeded();
for (LayoutTableSection* section = m_table->topNonEmptySection(); section; section = m_table->sectionBelow(section)) {
for (unsigned i = 0; i < section->numRows(); i++) {
LayoutTableRow* row = section->rowLayoutObjectAt(i);
if (!row)
continue;
for (LayoutTableCell* cell = row->firstCell(); cell; cell = cell->nextCell())
cell->setPreferredLogicalWidthsDirty();
}
}
}