diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index 50ceaefbf15..d69a93b9fe7 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -4137,6 +4137,11 @@ PresShell::ScrollFrameRectIntoView(nsIFrame* aFrame, didScroll = PR_TRUE; } + // only scroll one container when this flag is set + if (aFlags & SCROLL_FIRST_ANCESTOR_ONLY) { + break; + } + nsRect scrollPort = sf->GetScrollPortRect(); if (rect.XMost() < scrollPort.x || rect.x > scrollPort.XMost() || @@ -4155,7 +4160,7 @@ PresShell::ScrollFrameRectIntoView(nsIFrame* aFrame, } rect += container->GetPosition(); container = container->GetParent(); - } while (container && !(aFlags & SCROLL_FIRST_ANCESTOR_ONLY)); + } while (container); return didScroll; } diff --git a/layout/xul/base/src/nsMenuPopupFrame.cpp b/layout/xul/base/src/nsMenuPopupFrame.cpp index 6e19d259de4..fe02db3a798 100644 --- a/layout/xul/base/src/nsMenuPopupFrame.cpp +++ b/layout/xul/base/src/nsMenuPopupFrame.cpp @@ -1253,7 +1253,8 @@ void nsMenuPopupFrame::EnsureMenuItemIsVisible(nsMenuFrame* aMenuItem) nsRect(nsPoint(0,0), aMenuItem->GetRect().Size()), NS_PRESSHELL_SCROLL_ANYWHERE, NS_PRESSHELL_SCROLL_ANYWHERE, - nsIPresShell::SCROLL_OVERFLOW_HIDDEN); + nsIPresShell::SCROLL_OVERFLOW_HIDDEN | + nsIPresShell::SCROLL_FIRST_ANCESTOR_ONLY); } } diff --git a/toolkit/content/tests/widgets/test_menulist_keynav.xul b/toolkit/content/tests/widgets/test_menulist_keynav.xul index 062b7065af4..bfcb742fb42 100644 --- a/toolkit/content/tests/widgets/test_menulist_keynav.xul +++ b/toolkit/content/tests/widgets/test_menulist_keynav.xul @@ -3,18 +3,15 @@ + xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> - Menulist Key Navigation Tests