8000 gaia/tests/atoms/reflow.js at v1.4 · EricRahm/gaia · GitHub
[go: up one dir, main page]

Skip to content

Latest commit

 

History

History
38 lines (30 loc) · 764 Bytes

reflow.js

File metadata and controls

38 lines (30 loc) · 764 Bytes
'use strict';
const Cu = Components.utils;
(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) {
if (evt.detail.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);
0