Bug 703241. Part 2: Stop the 'scroll top of line into view' behavior when ancestors in the line are transformed or positioned. Allow that behavior for any kind of line-participant ancestor. r=mats
authorRobert O'Callahan <robert@ocallahan.org>
Fri, 22 Jun 2012 17:06:54 +1200
changeset 110778 f1f9518910e872648ae79bd0c4a4d7f7750af0df
parent 110777 fbf63fe2c1b0dc22f30c337ab3c78ee4e71435a7
child 110779 4033a060e7af1e2ae99194e0c489d3788ba2f944
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewersmats
bugs703241
milestone19.0a1
Bug 703241. Part 2: Stop the 'scroll top of line into view' behavior when ancestors in the line are transformed or positioned. Allow that behavior for any kind of line-participant ancestor. r=mats
dom/bindings/BindingGen.py
layout/base/nsPresShell.cpp
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -3000,29 +3000,28 @@ AccumulateFrameBounds(nsIFrame* aContain
 {
   nsIFrame* frame = aFrame;
   nsRect frameBounds = nsRect(nsPoint(0, 0), aFrame->GetSize());
 
   // If this is an inline frame and either the bounds height is 0 (quirks
   // layout model) or aUseWholeLineHeightForInlines is set, we need to
   // change the top of the bounds to include the whole line.
   if (frameBounds.height == 0 || aUseWholeLineHeightForInlines) {
-    nsIAtom* frameType = NULL;
     nsIFrame *prevFrame = aFrame;
     nsIFrame *f = aFrame;
 
-    while (f &&
-           (frameType = f->GetType()) == nsGkAtoms::inlineFrame) {
+    while (f && f->IsFrameOfType(nsIFrame::eLineParticipant) &&
+           !f->IsTransformed() && !f->IsPositioned()) {
       prevFrame = f;
       f = prevFrame->GetParent();
     }
 
     if (f != aFrame &&
         f &&
-        frameType == nsGkAtoms::blockFrame) {
+        f->GetType() == nsGkAtoms::blockFrame) {
       // find the line containing aFrame and increase the top of |offset|.
       if (f != aPrevBlock) {
         aLines = f->GetLineIterator();
         aPrevBlock = f;
         aCurLine = 0;
       }
       if (aLines) {
         int32_t index = aLines->FindLineContaining(prevFrame, aCurLine);