Change the bulk of ascent (baseline) computation to happen on a virtual method on nsIFrame, and remove the redundant descent member from nsHTMLReflowMetrics, primarily to support having both first-line and last-line baselines. b=367332 r+sr=roc
git-svn-id: svn://10.0.0.236/trunk@218785 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -341,7 +341,6 @@ nsHTMLButtonControlFrame::Reflow(nsPresContext* aPresContext,
|
||||
|
||||
aDesiredSize.ascent +=
|
||||
aReflowState.mComputedBorderPadding.top + focusPadding.top;
|
||||
aDesiredSize.descent = aDesiredSize.height - aDesiredSize.ascent;
|
||||
|
||||
aDesiredSize.mOverflowArea =
|
||||
nsRect(0, 0, aDesiredSize.width, aDesiredSize.height);
|
||||
@@ -413,14 +412,17 @@ nsHTMLButtonControlFrame::ReflowButtonContents(nsPresContext* aPresContext,
|
||||
yoff = (minInternalHeight - aDesiredSize.height) / 2;
|
||||
}
|
||||
|
||||
// Adjust the ascent by our offset (since we moved the child's
|
||||
// baseline by that much).
|
||||
aDesiredSize.ascent += yoff;
|
||||
|
||||
// Place the child
|
||||
FinishReflowChild(aFirstKid, aPresContext, &reflowState, aDesiredSize,
|
||||
xoffset,
|
||||
yoff + aFocusPadding.top + aReflowState.mComputedBorderPadding.top, 0);
|
||||
|
||||
if (aDesiredSize.ascent == nsHTMLReflowMetrics::ASK_FOR_BASELINE)
|
||||
aDesiredSize.ascent = aFirstKid->GetBaseline();
|
||||
|
||||
// Adjust the baseline by our offset (since we moved the child's
|
||||
// baseline by that much).
|
||||
aDesiredSize.ascent += yoff;
|
||||
}
|
||||
|
||||
/* virtual */ PRBool
|
||||
|
||||
Reference in New Issue
Block a user