UNPKG

modernizr

Version:

Modernizr is a JavaScript library that detects HTML5 and CSS3 features in the user’s browser.

32 lines (28 loc) 1.08 kB
/*! { "name": "CSS Display table", "property": "display-table", "caniuse": "css-table", "authors": ["scottjehl"], "tags": ["css"], "notes": [{ "name": "All additional table display values", "href": "http://pastebin.com/Gk9PeVaQ" }] } !*//* DOC `display: table` and `table-cell` test. (both are tested under one name `table-cell` ) All additional table display values are here: http://pastebin.com/Gk9PeVaQ though Scott has seen some IE false positives with that sort of weak detection. More testing neccessary perhaps. */ define(['Modernizr', 'testStyles'], function( Modernizr, testStyles ) { // If a document is in rtl mode this test will fail so we force ltr mode on the injeced // element https://github.com/Modernizr/Modernizr/issues/716 testStyles('#modernizr{display: table; direction: ltr}#modernizr div{display: table-cell; padding: 10px}', function( elem ) { var ret; var child = elem.children; ret = child[0].offsetLeft < child[1].offsetLeft; Modernizr.addTest('displaytable', ret, { aliases: ['display-table'] }); },2); });