зеркало из https://github.com/mozilla/pjs.git
Work on getting floaters working again
This commit is contained in:
Родитель
2193cef855
Коммит
f6e0e4fd8b
|
@ -1386,15 +1386,13 @@ nsBlockFrame::PlaceFloater(nsIPresContext* aPresContext,
|
|||
{
|
||||
// If the floater is the left-most non-zero size child frame then insert
|
||||
// it before the current line; otherwise add it to the below-current-line
|
||||
// todo list and we'll handle it when we flush out the line
|
||||
// todo list, and we'll handle it when we flush out the line
|
||||
if (IsLeftMostChild(aPlaceholder)) {
|
||||
nsISpaceManager* sm = aState.mSpaceManager;
|
||||
|
||||
// Get the type of floater
|
||||
nsIStyleContextPtr styleContext;
|
||||
aFloater->GetStyleContext(aPresContext, styleContext.AssignRef());
|
||||
nsStyleDisplay* floaterDisplay = (nsStyleDisplay*)
|
||||
styleContext->GetData(kStyleDisplaySID);
|
||||
nsStyleDisplay* floaterDisplay;
|
||||
aFloater->GetStyleData(kStyleDisplaySID, (nsStyleStruct*&)floaterDisplay);
|
||||
|
||||
// Commit some space in the space manager and adjust our current
|
||||
// band of available space.
|
||||
|
@ -1432,6 +1430,8 @@ nsBlockFrame::PlaceFloater(nsIPresContext* aPresContext,
|
|||
}
|
||||
}
|
||||
|
||||
// XXX It's unclear what coordinate space aY is in. Is it relative to the
|
||||
// upper-left origin of the containing block, or relative to aState.mY?
|
||||
void
|
||||
nsBlockFrame::PlaceBelowCurrentLineFloaters(nsBlockReflowState& aState,
|
||||
nscoord aY)
|
||||
|
@ -1452,13 +1452,12 @@ nsBlockFrame::PlaceBelowCurrentLineFloaters(nsBlockReflowState& aState,
|
|||
GetAvailableSpace(aState, aY);
|
||||
|
||||
// Get the type of floater
|
||||
nsIStyleContextPtr styleContext;
|
||||
floater->GetStyleContext(aState.mPresContext, styleContext.AssignRef());
|
||||
nsStyleDisplay* sd = (nsStyleDisplay*)
|
||||
styleContext->GetData(kStyleDisplaySID);
|
||||
nsStyleDisplay* sd;
|
||||
floater->GetStyleData(kStyleDisplaySID, (nsStyleStruct*&)sd);
|
||||
|
||||
floater->GetRect(region);
|
||||
region.y = bd->availSpace.y;
|
||||
// XXX GetAvailableSpace() is translating availSpace by aState.mY...
|
||||
region.y = bd->availSpace.y - aState.mY;
|
||||
if (NS_STYLE_FLOAT_LEFT == sd->mFloats) {
|
||||
region.x = bd->availSpace.x;
|
||||
} else {
|
||||
|
|
|
@ -1386,15 +1386,13 @@ nsBlockFrame::PlaceFloater(nsIPresContext* aPresContext,
|
|||
{
|
||||
// If the floater is the left-most non-zero size child frame then insert
|
||||
// it before the current line; otherwise add it to the below-current-line
|
||||
// todo list and we'll handle it when we flush out the line
|
||||
// todo list, and we'll handle it when we flush out the line
|
||||
if (IsLeftMostChild(aPlaceholder)) {
|
||||
nsISpaceManager* sm = aState.mSpaceManager;
|
||||
|
||||
// Get the type of floater
|
||||
nsIStyleContextPtr styleContext;
|
||||
aFloater->GetStyleContext(aPresContext, styleContext.AssignRef());
|
||||
nsStyleDisplay* floaterDisplay = (nsStyleDisplay*)
|
||||
styleContext->GetData(kStyleDisplaySID);
|
||||
nsStyleDisplay* floaterDisplay;
|
||||
aFloater->GetStyleData(kStyleDisplaySID, (nsStyleStruct*&)floaterDisplay);
|
||||
|
||||
// Commit some space in the space manager and adjust our current
|
||||
// band of available space.
|
||||
|
@ -1432,6 +1430,8 @@ nsBlockFrame::PlaceFloater(nsIPresContext* aPresContext,
|
|||
}
|
||||
}
|
||||
|
||||
// XXX It's unclear what coordinate space aY is in. Is it relative to the
|
||||
// upper-left origin of the containing block, or relative to aState.mY?
|
||||
void
|
||||
nsBlockFrame::PlaceBelowCurrentLineFloaters(nsBlockReflowState& aState,
|
||||
nscoord aY)
|
||||
|
@ -1452,13 +1452,12 @@ nsBlockFrame::PlaceBelowCurrentLineFloaters(nsBlockReflowState& aState,
|
|||
GetAvailableSpace(aState, aY);
|
||||
|
||||
// Get the type of floater
|
||||
nsIStyleContextPtr styleContext;
|
||||
floater->GetStyleContext(aState.mPresContext, styleContext.AssignRef());
|
||||
nsStyleDisplay* sd = (nsStyleDisplay*)
|
||||
styleContext->GetData(kStyleDisplaySID);
|
||||
nsStyleDisplay* sd;
|
||||
floater->GetStyleData(kStyleDisplaySID, (nsStyleStruct*&)sd);
|
||||
|
||||
floater->GetRect(region);
|
||||
region.y = bd->availSpace.y;
|
||||
// XXX GetAvailableSpace() is translating availSpace by aState.mY...
|
||||
region.y = bd->availSpace.y - aState.mY;
|
||||
if (NS_STYLE_FLOAT_LEFT == sd->mFloats) {
|
||||
region.x = bd->availSpace.x;
|
||||
} else {
|
||||
|
|
|
@ -1386,15 +1386,13 @@ nsBlockFrame::PlaceFloater(nsIPresContext* aPresContext,
|
|||
{
|
||||
// If the floater is the left-most non-zero size child frame then insert
|
||||
// it before the current line; otherwise add it to the below-current-line
|
||||
// todo list and we'll handle it when we flush out the line
|
||||
// todo list, and we'll handle it when we flush out the line
|
||||
if (IsLeftMostChild(aPlaceholder)) {
|
||||
nsISpaceManager* sm = aState.mSpaceManager;
|
||||
|
||||
// Get the type of floater
|
||||
nsIStyleContextPtr styleContext;
|
||||
aFloater->GetStyleContext(aPresContext, styleContext.AssignRef());
|
||||
nsStyleDisplay* floaterDisplay = (nsStyleDisplay*)
|
||||
styleContext->GetData(kStyleDisplaySID);
|
||||
nsStyleDisplay* floaterDisplay;
|
||||
aFloater->GetStyleData(kStyleDisplaySID, (nsStyleStruct*&)floaterDisplay);
|
||||
|
||||
// Commit some space in the space manager and adjust our current
|
||||
// band of available space.
|
||||
|
@ -1432,6 +1430,8 @@ nsBlockFrame::PlaceFloater(nsIPresContext* aPresContext,
|
|||
}
|
||||
}
|
||||
|
||||
// XXX It's unclear what coordinate space aY is in. Is it relative to the
|
||||
// upper-left origin of the containing block, or relative to aState.mY?
|
||||
void
|
||||
nsBlockFrame::PlaceBelowCurrentLineFloaters(nsBlockReflowState& aState,
|
||||
nscoord aY)
|
||||
|
@ -1452,13 +1452,12 @@ nsBlockFrame::PlaceBelowCurrentLineFloaters(nsBlockReflowState& aState,
|
|||
GetAvailableSpace(aState, aY);
|
||||
|
||||
// Get the type of floater
|
||||
nsIStyleContextPtr styleContext;
|
||||
floater->GetStyleContext(aState.mPresContext, styleContext.AssignRef());
|
||||
nsStyleDisplay* sd = (nsStyleDisplay*)
|
||||
styleContext->GetData(kStyleDisplaySID);
|
||||
nsStyleDisplay* sd;
|
||||
floater->GetStyleData(kStyleDisplaySID, (nsStyleStruct*&)sd);
|
||||
|
||||
floater->GetRect(region);
|
||||
region.y = bd->availSpace.y;
|
||||
// XXX GetAvailableSpace() is translating availSpace by aState.mY...
|
||||
region.y = bd->availSpace.y - aState.mY;
|
||||
if (NS_STYLE_FLOAT_LEFT == sd->mFloats) {
|
||||
region.x = bd->availSpace.x;
|
||||
} else {
|
||||
|
|
|
@ -414,11 +414,11 @@ nsLineLayout::ReflowChild()
|
|||
mReflowResult = NS_LINE_LAYOUT_REFLOW_RESULT_NOT_AWARE;
|
||||
nscoord dx = mReflowData.mX + kidSpacing->mMargin.left;
|
||||
if (isBlock) {
|
||||
mSpaceManager->Translate(dx, 0);
|
||||
mSpaceManager->Translate(dx, mY);
|
||||
rv = mBlock->ReflowBlockChild(mKidFrame, mPresContext,
|
||||
mSpaceManager, kidAvailSize, kidRect,
|
||||
kidMaxElementSize, kidReflowStatus);
|
||||
mSpaceManager->Translate(-dx, 0);
|
||||
mSpaceManager->Translate(-dx, -mY);
|
||||
kidRect.x = dx;
|
||||
kidRect.y = mY;
|
||||
kidSize.width = kidRect.width;
|
||||
|
|
|
@ -1386,15 +1386,13 @@ nsBlockFrame::PlaceFloater(nsIPresContext* aPresContext,
|
|||
{
|
||||
// If the floater is the left-most non-zero size child frame then insert
|
||||
// it before the current line; otherwise add it to the below-current-line
|
||||
// todo list and we'll handle it when we flush out the line
|
||||
// todo list, and we'll handle it when we flush out the line
|
||||
if (IsLeftMostChild(aPlaceholder)) {
|
||||
nsISpaceManager* sm = aState.mSpaceManager;
|
||||
|
||||
// Get the type of floater
|
||||
nsIStyleContextPtr styleContext;
|
||||
aFloater->GetStyleContext(aPresContext, styleContext.AssignRef());
|
||||
nsStyleDisplay* floaterDisplay = (nsStyleDisplay*)
|
||||
styleContext->GetData(kStyleDisplaySID);
|
||||
nsStyleDisplay* floaterDisplay;
|
||||
aFloater->GetStyleData(kStyleDisplaySID, (nsStyleStruct*&)floaterDisplay);
|
||||
|
||||
// Commit some space in the space manager and adjust our current
|
||||
// band of available space.
|
||||
|
@ -1432,6 +1430,8 @@ nsBlockFrame::PlaceFloater(nsIPresContext* aPresContext,
|
|||
}
|
||||
}
|
||||
|
||||
// XXX It's unclear what coordinate space aY is in. Is it relative to the
|
||||
// upper-left origin of the containing block, or relative to aState.mY?
|
||||
void
|
||||
nsBlockFrame::PlaceBelowCurrentLineFloaters(nsBlockReflowState& aState,
|
||||
nscoord aY)
|
||||
|
@ -1452,13 +1452,12 @@ nsBlockFrame::PlaceBelowCurrentLineFloaters(nsBlockReflowState& aState,
|
|||
GetAvailableSpace(aState, aY);
|
||||
|
||||
// Get the type of floater
|
||||
nsIStyleContextPtr styleContext;
|
||||
floater->GetStyleContext(aState.mPresContext, styleContext.AssignRef());
|
||||
nsStyleDisplay* sd = (nsStyleDisplay*)
|
||||
styleContext->GetData(kStyleDisplaySID);
|
||||
nsStyleDisplay* sd;
|
||||
floater->GetStyleData(kStyleDisplaySID, (nsStyleStruct*&)sd);
|
||||
|
||||
floater->GetRect(region);
|
||||
region.y = bd->availSpace.y;
|
||||
// XXX GetAvailableSpace() is translating availSpace by aState.mY...
|
||||
region.y = bd->availSpace.y - aState.mY;
|
||||
if (NS_STYLE_FLOAT_LEFT == sd->mFloats) {
|
||||
region.x = bd->availSpace.x;
|
||||
} else {
|
||||
|
|
|
@ -1386,15 +1386,13 @@ nsBlockFrame::PlaceFloater(nsIPresContext* aPresContext,
|
|||
{
|
||||
// If the floater is the left-most non-zero size child frame then insert
|
||||
// it before the current line; otherwise add it to the below-current-line
|
||||
// todo list and we'll handle it when we flush out the line
|
||||
// todo list, and we'll handle it when we flush out the line
|
||||
if (IsLeftMostChild(aPlaceholder)) {
|
||||
nsISpaceManager* sm = aState.mSpaceManager;
|
||||
|
||||
// Get the type of floater
|
||||
nsIStyleContextPtr styleContext;
|
||||
aFloater->GetStyleContext(aPresContext, styleContext.AssignRef());
|
||||
nsStyleDisplay* floaterDisplay = (nsStyleDisplay*)
|
||||
styleContext->GetData(kStyleDisplaySID);
|
||||
nsStyleDisplay* floaterDisplay;
|
||||
aFloater->GetStyleData(kStyleDisplaySID, (nsStyleStruct*&)floaterDisplay);
|
||||
|
||||
// Commit some space in the space manager and adjust our current
|
||||
// band of available space.
|
||||
|
@ -1432,6 +1430,8 @@ nsBlockFrame::PlaceFloater(nsIPresContext* aPresContext,
|
|||
}
|
||||
}
|
||||
|
||||
// XXX It's unclear what coordinate space aY is in. Is it relative to the
|
||||
// upper-left origin of the containing block, or relative to aState.mY?
|
||||
void
|
||||
nsBlockFrame::PlaceBelowCurrentLineFloaters(nsBlockReflowState& aState,
|
||||
nscoord aY)
|
||||
|
@ -1452,13 +1452,12 @@ nsBlockFrame::PlaceBelowCurrentLineFloaters(nsBlockReflowState& aState,
|
|||
GetAvailableSpace(aState, aY);
|
||||
|
||||
// Get the type of floater
|
||||
nsIStyleContextPtr styleContext;
|
||||
floater->GetStyleContext(aState.mPresContext, styleContext.AssignRef());
|
||||
nsStyleDisplay* sd = (nsStyleDisplay*)
|
||||
styleContext->GetData(kStyleDisplaySID);
|
||||
nsStyleDisplay* sd;
|
||||
floater->GetStyleData(kStyleDisplaySID, (nsStyleStruct*&)sd);
|
||||
|
||||
floater->GetRect(region);
|
||||
region.y = bd->availSpace.y;
|
||||
// XXX GetAvailableSpace() is translating availSpace by aState.mY...
|
||||
region.y = bd->availSpace.y - aState.mY;
|
||||
if (NS_STYLE_FLOAT_LEFT == sd->mFloats) {
|
||||
region.x = bd->availSpace.x;
|
||||
} else {
|
||||
|
|
|
@ -1386,15 +1386,13 @@ nsBlockFrame::PlaceFloater(nsIPresContext* aPresContext,
|
|||
{
|
||||
// If the floater is the left-most non-zero size child frame then insert
|
||||
// it before the current line; otherwise add it to the below-current-line
|
||||
// todo list and we'll handle it when we flush out the line
|
||||
// todo list, and we'll handle it when we flush out the line
|
||||
if (IsLeftMostChild(aPlaceholder)) {
|
||||
nsISpaceManager* sm = aState.mSpaceManager;
|
||||
|
||||
// Get the type of floater
|
||||
nsIStyleContextPtr styleContext;
|
||||
aFloater->GetStyleContext(aPresContext, styleContext.AssignRef());
|
||||
nsStyleDisplay* floaterDisplay = (nsStyleDisplay*)
|
||||
styleContext->GetData(kStyleDisplaySID);
|
||||
nsStyleDisplay* floaterDisplay;
|
||||
aFloater->GetStyleData(kStyleDisplaySID, (nsStyleStruct*&)floaterDisplay);
|
||||
|
||||
// Commit some space in the space manager and adjust our current
|
||||
// band of available space.
|
||||
|
@ -1432,6 +1430,8 @@ nsBlockFrame::PlaceFloater(nsIPresContext* aPresContext,
|
|||
}
|
||||
}
|
||||
|
||||
// XXX It's unclear what coordinate space aY is in. Is it relative to the
|
||||
// upper-left origin of the containing block, or relative to aState.mY?
|
||||
void
|
||||
nsBlockFrame::PlaceBelowCurrentLineFloaters(nsBlockReflowState& aState,
|
||||
nscoord aY)
|
||||
|
@ -1452,13 +1452,12 @@ nsBlockFrame::PlaceBelowCurrentLineFloaters(nsBlockReflowState& aState,
|
|||
GetAvailableSpace(aState, aY);
|
||||
|
||||
// Get the type of floater
|
||||
nsIStyleContextPtr styleContext;
|
||||
floater->GetStyleContext(aState.mPresContext, styleContext.AssignRef());
|
||||
nsStyleDisplay* sd = (nsStyleDisplay*)
|
||||
styleContext->GetData(kStyleDisplaySID);
|
||||
nsStyleDisplay* sd;
|
||||
floater->GetStyleData(kStyleDisplaySID, (nsStyleStruct*&)sd);
|
||||
|
||||
floater->GetRect(region);
|
||||
region.y = bd->availSpace.y;
|
||||
// XXX GetAvailableSpace() is translating availSpace by aState.mY...
|
||||
region.y = bd->availSpace.y - aState.mY;
|
||||
if (NS_STYLE_FLOAT_LEFT == sd->mFloats) {
|
||||
region.x = bd->availSpace.x;
|
||||
} else {
|
||||
|
|
|
@ -414,11 +414,11 @@ nsLineLayout::ReflowChild()
|
|||
mReflowResult = NS_LINE_LAYOUT_REFLOW_RESULT_NOT_AWARE;
|
||||
nscoord dx = mReflowData.mX + kidSpacing->mMargin.left;
|
||||
if (isBlock) {
|
||||
mSpaceManager->Translate(dx, 0);
|
||||
mSpaceManager->Translate(dx, mY);
|
||||
rv = mBlock->ReflowBlockChild(mKidFrame, mPresContext,
|
||||
mSpaceManager, kidAvailSize, kidRect,
|
||||
kidMaxElementSize, kidReflowStatus);
|
||||
mSpaceManager->Translate(-dx, 0);
|
||||
mSpaceManager->Translate(-dx, -mY);
|
||||
kidRect.x = dx;
|
||||
kidRect.y = mY;
|
||||
kidSize.width = kidRect.width;
|
||||
|
|
Загрузка…
Ссылка в новой задаче