Bug 1110277 patch 2 - Add nsLayoutUtils::LastContinuationOrIBSplitSibling(). r=bzbarsky

This is used in patch 3.
This commit is contained in:
L. David Baron 2015-01-11 15:43:10 -08:00
parent 9c0ffc3692
commit 877c418cca
2 changed files with 26 additions and 0 deletions

View File

@ -3907,6 +3907,25 @@ nsLayoutUtils::FirstContinuationOrIBSplitSibling(nsIFrame *aFrame)
return result;
}
nsIFrame*
nsLayoutUtils::LastContinuationOrIBSplitSibling(nsIFrame *aFrame)
{
nsIFrame *result = aFrame->FirstContinuation();
if (result->GetStateBits() & NS_FRAME_PART_OF_IBSPLIT) {
while (true) {
nsIFrame *f = static_cast<nsIFrame*>
(result->Properties().Get(nsIFrame::IBSplitSibling()));
if (!f)
break;
result = f;
}
}
result = result->LastContinuation();
return result;
}
bool
nsLayoutUtils::IsFirstContinuationOrIBSplitSibling(nsIFrame *aFrame)
{

View File

@ -1253,6 +1253,13 @@ public:
static nsIFrame*
FirstContinuationOrIBSplitSibling(nsIFrame *aFrame);
/**
* Get the last frame in the continuation-plus-ib-split-sibling chain
* containing aFrame.
*/
static nsIFrame*
LastContinuationOrIBSplitSibling(nsIFrame *aFrame);
/**
* Is FirstContinuationOrIBSplitSibling(aFrame) going to return
* aFrame?