Bug 1347270: remove the nsIDOMWindowUtils::ElementsRestyled API. r=bholley
authorEmilio Cobos Álvarez <emilio@crisal.io>
Tue, 30 May 2017 11:38:53 +0200
changeset 409529 bc65c7c5fd8044a897317989d602ef5540fe98b1
parent 409528 ac5d129532148f4785e57072dd65613face2c5db
child 409530 81ec0f138ba42c1471761451378213bc7d574af3
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholley
bugs1347270
milestone55.0a1
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
Bug 1347270: remove the nsIDOMWindowUtils::ElementsRestyled API. r=bholley MozReview-Commit-ID: AKsEWc7Wpip
dom/base/nsDOMWindowUtils.cpp
dom/interfaces/base/nsIDOMWindowUtils.idl
layout/base/GeckoRestyleManager.cpp
layout/base/nsPresContext.h
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -4043,28 +4043,16 @@ nsDOMWindowUtils::XpconnectArgument(nsID
 NS_IMETHODIMP
 nsDOMWindowUtils::AskPermission(nsIContentPermissionRequest* aRequest)
 {
   nsCOMPtr<nsPIDOMWindowOuter> window = do_QueryReferent(mWindow);
   return nsContentPermissionUtils::AskPermission(aRequest, window->GetCurrentInnerWindow());
 }
 
 NS_IMETHODIMP
-nsDOMWindowUtils::GetElementsRestyled(uint64_t* aResult)
-{
-  nsPresContext* presContext = GetPresContext();
-  if (!presContext) {
-    return NS_ERROR_NOT_AVAILABLE;
-  }
-
-  *aResult = presContext->ElementsRestyledCount();
-  return NS_OK;
-}
-
-NS_IMETHODIMP
 nsDOMWindowUtils::GetRestyleGeneration(uint64_t* aResult)
 {
   nsPresContext* presContext = GetPresContext();
   if (!presContext) {
     return NS_ERROR_NOT_AVAILABLE;
   }
 
   *aResult = presContext->GetRestyleGeneration();
--- a/dom/interfaces/base/nsIDOMWindowUtils.idl
+++ b/dom/interfaces/base/nsIDOMWindowUtils.idl
@@ -45,17 +45,17 @@ interface nsIURI;
 interface nsIDOMEventTarget;
 interface nsIRunnable;
 interface nsITranslationNodeList;
 interface nsIJSRAIIHelper;
 interface nsIContentPermissionRequest;
 interface nsIObserver;
 interface nsIDOMStorage;
 
-[scriptable, uuid(c471d440-004b-4c50-a6f2-747db5f443b6)]
+[scriptable, uuid(4d6732ca-9da7-4176-b8a1-8dde15cd0bf9)]
 interface nsIDOMWindowUtils : nsISupports {
 
   /**
    * Image animation mode of the window. When this attribute's value
    * is changed, the implementation should set all images in the window
    * to the given value. That is, when set to kDontAnimMode, all images
    * will stop animating. The attribute's value must be one of the
    * animationMode values from imgIContainer.
@@ -1871,27 +1871,16 @@ interface nsIDOMWindowUtils : nsISupport
 
   /**
    * Helper for JS components that need to send permission requests with
    * e10s support properly.
    */
   void askPermission(in nsIContentPermissionRequest aRequest);
 
   /**
-   * Number of elements restyled for the curent document.
-   *
-   * Note that during a restyle operation we may restyle an element more
-   * than once (e.g., for an inline that contains blocks).  This also
-   * counts restyling of pseudo-elements and anonymous boxes.
-   *
-   * May throw NS_ERROR_NOT_AVAILABLE.
-   */
-  readonly attribute unsigned long long elementsRestyled;
-
-  /**
    * Restyle generation for the current document.
    *
    * May throw NS_ERROR_NOT_AVAILABLE.
    */
   readonly attribute unsigned long long restyleGeneration;
 
   /**
    * Number of frames constructed (excluding breaking) for the curent
--- a/layout/base/GeckoRestyleManager.cpp
+++ b/layout/base/GeckoRestyleManager.cpp
@@ -1714,18 +1714,16 @@ ElementRestyler::Restyle(nsRestyleHint a
   MOZ_ASSERT(mPresContext == mFrame->PresContext(), "pres contexts match");
 
   NS_ASSERTION(!GetPrevContinuationWithSameStyle(mFrame),
                "should not be trying to restyle this frame separately");
 
   MOZ_ASSERT(!(aRestyleHint & eRestyle_LaterSiblings),
              "eRestyle_LaterSiblings must not be part of aRestyleHint");
 
-  mPresContext->RestyledElement();
-
   AutoDisplayContentsAncestorPusher adcp(mTreeMatchContext, mPresContext,
       mFrame->GetContent() ? mFrame->GetContent()->GetParent() : nullptr);
 
   AutoSelectorArrayTruncater asat(mSelectorsForDescendants);
 
   // List of descendant elements of mContent we know we will eventually need to
   // restyle.  Before we return from this function, we call
   // RestyleTracker::AddRestyleRootsIfAwaitingRestyle to ensure they get
--- a/layout/base/nsPresContext.h
+++ b/layout/base/nsPresContext.h
@@ -899,29 +899,23 @@ public:
   */
   bool EnsureVisible();
 
 #ifdef MOZ_REFLOW_PERF
   void CountReflows(const char * aName,
                                 nsIFrame * aFrame);
 #endif
 
-  void RestyledElement() {
-    ++mElementsRestyled;
-  }
   void ConstructedFrame() {
     ++mFramesConstructed;
   }
   void ReflowedFrame() {
     ++mFramesReflowed;
   }
 
-  uint64_t ElementsRestyledCount() {
-    return mElementsRestyled;
-  }
   uint64_t FramesConstructedCount() {
     return mFramesConstructed;
   }
   uint64_t FramesReflowedCount() {
     return mFramesReflowed;
   }
 
   /*