Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authordiosmosis <benaka@piwik.pro>2014-12-17 12:18:09 +0300
committerdiosmosis <benaka@piwik.pro>2014-12-17 14:07:07 +0300
commit88ca094eae45e629dbd0b062c82df0348c0b3226 (patch)
tree2c9cf4107a67bf169c0a0c07ba0cbacb6be25913 /tests
parent719eb5e57ad26e20f43c88e28acd0a45c1a61742 (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.js6
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