Bug 1357583: Add an API to get the restyle generation from the pres context. r=heycam
authorEmilio Cobos Álvarez <emilio@crisal.io>
Fri, 26 May 2017 16:39:11 +0200
changeset 361192 07778bb17a4a70341c91b91edcab5bf4f992607e
parent 361191 cc3616fd254b19ad8c3fa949c96e5a3086a9251b
child 361193 6597f70ef534751b2056c14a2776ec9fa5122421
push id90813
push usercbook@mozilla.com
push dateTue, 30 May 2017 09:53:44 +0000
treeherdermozilla-inbound@b5c3bb245c4e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1357583
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 1357583: Add an API to get the restyle generation from the pres context. r=heycam MozReview-Commit-ID: b7j0CpPimC
dom/base/nsDOMWindowUtils.cpp
dom/interfaces/base/nsIDOMWindowUtils.idl
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -4029,16 +4029,28 @@ nsDOMWindowUtils::GetElementsRestyled(ui
     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();
+  return NS_OK;
+}
+
+NS_IMETHODIMP
 nsDOMWindowUtils::GetFramesConstructed(uint64_t* aResult)
 {
   nsPresContext* presContext = GetPresContext();
   if (!presContext) {
     return NS_ERROR_NOT_AVAILABLE;
   }
 
   *aResult = presContext->FramesConstructedCount();
--- a/dom/interfaces/base/nsIDOMWindowUtils.idl
+++ b/dom/interfaces/base/nsIDOMWindowUtils.idl
@@ -1882,16 +1882,23 @@ interface nsIDOMWindowUtils : nsISupport
    * 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
    * document.
    *
    * May throw NS_ERROR_NOT_AVAILABLE.
    */
   readonly attribute unsigned long long framesConstructed;
 
   /**