Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adding checks for interesting `iframe` attributes.

* @sandbox enables granular restriction of the permissions with which
  framed content is allowed to run.

* @seamless renders `iframe` elements as though they were part of the
  containing document. CSS bleeds through, and links open in the parent
  window, for instance.

* @srcdoc provides the content that the frame ought to display.

All three are implemented in WebKit, and are specified in the ["The iframe
element" section of the WHATWG HTML living standard][1].

[1]: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-iframe-element.html
  • Loading branch information...
commit f9993e7cb2b2ccb25224dc2ce42c8d3782dfa94e 1 parent ef1a856
@mikewest authored
View
5 feature-detects/iframe-sandbox.js
@@ -0,0 +1,5 @@
+// Test for `sandbox` attribute in iframes.
+//
+// Spec: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-iframe-element.html#attr-iframe-sandbox
+
+Modernizr.addTest('sandbox', 'sandbox' in document.createElement('iframe'));
View
5 feature-detects/iframe-seamless.js
@@ -0,0 +1,5 @@
+// Test for `seamless` attribute in iframes.
+//
+// Spec: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-iframe-element.html#attr-iframe-seamless
+
+Modernizr.addTest('seamless', 'seamless' in document.createElement('iframe'));
View
5 feature-detects/iframe-srcdoc.js
@@ -0,0 +1,5 @@
+// Test for `srcdoc` attribute in iframes.
+//
+// Spec: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-iframe-element.html#attr-iframe-srcdoc
+
+Modernizr.addTest('srcdoc', 'srcdoc' in document.createElement('iframe'));
Please sign in to comment.
Something went wrong with that request. Please try again.