summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/support/sandbox_helper.js
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/support/sandbox_helper.js')
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/support/sandbox_helper.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/support/sandbox_helper.js b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/support/sandbox_helper.js
new file mode 100644
index 0000000000..26aa67faf4
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/support/sandbox_helper.js
@@ -0,0 +1,14 @@
+function IsSandboxSupported() {
+ if ('sandbox' in document.createElement('iframe')) {
+ return true;
+ }
+ return false;
+}
+
+function DisableTestForNonSupportingBrowsers() {
+ //check if sandbox is supported by the browser
+ if (!IsSandboxSupported()) {
+ document.getElementById('testframe').innerHTML = "FAIL: Your browser does not support the sandbox attribute on the iframe element.";
+ document.getElementById('testframe').style.color = "Red";
+ }
+}