Bug 458231 Frame overflow plays havoc with size of <label> or <description> r+sr=roc r=dao for backout of workaround for bug 69710

This commit is contained in:
Neil Rashbrook 2009-06-12 08:33:51 +01:00
parent ef16fedfde
commit 89ef57a324
4 changed files with 27 additions and 83 deletions

View File

@ -6610,24 +6610,32 @@ nsFrame::BoxReflow(nsBoxLayoutState& aState,
computedWidth = PR_MAX(computedWidth, 0);
reflowState.SetComputedWidth(computedWidth);
}
if (aHeight != NS_INTRINSICSIZE) {
nscoord computedHeight =
aHeight - reflowState.mComputedBorderPadding.TopBottom();
computedHeight = PR_MAX(computedHeight, 0);
reflowState.SetComputedHeight(computedHeight);
} else {
reflowState.SetComputedHeight(
ComputeSize(aRenderingContext, availSize, availSize.width,
nsSize(reflowState.mComputedMargin.LeftRight(),
reflowState.mComputedMargin.TopBottom()),
nsSize(reflowState.mComputedBorderPadding.LeftRight() -
reflowState.mComputedPadding.LeftRight(),
reflowState.mComputedBorderPadding.TopBottom() -
reflowState.mComputedPadding.TopBottom()),
nsSize(reflowState.mComputedPadding.LeftRight(),
reflowState.mComputedPadding.TopBottom()),
PR_FALSE).height
);
// Most child frames of box frames (e.g. subdocument or scroll frames)
// need to be constrained to the provided size and overflow as necessary.
// The one exception are block frames, because we need to know their
// natural height excluding any overflow area which may be caused by
// various CSS effects such as shadow or outline.
if (!IsFrameOfType(eBlockFrame)) {
if (aHeight != NS_INTRINSICSIZE) {
nscoord computedHeight =
aHeight - reflowState.mComputedBorderPadding.TopBottom();
computedHeight = PR_MAX(computedHeight, 0);
reflowState.SetComputedHeight(computedHeight);
} else {
reflowState.SetComputedHeight(
ComputeSize(aRenderingContext, availSize, availSize.width,
nsSize(reflowState.mComputedMargin.LeftRight(),
reflowState.mComputedMargin.TopBottom()),
nsSize(reflowState.mComputedBorderPadding.LeftRight() -
reflowState.mComputedPadding.LeftRight(),
reflowState.mComputedBorderPadding.TopBottom() -
reflowState.mComputedPadding.TopBottom()),
nsSize(reflowState.mComputedPadding.LeftRight(),
reflowState.mComputedPadding.TopBottom()),
PR_FALSE).height
);
}
}
// Box layout calls SetRect before Layout, whereas non-box layout
@ -6657,52 +6665,6 @@ nsFrame::BoxReflow(nsBoxLayoutState& aState,
NS_ASSERTION(NS_FRAME_IS_COMPLETE(status), "bad status");
// printf("width: %d, height: %d\n", aDesiredSize.mCombinedArea.width, aDesiredSize.mCombinedArea.height);
// see if the overflow option is set. If it is then if our child's bounds overflow then
// we will set the child's rect to include the overflow size.
if (HasOverflowRect()) {
// This kinda sucks. We should be able to handle the case
// where there's overflow above or to the left of the
// origin. But for now just chop that stuff off.
// (note: For RTL mode, replace "to the left of the origin"
// with "to the right of the range [0, aDesiredSize.width]")
//printf("OutsideChildren width=%d, height=%d\n", aDesiredSize.mOverflowArea.width, aDesiredSize.mOverflowArea.height);
if (NS_STYLE_DIRECTION_LTR == GetStyleVisibility()->mDirection) {
// LTR mode -- extend for overflow on right side.
aDesiredSize.width = PR_MAX(aDesiredSize.width,
aDesiredSize.mOverflowArea.XMost());
} else {
// RTL mode -- extend for overflow on left side.
nscoord leftmostValue = PR_MIN(0, aDesiredSize.mOverflowArea.x);
// Note: If anything, this increases aDesiredSize.width, because
// leftmostValue is non-positive.
aDesiredSize.width = aDesiredSize.width - leftmostValue;
}
if (aDesiredSize.width <= aWidth) {
aDesiredSize.height = aDesiredSize.mOverflowArea.YMost();
} else {
nscoord computedWidth = aDesiredSize.width -
reflowState.mComputedBorderPadding.LeftRight();
computedWidth = PR_MAX(computedWidth, 0);
reflowState.SetComputedWidth(computedWidth);
reflowState.availableWidth = aDesiredSize.width;
DidReflow(aPresContext, &reflowState, NS_FRAME_REFLOW_FINISHED);
#ifdef DEBUG_REFLOW
nsAdaptorAddIndents();
nsAdaptorPrintReason(reflowState);
printf("\n");
#endif
AddStateBits(NS_FRAME_IS_DIRTY);
WillReflow(aPresContext);
Reflow(aPresContext, aDesiredSize, reflowState, status);
if (HasOverflowRect())
aDesiredSize.height = aDesiredSize.mOverflowArea.YMost();
}
}
if (redrawAfterReflow) {
nsRect r = GetRect();
r.width = aDesiredSize.width;

View File

@ -705,7 +705,7 @@
<!-- White-space isn't allowed because a marquee could be
inside 'white-space: pre' -->
<content>
<html:div style="display: -moz-box; overflow: auto; width: -moz-available;"
<html:div style="display: inline-block; overflow: auto; width: -moz-available;"
><children
/></html:div>
</content>

View File

@ -83,15 +83,6 @@ checkbox[disabled="true"] {
color: GrayText;
}
/* XXX Hack to work around bug 458231 */
checkbox:-moz-system-metric(windows-classic) {
text-shadow: 1px 1px transparent;
}
checkbox:-moz-system-metric(windows-classic) > .checkbox-label-box > .checkbox-label {
margin-bottom: -2px !important;
}
checkbox[disabled="true"]:-moz-system-metric(windows-classic) {
color: ThreeDShadow;
text-shadow: 1px 1px ThreeDHighlight;

View File

@ -86,15 +86,6 @@ radio[disabled="true"] {
color: GrayText;
}
/* XXX Hack to work around bug 458231 */
radio:-moz-system-metric(windows-classic) {
text-shadow: 1px 1px transparent;
}
radio:-moz-system-metric(windows-classic) > .radio-label-box > .radio-label {
margin-bottom: -2px !important;
}
radio[disabled="true"]:-moz-system-metric(windows-classic) {
color: ThreeDShadow;
text-shadow: 1px 1px ThreeDHighlight;