Adjust hack dealing with the root scrollable frame to only map <body> to it in

quirks mode and to map <html> to it in both quirks and standards mode.  This is
more or less compatible with what IE6/Windows does.  Bug 211030, r+sr=jst
This commit is contained in:
bzbarsky%mit.edu 2003-07-01 23:47:27 +00:00
parent 648fe5ca55
commit 76858d0dcb

View File

@ -1007,10 +1007,14 @@ nsGenericHTMLElement::GetScrollInfo(nsIScrollableView **aScrollableView,
}
}
if (mNodeInfo->Equals(nsHTMLAtoms::body)) {
// The scroll info for the body element should map to the scroll
// info for the nearest scrollable frame above the body element
// (i.e. the root scrollable frame).
if ((InNavQuirksMode(doc) && mNodeInfo->Equals(nsHTMLAtoms::body)) ||
mNodeInfo->Equals(nsHTMLAtoms::html)) {
// In quirks mode, the scroll info for the body element should map to the
// scroll info for the nearest scrollable frame above the body element
// (i.e. the root scrollable frame). This is what IE6 does in quirks
// mode. In strict mode the root scrollable frame corresponds to the
// html element in IE6, so we map the scroll info for the html element to
// the root scrollable frame.
do {
frame->GetParent(&frame);