DOMTokenList Validation Added in Chrome 50

Published on Updated on

In Chrome 50, you'll be able to check the support of options for some HTML attributes that are backed by DOMTokenList instances in JavaScript. Right now, these places are:

  • iframe sandbox options
  • link relations (the rel attribute, or relLink in JavaScript)

Let's show a quick example:

var iframe = document.getElementById(...);
if (iframe.sandbox.supports('an-upcoming-feature')) {
// support code for mystery future feature
} else {
// fallback code
}
if (iframe.sandbox.supports('allow-scripts')) {
// instruct frame to run JavaScript
// NOTE: this is well-supported, and just an example!
}

As the list of supported options grows and changes, you can use feature detection to perform the correct actions for your web applications.

Updated on Improve article

Back

Device Orientation Changes Are Coming to Chrome 50

Next

Removing Headaches from Focus Management

This site uses cookies to deliver and enhance the quality of its services and to analyze traffic. If you agree, cookies are also used to serve advertising and to personalize the content and advertisements that you see. Learn more about our use of cookies.