瀏覽代碼

Spy scrollBounds on document too

Gaël Métais 10 年之前
父節點
當前提交
385de967a4
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      lib/tools/phantomas/custom_modules/modules/eventYLT/eventYLT.js

+ 1 - 1
lib/tools/phantomas/custom_modules/modules/eventYLT/eventYLT.js

@@ -39,7 +39,7 @@ exports.module = function(phantomas) {
                     });
 
                     // count window.addEventListener('scroll', ...) - issue #508
-                    if (eventType === 'scroll' && path === 'window') {
+                    if (eventType === 'scroll' && (path === 'window' || path === '#document')) {
                         phantomas.incrMetric('eventsScrollBound');
                         phantomas.addOffender('eventsScrollBound', 'bound by %s', phantomas.getBacktrace());
                     }