diff --git a/tests/PHPUnit/UI b/tests/PHPUnit/UI index 38cc1225c722d9a722221d2fc7796a6b81206351..0af99d928e2dc3c7dd5d6e4de865d0d89d037498 160000 --- a/tests/PHPUnit/UI +++ b/tests/PHPUnit/UI @@ -1 +1 @@ -Subproject commit 38cc1225c722d9a722221d2fc7796a6b81206351 +Subproject commit 0af99d928e2dc3c7dd5d6e4de865d0d89d037498 diff --git a/tests/lib/screenshot-testing/support/page-renderer.js b/tests/lib/screenshot-testing/support/page-renderer.js index 1124873f3a3713e9d77c33973fbfc2baccf5e9da..ab9c0f170e5ef88f4d826ac7ff225c456d4093ae 100644 --- a/tests/lib/screenshot-testing/support/page-renderer.js +++ b/tests/lib/screenshot-testing/support/page-renderer.js @@ -237,7 +237,29 @@ PageRenderer.prototype.capture = function (outputPath, callback, selector) { var element = window.jQuery(selector); if (element && element.length) { - return element[0].getBoundingClientRect(); + var clipRect = {bottom: null, height: null, left: null, right: null, top: null, width: null}; + + element.each(function (index, node) { + var rect = node.getBoundingClientRect(); + + if (null === clipRect.left || rect.left < clipRect.left) { + clipRect.left = rect.left; + } + if (null === clipRect.top || rect.top < clipRect.top) { + clipRect.top = rect.top; + } + if (null === clipRect.right || rect.right > clipRect.right) { + clipRect.right = rect.right; + } + if (null === clipRect.bottom || rect.bottom > clipRect.bottom) { + clipRect.bottom = rect.bottom; + } + }); + + clipRect.width = clipRect.right - clipRect.left; + clipRect.height = clipRect.bottom - clipRect.top; + + return clipRect; } }, selector);