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

Side by Side Diff: tools/telemetry/telemetry/internal/actions/gesture_common.js

Issue 1400213002: Update telemetry tests that rely on window.innerWidth/Height. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Worked on review comments Created 5 years, 2 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/public/web/WebView.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file provides common functionality for synthetic gesture actions. 5 // This file provides common functionality for synthetic gesture actions.
6 'use strict'; 6 'use strict';
7 7
8 (function() { 8 (function() {
9 9
10 // Returns the bounding rectangle wrt to the top-most document. 10 // Returns the bounding rectangle wrt to the top-most document.
(...skipping 21 matching lines...) Expand all
32 var rect = getBoundingRect(el); 32 var rect = getBoundingRect(el);
33 if (rect.top < 0) { 33 if (rect.top < 0) {
34 rect.height += rect.top; 34 rect.height += rect.top;
35 rect.top = 0; 35 rect.top = 0;
36 } 36 }
37 if (rect.left < 0) { 37 if (rect.left < 0) {
38 rect.width += rect.left; 38 rect.width += rect.left;
39 rect.left = 0; 39 rect.left = 0;
40 } 40 }
41 41
42 var outsideHeight = (rect.top + rect.height) - window.innerHeight; 42 // TODO(ymalik): Remove the fallback path once the visualViewportHeight and
43 var outsideWidth = (rect.left + rect.width) - window.innerWidth; 43 // visualViewportWidth properties roll into stable.
44 var visualViewportHeight = window.innerHeight;
45 var visualViewportWidth = window.innerWidth;
46 if (chrome.gpuBenchmarking.visualViewportHeight) {
47 visualViewportHeight = chrome.gpuBenchmarking.visualViewportHeight();
48 }
49 if (chrome.gpuBenchmarking.visualViewportWidth) {
50 visualViewportWidth = chrome.gpuBenchmarking.visualViewportWidth();
51 }
52 var outsideHeight = (rect.top + rect.height) - visualViewportHeight;
53 var outsideWidth = (rect.left + rect.width) - visualViewportWidth;
44 54
45 if (outsideHeight > 0) { 55 if (outsideHeight > 0) {
46 rect.height -= outsideHeight; 56 rect.height -= outsideHeight;
47 } 57 }
48 if (outsideWidth > 0) { 58 if (outsideWidth > 0) {
49 rect.width -= outsideWidth; 59 rect.width -= outsideWidth;
50 } 60 }
51 return rect; 61 return rect;
52 }; 62 };
53 63
54 window.__GestureCommon_GetBoundingVisibleRect = getBoundingVisibleRect; 64 window.__GestureCommon_GetBoundingVisibleRect = getBoundingVisibleRect;
55 })(); 65 })();
OLDNEW
« no previous file with comments | « third_party/WebKit/public/web/WebView.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698