本文整理汇总了C++中LayoutTableCell::size方法的典型用法代码示例。如果您正苦于以下问题:C++ LayoutTableCell::size方法的具体用法?C++ LayoutTableCell::size怎么用?C++ LayoutTableCell::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LayoutTableCell
的用法示例。
在下文中一共展示了LayoutTableCell::size方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: isDataTable
//.........这里部分代码省略.........
const ComputedStyle* tableStyle = table->style();
if (!tableStyle)
return false;
Color tableBGColor = tableStyle->visitedDependentColor(CSSPropertyBackgroundColor);
// check enough of the cells to find if the table matches our criteria
// Criteria:
// 1) must have at least one valid cell (and)
// 2) at least half of cells have borders (or)
// 3) at least half of cells have different bg colors than the table, and there is cell spacing
unsigned validCellCount = 0;
unsigned borderedCellCount = 0;
unsigned backgroundDifferenceCellCount = 0;
unsigned cellsWithTopBorder = 0;
unsigned cellsWithBottomBorder = 0;
unsigned cellsWithLeftBorder = 0;
unsigned cellsWithRightBorder = 0;
Color alternatingRowColors[5];
int alternatingRowColorCount = 0;
int headersInFirstColumnCount = 0;
for (int row = 0; row < numRows; ++row) {
int headersInFirstRowCount = 0;
for (int col = 0; col < numCols; ++col) {
LayoutTableCell* cell = firstBody->primaryCellAt(row, col);
if (!cell)
continue;
Node* cellNode = cell->node();
if (!cellNode)
continue;
if (cell->size().width() < 1 || cell->size().height() < 1)
continue;
validCellCount++;
bool isTHCell = cellNode->hasTagName(thTag);
// If the first row is comprised of all <th> tags, assume it is a data table.
if (!row && isTHCell)
headersInFirstRowCount++;
// If the first column is comprised of all <th> tags, assume it is a data table.
if (!col && isTHCell)
headersInFirstColumnCount++;
// in this case, the developer explicitly assigned a "data" table attribute
if (isHTMLTableCellElement(*cellNode)) {
HTMLTableCellElement& cellElement = toHTMLTableCellElement(*cellNode);
if (!cellElement.headers().isEmpty() || !cellElement.abbr().isEmpty()
|| !cellElement.axis().isEmpty() || !cellElement.scope().isEmpty())
return true;
}
const ComputedStyle* computedStyle = cell->style();
if (!computedStyle)
continue;
// If the empty-cells style is set, we'll call it a data table.
if (computedStyle->emptyCells() == HIDE)
return true;
// If a cell has matching bordered sides, call it a (fully) bordered cell.
if ((cell->borderTop() > 0 && cell->borderBottom() > 0)
|| (cell->borderLeft() > 0 && cell->borderRight() > 0))