|
@@ -121,24 +121,28 @@ var jsExecutionTransformer = function() {
|
|
debug('JS execution transformation complete');
|
|
debug('JS execution transformation complete');
|
|
|
|
|
|
|
|
|
|
- debug('Starting scroll execution transformation');
|
|
|
|
- offenders.DOMaccessesOnScroll = JSON.parse(data.toolsResults.phantomas.offenders.scrollExecutionTree[0]);
|
|
|
|
- if (offenders.DOMaccessesOnScroll.children) {
|
|
|
|
- offenders.DOMaccessesOnScroll.children.forEach(function(node) {
|
|
|
|
-
|
|
|
|
- // Mark a event flag
|
|
|
|
- if (['documentScroll', 'windowScroll', 'window.onscroll'].indexOf(node.data.type) >= 0) {
|
|
|
|
- node.windowPerformance = true;
|
|
|
|
- }
|
|
|
|
|
|
+ if (data.toolsResults.phantomas.offenders.scrollExecutionTree) {
|
|
|
|
+ debug('Starting scroll execution transformation');
|
|
|
|
+ offenders.DOMaccessesOnScroll = JSON.parse(data.toolsResults.phantomas.offenders.scrollExecutionTree[0]);
|
|
|
|
+ if (offenders.DOMaccessesOnScroll.children) {
|
|
|
|
+ offenders.DOMaccessesOnScroll.children.forEach(function(node) {
|
|
|
|
+
|
|
|
|
+ // Mark a event flag
|
|
|
|
+ if (['documentScroll', 'windowScroll', 'window.onscroll'].indexOf(node.data.type) >= 0) {
|
|
|
|
+ node.windowPerformance = true;
|
|
|
|
+ }
|
|
|
|
|
|
- // Transform domPaths into objects
|
|
|
|
- changeListOfDomPaths(node);
|
|
|
|
-
|
|
|
|
- // Count the number of DOM accesses, by counting the tree leafs
|
|
|
|
- metrics.DOMaccessesOnScroll += countTreeLeafs(node);
|
|
|
|
- });
|
|
|
|
|
|
+ // Transform domPaths into objects
|
|
|
|
+ changeListOfDomPaths(node);
|
|
|
|
+
|
|
|
|
+ // Count the number of DOM accesses, by counting the tree leafs
|
|
|
|
+ metrics.DOMaccessesOnScroll += countTreeLeafs(node);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ debug('Scroll execution transformation complete');
|
|
|
|
+ } else {
|
|
|
|
+ debug('Could not parse scrollExecutionTree');
|
|
}
|
|
}
|
|
- debug('Scroll execution transformation complete');
|
|
|
|
|
|
|
|
} catch(err) {
|
|
} catch(err) {
|
|
throw err;
|
|
throw err;
|