Bug 23014: Quirks mode percentage height: enable for iframes, enable for native scrollbars, and add safety check for unconstrained height. r=harishd

This commit is contained in:
pollmann%netscape.com 2000-05-16 22:02:16 +00:00
Родитель ec2a732bd6
Коммит ccbe4c0000
2 изменённых файлов: 36 добавлений и 6 удалений

Просмотреть файл

@ -1319,11 +1319,25 @@ CalcQuirkContainingBlockHeight(const nsHTMLReflowState& aReflowState)
}
else break;
}
else if (nsLayoutAtoms::canvasFrame != frameType.get()) {
else if (nsLayoutAtoms::canvasFrame == frameType.get()) {
// Use scroll frames' computed height if we have one, this will
// allow us to get viewport height for native scrollbars.
nsHTMLReflowState* scrollState = (nsHTMLReflowState *)rs->parentReflowState;
nsCOMPtr<nsIAtom> scrollFrameType;
scrollState->frame->GetFrameType(getter_AddRefs(scrollFrameType));
if (nsLayoutAtoms::scrollFrame == scrollFrameType.get()) {
rs = scrollState;
}
}
else {
break;
}
// the ancestor has a computed height, it is the percent base
// if the ancestor has a computed height, it is the percent base
result = rs->mComputedHeight;
// if unconstrained - don't sutract borders - would result in huge height
if (NS_AUTOHEIGHT == result) return result;
// if we got to the canvas frame, then subtract out
// margin/border/padding for the BODY and HTML elements
if (nsLayoutAtoms::canvasFrame == frameType.get()) {
@ -1429,7 +1443,8 @@ nsHTMLReflowState::ComputeContainingBlockRectangle(nsIPresContext* aPre
if (NS_AUTOHEIGHT == aContainingBlockHeight) {
nsCOMPtr<nsIAtom> fType;
frame->GetFrameType(getter_AddRefs(fType));
if (nsLayoutAtoms::tableFrame == fType.get()) {
if (nsLayoutAtoms::tableFrame == fType.get() ||
nsLayoutAtoms::htmlFrameOuterFrame == fType.get()) {
nsCompatibility mode;
aPresContext->GetCompatibilityMode(&mode);
if (eCompatibility_NavQuirks == mode) {

Просмотреть файл

@ -1319,11 +1319,25 @@ CalcQuirkContainingBlockHeight(const nsHTMLReflowState& aReflowState)
}
else break;
}
else if (nsLayoutAtoms::canvasFrame != frameType.get()) {
else if (nsLayoutAtoms::canvasFrame == frameType.get()) {
// Use scroll frames' computed height if we have one, this will
// allow us to get viewport height for native scrollbars.
nsHTMLReflowState* scrollState = (nsHTMLReflowState *)rs->parentReflowState;
nsCOMPtr<nsIAtom> scrollFrameType;
scrollState->frame->GetFrameType(getter_AddRefs(scrollFrameType));
if (nsLayoutAtoms::scrollFrame == scrollFrameType.get()) {
rs = scrollState;
}
}
else {
break;
}
// the ancestor has a computed height, it is the percent base
// if the ancestor has a computed height, it is the percent base
result = rs->mComputedHeight;
// if unconstrained - don't sutract borders - would result in huge height
if (NS_AUTOHEIGHT == result) return result;
// if we got to the canvas frame, then subtract out
// margin/border/padding for the BODY and HTML elements
if (nsLayoutAtoms::canvasFrame == frameType.get()) {
@ -1429,7 +1443,8 @@ nsHTMLReflowState::ComputeContainingBlockRectangle(nsIPresContext* aPre
if (NS_AUTOHEIGHT == aContainingBlockHeight) {
nsCOMPtr<nsIAtom> fType;
frame->GetFrameType(getter_AddRefs(fType));
if (nsLayoutAtoms::tableFrame == fType.get()) {
if (nsLayoutAtoms::tableFrame == fType.get() ||
nsLayoutAtoms::htmlFrameOuterFrame == fType.get()) {
nsCompatibility mode;
aPresContext->GetCompatibilityMode(&mode);
if (eCompatibility_NavQuirks == mode) {