Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(294)

Unified Diff: telemetry/telemetry/internal/actions/scroll.js

Issue 2138883002: Fix computation of scroll amount in scroll actions. (Closed) Base URL: https://github.com/catapult-project/catapult.git@master
Patch Set: Address comments Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: telemetry/telemetry/internal/actions/scroll.js
diff --git a/telemetry/telemetry/internal/actions/scroll.js b/telemetry/telemetry/internal/actions/scroll.js
index 1a295d05fca083781984c7d27193d27d3a6bc368..2cc565011e1aa0ce134354410ec8e45d716fe2d9 100644
--- a/telemetry/telemetry/internal/actions/scroll.js
+++ b/telemetry/telemetry/internal/actions/scroll.js
@@ -32,7 +32,9 @@
function supportedByBrowser() {
return !!(window.chrome &&
chrome.gpuBenchmarking &&
- chrome.gpuBenchmarking.smoothScrollBy);
+ chrome.gpuBenchmarking.smoothScrollBy &&
+ chrome.gpuBenchmarking.visualViewportHeight &&
+ chrome.gpuBenchmarking.visualViewportWidth);
}
// This class scrolls a page from the top to the bottom once.
@@ -52,7 +54,7 @@
var clientHeight;
// clientHeight is "special" for the body element.
if (this.element_ == document.body)
- clientHeight = window.innerHeight;
+ clientHeight = __GestureCommon_GetWindowHeight();
else
clientHeight = this.element_.clientHeight;
@@ -69,7 +71,7 @@
var clientWidth;
// clientWidth is "special" for the body element.
if (this.element_ == document.body)
- clientWidth = window.innerWidth;
+ clientWidth = __GestureCommon_GetWindowWidth();
else
clientWidth = this.element_.clientWidth;
« no previous file with comments | « telemetry/telemetry/internal/actions/repeatable_scroll_unittest.py ('k') | telemetry/telemetry/internal/actions/scroll.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698