From e8c63a5db7764c180bdac033bfd9bd88f7809109 Mon Sep 17 00:00:00 2001 From: Matthias Osswald Date: Wed, 27 Mar 2019 09:40:37 +0100 Subject: [PATCH] [FIX] Use full screen size for QUnit HTML iframe --- lib/client/browser.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/client/browser.js b/lib/client/browser.js index 6bdc4e51..3df0eb78 100644 --- a/lib/client/browser.js +++ b/lib/client/browser.js @@ -4,6 +4,16 @@ require("./discovery.js"); (function(window) { const karma = window.__karma__; + function setFullSize(element) { + element.style.height = "100%"; + element.style.padding = "0"; + element.style.margin = "0"; + } + + // Set karma execution frame to full size, so that the iframe can use width/height 100% + setFullSize(document.documentElement); + setFullSize(document.body); + karma.start = function() { const config = karma.config && karma.config.ui5 || {}; @@ -27,7 +37,9 @@ require("./discovery.js"); context._frame.onload = function() { onload.call(null, context); }; - context._frame.setAttribute("style", "height: 1024px; width: 1280px;"); + context._frame.style.height = "100%"; + context._frame.style.width = "100%"; + context._frame.style.border = "0"; context._frame.src = url; document.body.appendChild(context._frame); context.contentWindow = context._frame.contentWindow;