Bug 703241. Part 4: Don't let 'frame' be treated as its own container in PresShell::DoScrollContentIntoView. r=matspal
authorRobert O'Callahan <robert@ocallahan.org>
Wed, 17 Oct 2012 17:44:06 +1300
changeset 110647 4033a060e7af1e2ae99194e0c489d3788ba2f944
parent 110646 f1f9518910e872648ae79bd0c4a4d7f7750af0df
child 110648 9d5f464dc1c011439ef075789c6b3df2c7ceb257
push id23704
push useremorley@mozilla.com
push dateThu, 18 Oct 2012 17:12:58 +0000
treeherdermozilla-central@3779eb3f036f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmatspal
bugs703241
milestone19.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 703241. Part 4: Don't let 'frame' be treated as its own container in PresShell::DoScrollContentIntoView. r=matspal
dom/bindings/BindingGen.py
layout/base/nsPresShell.cpp
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -3274,18 +3274,20 @@ PresShell::DoScrollContentIntoView()
 
   if (frame->GetStateBits() & NS_FRAME_FIRST_REFLOW) {
     // The reflow flush before this scroll got interrupted, and this frame's
     // coords and size are all zero, and it has no content showing anyway.
     // Don't bother scrolling to it.  We'll try again when we finish up layout.
     return;
   }
 
+  // Make sure we skip 'frame' ... if it's scrollable, we should use its
+  // scrollable ancestor as the container.
   nsIFrame* container =
-    nsLayoutUtils::GetClosestFrameOfType(frame, nsGkAtoms::scrollFrame);
+    nsLayoutUtils::GetClosestFrameOfType(frame->GetParent(), nsGkAtoms::scrollFrame);
   if (!container) {
     // nothing can be scrolled
     return;
   }
 
   ScrollIntoViewData* data = static_cast<ScrollIntoViewData*>(
     mContentToScrollTo->GetProperty(nsGkAtoms::scrolling));
   if (NS_UNLIKELY(!data)) {