本文整理汇总了C++中RenderMultiColumnSet类的典型用法代码示例。如果您正苦于以下问题:C++ RenderMultiColumnSet类的具体用法?C++ RenderMultiColumnSet怎么用?C++ RenderMultiColumnSet使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了RenderMultiColumnSet类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: validateRegions
void RenderFlowThread::validateRegions()
{
if (m_regionsInvalidated) {
m_regionsInvalidated = false;
m_regionsHaveUniformLogicalHeight = true;
if (hasRegions()) {
LayoutUnit previousRegionLogicalHeight = 0;
bool firstRegionVisited = false;
for (RenderMultiColumnSetList::iterator iter = m_multiColumnSetList.begin(); iter != m_multiColumnSetList.end(); ++iter) {
RenderMultiColumnSet* columnSet = *iter;
LayoutUnit regionLogicalHeight = columnSet->pageLogicalHeight();
if (!firstRegionVisited) {
firstRegionVisited = true;
} else {
if (m_regionsHaveUniformLogicalHeight && previousRegionLogicalHeight != regionLogicalHeight)
m_regionsHaveUniformLogicalHeight = false;
}
previousRegionLogicalHeight = regionLogicalHeight;
}
}
}
updateLogicalWidth(); // Called to get the maximum logical width for the columnSet.
updateRegionsFlowThreadPortionRect();
}
示例2: RenderMultiColumnSet
RenderMultiColumnSet* RenderMultiColumnSet::createAnonymous(RenderFlowThread* flowThread)
{
Document& document = flowThread->document();
RenderMultiColumnSet* renderer = new RenderMultiColumnSet(flowThread);
renderer->setDocumentForAnonymous(&document);
return renderer;
}
示例3: new
void RenderMultiColumnBlock::ensureColumnSets()
{
// This function ensures we have the correct column set information before we get into layout.
// For a simple multi-column layout in continuous media, only one column set child is required.
// Once a column is nested inside an enclosing pagination context, the number of column sets
// required becomes 2n-1, where n is the total number of nested pagination contexts. For example:
//
// Column layout with no enclosing pagination model = 2 * 1 - 1 = 1 column set.
// Columns inside pages = 2 * 2 - 1 = 3 column sets (bottom of first page, all the subsequent pages, then the last page).
// Columns inside columns inside pages = 2 * 3 - 1 = 5 column sets.
//
// In addition, column spans will force a column set to "split" into before/after sets around the spanning region.
//
// Finally, we will need to deal with columns inside regions. If regions have variable widths, then there will need
// to be unique column sets created inside any region whose width is different from its surrounding regions. This is
// actually pretty similar to the spanning case, in that we break up the column sets whenever the width varies.
//
// FIXME: For now just make one column set. This matches the old multi-column code.
// Right now our goal is just feature parity with the old multi-column code so that we can switch over to the
// new code as soon as possible.
if (flowThread() && !firstChild()->isRenderMultiColumnSet()) {
RenderMultiColumnSet* columnSet = new (renderArena()) RenderMultiColumnSet(document(), flowThread());
columnSet->setStyle(RenderStyle::createAnonymousStyleWithDisplay(style(), BLOCK));
RenderBlock::addChild(columnSet, firstChild());
flowThread()->addRegionToThread(columnSet);
}
}
示例4: columnSetAtBlockOffset
LayoutUnit RenderFlowThread::pageLogicalHeightForOffset(LayoutUnit offset)
{
RenderMultiColumnSet* columnSet = columnSetAtBlockOffset(offset);
if (!columnSet)
return 0;
return columnSet->pageLogicalHeight();
}
示例5: RenderMultiColumnSet
RenderMultiColumnSet* RenderMultiColumnSet::createAnonymous(RenderFlowThread* flowThread, RenderStyle* parentStyle)
{
Document& document = flowThread->document();
RenderMultiColumnSet* renderer = new RenderMultiColumnSet(flowThread);
renderer->setDocumentForAnonymous(&document);
renderer->setStyle(RenderStyle::createAnonymousStyleWithDisplay(parentStyle, BLOCK));
return renderer;
}
示例6: findSetRendering
RenderMultiColumnSet* RenderMultiColumnFlowThread::findSetRendering(RenderObject* renderer) const
{
for (RenderMultiColumnSet* multicolSet = firstMultiColumnSet(); multicolSet; multicolSet = multicolSet->nextSiblingMultiColumnSet()) {
if (multicolSet->containsRendererInFlowThread(renderer))
return multicolSet;
}
return nullptr;
}
示例7: ASSERT
void RenderFlowThread::collectLayerFragments(LayerFragments& layerFragments, const LayoutRect& layerBoundingBox, const LayoutRect& dirtyRect)
{
ASSERT(!m_regionsInvalidated);
for (RenderMultiColumnSetList::const_iterator iter = m_multiColumnSetList.begin(); iter != m_multiColumnSetList.end(); ++iter) {
RenderMultiColumnSet* columnSet = *iter;
columnSet->collectLayerFragments(layerFragments, layerBoundingBox, dirtyRect);
}
}
示例8: willBeRemovedFromTree
void RenderMultiColumnFlowThread::willBeRemovedFromTree()
{
// Detach all column sets from the flow thread. Cannot destroy them at this point, since they
// are siblings of this object, and there may be pointers to this object's sibling somewhere
// further up on the call stack.
for (RenderMultiColumnSet* columnSet = firstMultiColumnSet(); columnSet; columnSet = columnSet->nextSiblingMultiColumnSet())
columnSet->detachRegion();
multiColumnBlockFlow()->setMultiColumnFlowThread(nullptr);
RenderFlowThread::willBeRemovedFromTree();
}
示例9: computeLogicalHeight
void RenderFlowThread::computeLogicalHeight(LayoutUnit, LayoutUnit logicalTop, LogicalExtentComputedValues& computedValues) const
{
computedValues.m_position = logicalTop;
computedValues.m_extent = 0;
for (RenderMultiColumnSetList::const_iterator iter = m_multiColumnSetList.begin(); iter != m_multiColumnSetList.end(); ++iter) {
RenderMultiColumnSet* columnSet = *iter;
computedValues.m_extent += columnSet->logicalHeightOfAllFlowThreadContent();
}
}
示例10: toRenderMultiColumnSet
void RenderMultiColumnFlowThread::addRegionToThread(RenderRegion* renderRegion)
{
RenderMultiColumnSet* columnSet = toRenderMultiColumnSet(renderRegion);
if (RenderMultiColumnSet* nextSet = columnSet->nextSiblingMultiColumnSet()) {
RenderRegionList::iterator it = m_regionList.find(nextSet);
ASSERT(it != m_regionList.end());
m_regionList.insertBefore(it, columnSet);
} else
m_regionList.add(columnSet);
renderRegion->setIsValid(true);
}
示例11: firstMultiColumnSet
RenderRegion* RenderMultiColumnFlowThread::regionAtBlockOffset(const RenderBox* box, LayoutUnit offset, bool extendLastRegion, RegionAutoGenerationPolicy autoGenerationPolicy)
{
if (!m_inLayout)
return RenderFlowThread::regionAtBlockOffset(box, offset, extendLastRegion, autoGenerationPolicy);
// Layout in progress. We are calculating the set heights as we speak, so the region range
// information is not up-to-date.
RenderMultiColumnSet* columnSet = m_lastSetWorkedOn ? m_lastSetWorkedOn : firstMultiColumnSet();
if (!columnSet) {
// If there's no set, bail. This multicol is empty or only consists of spanners. There
// are no regions.
return nullptr;
}
// The last set worked on is a good guess. But if we're not within the bounds, search for the
// right one.
if (offset < columnSet->logicalTopInFlowThread()) {
do {
if (RenderMultiColumnSet* prev = columnSet->previousSiblingMultiColumnSet())
columnSet = prev;
else
break;
} while (offset < columnSet->logicalTopInFlowThread());
} else {
while (offset >= columnSet->logicalBottomInFlowThread()) {
RenderMultiColumnSet* next = columnSet->nextSiblingMultiColumnSet();
if (!next || !next->hasBeenFlowed())
break;
columnSet = next;
}
}
return columnSet;
}
示例12: slowRectMapping
void RenderFlowThread::repaintRectangleInRegions(const LayoutRect& repaintRect) const
{
if (!shouldRepaint(repaintRect) || !hasValidRegionInfo())
return;
ForceHorriblySlowRectMapping slowRectMapping(*this); // We can't use layout state to repaint, since the regions are somewhere else.
// We can't use currentFlowThread as it is possible to have interleaved flow threads and the wrong one could be used.
// Let each columnSet figure out the proper enclosing flow thread.
CurrentRenderFlowThreadDisabler disabler(view());
for (RenderMultiColumnSetList::const_iterator iter = m_multiColumnSetList.begin(); iter != m_multiColumnSetList.end(); ++iter) {
RenderMultiColumnSet* columnSet = *iter;
columnSet->repaintFlowThreadContent(repaintRect);
}
}
示例13: setRegionRangeForBox
void RenderMultiColumnFlowThread::setRegionRangeForBox(const RenderBox* box, RenderRegion* startRegion, RenderRegion* endRegion)
{
// Some column sets may have zero height, which means that two or more sets may start at the
// exact same flow thread position, which means that some parts of the code may believe that a
// given box lives in sets that it doesn't really live in. Make some adjustments here and
// include such sets if they are adjacent to the start and/or end regions.
for (RenderMultiColumnSet* columnSet = toRenderMultiColumnSet(startRegion)->previousSiblingMultiColumnSet(); columnSet; columnSet = columnSet->previousSiblingMultiColumnSet()) {
if (columnSet->logicalHeightInFlowThread())
break;
startRegion = columnSet;
}
for (RenderMultiColumnSet* columnSet = toRenderMultiColumnSet(startRegion)->nextSiblingMultiColumnSet(); columnSet; columnSet = columnSet->nextSiblingMultiColumnSet()) {
if (columnSet->logicalHeightInFlowThread())
break;
endRegion = columnSet;
}
RenderFlowThread::setRegionRangeForBox(box, startRegion, endRegion);
}
示例14: updateRegionsFlowThreadPortionRect
void RenderFlowThread::updateRegionsFlowThreadPortionRect()
{
LayoutUnit logicalHeight = 0;
// FIXME: Optimize not to clear the interval all the time. This implies manually managing the tree nodes lifecycle.
m_multiColumnSetIntervalTree.clear();
m_multiColumnSetIntervalTree.initIfNeeded();
for (RenderMultiColumnSetList::iterator iter = m_multiColumnSetList.begin(); iter != m_multiColumnSetList.end(); ++iter) {
RenderMultiColumnSet* columnSet = *iter;
LayoutUnit columnSetLogicalWidth = columnSet->pageLogicalWidth();
LayoutUnit columnSetLogicalHeight = std::min<LayoutUnit>(RenderFlowThread::maxLogicalHeight() - logicalHeight, columnSet->logicalHeightOfAllFlowThreadContent());
LayoutRect columnSetRect(style()->direction() == LTR ? LayoutUnit() : logicalWidth() - columnSetLogicalWidth, logicalHeight, columnSetLogicalWidth, columnSetLogicalHeight);
columnSet->setFlowThreadPortionRect(isHorizontalWritingMode() ? columnSetRect : columnSetRect.transposedRect());
m_multiColumnSetIntervalTree.add(MultiColumnSetIntervalTree::createInterval(logicalHeight, logicalHeight + columnSetLogicalHeight, columnSet));
logicalHeight += columnSetLogicalHeight;
}
}
示例15: method
bool RenderMultiColumnBlock::relayoutForPagination(bool, LayoutUnit, LayoutStateMaintainer& statePusher)
{
if (m_inBalancingPass || !requiresBalancing())
return false;
m_inBalancingPass = true; // Prevent re-entering this method (and recursion into layout).
bool needsRelayout;
bool neededRelayout = false;
bool firstPass = true;
do {
// Column heights may change here because of balancing. We may have to do multiple layout
// passes, depending on how the contents is fitted to the changed column heights. In most
// cases, laying out again twice or even just once will suffice. Sometimes we need more
// passes than that, though, but the number of retries should not exceed the number of
// columns, unless we have a bug.
needsRelayout = false;
for (RenderBox* childBox = firstChildBox(); childBox; childBox = childBox->nextSiblingBox())
if (childBox != m_flowThread && childBox->isRenderMultiColumnSet()) {
RenderMultiColumnSet* multicolSet = toRenderMultiColumnSet(childBox);
if (multicolSet->calculateBalancedHeight(firstPass)) {
multicolSet->setChildNeedsLayout(MarkOnlyThis);
needsRelayout = true;
}
}
if (needsRelayout) {
// Layout again. Column balancing resulted in a new height.
neededRelayout = true;
m_flowThread->setChildNeedsLayout(MarkOnlyThis);
setChildNeedsLayout(MarkOnlyThis);
if (firstPass)
statePusher.pop();
layoutBlock(false);
}
firstPass = false;
} while (needsRelayout);
m_inBalancingPass = false;
return neededRelayout;
}