diff options
author | diosmosis <benaka@piwik.pro> | 2014-12-17 12:18:09 +0300 |
---|---|---|
committer | diosmosis <benaka@piwik.pro> | 2014-12-17 14:07:07 +0300 |
commit | 88ca094eae45e629dbd0b062c82df0348c0b3226 (patch) | |
tree | 2c9cf4107a67bf169c0a0c07ba0cbacb6be25913 /tests | |
parent | 719eb5e57ad26e20f43c88e28acd0a45c1a61742 (diff) |
Use jquery to get clip rect of screenshot to capture in screenshot tests instead of getBoundingClientRect.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/screenshot-testing/support/page-renderer.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/lib/screenshot-testing/support/page-renderer.js b/tests/lib/screenshot-testing/support/page-renderer.js index 7e8edcb466..a6819aabf1 100644 --- a/tests/lib/screenshot-testing/support/page-renderer.js +++ b/tests/lib/screenshot-testing/support/page-renderer.js @@ -250,7 +250,11 @@ PageRenderer.prototype.capture = function (outputPath, callback, selector) { var clipRect = {bottom: null, height: null, left: null, right: null, top: null, width: null}; element.each(function (index, node) { - var rect = node.getBoundingClientRect(); + var rect = $(node).offset(); + rect.width = $(node).outerWidth(); + rect.height = $(node).outerHeight(); + rect.right = rect.left + rect.width; + rect.bottom = rect.top + rect.height; if (isInvalidBoundingRect(rect)) { // element is not visible |