本文整理汇总了C++中nslinelist::iterator::GetCarriedOutBEndMargin方法的典型用法代码示例。如果您正苦于以下问题:C++ iterator::GetCarriedOutBEndMargin方法的具体用法?C++ iterator::GetCarriedOutBEndMargin怎么用?C++ iterator::GetCarriedOutBEndMargin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nslinelist::iterator
的用法示例。
在下文中一共展示了iterator::GetCarriedOutBEndMargin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
/*
* Reconstruct the vertical margin before the line |aLine| in order to
* do an incremental reflow that begins with |aLine| without reflowing
* the line before it. |aLine| may point to the fencepost at the end of
* the line list, and it is used this way since we (for now, anyway)
* always need to recover margins at the end of a block.
*
* The reconstruction involves walking backward through the line list to
* find any collapsed margins preceding the line that would have been in
* the reflow state's |mPrevBEndMargin| when we reflowed that line in
* a full reflow (under the rule in CSS2 that all adjacent vertical
* margins of blocks collapse).
*/
void
nsBlockReflowState::ReconstructMarginBefore(nsLineList::iterator aLine)
{
mPrevBEndMargin.Zero();
nsBlockFrame *block = mBlock;
nsLineList::iterator firstLine = block->begin_lines();
for (;;) {
--aLine;
if (aLine->IsBlock()) {
mPrevBEndMargin = aLine->GetCarriedOutBEndMargin();
break;
}
if (!aLine->IsEmpty()) {
break;
}
if (aLine == firstLine) {
// If the top margin was carried out (and thus already applied),
// set it to zero. Either way, we're done.
if (!GetFlag(BRS_ISBSTARTMARGINROOT)) {
mPrevBEndMargin.Zero();
}
break;
}
}
}
示例2:
/*
* Reconstruct the vertical margin before the line |aLine| in order to
* do an incremental reflow that begins with |aLine| without reflowing
* the line before it. |aLine| may point to the fencepost at the end of
* the line list, and it is used this way since we (for now, anyway)
* always need to recover margins at the end of a block.
*
* The reconstruction involves walking backward through the line list to
* find any collapsed margins preceding the line that would have been in
* the reflow state's |mPrevBEndMargin| when we reflowed that line in
* a full reflow (under the rule in CSS2 that all adjacent vertical
* margins of blocks collapse).
*/
void
BlockReflowInput::ReconstructMarginBefore(nsLineList::iterator aLine)
{
mPrevBEndMargin.Zero();
nsBlockFrame *block = mBlock;
nsLineList::iterator firstLine = block->LinesBegin();
for (;;) {
--aLine;
if (aLine->IsBlock()) {
mPrevBEndMargin = aLine->GetCarriedOutBEndMargin();
break;
}
if (!aLine->IsEmpty()) {
break;
}
if (aLine == firstLine) {
// If the top margin was carried out (and thus already applied),
// set it to zero. Either way, we're done.
if (!mFlags.mIsBStartMarginRoot) {
mPrevBEndMargin.Zero();
}
break;
}
}
}