Backed out changeset 8228e57646bf (bug 1480641) for build bustages on a CLOSED TREE
authorTiberius Oros <toros@mozilla.com>
Tue, 07 Aug 2018 02:45:36 +0300
changeset 485371 35326321927f30e042ffd1b68c4356cead7863ce
parent 485370 8228e57646bf3db97cbfa9f28df5710dc925f570
child 485372 d6d39130d3c9c355e2656941ea39703fc2265f1e
push id9719
push userffxbld-merge
push dateFri, 24 Aug 2018 17:49:46 +0000
treeherdermozilla-beta@719ec98fba77 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1480641
milestone63.0a1
backs out8228e57646bf3db97cbfa9f28df5710dc925f570
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
Backed out changeset 8228e57646bf (bug 1480641) for build bustages on a CLOSED TREE
docshell/base/moz.build
docshell/base/nsDocShell.cpp
docshell/base/nsDocShell.h
docshell/base/nsITextScroll.idl
toolkit/components/browser/nsWebBrowser.cpp
toolkit/components/browser/nsWebBrowser.h
--- a/docshell/base/moz.build
+++ b/docshell/base/moz.build
@@ -44,16 +44,17 @@ XPIDL_SOURCES += [
     'nsIDocShellTreeItem.idl',
     'nsIDocShellTreeOwner.idl',
     'nsIDocumentLoaderFactory.idl',
     'nsILoadContext.idl',
     'nsIPrivacyTransitionObserver.idl',
     'nsIReflowObserver.idl',
     'nsIRefreshURI.idl',
     'nsIScrollable.idl',
+    'nsITextScroll.idl',
     'nsITooltipListener.idl',
     'nsITooltipTextProvider.idl',
     'nsIURIFixup.idl',
     'nsIWebNavigation.idl',
     'nsIWebNavigationInfo.idl',
     'nsIWebPageDescriptor.idl',
 ]
 
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -515,16 +515,17 @@ NS_IMPL_ADDREF_INHERITED(nsDocShell, nsD
 NS_IMPL_RELEASE_INHERITED(nsDocShell, nsDocLoader)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsDocShell)
   NS_INTERFACE_MAP_ENTRY(nsIDocShell)
   NS_INTERFACE_MAP_ENTRY(nsIDocShellTreeItem)
   NS_INTERFACE_MAP_ENTRY(nsIWebNavigation)
   NS_INTERFACE_MAP_ENTRY(nsIBaseWindow)
   NS_INTERFACE_MAP_ENTRY(nsIScrollable)
+  NS_INTERFACE_MAP_ENTRY(nsITextScroll)
   NS_INTERFACE_MAP_ENTRY(nsIRefreshURI)
   NS_INTERFACE_MAP_ENTRY(nsIWebProgressListener)
   NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
   NS_INTERFACE_MAP_ENTRY(nsIWebPageDescriptor)
   NS_INTERFACE_MAP_ENTRY(nsIAuthPromptProvider)
   NS_INTERFACE_MAP_ENTRY(nsILoadContext)
   NS_INTERFACE_MAP_ENTRY(nsIWebShellServices)
   NS_INTERFACE_MAP_ENTRY(nsILinkHandler)
@@ -6084,16 +6085,42 @@ nsDocShell::GetScrollbarVisibility(bool*
     *aHorizontalVisible =
       (scrollbarVisibility & nsIScrollableFrame::HORIZONTAL) != 0;
   }
 
   return NS_OK;
 }
 
 //*****************************************************************************
+// nsDocShell::nsITextScroll
+//*****************************************************************************
+
+NS_IMETHODIMP
+nsDocShell::ScrollByLines(int32_t aNumLines)
+{
+  nsIScrollableFrame* sf = GetRootScrollFrame();
+  NS_ENSURE_TRUE(sf, NS_ERROR_FAILURE);
+
+  sf->ScrollBy(nsIntPoint(0, aNumLines), nsIScrollableFrame::LINES,
+               nsIScrollableFrame::SMOOTH);
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+nsDocShell::ScrollByPages(int32_t aNumPages)
+{
+  nsIScrollableFrame* sf = GetRootScrollFrame();
+  NS_ENSURE_TRUE(sf, NS_ERROR_FAILURE);
+
+  sf->ScrollBy(nsIntPoint(0, aNumPages), nsIScrollableFrame::PAGES,
+               nsIScrollableFrame::SMOOTH);
+  return NS_OK;
+}
+
+//*****************************************************************************
 // nsDocShell::nsIRefreshURI
 //*****************************************************************************
 
 NS_IMETHODIMP
 nsDocShell::RefreshURI(nsIURI* aURI, nsIPrincipal* aPrincipal,
                        int32_t aDelay, bool aRepeat,
                        bool aMetaRefresh)
 {
--- a/docshell/base/nsDocShell.h
+++ b/docshell/base/nsDocShell.h
@@ -30,16 +30,17 @@
 #include "nsIInterfaceRequestor.h"
 #include "nsILinkHandler.h"
 #include "nsILoadContext.h"
 #include "nsILoadURIDelegate.h"
 #include "nsINetworkInterceptController.h"
 #include "nsIRefreshURI.h"
 #include "nsIScrollable.h"
 #include "nsITabParent.h"
+#include "nsITextScroll.h"
 #include "nsIWebNavigation.h"
 #include "nsIWebPageDescriptor.h"
 #include "nsIWebProgressListener.h"
 #include "nsIWebShellServices.h"
 
 #include "nsAutoPtr.h"
 #include "nsCOMPtr.h"
 #include "nsContentPolicyUtils.h"
@@ -116,16 +117,17 @@ enum eCharsetReloadState
 };
 
 class nsDocShell final
   : public nsDocLoader
   , public nsIDocShell
   , public nsIWebNavigation
   , public nsIBaseWindow
   , public nsIScrollable
+  , public nsITextScroll
   , public nsIRefreshURI
   , public nsIWebProgressListener
   , public nsIWebPageDescriptor
   , public nsIAuthPromptProvider
   , public nsILoadContext
   , public nsIWebShellServices
   , public nsILinkHandler
   , public nsIClipboardCommands
@@ -166,16 +168,17 @@ public:
   MOZ_DECLARE_WEAKREFERENCE_TYPENAME(nsDocShell)
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsDocShell, nsDocLoader)
   NS_DECL_NSIDOCSHELL
   NS_DECL_NSIDOCSHELLTREEITEM
   NS_DECL_NSIWEBNAVIGATION
   NS_DECL_NSIBASEWINDOW
   NS_DECL_NSISCROLLABLE
+  NS_DECL_NSITEXTSCROLL
   NS_DECL_NSIINTERFACEREQUESTOR
   NS_DECL_NSIWEBPROGRESSLISTENER
   NS_DECL_NSIREFRESHURI
   NS_DECL_NSIWEBPAGEDESCRIPTOR
   NS_DECL_NSIAUTHPROMPTPROVIDER
   NS_DECL_NSICLIPBOARDCOMMANDS
   NS_DECL_NSIWEBSHELLSERVICES
   NS_DECL_NSINETWORKINTERCEPTCONTROLLER
new file mode 100644
--- /dev/null
+++ b/docshell/base/nsITextScroll.idl
@@ -0,0 +1,33 @@
+/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#include "nsISupports.idl"
+
+/**
+ * The nsITextScroll is an interface that can be implemented by a control that
+ * supports text scrolling. 
+ */
+
+[scriptable, uuid(067B28A0-877F-11d3-AF7E-00A024FFC08C)]
+interface nsITextScroll : nsISupports
+{
+  /**
+   * Scroll the view up or down by aNumLines lines. positive
+   * values move down in the view. Prevents scrolling off the
+   * end of the view.
+   * @param numLines number of lines to scroll the view by
+   */
+	void scrollByLines(in long numLines);
+
+	/**
+   * Scroll the view up or down by numPages pages. a page
+   * is considered to be the amount displayed by the clip view.
+   * positive values move down in the view. Prevents scrolling
+   * off the end of the view.
+   * @param numPages number of pages to scroll the view by
+   */
+	void scrollByPages(in long numPages);
+};
\ No newline at end of file
--- a/toolkit/components/browser/nsWebBrowser.cpp
+++ b/toolkit/components/browser/nsWebBrowser.cpp
@@ -110,24 +110,26 @@ NS_IMPL_CYCLE_COLLECTING_ADDREF(nsWebBro
 NS_IMPL_CYCLE_COLLECTING_RELEASE(nsWebBrowser)
 
 NS_IMPL_CYCLE_COLLECTION(nsWebBrowser,
                          mDocShell,
                          mDocShellAsReq,
                          mDocShellAsWin,
                          mDocShellAsNav,
                          mDocShellAsScrollable,
+                         mDocShellAsTextScroll,
                          mWebProgress)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsWebBrowser)
   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIWebBrowser)
   NS_INTERFACE_MAP_ENTRY(nsIWebBrowser)
   NS_INTERFACE_MAP_ENTRY(nsIWebNavigation)
   NS_INTERFACE_MAP_ENTRY(nsIBaseWindow)
   NS_INTERFACE_MAP_ENTRY(nsIScrollable)
+  NS_INTERFACE_MAP_ENTRY(nsITextScroll)
   NS_INTERFACE_MAP_ENTRY(nsIDocShellTreeItem)
   NS_INTERFACE_MAP_ENTRY(nsIInterfaceRequestor)
   NS_INTERFACE_MAP_ENTRY(nsIWebBrowserSetup)
   NS_INTERFACE_MAP_ENTRY(nsIWebBrowserPersist)
   NS_INTERFACE_MAP_ENTRY(nsICancelable)
   NS_INTERFACE_MAP_ENTRY(nsIWebBrowserFocus)
   NS_INTERFACE_MAP_ENTRY(nsIWebProgressListener)
   NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
@@ -1635,16 +1637,36 @@ nsWebBrowser::GetScrollbarVisibility(boo
 {
   NS_ENSURE_STATE(mDocShell);
 
   return mDocShellAsScrollable->GetScrollbarVisibility(aVerticalVisible,
                                                        aHorizontalVisible);
 }
 
 //*****************************************************************************
+// nsWebBrowser::nsITextScroll
+//*****************************************************************************
+
+NS_IMETHODIMP
+nsWebBrowser::ScrollByLines(int32_t aNumLines)
+{
+  NS_ENSURE_STATE(mDocShell);
+
+  return mDocShellAsTextScroll->ScrollByLines(aNumLines);
+}
+
+NS_IMETHODIMP
+nsWebBrowser::ScrollByPages(int32_t aNumPages)
+{
+  NS_ENSURE_STATE(mDocShell);
+
+  return mDocShellAsTextScroll->ScrollByPages(aNumPages);
+}
+
+//*****************************************************************************
 // nsWebBrowser: Listener Helpers
 //*****************************************************************************
 
 NS_IMETHODIMP
 nsWebBrowser::SetDocShell(nsIDocShell* aDocShell)
 {
   // We need to keep the docshell alive while we perform the changes, but we
   // don't need to call any methods on it.
@@ -1653,25 +1675,27 @@ nsWebBrowser::SetDocShell(nsIDocShell* a
 
   if (aDocShell) {
     NS_ENSURE_TRUE(!mDocShell, NS_ERROR_FAILURE);
 
     nsCOMPtr<nsIInterfaceRequestor> req(do_QueryInterface(aDocShell));
     nsCOMPtr<nsIBaseWindow> baseWin(do_QueryInterface(aDocShell));
     nsCOMPtr<nsIWebNavigation> nav(do_QueryInterface(aDocShell));
     nsCOMPtr<nsIScrollable> scrollable(do_QueryInterface(aDocShell));
+    nsCOMPtr<nsITextScroll> textScroll(do_QueryInterface(aDocShell));
     nsCOMPtr<nsIWebProgress> progress(do_GetInterface(aDocShell));
-    NS_ENSURE_TRUE(req && baseWin && nav && scrollable && progress,
+    NS_ENSURE_TRUE(req && baseWin && nav && scrollable && textScroll && progress,
                    NS_ERROR_FAILURE);
 
     mDocShell = aDocShell;
     mDocShellAsReq = req;
     mDocShellAsWin = baseWin;
     mDocShellAsNav = nav;
     mDocShellAsScrollable = scrollable;
+    mDocShellAsTextScroll = textScroll;
     mWebProgress = progress;
 
     // By default, do not allow DNS prefetch, so we don't break our frozen
     // API.  Embeddors who decide to enable it should do so manually.
     mDocShell->SetAllowDNSPrefetch(false);
 
     // It's possible to call setIsActive() on us before we have a docshell.
     // If we're getting a docshell now, pass along our desired value. The
@@ -1686,16 +1710,17 @@ nsWebBrowser::SetDocShell(nsIDocShell* a
       mDocShellAsWin->Destroy();
     }
 
     mDocShell = nullptr;
     mDocShellAsReq = nullptr;
     mDocShellAsWin = nullptr;
     mDocShellAsNav = nullptr;
     mDocShellAsScrollable = nullptr;
+    mDocShellAsTextScroll = nullptr;
     mWebProgress = nullptr;
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsWebBrowser::EnsureDocShellTreeOwner()
--- a/toolkit/components/browser/nsWebBrowser.h
+++ b/toolkit/components/browser/nsWebBrowser.h
@@ -19,16 +19,17 @@
 #include "nsCWebBrowser.h"
 #include "nsIBaseWindow.h"
 #include "nsIDocShell.h"
 #include "nsIDocShellTreeItem.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsIScrollable.h"
 #include "nsISHistory.h"
+#include "nsITextScroll.h"
 #include "nsIWidget.h"
 #include "nsIWebProgress.h"
 #include "nsISecureBrowserUI.h"
 #include "nsIWebBrowser.h"
 #include "nsIWebNavigation.h"
 #include "nsIWebBrowserSetup.h"
 #include "nsIWebBrowserPersist.h"
 #include "nsIWebBrowserFocus.h"
@@ -70,16 +71,17 @@ public:
 
 
 class nsWebBrowser final : public nsIWebBrowser,
                            public nsIWebNavigation,
                            public nsIWebBrowserSetup,
                            public nsIDocShellTreeItem,
                            public nsIBaseWindow,
                            public nsIScrollable,
+                           public nsITextScroll,
                            public nsIInterfaceRequestor,
                            public nsIWebBrowserPersist,
                            public nsIWebBrowserFocus,
                            public nsIWebProgressListener,
                            public nsSupportsWeakReference
 {
   friend class nsDocShellTreeOwner;
 
@@ -108,16 +110,17 @@ public:
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsWebBrowser, nsIWebBrowser)
 
   NS_DECL_NSIBASEWINDOW
   NS_DECL_NSIDOCSHELLTREEITEM
   NS_DECL_NSIINTERFACEREQUESTOR
   NS_DECL_NSISCROLLABLE
+  NS_DECL_NSITEXTSCROLL
   NS_DECL_NSIWEBBROWSER
   NS_DECL_NSIWEBNAVIGATION
   NS_DECL_NSIWEBBROWSERSETUP
   NS_DECL_NSIWEBBROWSERPERSIST
   NS_DECL_NSICANCELABLE
   NS_DECL_NSIWEBBROWSERFOCUS
   NS_DECL_NSIWEBPROGRESSLISTENER
 
@@ -140,16 +143,17 @@ protected:
 
 protected:
   RefPtr<nsDocShellTreeOwner> mDocShellTreeOwner;
   nsCOMPtr<nsIDocShell> mDocShell;
   nsCOMPtr<nsIInterfaceRequestor> mDocShellAsReq;
   nsCOMPtr<nsIBaseWindow> mDocShellAsWin;
   nsCOMPtr<nsIWebNavigation> mDocShellAsNav;
   nsCOMPtr<nsIScrollable> mDocShellAsScrollable;
+  nsCOMPtr<nsITextScroll> mDocShellAsTextScroll;
   mozilla::OriginAttributes mOriginAttributes;
 
   nsCOMPtr<nsIWidget> mInternalWidget;
   nsCOMPtr<nsIWindowWatcher> mWWatch;
   nsAutoPtr<nsWebBrowserInitInfo> mInitInfo;
   uint32_t mContentType;
   bool mActivating;
   bool mShouldEnableHistory;