Updated the code to use the nsIScrollableFrame interface instead of assuming the FirstChild is the scrolled-frame. r=evaughan

git-svn-id: svn://10.0.0.236/trunk@60395 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
attinasi%netscape.com 2000-02-11 01:23:36 +00:00
parent 61ddb0fb94
commit 30f1afd12d
2 changed files with 18 additions and 4 deletions

View File

@ -79,6 +79,7 @@
#include "nsBlockFrame.h"
#include "nsGfxTextControlFrame.h"
#include "nsIScrollableFrame.h"
#include "nsIServiceManager.h"
#include "nsIXBLService.h"
@ -5623,9 +5624,15 @@ nsCSSFrameConstructor::GetFrameFor(nsIPresShell* aPresShell,
const nsStyleDisplay* display;
frame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&)display);
if (display->IsBlockLevel() && IsScrollable(aPresContext, display)) {
frame->FirstChild(aPresContext, nsnull, &frame);
// If the primary frame supports IScrollableFrame, then get the scrolled frame.
// That's the frame that gets the reflow command
nsIScrollableFrame *pScrollableFrame = nsnull;
if (NS_SUCCEEDED( frame->QueryInterface(nsIScrollableFrame::GetIID(),
(void **)&pScrollableFrame) ))
{
pScrollableFrame->GetScrolledFrame( aPresContext, frame );
}
// if we get an outer table frame use its 1st child which is a table inner frame
// if we get a table cell frame use its 1st child which is an area frame
else if ((NS_STYLE_DISPLAY_TABLE == display->mDisplay) ||

View File

@ -79,6 +79,7 @@
#include "nsBlockFrame.h"
#include "nsGfxTextControlFrame.h"
#include "nsIScrollableFrame.h"
#include "nsIServiceManager.h"
#include "nsIXBLService.h"
@ -5623,9 +5624,15 @@ nsCSSFrameConstructor::GetFrameFor(nsIPresShell* aPresShell,
const nsStyleDisplay* display;
frame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&)display);
if (display->IsBlockLevel() && IsScrollable(aPresContext, display)) {
frame->FirstChild(aPresContext, nsnull, &frame);
// If the primary frame supports IScrollableFrame, then get the scrolled frame.
// That's the frame that gets the reflow command
nsIScrollableFrame *pScrollableFrame = nsnull;
if (NS_SUCCEEDED( frame->QueryInterface(nsIScrollableFrame::GetIID(),
(void **)&pScrollableFrame) ))
{
pScrollableFrame->GetScrolledFrame( aPresContext, frame );
}
// if we get an outer table frame use its 1st child which is a table inner frame
// if we get a table cell frame use its 1st child which is an area frame
else if ((NS_STYLE_DISPLAY_TABLE == display->mDisplay) ||