本文整理汇总了C++中RenderTable::cellBefore方法的典型用法代码示例。如果您正苦于以下问题:C++ RenderTable::cellBefore方法的具体用法?C++ RenderTable::cellBefore怎么用?C++ RenderTable::cellBefore使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RenderTable
的用法示例。
在下文中一共展示了RenderTable::cellBefore方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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));
}
示例2: collapsedStartBorder
CollapsedBorderValue RenderTableCell::collapsedStartBorder() const
{
RenderTable* table = this->table();
bool isStartColumn = col() == 0;
// For the start border, we need to check, in order of precedence:
// (1) Our start border.
int start = CSSProperty::resolveDirectionAwareProperty(CSSPropertyWebkitBorderStartColor, table->style()->direction(), table->style()->writingMode());
int end = CSSProperty::resolveDirectionAwareProperty(CSSPropertyWebkitBorderEndColor, table->style()->direction(), table->style()->writingMode());
CollapsedBorderValue result(&style()->borderStart(), style()->visitedDependentColor(start), BCELL);
// (2) The end border of the preceding cell.
if (RenderTableCell* prevCell = table->cellBefore(this)) {
CollapsedBorderValue prevCellBorder = CollapsedBorderValue(&prevCell->style()->borderEnd(), prevCell->style()->visitedDependentColor(end), BCELL);
result = chooseBorder(prevCellBorder, result);
if (!result.exists())
return result;
} else if (isStartColumn) {
// (3) Our row's start border.
result = chooseBorder(result, CollapsedBorderValue(&parent()->style()->borderStart(), parent()->style()->visitedDependentColor(start), BROW));
if (!result.exists())
return result;
// (4) Our row group's start border.
result = chooseBorder(result, CollapsedBorderValue(§ion()->style()->borderStart(), section()->style()->visitedDependentColor(start), BROWGROUP));
if (!result.exists())
return result;
}
// (5) Our column and column group's start borders.
bool startColEdge;
bool endColEdge;
RenderTableCol* colElt = table->colElement(col(), &startColEdge, &endColEdge);
if (colElt && startColEdge) {
result = chooseBorder(result, CollapsedBorderValue(&colElt->style()->borderStart(), colElt->style()->visitedDependentColor(start), BCOL));
if (!result.exists())
return result;
if (colElt->parent()->isTableCol() && !colElt->previousSibling()) {
result = chooseBorder(result, CollapsedBorderValue(&colElt->parent()->style()->borderStart(), colElt->parent()->style()->visitedDependentColor(start), BCOLGROUP));
if (!result.exists())
return result;
}
}
// (6) The end border of the preceding column.
if (!isStartColumn) {
colElt = table->colElement(col() -1, &startColEdge, &endColEdge);
if (colElt && endColEdge) {
CollapsedBorderValue endBorder = CollapsedBorderValue(&colElt->style()->borderEnd(), colElt->style()->visitedDependentColor(end), BCOL);
result = chooseBorder(endBorder, result);
if (!result.exists())
return result;
}
} else {
// (7) The table's start border.
result = chooseBorder(result, CollapsedBorderValue(&table->style()->borderStart(), table->style()->visitedDependentColor(start), BTABLE));
if (!result.exists())
return result;
}
return result;
}
示例3: collapsedRightBorder
CollapsedBorderValue RenderTableCell::collapsedRightBorder(bool rtl) const
{
RenderTable* tableElt = table();
bool rightmostColumn;
if (rtl)
rightmostColumn = col() == 0;
else {
int effCol = tableElt->colToEffCol(col() + colSpan() - 1);
rightmostColumn = effCol == tableElt->numEffCols() - 1;
}
// For border right, we need to check, in order of precedence:
// (1) Our right border.
CollapsedBorderValue result = CollapsedBorderValue(&style()->borderRight(), BCELL);
// (2) The left border of the cell to the right.
if (!rightmostColumn) {
RenderTableCell* nextCell = rtl ? tableElt->cellBefore(this) : tableElt->cellAfter(this);
if (nextCell && nextCell->style()) {
result = rtl ? compareBorders(CollapsedBorderValue(&nextCell->style()->borderLeft(), BCELL), result) : compareBorders(result, CollapsedBorderValue(&nextCell->style()->borderLeft(), BCELL));
if (!result.exists())
return result;
}
} else {
// (3) Our row's right border.
result = compareBorders(result, CollapsedBorderValue(&parent()->style()->borderRight(), BROW));
if (!result.exists())
return result;
// (4) Our row group's right border.
result = compareBorders(result, CollapsedBorderValue(§ion()->style()->borderRight(), BROWGROUP));
if (!result.exists())
return result;
}
// (5) Our column and column group's right borders.
bool startColEdge;
bool endColEdge;
RenderTableCol* colElt = tableElt->colElement(col() + (rtl ? 0 : colSpan() - 1), &startColEdge, &endColEdge);
if (colElt && (!rtl ? endColEdge : startColEdge)) {
result = compareBorders(result, CollapsedBorderValue(&colElt->style()->borderRight(), BCOL));
if (!result.exists())
return result;
if (colElt->parent()->isTableCol() && (!rtl ? !colElt->nextSibling() : !colElt->previousSibling())) {
result = compareBorders(result, CollapsedBorderValue(&colElt->parent()->style()->borderRight(), BCOLGROUP));
if (!result.exists())
return result;
}
}
// (6) The left border of the column to the right.
if (!rightmostColumn) {
colElt = tableElt->colElement(col() + (rtl ? -1 : colSpan()), &startColEdge, &endColEdge);
if (colElt && (!rtl ? startColEdge : endColEdge)) {
result = rtl ? compareBorders(CollapsedBorderValue(&colElt->style()->borderLeft(), BCOL), result) : compareBorders(result, CollapsedBorderValue(&colElt->style()->borderLeft(), BCOL));
if (!result.exists())
return result;
}
} else {
// (7) The table's right border.
result = compareBorders(result, CollapsedBorderValue(&tableElt->style()->borderRight(), BTABLE));
if (!result.exists())
return result;
}
return result;
}