本文整理汇总了C++中RenderTable::sectionAbove方法的典型用法代码示例。如果您正苦于以下问题:C++ RenderTable::sectionAbove方法的具体用法?C++ RenderTable::sectionAbove怎么用?C++ RenderTable::sectionAbove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RenderTable
的用法示例。
在下文中一共展示了RenderTable::sectionAbove方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: collapsedBeforeBorder
CollapsedBorderValue RenderTableCell::collapsedBeforeBorder() const
{
RenderTable* table = this->table();
// For before border, we need to check, in order of precedence:
// (1) Our before border.
int before = CSSProperty::resolveDirectionAwareProperty(CSSPropertyWebkitBorderBeforeColor, table->style()->direction(), table->style()->writingMode());
int after = CSSProperty::resolveDirectionAwareProperty(CSSPropertyWebkitBorderAfterColor, table->style()->direction(), table->style()->writingMode());
CollapsedBorderValue result = CollapsedBorderValue(&style()->borderBefore(), style()->visitedDependentColor(before), BCELL);
RenderTableCell* prevCell = table->cellAbove(this);
if (prevCell) {
// (2) A before cell's after border.
result = chooseBorder(CollapsedBorderValue(&prevCell->style()->borderAfter(), prevCell->style()->visitedDependentColor(after), BCELL), result);
if (!result.exists())
return result;
}
// (3) Our row's before border.
result = chooseBorder(result, CollapsedBorderValue(&parent()->style()->borderBefore(), parent()->style()->visitedDependentColor(before), BROW));
if (!result.exists())
return result;
// (4) The previous row's after border.
if (prevCell) {
RenderObject* prevRow = 0;
if (prevCell->section() == section())
prevRow = parent()->previousSibling();
else
prevRow = prevCell->section()->lastChild();
if (prevRow) {
result = chooseBorder(CollapsedBorderValue(&prevRow->style()->borderAfter(), prevRow->style()->visitedDependentColor(after), BROW), result);
if (!result.exists())
return result;
}
}
// Now check row groups.
RenderTableSection* currSection = section();
if (!row()) {
// (5) Our row group's before border.
result = chooseBorder(result, CollapsedBorderValue(&currSection->style()->borderBefore(), currSection->style()->visitedDependentColor(before), BROWGROUP));
if (!result.exists())
return result;
// (6) Previous row group's after border.
currSection = table->sectionAbove(currSection);
if (currSection) {
result = chooseBorder(CollapsedBorderValue(&currSection->style()->borderAfter(), currSection->style()->visitedDependentColor(after), BROWGROUP), result);
if (!result.exists())
return result;
}
}
if (!currSection) {
// (8) Our column and column group's before borders.
RenderTableCol* colElt = table->colElement(col());
if (colElt) {
result = chooseBorder(result, CollapsedBorderValue(&colElt->style()->borderBefore(), colElt->style()->visitedDependentColor(before), BCOL));
if (!result.exists())
return result;
if (colElt->parent()->isTableCol()) {
result = chooseBorder(result, CollapsedBorderValue(&colElt->parent()->style()->borderBefore(), colElt->parent()->style()->visitedDependentColor(before), BCOLGROUP));
if (!result.exists())
return result;
}
}
// (9) The table's before border.
result = chooseBorder(result, CollapsedBorderValue(&table->style()->borderBefore(), table->style()->visitedDependentColor(before), BTABLE));
if (!result.exists())
return result;
}
return result;
}