bug 514732 - fix bustage for shared lib builds r=bz
authorRobert O'Callahan <robert@ocallahan.org>
Mon, 02 Nov 2009 21:55:35 -0500
changeset 34482 62958c5bc9162673460e366d2fe2d515a2b59b27
parent 34481 905bcb1d08c18c2df0ac752771534005af277c33
child 34483 b194e6c3f210ffdedad1b91719d95a412fca84d8
push idunknown
push userunknown
push dateunknown
reviewersbz
bugs514732
milestone1.9.3a1pre
bug 514732 - fix bustage for shared lib builds r=bz
docshell/base/nsDocShell.cpp
layout/base/nsIPresShell.h
layout/base/nsPresShell.cpp
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -6952,17 +6952,18 @@ nsDocShell::RestoreFromHistory()
     if (newRootView) {
         if (!newBounds.IsEmpty() && newBounds != oldBounds) {
 #ifdef DEBUG_PAGE_CACHE
             printf("resize widget(%d, %d, %d, %d)\n", newBounds.x,
                    newBounds.y, newBounds.width, newBounds.height);
 #endif
             mContentViewer->SetBounds(newBounds);
         } else {
-            nsIScrollableFrame *rootScrollFrame = do_QueryFrame(shell->GetRootScrollFrame());
+            nsIScrollableFrame *rootScrollFrame =
+              shell->GetRootScrollFrameAsScrollableExternal();
             if (rootScrollFrame) {
                 rootScrollFrame->PostScrolledAreaEventForCurrentArea();
             }
         }
     }
 
     // Simulate the completion of the load.
     nsDocShell::FinishRestore();
--- a/layout/base/nsIPresShell.h
+++ b/layout/base/nsIPresShell.h
@@ -119,18 +119,18 @@ typedef struct CapturingContentInfo {
   nsIContent* mContent;
 
   CapturingContentInfo() :
     mAllowed(PR_FALSE), mRetargetToElement(PR_FALSE), mContent(nsnull) { }
 } CapturingContentInfo;
 
 // eed2ef56-133f-4696-9eee-5fc45d816be8
 #define NS_IPRESSHELL_IID     \
-{ 0xeed2ef56, 0x133f, 0x4696, \
-  { 0x9e, 0xee, 0x5f, 0xc4, 0x5d, 0x81, 0x6b, 0xe8 } }
+{ 0x8ceb97da, 0x5075, 0x4bdd, \
+  { 0xb1, 0xd5, 0x4e, 0x1e, 0xf2, 0x88, 0x0b, 0x5e } }
 
 // Constants for ScrollContentIntoView() function
 #define NS_PRESSHELL_SCROLL_TOP      0
 #define NS_PRESSHELL_SCROLL_BOTTOM   100
 #define NS_PRESSHELL_SCROLL_LEFT     0
 #define NS_PRESSHELL_SCROLL_RIGHT    100
 #define NS_PRESSHELL_SCROLL_CENTER   50
 #define NS_PRESSHELL_SCROLL_ANYWHERE -1
@@ -340,16 +340,22 @@ public:
    */
   nsIFrame* GetRootScrollFrame() const;
 
   /*
    * The same as GetRootScrollFrame, but returns an nsIScrollableFrame
    */
   nsIScrollableFrame* GetRootScrollFrameAsScrollable() const;
 
+  /*
+   * The same as GetRootScrollFrame, but returns an nsIScrollableFrame.
+   * Can be called by code not linked into gklayout.
+   */
+  virtual nsIScrollableFrame* GetRootScrollFrameAsScrollableExternal() const;
+
   /**
    * Returns the page sequence frame associated with the frame hierarchy.
    * Returns NULL if not a paginated view.
    */
   NS_IMETHOD GetPageSequenceFrame(nsIPageSequenceFrame** aResult) const = 0;
 
   /**
    * Gets the primary frame associated with the content object. This is a
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -3200,16 +3200,22 @@ nsIPresShell::GetRootScrollFrameAsScroll
   if (!frame)
     return nsnull;
   nsIScrollableFrame* scrollableFrame = do_QueryFrame(frame);
   NS_ASSERTION(scrollableFrame,
                "All scroll frames must implement nsIScrollableFrame");
   return scrollableFrame;
 }
 
+nsIScrollableFrame*
+nsIPresShell::GetRootScrollFrameAsScrollableExternal() const
+{
+  return GetRootScrollFrameAsScrollable();
+}
+
 NS_IMETHODIMP
 PresShell::GetPageSequenceFrame(nsIPageSequenceFrame** aResult) const
 {
   NS_PRECONDITION(nsnull != aResult, "null ptr");
   if (nsnull == aResult) {
     return NS_ERROR_NULL_POINTER;
   }