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

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

Issue 2162963002: [polymer] Merge of master into polymer10-migration (Closed) Base URL: git@github.com:catapult-project/catapult.git@polymer10-migration
Patch Set: Merge polymer10-migration int polymer10-merge 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 d23cd63984dab41518992ece4a3ca5b7e0d68059..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;
@@ -124,14 +126,10 @@
this.getScrollDistance_());
var rect = __GestureCommon_GetBoundingVisibleRect(this.options_.element_);
- // TODO(bccheng): workaround crbug/599656
- // Use device-independent pixel value for the x and y positions
var start_left =
- rect.left + (rect.width / window.devicePixelRatio) *
- this.options_.left_start_ratio_;
+ rect.left + rect.width * this.options_.left_start_ratio_;
var start_top =
- rect.top + (rect.height / window.devicePixelRatio) *
- this.options_.top_start_ratio_;
+ rect.top + rect.height * this.options_.top_start_ratio_;
chrome.gpuBenchmarking.smoothScrollBy(
distance, this.onGestureComplete_.bind(this), start_left, start_top,
this.options_.gesture_source_type_, this.options_.direction_,
« 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