Bug 1413817 - Add a note for observeStyling. r?birtles draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Thu, 09 Nov 2017 08:06:36 +0900
changeset 695297 686255678267d540fbf9f35f517ebf7709d5a7c4
parent 695296 8fb61cd238331f9ec20fdc05b786dba7ac48082f
child 695298 12cac7c126e510046860818aa52fe8d40b36eb9f
push id88383
push userhikezoe@mozilla.com
push dateThu, 09 Nov 2017 00:26:11 +0000
reviewersbirtles
bugs1413817
milestone58.0a1
Bug 1413817 - Add a note for observeStyling. r?birtles MozReview-Commit-ID: GceXjd3EJR7
dom/animation/test/mozilla/file_restyles.html
--- a/dom/animation/test/mozilla/file_restyles.html
+++ b/dom/animation/test/mozilla/file_restyles.html
@@ -40,16 +40,22 @@ div {
   background-color: white;
 }
 </style>
 </head>
 <body>
 <script>
 'use strict';
 
+// NOTE: This function must be called right after browser processd
+// requestAnimationFrames because this function counts requestAnimationFrame
+// callbacks as we monitored restyling process.  So if this function was called
+// just before requestAnimationFrame (e.g. inside animationstart event
+// callback), there is no chance to process restyling to be monitored in the
+// next requestAnimationFrame callback.
 function observeStyling(frameCount, onFrame) {
   var docShell =
     SpecialPowers.wrap(window)
                  .QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor)
                  .getInterface(SpecialPowers.Ci.nsIWebNavigation)
                  .QueryInterface(SpecialPowers.Ci.nsIDocShell);
 
   docShell.recordProfileTimelineMarkers = true;