зеркало из https://github.com/mozilla/pjs.git
Eliminated some code that's no longer needed now that the info is in the
HTML reflow state
This commit is contained in:
Родитель
0410405922
Коммит
756524925c
|
@ -520,12 +520,8 @@ nsAreaFrame::Reflow(nsIPresContext& aPresContext,
|
|||
if (floaterYMost > 0) {
|
||||
// What we need to check for is if the bottom most floater extends below
|
||||
// the content area of the desired size
|
||||
nsMargin borderPadding;
|
||||
nscoord contentYMost;
|
||||
|
||||
nsHTMLReflowState::ComputeBorderPaddingFor(this, aReflowState.parentReflowState,
|
||||
borderPadding);
|
||||
contentYMost = aDesiredSize.height - borderPadding.bottom;
|
||||
nscoord contentYMost = aDesiredSize.height -
|
||||
aReflowState.mComputedBorderPadding.bottom;
|
||||
|
||||
if (floaterYMost > contentYMost) {
|
||||
aDesiredSize.height += floaterYMost - contentYMost;
|
||||
|
@ -623,18 +619,14 @@ nsAreaFrame::ReflowAbsoluteFrame(nsIPresContext& aPresContext,
|
|||
kidReflowState.reason = eReflowReason_Initial;
|
||||
}
|
||||
|
||||
// XXX Temporary hack until the block/inline code starts using 'computedWidth'
|
||||
kidReflowState.availableWidth = kidReflowState.computedWidth;
|
||||
rv = htmlReflow->Reflow(aPresContext, kidDesiredSize, kidReflowState, aStatus);
|
||||
|
||||
// XXX If the child had a fixed height, then make sure it respected it...
|
||||
if (NS_AUTOHEIGHT != kidReflowState.computedHeight) {
|
||||
if (kidDesiredSize.height < kidReflowState.computedHeight) {
|
||||
kidDesiredSize.height = kidReflowState.computedHeight;
|
||||
|
||||
nsMargin borderPadding;
|
||||
nsHTMLReflowState::ComputeBorderPaddingFor(aKidFrame, &aReflowState, borderPadding);
|
||||
kidDesiredSize.height += borderPadding.top + borderPadding.bottom;
|
||||
kidDesiredSize.height += kidReflowState.mComputedBorderPadding.top +
|
||||
kidReflowState.mComputedBorderPadding.bottom;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -412,10 +412,7 @@ nsBulletFrame::Reflow(nsIPresContext& aPresContext,
|
|||
|
||||
// Add in the border and padding; split the top/bottom between the
|
||||
// ascent and descent to make things look nice
|
||||
nsMargin borderPadding;
|
||||
nsHTMLReflowState::ComputeBorderPaddingFor(this,
|
||||
aReflowState.parentReflowState,
|
||||
borderPadding);
|
||||
const nsMargin& borderPadding = aReflowState.mComputedBorderPadding;
|
||||
aMetrics.width += borderPadding.left + borderPadding.right;
|
||||
aMetrics.height += borderPadding.top + borderPadding.bottom;
|
||||
aMetrics.ascent += borderPadding.top;
|
||||
|
|
|
@ -421,9 +421,6 @@ nsHTMLReflowState::InitAbsoluteConstraints(nsIPresContext& aPresContext,
|
|||
nscoord containingBlockWidth,
|
||||
nscoord containingBlockHeight)
|
||||
{
|
||||
// XXX Correctly handle absolutely positioned elements by using the
|
||||
// correct edge (computed width/height is the content edge)...
|
||||
|
||||
// If any of the offsets are 'auto', then get the placeholder frame
|
||||
// and compute its origin relative to the containing block
|
||||
nsPoint placeholderOffset(0, 0);
|
||||
|
|
|
@ -93,9 +93,7 @@ nsLeafFrame::AddBordersAndPadding(nsIPresContext* aPresContext,
|
|||
nsHTMLReflowMetrics& aMetrics,
|
||||
nsMargin& aBorderPadding)
|
||||
{
|
||||
nsHTMLReflowState::ComputeBorderPaddingFor(this,
|
||||
aReflowState.parentReflowState,
|
||||
aBorderPadding);
|
||||
aBorderPadding = aReflowState.mComputedBorderPadding;
|
||||
aMetrics.width += aBorderPadding.left + aBorderPadding.right;
|
||||
aMetrics.height += aBorderPadding.top + aBorderPadding.bottom;
|
||||
aMetrics.ascent = aMetrics.height;
|
||||
|
|
|
@ -520,12 +520,8 @@ nsAreaFrame::Reflow(nsIPresContext& aPresContext,
|
|||
if (floaterYMost > 0) {
|
||||
// What we need to check for is if the bottom most floater extends below
|
||||
// the content area of the desired size
|
||||
nsMargin borderPadding;
|
||||
nscoord contentYMost;
|
||||
|
||||
nsHTMLReflowState::ComputeBorderPaddingFor(this, aReflowState.parentReflowState,
|
||||
borderPadding);
|
||||
contentYMost = aDesiredSize.height - borderPadding.bottom;
|
||||
nscoord contentYMost = aDesiredSize.height -
|
||||
aReflowState.mComputedBorderPadding.bottom;
|
||||
|
||||
if (floaterYMost > contentYMost) {
|
||||
aDesiredSize.height += floaterYMost - contentYMost;
|
||||
|
@ -623,18 +619,14 @@ nsAreaFrame::ReflowAbsoluteFrame(nsIPresContext& aPresContext,
|
|||
kidReflowState.reason = eReflowReason_Initial;
|
||||
}
|
||||
|
||||
// XXX Temporary hack until the block/inline code starts using 'computedWidth'
|
||||
kidReflowState.availableWidth = kidReflowState.computedWidth;
|
||||
rv = htmlReflow->Reflow(aPresContext, kidDesiredSize, kidReflowState, aStatus);
|
||||
|
||||
// XXX If the child had a fixed height, then make sure it respected it...
|
||||
if (NS_AUTOHEIGHT != kidReflowState.computedHeight) {
|
||||
if (kidDesiredSize.height < kidReflowState.computedHeight) {
|
||||
kidDesiredSize.height = kidReflowState.computedHeight;
|
||||
|
||||
nsMargin borderPadding;
|
||||
nsHTMLReflowState::ComputeBorderPaddingFor(aKidFrame, &aReflowState, borderPadding);
|
||||
kidDesiredSize.height += borderPadding.top + borderPadding.bottom;
|
||||
kidDesiredSize.height += kidReflowState.mComputedBorderPadding.top +
|
||||
kidReflowState.mComputedBorderPadding.bottom;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -412,10 +412,7 @@ nsBulletFrame::Reflow(nsIPresContext& aPresContext,
|
|||
|
||||
// Add in the border and padding; split the top/bottom between the
|
||||
// ascent and descent to make things look nice
|
||||
nsMargin borderPadding;
|
||||
nsHTMLReflowState::ComputeBorderPaddingFor(this,
|
||||
aReflowState.parentReflowState,
|
||||
borderPadding);
|
||||
const nsMargin& borderPadding = aReflowState.mComputedBorderPadding;
|
||||
aMetrics.width += borderPadding.left + borderPadding.right;
|
||||
aMetrics.height += borderPadding.top + borderPadding.bottom;
|
||||
aMetrics.ascent += borderPadding.top;
|
||||
|
|
|
@ -421,9 +421,6 @@ nsHTMLReflowState::InitAbsoluteConstraints(nsIPresContext& aPresContext,
|
|||
nscoord containingBlockWidth,
|
||||
nscoord containingBlockHeight)
|
||||
{
|
||||
// XXX Correctly handle absolutely positioned elements by using the
|
||||
// correct edge (computed width/height is the content edge)...
|
||||
|
||||
// If any of the offsets are 'auto', then get the placeholder frame
|
||||
// and compute its origin relative to the containing block
|
||||
nsPoint placeholderOffset(0, 0);
|
||||
|
|
|
@ -93,9 +93,7 @@ nsLeafFrame::AddBordersAndPadding(nsIPresContext* aPresContext,
|
|||
nsHTMLReflowMetrics& aMetrics,
|
||||
nsMargin& aBorderPadding)
|
||||
{
|
||||
nsHTMLReflowState::ComputeBorderPaddingFor(this,
|
||||
aReflowState.parentReflowState,
|
||||
aBorderPadding);
|
||||
aBorderPadding = aReflowState.mComputedBorderPadding;
|
||||
aMetrics.width += aBorderPadding.left + aBorderPadding.right;
|
||||
aMetrics.height += aBorderPadding.top + aBorderPadding.bottom;
|
||||
aMetrics.ascent = aMetrics.height;
|
||||
|
|
Загрузка…
Ссылка в новой задаче