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