Bug 763570 - Part 2 - Add a scrollframe from frameset documents on Fennec, so that they work with async pan/zoom and touch events. r=bz a=johnath
authorKartikaya Gupta <kgupta@mozilla.com>
Fri, 15 Jun 2012 17:49:53 -0400
changeset 96120 3343cb8a2d22ac20fefd2754f2eb7efc7c16de76
parent 96119 04661ed6772fcd47420155e49f93b436540daef0
child 96121 7945471fc07fac715a47e1885ae28a542ecb4be7
push id1007
push userkgupta@mozilla.com
push dateTue, 19 Jun 2012 19:28:22 +0000
treeherdermozilla-beta@3343cb8a2d22 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz, johnath
bugs763570
milestone14.0
Bug 763570 - Part 2 - Add a scrollframe from frameset documents on Fennec, so that they work with async pan/zoom and touch events. r=bz a=johnath
layout/base/nsCSSFrameConstructor.cpp
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -2587,25 +2587,27 @@ nsCSSFrameConstructor::SetUpDocElementCo
   NS_PRECONDITION(!aDocElement->GetParent(), "Not root content?");
   NS_PRECONDITION(aDocElement->GetCurrentDoc(), "Not in a document?");
   NS_PRECONDITION(aDocElement->GetCurrentDoc()->GetRootElement() ==
                   aDocElement, "Not the root of the document?");
 
   /*
     how the root frame hierarchy should look
 
-  Galley presentation, non-XUL, with scrolling (i.e. not a frameset):
+  Galley presentation, non-XUL, with scrolling (i.e. not a frameset,
+  or framesets with async pan/zoom like on Fennec):
   
       ViewportFrame [fixed-cb]
         nsHTMLScrollFrame
           nsCanvasFrame [abs-cb]
             root element frame (nsBlockFrame, nsSVGOuterSVGFrame,
                                 nsTableOuterFrame, nsPlaceholderFrame)
 
-  Galley presentation, non-XUL, without scrolling (i.e. a frameset):
+  Galley presentation, non-XUL, without scrolling (i.e. a frameset,
+  except when async pan/zoom is enabled):
   
       ViewportFrame [fixed-cb]
         nsCanvasFrame [abs-cb]
           root element frame (nsBlockFrame)
 
   Galley presentation, XUL
   
       ViewportFrame [fixed-cb]
@@ -2712,22 +2714,25 @@ nsCSSFrameConstructor::SetUpDocElementCo
 
   if (!isHTML) {
     isXUL = aDocElement->IsXUL();
   }
 
   // Never create scrollbars for XUL documents
   bool isScrollable = !isXUL;
 
-  // Never create scrollbars for frameset documents.
+#ifndef MOZ_WIDGET_ANDROID
+  // Never create scrollbars for frameset documents, except on android
+  // where we have async pan/zoom and need a scrollable root frame.
   if (isHTML) {
     nsCOMPtr<nsIHTMLDocument> htmlDoc = do_QueryInterface(mDocument);
     if (htmlDoc && htmlDoc->GetIsFrameset())
       isScrollable = false;
   }
+#endif
 
   if (isPaginated) {
     isScrollable = presContext->HasPaginatedScrolling();
   }
 
   // We no longer need to do overflow propagation here. It's taken care of
   // when we construct frames for the element whose overflow might be
   // propagated