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

Unified Diff: tools/telemetry/telemetry/page/actions/gesture_common.js

Issue 1056133003: Move page/actions to internal/actions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add copyright header. Created 5 years, 9 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: tools/telemetry/telemetry/page/actions/gesture_common.js
diff --git a/tools/telemetry/telemetry/page/actions/gesture_common.js b/tools/telemetry/telemetry/page/actions/gesture_common.js
deleted file mode 100644
index 2e17fa2b69e81fb7f7ccecebc1573a7f27c4d421..0000000000000000000000000000000000000000
--- a/tools/telemetry/telemetry/page/actions/gesture_common.js
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// This file provides common functionality for synthetic gesture actions.
-'use strict';
-
-(function() {
-
- // Returns the bounding rectangle wrt to the top-most document.
- function getBoundingRect(el) {
- var client_rect = el.getBoundingClientRect();
- var bound = { left: client_rect.left,
- top: client_rect.top,
- width: client_rect.width,
- height: client_rect.height };
-
- var frame = el.ownerDocument.defaultView.frameElement;
- while (frame) {
- var frame_bound = frame.getBoundingClientRect();
- // This computation doesn't account for more complex CSS transforms on the
- // frame (e.g. scaling or rotations).
- bound.left += frame_bound.left;
- bound.top += frame_bound.top;
-
- frame = frame.ownerDocument.frameElement;
- }
- return bound;
- }
-
- function getBoundingVisibleRect(el) {
- var rect = getBoundingRect(el);
- if (rect.top < 0) {
- rect.height += rect.top;
- rect.top = 0;
- }
- if (rect.left < 0) {
- rect.width += rect.left;
- rect.left = 0;
- }
-
- var outsideHeight = (rect.top + rect.height) - window.innerHeight;
- var outsideWidth = (rect.left + rect.width) - window.innerWidth;
-
- if (outsideHeight > 0) {
- rect.height -= outsideHeight;
- }
- if (outsideWidth > 0) {
- rect.width -= outsideWidth;
- }
- return rect;
- };
-
- window.__GestureCommon_GetBoundingVisibleRect = getBoundingVisibleRect;
-})();
« no previous file with comments | « tools/telemetry/telemetry/page/actions/drag_unittest.py ('k') | tools/telemetry/telemetry/page/actions/javascript_click.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698