mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 01:48:05 +00:00
bug 29276 (text inside <label> tags within a table cell breaks out of table cell)
bug 1164 (ALIGN=MIDDLE and ALIGN=ABSMIDDLE values are not being supported) bug 54119 (percentage (%) image (img) heights do nothing) r=karnaze, rods, attinasi a=waterson
This commit is contained in:
parent
c080ea9b7e
commit
13899dbffa
@ -2534,6 +2534,8 @@ static nsGenericHTMLElement::EnumTable kCompatTableHAlignTable[] = {
|
||||
{ "char", NS_STYLE_TEXT_ALIGN_CHAR },
|
||||
{ "justify",NS_STYLE_TEXT_ALIGN_JUSTIFY },
|
||||
{ "abscenter", NS_STYLE_TEXT_ALIGN_CENTER },
|
||||
{ "absmiddle", NS_STYLE_TEXT_ALIGN_CENTER },
|
||||
{ "middle", NS_STYLE_TEXT_ALIGN_CENTER },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
|
@ -1502,12 +1502,6 @@ nsBlockFrame::Reflow(nsIPresContext* aPresContext,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
/*
|
||||
ListTag(stdout);
|
||||
printf(": begin reflow type %d availSize=%d,%d computedSize=%d,%d\n",
|
||||
aReflowState.reason, aReflowState.availableWidth, aReflowState.availableHeight,
|
||||
aReflowState.mComputedWidth, aReflowState.mComputedHeight);
|
||||
*/
|
||||
DO_GLOBAL_REFLOW_COUNT("nsBlockFrame", aReflowState.reason);
|
||||
|
||||
#ifdef DEBUG
|
||||
@ -2570,14 +2564,24 @@ nsBlockFrame::PrepareResizeReflow(nsBlockReflowState& aState)
|
||||
|
||||
nsLineBox* line = mLines;
|
||||
if (tryAndSkipLines) {
|
||||
// The line's bounds are relative to the border edge of the frame
|
||||
nscoord newAvailWidth = aState.mReflowState.mComputedBorderPadding.left;
|
||||
|
||||
if (NS_SHRINKWRAPWIDTH == aState.mReflowState.mComputedWidth) {
|
||||
newAvailWidth += aState.mReflowState.mComputedMaxWidth;
|
||||
if (NS_UNCONSTRAINEDSIZE != aState.mReflowState.mComputedMaxWidth) {
|
||||
newAvailWidth += aState.mReflowState.mComputedMaxWidth;
|
||||
}
|
||||
else {
|
||||
newAvailWidth += aState.mReflowState.availableWidth;
|
||||
}
|
||||
} else {
|
||||
newAvailWidth += aState.mReflowState.mComputedWidth;
|
||||
if (NS_UNCONSTRAINEDSIZE != aState.mReflowState.mComputedMaxWidth) {
|
||||
newAvailWidth += aState.mReflowState.mComputedWidth;
|
||||
}
|
||||
else {
|
||||
newAvailWidth += aState.mReflowState.availableWidth;
|
||||
}
|
||||
}
|
||||
NS_ASSERTION(NS_UNCONSTRAINEDSIZE != newAvailWidth, "bad math, newAvailWidth is infinite");
|
||||
|
||||
#ifdef DEBUG
|
||||
if (gNoisyReflow) {
|
||||
@ -4450,13 +4454,14 @@ nsBlockFrame::ReflowInlineFrame(nsBlockReflowState& aState,
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
#if 0
|
||||
// Mark next line dirty in case SplitLine didn't end up
|
||||
// pushing any frames.
|
||||
nsLineBox* next = aLine->mNext;
|
||||
if ((nsnull != next) && !next->IsBlock()) {
|
||||
next->MarkDirty();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else if (NS_FRAME_IS_NOT_COMPLETE(frameReflowStatus)) {
|
||||
|
@ -1502,12 +1502,6 @@ nsBlockFrame::Reflow(nsIPresContext* aPresContext,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
/*
|
||||
ListTag(stdout);
|
||||
printf(": begin reflow type %d availSize=%d,%d computedSize=%d,%d\n",
|
||||
aReflowState.reason, aReflowState.availableWidth, aReflowState.availableHeight,
|
||||
aReflowState.mComputedWidth, aReflowState.mComputedHeight);
|
||||
*/
|
||||
DO_GLOBAL_REFLOW_COUNT("nsBlockFrame", aReflowState.reason);
|
||||
|
||||
#ifdef DEBUG
|
||||
@ -2570,14 +2564,24 @@ nsBlockFrame::PrepareResizeReflow(nsBlockReflowState& aState)
|
||||
|
||||
nsLineBox* line = mLines;
|
||||
if (tryAndSkipLines) {
|
||||
// The line's bounds are relative to the border edge of the frame
|
||||
nscoord newAvailWidth = aState.mReflowState.mComputedBorderPadding.left;
|
||||
|
||||
if (NS_SHRINKWRAPWIDTH == aState.mReflowState.mComputedWidth) {
|
||||
newAvailWidth += aState.mReflowState.mComputedMaxWidth;
|
||||
if (NS_UNCONSTRAINEDSIZE != aState.mReflowState.mComputedMaxWidth) {
|
||||
newAvailWidth += aState.mReflowState.mComputedMaxWidth;
|
||||
}
|
||||
else {
|
||||
newAvailWidth += aState.mReflowState.availableWidth;
|
||||
}
|
||||
} else {
|
||||
newAvailWidth += aState.mReflowState.mComputedWidth;
|
||||
if (NS_UNCONSTRAINEDSIZE != aState.mReflowState.mComputedMaxWidth) {
|
||||
newAvailWidth += aState.mReflowState.mComputedWidth;
|
||||
}
|
||||
else {
|
||||
newAvailWidth += aState.mReflowState.availableWidth;
|
||||
}
|
||||
}
|
||||
NS_ASSERTION(NS_UNCONSTRAINEDSIZE != newAvailWidth, "bad math, newAvailWidth is infinite");
|
||||
|
||||
#ifdef DEBUG
|
||||
if (gNoisyReflow) {
|
||||
@ -4450,13 +4454,14 @@ nsBlockFrame::ReflowInlineFrame(nsBlockReflowState& aState,
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
#if 0
|
||||
// Mark next line dirty in case SplitLine didn't end up
|
||||
// pushing any frames.
|
||||
nsLineBox* next = aLine->mNext;
|
||||
if ((nsnull != next) && !next->IsBlock()) {
|
||||
next->MarkDirty();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else if (NS_FRAME_IS_NOT_COMPLETE(frameReflowStatus)) {
|
||||
|
@ -1502,12 +1502,6 @@ nsBlockFrame::Reflow(nsIPresContext* aPresContext,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
/*
|
||||
ListTag(stdout);
|
||||
printf(": begin reflow type %d availSize=%d,%d computedSize=%d,%d\n",
|
||||
aReflowState.reason, aReflowState.availableWidth, aReflowState.availableHeight,
|
||||
aReflowState.mComputedWidth, aReflowState.mComputedHeight);
|
||||
*/
|
||||
DO_GLOBAL_REFLOW_COUNT("nsBlockFrame", aReflowState.reason);
|
||||
|
||||
#ifdef DEBUG
|
||||
@ -2570,14 +2564,24 @@ nsBlockFrame::PrepareResizeReflow(nsBlockReflowState& aState)
|
||||
|
||||
nsLineBox* line = mLines;
|
||||
if (tryAndSkipLines) {
|
||||
// The line's bounds are relative to the border edge of the frame
|
||||
nscoord newAvailWidth = aState.mReflowState.mComputedBorderPadding.left;
|
||||
|
||||
if (NS_SHRINKWRAPWIDTH == aState.mReflowState.mComputedWidth) {
|
||||
newAvailWidth += aState.mReflowState.mComputedMaxWidth;
|
||||
if (NS_UNCONSTRAINEDSIZE != aState.mReflowState.mComputedMaxWidth) {
|
||||
newAvailWidth += aState.mReflowState.mComputedMaxWidth;
|
||||
}
|
||||
else {
|
||||
newAvailWidth += aState.mReflowState.availableWidth;
|
||||
}
|
||||
} else {
|
||||
newAvailWidth += aState.mReflowState.mComputedWidth;
|
||||
if (NS_UNCONSTRAINEDSIZE != aState.mReflowState.mComputedMaxWidth) {
|
||||
newAvailWidth += aState.mReflowState.mComputedWidth;
|
||||
}
|
||||
else {
|
||||
newAvailWidth += aState.mReflowState.availableWidth;
|
||||
}
|
||||
}
|
||||
NS_ASSERTION(NS_UNCONSTRAINEDSIZE != newAvailWidth, "bad math, newAvailWidth is infinite");
|
||||
|
||||
#ifdef DEBUG
|
||||
if (gNoisyReflow) {
|
||||
@ -4450,13 +4454,14 @@ nsBlockFrame::ReflowInlineFrame(nsBlockReflowState& aState,
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
#if 0
|
||||
// Mark next line dirty in case SplitLine didn't end up
|
||||
// pushing any frames.
|
||||
nsLineBox* next = aLine->mNext;
|
||||
if ((nsnull != next) && !next->IsBlock()) {
|
||||
next->MarkDirty();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else if (NS_FRAME_IS_NOT_COMPLETE(frameReflowStatus)) {
|
||||
|
@ -1441,18 +1441,13 @@ nsHTMLReflowState::ComputeContainingBlockRectangle(nsIPresContext* aPre
|
||||
if (NS_UNCONSTRAINEDSIZE == availableWidth) {
|
||||
aContainingBlockWidth = NS_UNCONSTRAINEDSIZE;
|
||||
}
|
||||
// a table in quirks mode gets a containing block based on the viewport (less
|
||||
// body margins, border, padding) if the table is a child of the body.
|
||||
// an element in quirks mode gets a containing block based on the viewport (less
|
||||
// body margins, border, padding) if the element is a child of the body.
|
||||
if (NS_AUTOHEIGHT == aContainingBlockHeight) {
|
||||
nsCOMPtr<nsIAtom> fType;
|
||||
frame->GetFrameType(getter_AddRefs(fType));
|
||||
if (nsLayoutAtoms::tableFrame == fType.get() ||
|
||||
nsLayoutAtoms::htmlFrameOuterFrame == fType.get()) {
|
||||
nsCompatibility mode;
|
||||
aPresContext->GetCompatibilityMode(&mode);
|
||||
if (eCompatibility_NavQuirks == mode) {
|
||||
aContainingBlockHeight = CalcQuirkContainingBlockHeight(*aContainingBlockRS);
|
||||
}
|
||||
nsCompatibility mode;
|
||||
aPresContext->GetCompatibilityMode(&mode);
|
||||
if (eCompatibility_NavQuirks == mode) {
|
||||
aContainingBlockHeight = CalcQuirkContainingBlockHeight(*aContainingBlockRS);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1551,8 +1546,34 @@ nsHTMLReflowState::InitConstraints(nsIPresContext* aPresContext,
|
||||
// that depends on the content height
|
||||
if (eStyleUnit_Percent == heightUnit) {
|
||||
if (NS_AUTOHEIGHT == aContainingBlockHeight) {
|
||||
// Interpret the height like 'auto'
|
||||
heightUnit = eStyleUnit_Auto;
|
||||
// this if clause enables %-height on replaced inline frames,
|
||||
// such as images. See bug 54119. The else clause "heightUnit = eStyleUnit_Auto;"
|
||||
// used to be called exclusively.
|
||||
if (NS_FRAME_REPLACED(NS_CSS_FRAME_TYPE_INLINE) == mFrameType) {
|
||||
// Get the containing block reflow state
|
||||
const nsHTMLReflowState* cbrs =
|
||||
GetContainingBlockReflowState(parentReflowState);
|
||||
NS_ASSERTION(nsnull != cbrs, "no containing block");
|
||||
nsCompatibility mode;
|
||||
aPresContext->GetCompatibilityMode(&mode);
|
||||
// in quirks mode, get the cb height using the special quirk method
|
||||
if (eCompatibility_NavQuirks == mode) {
|
||||
aContainingBlockHeight = CalcQuirkContainingBlockHeight(*cbrs);
|
||||
}
|
||||
// in standard mode, use the cb height. if it's "auto", as will be the case
|
||||
// by default in BODY, use auto height as per CSS2 spec.
|
||||
else
|
||||
{
|
||||
if (NS_AUTOHEIGHT != cbrs->mComputedHeight)
|
||||
aContainingBlockHeight = cbrs->mComputedHeight;
|
||||
else
|
||||
heightUnit = eStyleUnit_Auto;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// default to interpreting the height like 'auto'
|
||||
heightUnit = eStyleUnit_Auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1849,6 +1870,7 @@ nsHTMLReflowState::ComputeBlockBoxData(nsIPresContext* aPresContext,
|
||||
// Use 'min-width' as the value for 'width'
|
||||
mComputedWidth = mComputedMinWidth;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -1502,12 +1502,6 @@ nsBlockFrame::Reflow(nsIPresContext* aPresContext,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
/*
|
||||
ListTag(stdout);
|
||||
printf(": begin reflow type %d availSize=%d,%d computedSize=%d,%d\n",
|
||||
aReflowState.reason, aReflowState.availableWidth, aReflowState.availableHeight,
|
||||
aReflowState.mComputedWidth, aReflowState.mComputedHeight);
|
||||
*/
|
||||
DO_GLOBAL_REFLOW_COUNT("nsBlockFrame", aReflowState.reason);
|
||||
|
||||
#ifdef DEBUG
|
||||
@ -2570,14 +2564,24 @@ nsBlockFrame::PrepareResizeReflow(nsBlockReflowState& aState)
|
||||
|
||||
nsLineBox* line = mLines;
|
||||
if (tryAndSkipLines) {
|
||||
// The line's bounds are relative to the border edge of the frame
|
||||
nscoord newAvailWidth = aState.mReflowState.mComputedBorderPadding.left;
|
||||
|
||||
if (NS_SHRINKWRAPWIDTH == aState.mReflowState.mComputedWidth) {
|
||||
newAvailWidth += aState.mReflowState.mComputedMaxWidth;
|
||||
if (NS_UNCONSTRAINEDSIZE != aState.mReflowState.mComputedMaxWidth) {
|
||||
newAvailWidth += aState.mReflowState.mComputedMaxWidth;
|
||||
}
|
||||
else {
|
||||
newAvailWidth += aState.mReflowState.availableWidth;
|
||||
}
|
||||
} else {
|
||||
newAvailWidth += aState.mReflowState.mComputedWidth;
|
||||
if (NS_UNCONSTRAINEDSIZE != aState.mReflowState.mComputedMaxWidth) {
|
||||
newAvailWidth += aState.mReflowState.mComputedWidth;
|
||||
}
|
||||
else {
|
||||
newAvailWidth += aState.mReflowState.availableWidth;
|
||||
}
|
||||
}
|
||||
NS_ASSERTION(NS_UNCONSTRAINEDSIZE != newAvailWidth, "bad math, newAvailWidth is infinite");
|
||||
|
||||
#ifdef DEBUG
|
||||
if (gNoisyReflow) {
|
||||
@ -4450,13 +4454,14 @@ nsBlockFrame::ReflowInlineFrame(nsBlockReflowState& aState,
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
#if 0
|
||||
// Mark next line dirty in case SplitLine didn't end up
|
||||
// pushing any frames.
|
||||
nsLineBox* next = aLine->mNext;
|
||||
if ((nsnull != next) && !next->IsBlock()) {
|
||||
next->MarkDirty();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else if (NS_FRAME_IS_NOT_COMPLETE(frameReflowStatus)) {
|
||||
|
@ -1502,12 +1502,6 @@ nsBlockFrame::Reflow(nsIPresContext* aPresContext,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
/*
|
||||
ListTag(stdout);
|
||||
printf(": begin reflow type %d availSize=%d,%d computedSize=%d,%d\n",
|
||||
aReflowState.reason, aReflowState.availableWidth, aReflowState.availableHeight,
|
||||
aReflowState.mComputedWidth, aReflowState.mComputedHeight);
|
||||
*/
|
||||
DO_GLOBAL_REFLOW_COUNT("nsBlockFrame", aReflowState.reason);
|
||||
|
||||
#ifdef DEBUG
|
||||
@ -2570,14 +2564,24 @@ nsBlockFrame::PrepareResizeReflow(nsBlockReflowState& aState)
|
||||
|
||||
nsLineBox* line = mLines;
|
||||
if (tryAndSkipLines) {
|
||||
// The line's bounds are relative to the border edge of the frame
|
||||
nscoord newAvailWidth = aState.mReflowState.mComputedBorderPadding.left;
|
||||
|
||||
if (NS_SHRINKWRAPWIDTH == aState.mReflowState.mComputedWidth) {
|
||||
newAvailWidth += aState.mReflowState.mComputedMaxWidth;
|
||||
if (NS_UNCONSTRAINEDSIZE != aState.mReflowState.mComputedMaxWidth) {
|
||||
newAvailWidth += aState.mReflowState.mComputedMaxWidth;
|
||||
}
|
||||
else {
|
||||
newAvailWidth += aState.mReflowState.availableWidth;
|
||||
}
|
||||
} else {
|
||||
newAvailWidth += aState.mReflowState.mComputedWidth;
|
||||
if (NS_UNCONSTRAINEDSIZE != aState.mReflowState.mComputedMaxWidth) {
|
||||
newAvailWidth += aState.mReflowState.mComputedWidth;
|
||||
}
|
||||
else {
|
||||
newAvailWidth += aState.mReflowState.availableWidth;
|
||||
}
|
||||
}
|
||||
NS_ASSERTION(NS_UNCONSTRAINEDSIZE != newAvailWidth, "bad math, newAvailWidth is infinite");
|
||||
|
||||
#ifdef DEBUG
|
||||
if (gNoisyReflow) {
|
||||
@ -4450,13 +4454,14 @@ nsBlockFrame::ReflowInlineFrame(nsBlockReflowState& aState,
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
#if 0
|
||||
// Mark next line dirty in case SplitLine didn't end up
|
||||
// pushing any frames.
|
||||
nsLineBox* next = aLine->mNext;
|
||||
if ((nsnull != next) && !next->IsBlock()) {
|
||||
next->MarkDirty();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else if (NS_FRAME_IS_NOT_COMPLETE(frameReflowStatus)) {
|
||||
|
@ -1502,12 +1502,6 @@ nsBlockFrame::Reflow(nsIPresContext* aPresContext,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
/*
|
||||
ListTag(stdout);
|
||||
printf(": begin reflow type %d availSize=%d,%d computedSize=%d,%d\n",
|
||||
aReflowState.reason, aReflowState.availableWidth, aReflowState.availableHeight,
|
||||
aReflowState.mComputedWidth, aReflowState.mComputedHeight);
|
||||
*/
|
||||
DO_GLOBAL_REFLOW_COUNT("nsBlockFrame", aReflowState.reason);
|
||||
|
||||
#ifdef DEBUG
|
||||
@ -2570,14 +2564,24 @@ nsBlockFrame::PrepareResizeReflow(nsBlockReflowState& aState)
|
||||
|
||||
nsLineBox* line = mLines;
|
||||
if (tryAndSkipLines) {
|
||||
// The line's bounds are relative to the border edge of the frame
|
||||
nscoord newAvailWidth = aState.mReflowState.mComputedBorderPadding.left;
|
||||
|
||||
if (NS_SHRINKWRAPWIDTH == aState.mReflowState.mComputedWidth) {
|
||||
newAvailWidth += aState.mReflowState.mComputedMaxWidth;
|
||||
if (NS_UNCONSTRAINEDSIZE != aState.mReflowState.mComputedMaxWidth) {
|
||||
newAvailWidth += aState.mReflowState.mComputedMaxWidth;
|
||||
}
|
||||
else {
|
||||
newAvailWidth += aState.mReflowState.availableWidth;
|
||||
}
|
||||
} else {
|
||||
newAvailWidth += aState.mReflowState.mComputedWidth;
|
||||
if (NS_UNCONSTRAINEDSIZE != aState.mReflowState.mComputedMaxWidth) {
|
||||
newAvailWidth += aState.mReflowState.mComputedWidth;
|
||||
}
|
||||
else {
|
||||
newAvailWidth += aState.mReflowState.availableWidth;
|
||||
}
|
||||
}
|
||||
NS_ASSERTION(NS_UNCONSTRAINEDSIZE != newAvailWidth, "bad math, newAvailWidth is infinite");
|
||||
|
||||
#ifdef DEBUG
|
||||
if (gNoisyReflow) {
|
||||
@ -4450,13 +4454,14 @@ nsBlockFrame::ReflowInlineFrame(nsBlockReflowState& aState,
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
#if 0
|
||||
// Mark next line dirty in case SplitLine didn't end up
|
||||
// pushing any frames.
|
||||
nsLineBox* next = aLine->mNext;
|
||||
if ((nsnull != next) && !next->IsBlock()) {
|
||||
next->MarkDirty();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else if (NS_FRAME_IS_NOT_COMPLETE(frameReflowStatus)) {
|
||||
|
@ -1441,18 +1441,13 @@ nsHTMLReflowState::ComputeContainingBlockRectangle(nsIPresContext* aPre
|
||||
if (NS_UNCONSTRAINEDSIZE == availableWidth) {
|
||||
aContainingBlockWidth = NS_UNCONSTRAINEDSIZE;
|
||||
}
|
||||
// a table in quirks mode gets a containing block based on the viewport (less
|
||||
// body margins, border, padding) if the table is a child of the body.
|
||||
// an element in quirks mode gets a containing block based on the viewport (less
|
||||
// body margins, border, padding) if the element is a child of the body.
|
||||
if (NS_AUTOHEIGHT == aContainingBlockHeight) {
|
||||
nsCOMPtr<nsIAtom> fType;
|
||||
frame->GetFrameType(getter_AddRefs(fType));
|
||||
if (nsLayoutAtoms::tableFrame == fType.get() ||
|
||||
nsLayoutAtoms::htmlFrameOuterFrame == fType.get()) {
|
||||
nsCompatibility mode;
|
||||
aPresContext->GetCompatibilityMode(&mode);
|
||||
if (eCompatibility_NavQuirks == mode) {
|
||||
aContainingBlockHeight = CalcQuirkContainingBlockHeight(*aContainingBlockRS);
|
||||
}
|
||||
nsCompatibility mode;
|
||||
aPresContext->GetCompatibilityMode(&mode);
|
||||
if (eCompatibility_NavQuirks == mode) {
|
||||
aContainingBlockHeight = CalcQuirkContainingBlockHeight(*aContainingBlockRS);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1551,8 +1546,34 @@ nsHTMLReflowState::InitConstraints(nsIPresContext* aPresContext,
|
||||
// that depends on the content height
|
||||
if (eStyleUnit_Percent == heightUnit) {
|
||||
if (NS_AUTOHEIGHT == aContainingBlockHeight) {
|
||||
// Interpret the height like 'auto'
|
||||
heightUnit = eStyleUnit_Auto;
|
||||
// this if clause enables %-height on replaced inline frames,
|
||||
// such as images. See bug 54119. The else clause "heightUnit = eStyleUnit_Auto;"
|
||||
// used to be called exclusively.
|
||||
if (NS_FRAME_REPLACED(NS_CSS_FRAME_TYPE_INLINE) == mFrameType) {
|
||||
// Get the containing block reflow state
|
||||
const nsHTMLReflowState* cbrs =
|
||||
GetContainingBlockReflowState(parentReflowState);
|
||||
NS_ASSERTION(nsnull != cbrs, "no containing block");
|
||||
nsCompatibility mode;
|
||||
aPresContext->GetCompatibilityMode(&mode);
|
||||
// in quirks mode, get the cb height using the special quirk method
|
||||
if (eCompatibility_NavQuirks == mode) {
|
||||
aContainingBlockHeight = CalcQuirkContainingBlockHeight(*cbrs);
|
||||
}
|
||||
// in standard mode, use the cb height. if it's "auto", as will be the case
|
||||
// by default in BODY, use auto height as per CSS2 spec.
|
||||
else
|
||||
{
|
||||
if (NS_AUTOHEIGHT != cbrs->mComputedHeight)
|
||||
aContainingBlockHeight = cbrs->mComputedHeight;
|
||||
else
|
||||
heightUnit = eStyleUnit_Auto;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// default to interpreting the height like 'auto'
|
||||
heightUnit = eStyleUnit_Auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1849,6 +1870,7 @@ nsHTMLReflowState::ComputeBlockBoxData(nsIPresContext* aPresContext,
|
||||
// Use 'min-width' as the value for 'width'
|
||||
mComputedWidth = mComputedMinWidth;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -2534,6 +2534,8 @@ static nsGenericHTMLElement::EnumTable kCompatTableHAlignTable[] = {
|
||||
{ "char", NS_STYLE_TEXT_ALIGN_CHAR },
|
||||
{ "justify",NS_STYLE_TEXT_ALIGN_JUSTIFY },
|
||||
{ "abscenter", NS_STYLE_TEXT_ALIGN_CENTER },
|
||||
{ "absmiddle", NS_STYLE_TEXT_ALIGN_CENTER },
|
||||
{ "middle", NS_STYLE_TEXT_ALIGN_CENTER },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user