VulpesOS/gaia/tests/atoms/reflow.js
OverSu b38dea0597 Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
2026-09-30 23:13:03 +02:00

37 lines
787 B
JavaScript
Executable file

'use strict';
(function(exports) {
if ('MozReflowAtom' in exports) {
return;
}
exports.MozReflowAtom = {
count: null,
_trackingManifest: null,
init: function rw_init() {
exports.addEventListener('developer-hud-update', this);
},
handleEvent: function rw_handleEvent(evt) {
var metric = evt.detail.metric.name || evt.detail.metric;
if (metric !== 'reflows' ||
evt.detail.manifest !== this._trackingManifest) {
return;
}
this.count++;
},
startTracking: function(manifestURL) {
this._trackingManifest = manifestURL;
this.count = 0;
},
stopTracking: function() {
this.count = 0;
this._trackingManifest = null;
},
};
exports.MozReflowAtom.init();
})(window);