Bug 617539 - Fold in nsIFrameLoader_MOZILLA_2_0_BRANCH, r=bz
authorBenjamin Smedberg <benjamin@smedbergs.us>
Fri, 25 Mar 2011 11:03:35 -0400
changeset 63890 8090e860a5335b6d50db092032c48cc58796a36e
parent 63889 ec57c96251e92122260133ddb43cc25e3c65002b
child 63891 b9b31e5840b7182a39841a6684054939ff304899
push idunknown
push userunknown
push dateunknown
reviewersbz
bugs617539
milestone2.2a1pre
Bug 617539 - Fold in nsIFrameLoader_MOZILLA_2_0_BRANCH, r=bz
content/base/public/nsIFrameLoader.idl
content/base/src/nsFrameLoader.cpp
content/base/src/nsFrameLoader.h
layout/ipc/test-ipcbrowser-chrome.js
layout/tools/reftest/reftest-content.js
--- a/content/base/public/nsIFrameLoader.idl
+++ b/content/base/public/nsIFrameLoader.idl
@@ -136,17 +136,17 @@ interface nsIContentViewManager : nsISup
                          [retval, array, size_is(aLength)] out nsIContentView aResult);
 
   /**
    * The root content view.
    */
   readonly attribute nsIContentView rootContentView;
 };
 
-[scriptable, uuid(50a67436-bb44-11df-8d9a-001e37d2764a)]
+[scriptable, uuid(13c512d6-fba0-402a-9244-fe7941c43965)]
 interface nsIFrameLoader : nsISupports
 {
   /**
    * Get the docshell from the frame loader.
    */
   readonly attribute nsIDocShell docShell;
 
   /**
@@ -212,26 +212,33 @@ interface nsIFrameLoader : nsISupports
   void sendCrossProcessKeyEvent(in AString aType,
                                 in long aKeyCode,
                                 in long aCharCode,
                                 in long aModifiers,
                                 [optional] in boolean aPreventDefault);
 
   attribute boolean delayRemoteDialogs;
 
+  /** 
+   * The default rendering mode is synchronous scrolling.  In this
+   * mode, it's an error to try to set a target viewport.
+   */
+  const unsigned long RENDER_MODE_DEFAULT        = 0x00000000;
 
   /**
-   * DEPRECATED. Please QI to nsIContentViewManager.
-   * FIXME 615368
+   * When asynchronous scrolling is enabled, a target viewport can be
+   * set to transform content pixels wrt its CSS viewport.
+   *
+   * NB: when async scrolling is enabled, it's the *user's*
+   * responsibility to update the target scroll offset.  In effect,
+   * the platform hands over control of scroll offset to the user.
    */
-  void scrollViewportTo(in float xPx, in float yPx);
-  void scrollViewportBy(in float dxPx, in float dyPx);
-  void setViewportScale(in float xScale, in float yScale);
-  readonly attribute float viewportScrollX;
-  readonly attribute float viewportScrollY;
+  const unsigned long RENDER_MODE_ASYNC_SCROLL   = 0x00000001;
+
+  attribute unsigned long renderMode;
 };
 
 native alreadyAddRefed_nsFrameLoader(already_AddRefed<nsFrameLoader>);
 
 [scriptable, uuid(5879040e-83e9-40e3-b2bb-5ddf43b76e47)]
 interface nsIFrameLoaderOwner : nsISupports
 {
   /**
@@ -247,30 +254,8 @@ interface nsIFrameLoaderOwner : nsISuppo
    *
    * @throws NS_ERROR_NOT_IMPLEMENTED if the swapping logic is not
    *   implemented for the two given frame loader owners.
    * @throws NS_ERROR_DOM_SECURITY_ERR if the swap is not allowed on
    *   security grounds.
    */
   void swapFrameLoaders(in nsIFrameLoaderOwner aOtherOwner);
 };
-
-/** Please merge me into something else after 2.0 branches. */
-[scriptable, uuid(e3e2d3f8-1397-4984-abb3-435c29a1ca55)]
-interface nsIFrameLoader_MOZILLA_2_0_BRANCH : nsISupports
-{
-  /** 
-   * The default rendering mode is synchronous scrolling.  In this
-   * mode, it's an error to try to set a target viewport.
-   */
-  const unsigned long RENDER_MODE_DEFAULT        = 0x00000000;
-  /**
-   * When asynchronous scrolling is enabled, a target viewport can be
-   * set to transform content pixels wrt its CSS viewport.
-   *
-   * NB: when async scrolling is enabled, it's the *user's*
-   * responsibility to update the target scroll offset.  In effect,
-   * the platform hands over control of scroll offset to the user.
-   */
-  const unsigned long RENDER_MODE_ASYNC_SCROLL   = 0x00000001;
-
-  attribute unsigned long renderMode;
-};
--- a/content/base/src/nsFrameLoader.cpp
+++ b/content/base/src/nsFrameLoader.cpp
@@ -305,17 +305,16 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mChildMessageManager)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF_AMBIGUOUS(nsFrameLoader, nsIFrameLoader)
 NS_IMPL_CYCLE_COLLECTING_RELEASE_AMBIGUOUS(nsFrameLoader, nsIFrameLoader)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsFrameLoader)
   NS_INTERFACE_MAP_ENTRY(nsIFrameLoader)
-  NS_INTERFACE_MAP_ENTRY(nsIFrameLoader_MOZILLA_2_0_BRANCH)
   NS_INTERFACE_MAP_ENTRY(nsIContentViewManager)
   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIFrameLoader)
 NS_INTERFACE_MAP_END
 
 nsFrameLoader::nsFrameLoader(nsIContent *aOwner, PRBool aNetworkCreated)
   : mOwnerContent(aOwner)
   , mDepthTooGreat(PR_FALSE)
   , mIsTopLevelContent(PR_FALSE)
@@ -1680,46 +1679,16 @@ nsFrameLoader::UpdateBaseWindowPositionA
 
     baseWindow->SetPositionAndSize(x, y, size.width, size.height, PR_FALSE);
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsFrameLoader::ScrollViewportTo(float aXpx, float aYpx)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-nsFrameLoader::ScrollViewportBy(float aDXpx, float aDYpx)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-nsFrameLoader::SetViewportScale(float aXScale, float aYScale)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-nsFrameLoader::GetViewportScrollX(float* aViewportScrollX)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-nsFrameLoader::GetViewportScrollY(float* aViewportScrollY)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
 nsFrameLoader::GetRenderMode(PRUint32* aRenderMode)
 {
   *aRenderMode = mRenderMode;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsFrameLoader::SetRenderMode(PRUint32 aRenderMode)
--- a/content/base/src/nsFrameLoader.h
+++ b/content/base/src/nsFrameLoader.h
@@ -159,17 +159,16 @@ private:
   nsresult Update(const ViewConfig& aConfig);
 
   ViewID mScrollId;
   ViewConfig mConfig;
 };
 
 
 class nsFrameLoader : public nsIFrameLoader,
-                      public nsIFrameLoader_MOZILLA_2_0_BRANCH,
                       public nsIContentViewManager
 {
   friend class AutoResetInShow;
 #ifdef MOZ_IPC
   typedef mozilla::dom::PBrowserParent PBrowserParent;
   typedef mozilla::dom::TabParent TabParent;
   typedef mozilla::layout::RenderFrameParent RenderFrameParent;
 #endif
@@ -191,17 +190,16 @@ public:
     return !!(mRenderMode & RENDER_MODE_ASYNC_SCROLL);
   }
 
   static nsFrameLoader* Create(nsIContent* aOwner, PRBool aNetworkCreated);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsFrameLoader, nsIFrameLoader)
   NS_DECL_NSIFRAMELOADER
-  NS_DECL_NSIFRAMELOADER_MOZILLA_2_0_BRANCH
   NS_DECL_NSICONTENTVIEWMANAGER
   NS_HIDDEN_(nsresult) CheckForRecursiveLoad(nsIURI* aURI);
   nsresult ReallyStartLoading();
   void Finalize();
   nsIDocShell* GetExistingDocShell() { return mDocShell; }
   nsPIDOMEventTarget* GetTabChildGlobalAsEventTarget();
   nsresult CreateStaticClone(nsIFrameLoader* aDest);
 
--- a/layout/ipc/test-ipcbrowser-chrome.js
+++ b/layout/ipc/test-ipcbrowser-chrome.js
@@ -17,19 +17,17 @@ function viewManager() {
     return frameLoader().QueryInterface(Components.interfaces.nsIContentViewManager);
 }
 
 function rootView() {
     return viewManager().rootContentView;
 }
 
 function enableAsyncScrolling() {
-    var i = Components.interfaces.nsIFrameLoader_MOZILLA_2_0_BRANCH;
-    var enabler = frameLoader().QueryInterface(i);
-    enabler.renderMode = i.RENDER_MODE_ASYNC_SCROLL;
+    frameLoader().renderMode = Components.interfaces.nsIFrameLoaer.RENDER_MODE_ASYNC_SCROLL;
 }
 
 // Functions affecting the content window.
 
 function loadURL(url) {
     browser().setAttribute('src', url);
 }
 
--- a/layout/tools/reftest/reftest-content.js
+++ b/layout/tools/reftest/reftest-content.js
@@ -115,21 +115,16 @@ function webNavigation() {
     return docShell.QueryInterface(CI.nsIWebNavigation);
 }
 
 function windowUtils() {
     return content.QueryInterface(CI.nsIInterfaceRequestor)
                   .getInterface(CI.nsIDOMWindowUtils);
 }
 
-function windowUtils20() {
-    return windowUtils()
-               .QueryInterface(Components.interfaces.nsIDOMWindowUtils_MOZILLA_2_0_BRANCH);
-}
-
 function IDForEventTarget(event)
 {
     try {
         return "'" + event.target.getAttribute('id') + "'";
     } catch (ex) {
         return "<unknown>";
     }
 }
@@ -253,17 +248,17 @@ function setupDisplayport(contentRootEle
         windowUtils().setCSSViewport(vw, vh);
     }
 
     // XXX support displayPortX/Y when needed
     var dpw = attrOrDefault("reftest-displayport-w", 0);
     var dph = attrOrDefault("reftest-displayport-h", 0);
     if (dpw !== 0 || dph !== 0) {
         LogInfo("Setting displayport to <x=0, y=0, w="+ dpw +", h="+ dph +">");
-        windowUtils20().setDisplayPortForElement(0, 0, dpw, dph, content.document.documentElement);
+        windowUtils().setDisplayPortForElement(0, 0, dpw, dph, content.document.documentElement);
     }
 
     // XXX support resolution when needed
 
     // XXX support viewconfig when needed
 }
 
 function resetDisplayport() {