本文整理汇总了C++中LayoutBlockFlow::styleRef方法的典型用法代码示例。如果您正苦于以下问题:C++ LayoutBlockFlow::styleRef方法的具体用法?C++ LayoutBlockFlow::styleRef怎么用?C++ LayoutBlockFlow::styleRef使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LayoutBlockFlow
的用法示例。
在下文中一共展示了LayoutBlockFlow::styleRef方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: calculateMaxColumnHeight
LayoutUnit MultiColumnFragmentainerGroup::calculateMaxColumnHeight() const
{
LayoutBlockFlow* multicolBlock = m_columnSet.multiColumnBlockFlow();
const ComputedStyle& multicolStyle = multicolBlock->styleRef();
LayoutMultiColumnFlowThread* flowThread = m_columnSet.multiColumnFlowThread();
LayoutUnit availableHeight = flowThread->columnHeightAvailable();
LayoutUnit maxColumnHeight = availableHeight ? availableHeight : LayoutUnit::max();
if (!multicolStyle.logicalMaxHeight().isMaxSizeNone()) {
LayoutUnit logicalMaxHeight = multicolBlock->computeContentLogicalHeight(MaxSize, multicolStyle.logicalMaxHeight(), -1);
if (logicalMaxHeight != -1 && maxColumnHeight > logicalMaxHeight)
maxColumnHeight = logicalMaxHeight;
}
LayoutUnit maxHeight = heightAdjustedForRowOffset(maxColumnHeight);
if (LayoutMultiColumnFlowThread* enclosingFlowThread = flowThread->enclosingFlowThread()) {
if (enclosingFlowThread->isPageLogicalHeightKnown()) {
// We're nested inside another fragmentation context whose fragmentainer heights are
// known. This constrains the max height.
LayoutUnit remainingOuterLogicalHeight = enclosingFlowThread->pageRemainingLogicalHeightForOffset(blockOffsetInEnclosingFlowThread(), LayoutBlock::AssociateWithLatterPage);
ASSERT(remainingOuterLogicalHeight > 0);
if (maxHeight > remainingOuterLogicalHeight)
maxHeight = remainingOuterLogicalHeight;
}
}
return maxHeight;
}
示例2: createAndInsertMultiColumnSet
void LayoutMultiColumnFlowThread::createAndInsertMultiColumnSet(LayoutBox* insertBefore)
{
LayoutBlockFlow* multicolContainer = multiColumnBlockFlow();
LayoutMultiColumnSet* newSet = LayoutMultiColumnSet::createAnonymous(*this, multicolContainer->styleRef());
multicolContainer->LayoutBlock::addChild(newSet, insertBefore);
invalidateColumnSets();
// We cannot handle immediate column set siblings (and there's no need for it, either).
// There has to be at least one spanner separating them.
ASSERT(!newSet->previousSiblingMultiColumnBox() || !newSet->previousSiblingMultiColumnBox()->isLayoutMultiColumnSet());
ASSERT(!newSet->nextSiblingMultiColumnBox() || !newSet->nextSiblingMultiColumnBox()->isLayoutMultiColumnSet());
}
示例3: calculateMaxColumnHeight
LayoutUnit MultiColumnFragmentainerGroup::calculateMaxColumnHeight() const
{
LayoutBlockFlow* multicolBlock = m_columnSet.multiColumnBlockFlow();
const ComputedStyle& multicolStyle = multicolBlock->styleRef();
LayoutUnit availableHeight = m_columnSet.multiColumnFlowThread()->columnHeightAvailable();
LayoutUnit maxColumnHeight = availableHeight ? availableHeight : LayoutUnit::max();
if (!multicolStyle.logicalMaxHeight().isMaxSizeNone()) {
LayoutUnit logicalMaxHeight = multicolBlock->computeContentLogicalHeight(MaxSize, multicolStyle.logicalMaxHeight(), -1);
if (logicalMaxHeight != -1 && maxColumnHeight > logicalMaxHeight)
maxColumnHeight = logicalMaxHeight;
}
return heightAdjustedForRowOffset(maxColumnHeight);
}
示例4: setFullScreenLayoutObject
void Fullscreen::setFullScreenLayoutObject(LayoutFullScreen* layoutObject) {
if (layoutObject == m_fullScreenLayoutObject)
return;
if (layoutObject && m_savedPlaceholderComputedStyle) {
layoutObject->createPlaceholder(m_savedPlaceholderComputedStyle.release(),
m_savedPlaceholderFrameRect);
} else if (layoutObject && m_fullScreenLayoutObject &&
m_fullScreenLayoutObject->placeholder()) {
LayoutBlockFlow* placeholder = m_fullScreenLayoutObject->placeholder();
layoutObject->createPlaceholder(
ComputedStyle::clone(placeholder->styleRef()),
placeholder->frameRect());
}
if (m_fullScreenLayoutObject)
m_fullScreenLayoutObject->unwrapLayoutObject();
DCHECK(!m_fullScreenLayoutObject);
m_fullScreenLayoutObject = layoutObject;
}
示例5: createAndInsertSpannerPlaceholder
void LayoutMultiColumnFlowThread::createAndInsertSpannerPlaceholder(LayoutBox* spannerObjectInFlowThread, LayoutObject* insertedBeforeInFlowThread)
{
LayoutBox* insertBeforeColumnBox = nullptr;
LayoutMultiColumnSet* setToSplit = nullptr;
if (insertedBeforeInFlowThread) {
// The spanner is inserted before something. Figure out what this entails. If the
// next object is a spanner too, it means that we can simply insert a new spanner
// placeholder in front of its placeholder.
insertBeforeColumnBox = insertedBeforeInFlowThread->spannerPlaceholder();
if (!insertBeforeColumnBox) {
// The next object isn't a spanner; it's regular column content. Examine what
// comes right before us in the flow thread, then.
LayoutObject* previousLayoutObject = previousInPreOrderSkippingOutOfFlow(this, spannerObjectInFlowThread);
if (!previousLayoutObject || previousLayoutObject == this) {
// The spanner is inserted as the first child of the multicol container,
// which means that we simply insert a new spanner placeholder at the
// beginning.
insertBeforeColumnBox = firstMultiColumnBox();
} else if (LayoutMultiColumnSpannerPlaceholder* previousPlaceholder = containingColumnSpannerPlaceholder(previousLayoutObject)) {
// Before us is another spanner. We belong right after it then.
insertBeforeColumnBox = previousPlaceholder->nextSiblingMultiColumnBox();
} else {
// We're inside regular column content with both feet. Find out which column
// set this is. It needs to be split it into two sets, so that we can insert
// a new spanner placeholder between them.
setToSplit = mapDescendantToColumnSet(previousLayoutObject);
ASSERT(setToSplit == mapDescendantToColumnSet(insertedBeforeInFlowThread));
insertBeforeColumnBox = setToSplit->nextSiblingMultiColumnBox();
// We've found out which set that needs to be split. Now proceed to
// inserting the spanner placeholder, and then insert a second column set.
}
}
ASSERT(setToSplit || insertBeforeColumnBox);
}
LayoutBlockFlow* multicolContainer = multiColumnBlockFlow();
LayoutMultiColumnSpannerPlaceholder* newPlaceholder = LayoutMultiColumnSpannerPlaceholder::createAnonymous(multicolContainer->styleRef(), *spannerObjectInFlowThread);
ASSERT(!insertBeforeColumnBox || insertBeforeColumnBox->parent() == multicolContainer);
multicolContainer->LayoutBlock::addChild(newPlaceholder, insertBeforeColumnBox);
spannerObjectInFlowThread->setSpannerPlaceholder(*newPlaceholder);
if (setToSplit)
createAndInsertMultiColumnSet(insertBeforeColumnBox);
}