Bug 1413817 - Add a note for observeStyling. r?birtles
MozReview-Commit-ID: GceXjd3EJR7
--- 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;