зеркало из https://github.com/mozilla/gecko-dev.git
Rename float continuations to pushed floats. (Bug 563584, patch 33) r=roc
This patch was generated with the following sed commands on layout/generic/*.{h,cpp}: 's/FLOAT_CONTINUATION/PUSHED_FLOAT/g;s/FloatContinuation/PushedFloat/g;s/float continuation/pushed float/g' plus whitespace fixup where the frame state bits are defined.
This commit is contained in:
Родитель
051d2eec64
Коммит
7afdbd9a59
|
@ -565,7 +565,7 @@ nsBlockFrame::GetChildList(nsIAtom* aListName) const
|
||||||
return list ? *list : nsFrameList::EmptyList();
|
return list ? *list : nsFrameList::EmptyList();
|
||||||
}
|
}
|
||||||
else if (aListName == nsGkAtoms::floatContinuationsList) {
|
else if (aListName == nsGkAtoms::floatContinuationsList) {
|
||||||
const nsFrameList* list = GetFloatContinuations();
|
const nsFrameList* list = GetPushedFloats();
|
||||||
return list ? *list : nsFrameList::EmptyList();
|
return list ? *list : nsFrameList::EmptyList();
|
||||||
}
|
}
|
||||||
else if (aListName == nsGkAtoms::floatList) {
|
else if (aListName == nsGkAtoms::floatList) {
|
||||||
|
@ -582,7 +582,7 @@ nsBlockFrame::GetChildList(nsIAtom* aListName) const
|
||||||
#define NS_BLOCK_FRAME_FLOAT_LIST_INDEX (NS_CONTAINER_LIST_COUNT_INCL_OC + 1)
|
#define NS_BLOCK_FRAME_FLOAT_LIST_INDEX (NS_CONTAINER_LIST_COUNT_INCL_OC + 1)
|
||||||
#define NS_BLOCK_FRAME_BULLET_LIST_INDEX (NS_CONTAINER_LIST_COUNT_INCL_OC + 2)
|
#define NS_BLOCK_FRAME_BULLET_LIST_INDEX (NS_CONTAINER_LIST_COUNT_INCL_OC + 2)
|
||||||
#define NS_BLOCK_FRAME_ABSOLUTE_LIST_INDEX (NS_CONTAINER_LIST_COUNT_INCL_OC + 3)
|
#define NS_BLOCK_FRAME_ABSOLUTE_LIST_INDEX (NS_CONTAINER_LIST_COUNT_INCL_OC + 3)
|
||||||
#define NS_BLOCK_FRAME_FLOAT_CONTINUATIONS_LIST_INDEX (NS_CONTAINER_LIST_COUNT_INCL_OC + 4)
|
#define NS_BLOCK_FRAME_PUSHED_FLOATS_LIST_INDEX (NS_CONTAINER_LIST_COUNT_INCL_OC + 4)
|
||||||
// If adding/removing lists, don't forget to update the count in nsBlockFrame.h
|
// If adding/removing lists, don't forget to update the count in nsBlockFrame.h
|
||||||
|
|
||||||
nsIAtom*
|
nsIAtom*
|
||||||
|
@ -600,7 +600,7 @@ nsBlockFrame::GetAdditionalChildListName(PRInt32 aIndex) const
|
||||||
return nsGkAtoms::overflowOutOfFlowList;
|
return nsGkAtoms::overflowOutOfFlowList;
|
||||||
case NS_BLOCK_FRAME_ABSOLUTE_LIST_INDEX:
|
case NS_BLOCK_FRAME_ABSOLUTE_LIST_INDEX:
|
||||||
return nsGkAtoms::absoluteList;
|
return nsGkAtoms::absoluteList;
|
||||||
case NS_BLOCK_FRAME_FLOAT_CONTINUATIONS_LIST_INDEX:
|
case NS_BLOCK_FRAME_PUSHED_FLOATS_LIST_INDEX:
|
||||||
return nsGkAtoms::floatContinuationsList;
|
return nsGkAtoms::floatContinuationsList;
|
||||||
default:
|
default:
|
||||||
return nsnull;
|
return nsnull;
|
||||||
|
@ -997,11 +997,11 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
|
||||||
nsOverflowContinuationTracker tracker(aPresContext, this, PR_FALSE);
|
nsOverflowContinuationTracker tracker(aPresContext, this, PR_FALSE);
|
||||||
state.mOverflowTracker = &tracker;
|
state.mOverflowTracker = &tracker;
|
||||||
|
|
||||||
// Drain & handle float continuations
|
// Drain & handle pushed floats
|
||||||
DrainFloatContinuations(state);
|
DrainPushedFloats(state);
|
||||||
nsRect fcBounds;
|
nsRect fcBounds;
|
||||||
nsReflowStatus fcStatus = NS_FRAME_COMPLETE;
|
nsReflowStatus fcStatus = NS_FRAME_COMPLETE;
|
||||||
rv = ReflowFloatContinuations(state, fcBounds, fcStatus);
|
rv = ReflowPushedFloats(state, fcBounds, fcStatus);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
// If we're not dirty (which means we'll mark everything dirty later)
|
// If we're not dirty (which means we'll mark everything dirty later)
|
||||||
|
@ -1029,7 +1029,7 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!NS_FRAME_IS_FULLY_COMPLETE(state.mReflowStatus)) {
|
if (!NS_FRAME_IS_FULLY_COMPLETE(state.mReflowStatus)) {
|
||||||
if (GetOverflowLines() || GetFloatContinuations()) {
|
if (GetOverflowLines() || GetPushedFloats()) {
|
||||||
state.mReflowStatus |= NS_FRAME_REFLOW_NEXTINFLOW;
|
state.mReflowStatus |= NS_FRAME_REFLOW_NEXTINFLOW;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1088,7 +1088,7 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
|
||||||
ComputeCombinedArea(aReflowState, aMetrics, bottomEdgeOfChildren);
|
ComputeCombinedArea(aReflowState, aMetrics, bottomEdgeOfChildren);
|
||||||
// Factor overflow container child bounds into the overflow area
|
// Factor overflow container child bounds into the overflow area
|
||||||
aMetrics.mOverflowArea.UnionRect(aMetrics.mOverflowArea, ocBounds);
|
aMetrics.mOverflowArea.UnionRect(aMetrics.mOverflowArea, ocBounds);
|
||||||
// Factor float continuation child bounds into the overflow area
|
// Factor pushed float child bounds into the overflow area
|
||||||
aMetrics.mOverflowArea.UnionRect(aMetrics.mOverflowArea, fcBounds);
|
aMetrics.mOverflowArea.UnionRect(aMetrics.mOverflowArea, fcBounds);
|
||||||
|
|
||||||
// Let the absolutely positioned container reflow any absolutely positioned
|
// Let the absolutely positioned container reflow any absolutely positioned
|
||||||
|
@ -1770,9 +1770,9 @@ nsBlockFrame::ReflowDirtyLines(nsBlockReflowState& aState)
|
||||||
// recompute the carried out margin before the line if we want to
|
// recompute the carried out margin before the line if we want to
|
||||||
// reflow it or if its previous margin is dirty
|
// reflow it or if its previous margin is dirty
|
||||||
PRBool needToRecoverState = PR_FALSE;
|
PRBool needToRecoverState = PR_FALSE;
|
||||||
// Float continuations were reflowed in ReflowFloatContinuations
|
// Float continuations were reflowed in ReflowPushedFloats
|
||||||
PRBool reflowedFloat = mFloats.NotEmpty() &&
|
PRBool reflowedFloat = mFloats.NotEmpty() &&
|
||||||
(mFloats.FirstChild()->GetStateBits() & NS_FRAME_IS_FLOAT_CONTINUATION);
|
(mFloats.FirstChild()->GetStateBits() & NS_FRAME_IS_PUSHED_FLOAT);
|
||||||
PRBool lastLineMovedUp = PR_FALSE;
|
PRBool lastLineMovedUp = PR_FALSE;
|
||||||
// We save up information about BR-clearance here
|
// We save up information about BR-clearance here
|
||||||
PRUint8 inlineFloatBreakType = aState.mFloatBreakType;
|
PRUint8 inlineFloatBreakType = aState.mFloatBreakType;
|
||||||
|
@ -3933,7 +3933,7 @@ nsBlockFrame::SplitFloat(nsBlockReflowState& aState,
|
||||||
aState.mFloatManager->SetSplitRightFloatAcrossBreak();
|
aState.mFloatManager->SetSplitRightFloatAcrossBreak();
|
||||||
}
|
}
|
||||||
|
|
||||||
aState.AppendFloatContinuation(nextInFlow);
|
aState.AppendPushedFloat(nextInFlow);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3954,7 +3954,7 @@ CheckPlaceholderInLine(nsIFrame* aBlock, nsLineBox* aLine, nsFloatCache* aFC)
|
||||||
return PR_TRUE;
|
return PR_TRUE;
|
||||||
NS_ASSERTION(!aFC->mFloat->GetPrevContinuation(),
|
NS_ASSERTION(!aFC->mFloat->GetPrevContinuation(),
|
||||||
"float in a line should never be a continuation");
|
"float in a line should never be a continuation");
|
||||||
NS_ASSERTION(!(aFC->mFloat->GetStateBits() & NS_FRAME_IS_FLOAT_CONTINUATION),
|
NS_ASSERTION(!(aFC->mFloat->GetStateBits() & NS_FRAME_IS_PUSHED_FLOAT),
|
||||||
"float in a line should never be a pushed float");
|
"float in a line should never be a pushed float");
|
||||||
nsIFrame* ph = aBlock->PresContext()->FrameManager()->
|
nsIFrame* ph = aBlock->PresContext()->FrameManager()->
|
||||||
GetPlaceholderFrameFor(aFC->mFloat->GetFirstInFlow());
|
GetPlaceholderFrameFor(aFC->mFloat->GetFirstInFlow());
|
||||||
|
@ -4447,15 +4447,15 @@ nsBlockFrame::DrainOverflowLines(nsBlockReflowState& aState)
|
||||||
|
|
||||||
// This function assumes our prev-in-flow has completed reflow and its
|
// This function assumes our prev-in-flow has completed reflow and its
|
||||||
// mFloats may contain frames at the end of its float list, marked with
|
// mFloats may contain frames at the end of its float list, marked with
|
||||||
// NS_FRAME_IS_FLOAT_CONTINUATION, that should be pulled to this block.
|
// NS_FRAME_IS_PUSHED_FLOAT, that should be pulled to this block.
|
||||||
void
|
void
|
||||||
nsBlockFrame::DrainFloatContinuations(nsBlockReflowState& aState)
|
nsBlockFrame::DrainPushedFloats(nsBlockReflowState& aState)
|
||||||
{
|
{
|
||||||
// Take any continuations we need to take from our prev-in-flow.
|
// Take any continuations we need to take from our prev-in-flow.
|
||||||
nsBlockFrame* prevBlock = static_cast<nsBlockFrame*>(GetPrevInFlow());
|
nsBlockFrame* prevBlock = static_cast<nsBlockFrame*>(GetPrevInFlow());
|
||||||
if (!prevBlock)
|
if (!prevBlock)
|
||||||
return;
|
return;
|
||||||
nsFrameList *list = prevBlock->RemoveFloatContinuations();
|
nsFrameList *list = prevBlock->RemovePushedFloats();
|
||||||
if (list) {
|
if (list) {
|
||||||
if (list->NotEmpty()) {
|
if (list->NotEmpty()) {
|
||||||
mFloats.InsertFrames(this, nsnull, *list);
|
mFloats.InsertFrames(this, nsnull, *list);
|
||||||
|
@ -4563,41 +4563,41 @@ nsBlockFrame::SetOverflowOutOfFlows(const nsFrameList& aList,
|
||||||
}
|
}
|
||||||
|
|
||||||
nsFrameList*
|
nsFrameList*
|
||||||
nsBlockFrame::GetFloatContinuations() const
|
nsBlockFrame::GetPushedFloats() const
|
||||||
{
|
{
|
||||||
if (!(GetStateBits() & NS_BLOCK_HAS_FLOAT_CONTINUATIONS)) {
|
if (!(GetStateBits() & NS_BLOCK_HAS_PUSHED_FLOATS)) {
|
||||||
return nsnull;
|
return nsnull;
|
||||||
}
|
}
|
||||||
nsFrameList* result =
|
nsFrameList* result =
|
||||||
static_cast<nsFrameList*>(Properties().Get(FloatContinuationProperty()));
|
static_cast<nsFrameList*>(Properties().Get(PushedFloatProperty()));
|
||||||
NS_ASSERTION(result, "value should always be non-empty when state set");
|
NS_ASSERTION(result, "value should always be non-empty when state set");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsFrameList*
|
nsFrameList*
|
||||||
nsBlockFrame::EnsureFloatContinuations()
|
nsBlockFrame::EnsurePushedFloats()
|
||||||
{
|
{
|
||||||
nsFrameList *result = GetFloatContinuations();
|
nsFrameList *result = GetPushedFloats();
|
||||||
if (result)
|
if (result)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
result = new nsFrameList;
|
result = new nsFrameList;
|
||||||
Properties().Set(FloatContinuationProperty(), result);
|
Properties().Set(PushedFloatProperty(), result);
|
||||||
AddStateBits(NS_BLOCK_HAS_FLOAT_CONTINUATIONS);
|
AddStateBits(NS_BLOCK_HAS_PUSHED_FLOATS);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsFrameList*
|
nsFrameList*
|
||||||
nsBlockFrame::RemoveFloatContinuations()
|
nsBlockFrame::RemovePushedFloats()
|
||||||
{
|
{
|
||||||
if (!(GetStateBits() & NS_BLOCK_HAS_FLOAT_CONTINUATIONS)) {
|
if (!(GetStateBits() & NS_BLOCK_HAS_PUSHED_FLOATS)) {
|
||||||
return nsnull;
|
return nsnull;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsFrameList *result =
|
nsFrameList *result =
|
||||||
static_cast<nsFrameList*>(Properties().Remove(FloatContinuationProperty()));
|
static_cast<nsFrameList*>(Properties().Remove(PushedFloatProperty()));
|
||||||
RemoveStateBits(NS_BLOCK_HAS_FLOAT_CONTINUATIONS);
|
RemoveStateBits(NS_BLOCK_HAS_PUSHED_FLOATS);
|
||||||
NS_ASSERTION(result, "value should always be non-empty when state set");
|
NS_ASSERTION(result, "value should always be non-empty when state set");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -4935,7 +4935,7 @@ nsBlockFrame::RemoveFrame(nsIAtom* aListName,
|
||||||
// we are removing; this way is a bit messy, but so is the rest of the code.
|
// we are removing; this way is a bit messy, but so is the rest of the code.
|
||||||
// See bug 390762.
|
// See bug 390762.
|
||||||
NS_ASSERTION(!aOldFrame->GetPrevContinuation(),
|
NS_ASSERTION(!aOldFrame->GetPrevContinuation(),
|
||||||
"RemoveFrame should not be called on float continuations.");
|
"RemoveFrame should not be called on pushed floats.");
|
||||||
for (nsIFrame* f = aOldFrame;
|
for (nsIFrame* f = aOldFrame;
|
||||||
f && !(f->GetStateBits() & NS_FRAME_IS_OVERFLOW_CONTAINER);
|
f && !(f->GetStateBits() & NS_FRAME_IS_OVERFLOW_CONTAINER);
|
||||||
f = f->GetNextContinuation()) {
|
f = f->GetNextContinuation()) {
|
||||||
|
@ -5421,7 +5421,7 @@ nsBlockFrame::StealFrame(nsPresContext* aPresContext,
|
||||||
aChild->GetStyleDisplay()->IsFloating()) {
|
aChild->GetStyleDisplay()->IsFloating()) {
|
||||||
PRBool removed = mFloats.RemoveFrameIfPresent(aChild);
|
PRBool removed = mFloats.RemoveFrameIfPresent(aChild);
|
||||||
if (!removed) {
|
if (!removed) {
|
||||||
nsFrameList* list = GetFloatContinuations();
|
nsFrameList* list = GetPushedFloats();
|
||||||
if (list) {
|
if (list) {
|
||||||
removed = list->RemoveFrameIfPresent(aChild);
|
removed = list->RemoveFrameIfPresent(aChild);
|
||||||
}
|
}
|
||||||
|
@ -5733,13 +5733,13 @@ nsBlockFrame::FindTrailingClear()
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
nsBlockFrame::ReflowFloatContinuations(nsBlockReflowState& aState,
|
nsBlockFrame::ReflowPushedFloats(nsBlockReflowState& aState,
|
||||||
nsRect& aBounds,
|
nsRect& aBounds,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
for (nsIFrame* f = mFloats.FirstChild(), *next;
|
for (nsIFrame* f = mFloats.FirstChild(), *next;
|
||||||
f && (f->GetStateBits() & NS_FRAME_IS_FLOAT_CONTINUATION);
|
f && (f->GetStateBits() & NS_FRAME_IS_PUSHED_FLOAT);
|
||||||
f = next) {
|
f = next) {
|
||||||
// save next sibling now, since reflowing could push the entire
|
// save next sibling now, since reflowing could push the entire
|
||||||
// float, changing its siblings
|
// float, changing its siblings
|
||||||
|
@ -5789,7 +5789,7 @@ void
|
||||||
nsBlockFrame::RecoverFloats(nsFloatManager& aFloatManager)
|
nsBlockFrame::RecoverFloats(nsFloatManager& aFloatManager)
|
||||||
{
|
{
|
||||||
// Recover our own floats
|
// Recover our own floats
|
||||||
nsIFrame* stop = nsnull; // Stop before we reach float continuations that
|
nsIFrame* stop = nsnull; // Stop before we reach pushed floats that
|
||||||
// belong to our next-in-flow
|
// belong to our next-in-flow
|
||||||
for (nsIFrame* f = mFloats.FirstChild(); f && f != stop; f = f->GetNextSibling()) {
|
for (nsIFrame* f = mFloats.FirstChild(); f && f != stop; f = f->GetNextSibling()) {
|
||||||
nsRect region = nsFloatManager::GetRegionFor(f);
|
nsRect region = nsFloatManager::GetRegionFor(f);
|
||||||
|
@ -6061,7 +6061,7 @@ nsBlockFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||||
if (GetPrevInFlow()) {
|
if (GetPrevInFlow()) {
|
||||||
DisplayOverflowContainers(aBuilder, aDirtyRect, aLists);
|
DisplayOverflowContainers(aBuilder, aDirtyRect, aLists);
|
||||||
for (nsIFrame* f = mFloats.FirstChild(); f; f = f->GetNextSibling()) {
|
for (nsIFrame* f = mFloats.FirstChild(); f; f = f->GetNextSibling()) {
|
||||||
if (f->GetStateBits() & NS_FRAME_IS_FLOAT_CONTINUATION)
|
if (f->GetStateBits() & NS_FRAME_IS_PUSHED_FLOAT)
|
||||||
BuildDisplayListForChild(aBuilder, f, aDirtyRect, aLists);
|
BuildDisplayListForChild(aBuilder, f, aDirtyRect, aLists);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6681,9 +6681,9 @@ void nsBlockFrame::CollectFloats(nsIFrame* aFrame, nsFrameList& aList,
|
||||||
aFrame->GetType() == nsGkAtoms::placeholderFrame ?
|
aFrame->GetType() == nsGkAtoms::placeholderFrame ?
|
||||||
nsLayoutUtils::GetFloatFromPlaceholder(aFrame) : nsnull;
|
nsLayoutUtils::GetFloatFromPlaceholder(aFrame) : nsnull;
|
||||||
if (outOfFlowFrame) {
|
if (outOfFlowFrame) {
|
||||||
if (outOfFlowFrame->GetStateBits() & NS_FRAME_IS_FLOAT_CONTINUATION) {
|
if (outOfFlowFrame->GetStateBits() & NS_FRAME_IS_PUSHED_FLOAT) {
|
||||||
if (outOfFlowFrame->GetParent() == this) {
|
if (outOfFlowFrame->GetParent() == this) {
|
||||||
nsFrameList* list = GetFloatContinuations();
|
nsFrameList* list = GetPushedFloats();
|
||||||
if (!list || !list->RemoveFrameIfPresent(outOfFlowFrame)) {
|
if (!list || !list->RemoveFrameIfPresent(outOfFlowFrame)) {
|
||||||
mFloats.RemoveFrame(outOfFlowFrame);
|
mFloats.RemoveFrame(outOfFlowFrame);
|
||||||
}
|
}
|
||||||
|
@ -6749,7 +6749,7 @@ nsBlockFrame::CheckFloats(nsBlockReflowState& aState)
|
||||||
PRBool equal = PR_TRUE;
|
PRBool equal = PR_TRUE;
|
||||||
PRUint32 i = 0;
|
PRUint32 i = 0;
|
||||||
for (nsIFrame* f = mFloats.FirstChild(); f; f = f->GetNextSibling()) {
|
for (nsIFrame* f = mFloats.FirstChild(); f; f = f->GetNextSibling()) {
|
||||||
if (f->GetStateBits() & NS_FRAME_IS_FLOAT_CONTINUATION)
|
if (f->GetStateBits() & NS_FRAME_IS_PUSHED_FLOAT)
|
||||||
continue;
|
continue;
|
||||||
storedFloats.AppendElement(f);
|
storedFloats.AppendElement(f);
|
||||||
if (i < lineFloats.Length() && lineFloats.ElementAt(i) != f) {
|
if (i < lineFloats.Length() && lineFloats.ElementAt(i) != f) {
|
||||||
|
|
|
@ -94,7 +94,7 @@ class nsIntervalSet;
|
||||||
* frame in a block's normal child list.
|
* frame in a block's normal child list.
|
||||||
* -- While a block is being reflowed, and from then until
|
* -- While a block is being reflowed, and from then until
|
||||||
* its next-in-flow is reflowed it may have a
|
* its next-in-flow is reflowed it may have a
|
||||||
* FloatContinuationProperty frame property that points to
|
* PushedFloatProperty frame property that points to
|
||||||
* an nsFrameList. This list contains continuations for
|
* an nsFrameList. This list contains continuations for
|
||||||
* floats whose prev-in-flow is in the block's regular float
|
* floats whose prev-in-flow is in the block's regular float
|
||||||
* list and first-in-flows of floats that did not fit, but
|
* list and first-in-flows of floats that did not fit, but
|
||||||
|
@ -118,7 +118,7 @@ class nsIntervalSet;
|
||||||
* continuation chain or none of them.
|
* continuation chain or none of them.
|
||||||
*/
|
*/
|
||||||
#define NS_BLOCK_NEEDS_BIDI_RESOLUTION NS_FRAME_STATE_BIT(20)
|
#define NS_BLOCK_NEEDS_BIDI_RESOLUTION NS_FRAME_STATE_BIT(20)
|
||||||
#define NS_BLOCK_HAS_FLOAT_CONTINUATIONS NS_FRAME_STATE_BIT(21)
|
#define NS_BLOCK_HAS_PUSHED_FLOATS NS_FRAME_STATE_BIT(21)
|
||||||
#define NS_BLOCK_HAS_LINE_CURSOR NS_FRAME_STATE_BIT(24)
|
#define NS_BLOCK_HAS_LINE_CURSOR NS_FRAME_STATE_BIT(24)
|
||||||
#define NS_BLOCK_HAS_OVERFLOW_LINES NS_FRAME_STATE_BIT(25)
|
#define NS_BLOCK_HAS_OVERFLOW_LINES NS_FRAME_STATE_BIT(25)
|
||||||
#define NS_BLOCK_HAS_OVERFLOW_OUT_OF_FLOWS NS_FRAME_STATE_BIT(26)
|
#define NS_BLOCK_HAS_OVERFLOW_OUT_OF_FLOWS NS_FRAME_STATE_BIT(26)
|
||||||
|
@ -161,7 +161,7 @@ public:
|
||||||
|
|
||||||
// This is a child list too, but we let nsBlockReflowState get to it
|
// This is a child list too, but we let nsBlockReflowState get to it
|
||||||
// directly too.
|
// directly too.
|
||||||
NS_DECLARE_FRAME_PROPERTY(FloatContinuationProperty,
|
NS_DECLARE_FRAME_PROPERTY(PushedFloatProperty,
|
||||||
nsContainerFrame::DestroyFrameList)
|
nsContainerFrame::DestroyFrameList)
|
||||||
|
|
||||||
// nsQueryFrame
|
// nsQueryFrame
|
||||||
|
@ -461,19 +461,19 @@ protected:
|
||||||
*/
|
*/
|
||||||
PRBool DrainOverflowLines(nsBlockReflowState& aState);
|
PRBool DrainOverflowLines(nsBlockReflowState& aState);
|
||||||
|
|
||||||
/** grab float continuations from this block's prevInFlow, and splice
|
/** grab pushed floats from this block's prevInFlow, and splice
|
||||||
* them into this block's mFloats list.
|
* them into this block's mFloats list.
|
||||||
*/
|
*/
|
||||||
void DrainFloatContinuations(nsBlockReflowState& aState);
|
void DrainPushedFloats(nsBlockReflowState& aState);
|
||||||
|
|
||||||
/** Load all our floats into the float manager (without reflowing them).
|
/** Load all our floats into the float manager (without reflowing them).
|
||||||
* Assumes float manager is in our own coordinate system.
|
* Assumes float manager is in our own coordinate system.
|
||||||
*/
|
*/
|
||||||
void RecoverFloats(nsFloatManager& aFloatManager);
|
void RecoverFloats(nsFloatManager& aFloatManager);
|
||||||
|
|
||||||
/** Reflow float continuations
|
/** Reflow pushed floats
|
||||||
*/
|
*/
|
||||||
nsresult ReflowFloatContinuations(nsBlockReflowState& aState,
|
nsresult ReflowPushedFloats(nsBlockReflowState& aState,
|
||||||
nsRect& aBounds,
|
nsRect& aBounds,
|
||||||
nsReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
|
@ -724,13 +724,13 @@ protected:
|
||||||
nsFrameList* GetOverflowOutOfFlows() const;
|
nsFrameList* GetOverflowOutOfFlows() const;
|
||||||
void SetOverflowOutOfFlows(const nsFrameList& aList, nsFrameList* aPropValue);
|
void SetOverflowOutOfFlows(const nsFrameList& aList, nsFrameList* aPropValue);
|
||||||
|
|
||||||
// Get the float continuations list
|
// Get the pushed floats list
|
||||||
nsFrameList* GetFloatContinuations() const;
|
nsFrameList* GetPushedFloats() const;
|
||||||
// Get the float continuations list, or if there is not currently one,
|
// Get the pushed floats list, or if there is not currently one,
|
||||||
// make a new empty one.
|
// make a new empty one.
|
||||||
nsFrameList* EnsureFloatContinuations();
|
nsFrameList* EnsurePushedFloats();
|
||||||
// Remove and return the float continuations list.
|
// Remove and return the pushed floats list.
|
||||||
nsFrameList* RemoveFloatContinuations();
|
nsFrameList* RemovePushedFloats();
|
||||||
|
|
||||||
#ifdef NS_DEBUG
|
#ifdef NS_DEBUG
|
||||||
void VerifyLines(PRBool aFinalCheckOK);
|
void VerifyLines(PRBool aFinalCheckOK);
|
||||||
|
|
|
@ -71,7 +71,7 @@ nsBlockReflowState::nsBlockReflowState(const nsHTMLReflowState& aReflowState,
|
||||||
: mBlock(aFrame),
|
: mBlock(aFrame),
|
||||||
mPresContext(aPresContext),
|
mPresContext(aPresContext),
|
||||||
mReflowState(aReflowState),
|
mReflowState(aReflowState),
|
||||||
mFloatContinuations(nsnull),
|
mPushedFloats(nsnull),
|
||||||
mOverflowTracker(nsnull),
|
mOverflowTracker(nsnull),
|
||||||
mPrevBottomMargin(),
|
mPrevBottomMargin(),
|
||||||
mLineNumber(0),
|
mLineNumber(0),
|
||||||
|
@ -426,19 +426,19 @@ nsBlockReflowState::ReconstructMarginAbove(nsLineList::iterator aLine)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
nsBlockReflowState::SetupFloatContinuationList()
|
nsBlockReflowState::SetupPushedFloatList()
|
||||||
{
|
{
|
||||||
NS_ABORT_IF_FALSE(!GetFlag(BRS_PROPTABLE_FLOATCLIST) == !mFloatContinuations,
|
NS_ABORT_IF_FALSE(!GetFlag(BRS_PROPTABLE_FLOATCLIST) == !mPushedFloats,
|
||||||
"flag mismatch");
|
"flag mismatch");
|
||||||
if (!GetFlag(BRS_PROPTABLE_FLOATCLIST)) {
|
if (!GetFlag(BRS_PROPTABLE_FLOATCLIST)) {
|
||||||
// If we're being re-Reflow'd without our next-in-flow having been
|
// If we're being re-Reflow'd without our next-in-flow having been
|
||||||
// reflowed, some float continuations from our previous reflow might
|
// reflowed, some pushed floats from our previous reflow might
|
||||||
// still be on our float continuations list. However, that's
|
// still be on our pushed floats list. However, that's
|
||||||
// actually fine, since they'll all end up being stolen and
|
// actually fine, since they'll all end up being stolen and
|
||||||
// reordered into the correct order again.
|
// reordered into the correct order again.
|
||||||
// (nsBlockFrame::ReflowDirtyLines ensures that any lines with
|
// (nsBlockFrame::ReflowDirtyLines ensures that any lines with
|
||||||
// pushed floats are reflowed.)
|
// pushed floats are reflowed.)
|
||||||
mFloatContinuations = mBlock->EnsureFloatContinuations();
|
mPushedFloats = mBlock->EnsurePushedFloats();
|
||||||
SetFlag(BRS_PROPTABLE_FLOATCLIST, PR_TRUE);
|
SetFlag(BRS_PROPTABLE_FLOATCLIST, PR_TRUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -552,10 +552,10 @@ nsBlockReflowState::AddFloat(nsLineLayout* aLineLayout,
|
||||||
NS_ABORT_IF_FALSE(aFloat->GetParent()->IsFrameOfType(nsIFrame::eBlockFrame),
|
NS_ABORT_IF_FALSE(aFloat->GetParent()->IsFrameOfType(nsIFrame::eBlockFrame),
|
||||||
"float's parent must be block");
|
"float's parent must be block");
|
||||||
NS_ABORT_IF_FALSE(aFloat->GetParent() == mBlock ||
|
NS_ABORT_IF_FALSE(aFloat->GetParent() == mBlock ||
|
||||||
(aFloat->GetStateBits() & NS_FRAME_IS_FLOAT_CONTINUATION),
|
(aFloat->GetStateBits() & NS_FRAME_IS_PUSHED_FLOAT),
|
||||||
"float should be in this block unless it was marked as "
|
"float should be in this block unless it was marked as "
|
||||||
"float continuation");
|
"pushed float");
|
||||||
if (aFloat->GetStateBits() & NS_FRAME_IS_FLOAT_CONTINUATION) {
|
if (aFloat->GetStateBits() & NS_FRAME_IS_PUSHED_FLOAT) {
|
||||||
// If, in a previous reflow, the float was pushed entirely to
|
// If, in a previous reflow, the float was pushed entirely to
|
||||||
// another column/page, we need to steal it back. (We might just
|
// another column/page, we need to steal it back. (We might just
|
||||||
// push it again, though.) Likewise, if that previous reflow
|
// push it again, though.) Likewise, if that previous reflow
|
||||||
|
@ -565,7 +565,7 @@ nsBlockReflowState::AddFloat(nsLineLayout* aLineLayout,
|
||||||
static_cast<nsBlockFrame*>(aFloat->GetParent());
|
static_cast<nsBlockFrame*>(aFloat->GetParent());
|
||||||
floatParent->StealFrame(mPresContext, aFloat);
|
floatParent->StealFrame(mPresContext, aFloat);
|
||||||
|
|
||||||
aFloat->RemoveStateBits(NS_FRAME_IS_FLOAT_CONTINUATION);
|
aFloat->RemoveStateBits(NS_FRAME_IS_PUSHED_FLOAT);
|
||||||
|
|
||||||
// Appending is fine, since if a float was pushed to the next
|
// Appending is fine, since if a float was pushed to the next
|
||||||
// page/column, all later floats were also pushed.
|
// page/column, all later floats were also pushed.
|
||||||
|
@ -947,11 +947,11 @@ nsBlockReflowState::PushFloatPastBreak(nsIFrame *aFloat)
|
||||||
mFloatManager->SetPushedRightFloatPastBreak();
|
mFloatManager->SetPushedRightFloatPastBreak();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Put the float on the float continuations list, even though it
|
// Put the float on the pushed floats list, even though it
|
||||||
// isn't actually a continuation.
|
// isn't actually a continuation.
|
||||||
nsresult rv = mBlock->StealFrame(mPresContext, aFloat);
|
nsresult rv = mBlock->StealFrame(mPresContext, aFloat);
|
||||||
NS_ASSERTION(NS_SUCCEEDED(rv), "StealFrame should succeed");
|
NS_ASSERTION(NS_SUCCEEDED(rv), "StealFrame should succeed");
|
||||||
AppendFloatContinuation(aFloat);
|
AppendPushedFloat(aFloat);
|
||||||
|
|
||||||
NS_FRAME_SET_OVERFLOW_INCOMPLETE(mReflowStatus);
|
NS_FRAME_SET_OVERFLOW_INCOMPLETE(mReflowStatus);
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,7 +62,7 @@
|
||||||
// the current line
|
// the current line
|
||||||
#define BRS_LINE_LAYOUT_EMPTY 0x00000080
|
#define BRS_LINE_LAYOUT_EMPTY 0x00000080
|
||||||
#define BRS_ISOVERFLOWCONTAINER 0x00000100
|
#define BRS_ISOVERFLOWCONTAINER 0x00000100
|
||||||
// Our mFloatContinuations list is stored on the blocks' proptable
|
// Our mPushedFloats list is stored on the blocks' proptable
|
||||||
#define BRS_PROPTABLE_FLOATCLIST 0x00000200
|
#define BRS_PROPTABLE_FLOATCLIST 0x00000200
|
||||||
#define BRS_LASTFLAG BRS_PROPTABLE_FLOATCLIST
|
#define BRS_LASTFLAG BRS_PROPTABLE_FLOATCLIST
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ public:
|
||||||
* The following functions all return PR_TRUE if they were able to
|
* The following functions all return PR_TRUE if they were able to
|
||||||
* place the float, PR_FALSE if the float did not fit in available
|
* place the float, PR_FALSE if the float did not fit in available
|
||||||
* space.
|
* space.
|
||||||
* aLineLayout is null when we are reflowing float continuations (because
|
* aLineLayout is null when we are reflowing pushed floats (because
|
||||||
* they are not associated with a line box).
|
* they are not associated with a line box).
|
||||||
*/
|
*/
|
||||||
PRBool AddFloat(nsLineLayout* aLineLayout,
|
PRBool AddFloat(nsLineLayout* aLineLayout,
|
||||||
|
@ -230,15 +230,15 @@ public:
|
||||||
// Continuation out-of-flow float frames that need to move to our
|
// Continuation out-of-flow float frames that need to move to our
|
||||||
// next in flow are placed here during reflow. It's a pointer to
|
// next in flow are placed here during reflow. It's a pointer to
|
||||||
// a frame list stored in the block's property table.
|
// a frame list stored in the block's property table.
|
||||||
nsFrameList *mFloatContinuations;
|
nsFrameList *mPushedFloats;
|
||||||
// This method makes sure float continuations are accessible to
|
// This method makes sure pushed floats are accessible to
|
||||||
// StealFrame. Call it before adding any frames to mFloatContinuations.
|
// StealFrame. Call it before adding any frames to mPushedFloats.
|
||||||
void SetupFloatContinuationList();
|
void SetupPushedFloatList();
|
||||||
// Use this method to append to mFloatContinuations.
|
// Use this method to append to mPushedFloats.
|
||||||
void AppendFloatContinuation(nsIFrame* aFloatCont) {
|
void AppendPushedFloat(nsIFrame* aFloatCont) {
|
||||||
SetupFloatContinuationList();
|
SetupPushedFloatList();
|
||||||
aFloatCont->AddStateBits(NS_FRAME_IS_FLOAT_CONTINUATION);
|
aFloatCont->AddStateBits(NS_FRAME_IS_PUSHED_FLOAT);
|
||||||
mFloatContinuations->AppendFrame(mBlock, aFloatCont);
|
mPushedFloats->AppendFrame(mBlock, aFloatCont);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Track child overflow continuations.
|
// Track child overflow continuations.
|
||||||
|
|
|
@ -260,7 +260,7 @@ typedef PRUint64 nsFrameState;
|
||||||
// placeholder. This can happen for two reasons: (1) the float was
|
// placeholder. This can happen for two reasons: (1) the float was
|
||||||
// split, and this piece is the continuation, or (2) the entire float
|
// split, and this piece is the continuation, or (2) the entire float
|
||||||
// didn't fit on the page.
|
// didn't fit on the page.
|
||||||
#define NS_FRAME_IS_FLOAT_CONTINUATION NS_FRAME_STATE_BIT(32)
|
#define NS_FRAME_IS_PUSHED_FLOAT NS_FRAME_STATE_BIT(32)
|
||||||
|
|
||||||
// The lower 20 bits and upper 32 bits of the frame state are reserved
|
// The lower 20 bits and upper 32 bits of the frame state are reserved
|
||||||
// by this API.
|
// by this API.
|
||||||
|
|
Загрузка…
Ссылка в новой задаче