Bug 258006 Mouse-wheel scroll events does not propagate to viewport from fixed pos. elements r+sr=roc

git-svn-id: svn://10.0.0.236/trunk@188690 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
masayuki%d-toybox.com
2006-02-01 19:55:35 +00:00
parent 7bd7ef3c84
commit b94de096af
3 changed files with 37 additions and 20 deletions

View File

@@ -2658,19 +2658,6 @@ static void CheckForFocus(nsPIDOMWindow* aOurWindow,
aFocusController->SetFocusedWindow(ourWin);
}
static nsIFrame*
GetRootScrollFrame(nsIFrame* aRootFrame) {
// Ensure root frame is a viewport frame
if (aRootFrame && nsLayoutAtoms::viewportFrame == aRootFrame->GetType()) {
nsIFrame* theFrame = aRootFrame->GetFirstChild(nsnull);
if (theFrame && nsLayoutAtoms::scrollFrame == theFrame->GetType()) {
return theFrame;
}
}
return nsnull;
}
NS_IMETHODIMP
PresShell::GetDidInitialReflow(PRBool *aDidInitialReflow)
{
@@ -3409,6 +3396,19 @@ nsIPresShell::GetRootFrame() const
return FrameManager()->GetRootFrame();
}
nsIFrame*
nsIPresShell::GetRootScrollFrame() const
{
nsIFrame* rootFrame = FrameManager()->GetRootFrame();
// Ensure root frame is a viewport frame
if (!rootFrame || nsLayoutAtoms::viewportFrame != rootFrame->GetType())
return nsnull;
nsIFrame* theFrame = rootFrame->GetFirstChild(nsnull);
if (!theFrame || nsLayoutAtoms::scrollFrame != theFrame->GetType())
return nsnull;
return theFrame;
}
NS_IMETHODIMP
PresShell::GetPageSequenceFrame(nsIPageSequenceFrame** aResult) const
{
@@ -3469,7 +3469,6 @@ PresShell::EndLoad(nsIDocument *aDocument)
{
// Restore frame state for the root scroll frame
nsIFrame* rootFrame = FrameManager()->GetRootFrame();
nsCOMPtr<nsILayoutHistoryState> historyState =
aDocument->GetLayoutHistoryState();
// Make sure we don't reenter reflow via the sync paint that happens while
@@ -3478,8 +3477,8 @@ PresShell::EndLoad(nsIDocument *aDocument)
// it'll get all confused.
++mChangeNestCount;
if (rootFrame && historyState) {
nsIFrame* scrollFrame = GetRootScrollFrame(rootFrame);
if (historyState) {
nsIFrame* scrollFrame = GetRootScrollFrame();
if (scrollFrame) {
nsIScrollableFrame* scrollableFrame;
CallQueryInterface(scrollFrame, &scrollableFrame);
@@ -4545,7 +4544,7 @@ PresShell::CaptureHistoryState(nsILayoutHistoryState** aState, PRBool aLeavingPa
// As the scroll position is 0 and this will cause us to loose
// our previously saved place!
if (aLeavingPage) {
nsIFrame* scrollFrame = GetRootScrollFrame(rootFrame);
nsIFrame* scrollFrame = GetRootScrollFrame();
if (scrollFrame) {
FrameManager()->CaptureFrameStateFor(scrollFrame, historyState,
nsIStatefulFrame::eDocumentScrollState);