Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 var outsideHeight = (rect.top + rect.height) - |
| 43 var outsideWidth = (rect.left + rect.width) - window.innerWidth; | 43 chrome.gpuBenchmarking.visualViewportHeight(); |
|
Sami
2015/10/14 10:44:38
Some telemetry tests run against older reference b
ymalik
2015/10/14 15:56:10
Done.
We do have plans in the future (perhaps ne
| |
| 44 var outsideWidth = (rect.left + rect.width) - | |
| 45 chrome.gpuBenchmarking.visualViewportWidth(); | |
| 44 | 46 |
| 45 if (outsideHeight > 0) { | 47 if (outsideHeight > 0) { |
| 46 rect.height -= outsideHeight; | 48 rect.height -= outsideHeight; |
| 47 } | 49 } |
| 48 if (outsideWidth > 0) { | 50 if (outsideWidth > 0) { |
| 49 rect.width -= outsideWidth; | 51 rect.width -= outsideWidth; |
| 50 } | 52 } |
| 51 return rect; | 53 return rect; |
| 52 }; | 54 }; |
| 53 | 55 |
| 54 window.__GestureCommon_GetBoundingVisibleRect = getBoundingVisibleRect; | 56 window.__GestureCommon_GetBoundingVisibleRect = getBoundingVisibleRect; |
| 55 })(); | 57 })(); |
| OLD | NEW |