How to Properly Detect <details> Support

Between version 10.0.603 and 12.0.701 Google Chrome had partial support for the <details> carelessly leaving its rendering for later.
Mathias Bynens created a feature test which was too convoluted for my liking.
So I've made some research and found a shorter method which use what-I-am-calling correlated feature detection.

if(!("open"in document.createElement("details"))||

In the very unlikely edge case that you have installed Gears on Chrome 12+ you would be served the javascript polyfill instead.
As a matter of fact Google plans to provide offline support to Gmail using HTML5 this summer which will probably coincide with the first stable release to natively support the <details> element.

About this entry