Skip to content

Commit

Permalink
Adding checks for interesting iframe attributes.
Browse files Browse the repository at this point in the history
* @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
mikewest committed Aug 10, 2012
1 parent ef1a856 commit f9993e7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions 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'));
5 changes: 5 additions & 0 deletions 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'));
5 changes: 5 additions & 0 deletions 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'));

0 comments on commit f9993e7

Please sign in to comment.