Skip to content

Commit

Permalink
Adding a few more testdata points. Fixing path stuff from last change.
Browse files Browse the repository at this point in the history
  • Loading branch information
SlexAxton committed Feb 25, 2013
1 parent 16ad49a commit 894062d
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 13 deletions.
19 changes: 15 additions & 4 deletions feature-detects/css/displayrunin.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
/*!
{
"name": "CSS Display run-in",
"property": "display-runin",
"authors": ["alanhogan"],
"tags": ["css"],
"notes": [{
"name": "CSS Tricks Article",
"href": "http://css-tricks.com/596-run-in/"
},{
"name": "Related Github Issue",
"href": "https://github.com/Modernizr/Modernizr/issues/198"
}]
}
!*/
define(['Modernizr', 'testStyles'], function( Modernizr, testStyles ) {
// by alanhogan
// https://github.com/Modernizr/Modernizr/issues/198
// http://css-tricks.com/596-run-in/

testStyles(' #modernizr { display: run-in; } ', function( elem, rule ) {
var ret = (window.getComputedStyle ?
getComputedStyle(elem, null).getPropertyValue('display') :
Expand Down
29 changes: 22 additions & 7 deletions feature-detects/css/displaytable.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,31 @@
define(['Modernizr', 'testStyles'], function( Modernizr, testStyles ) {
// display: table and table-cell test. (both are tested under one name "table-cell" )
// By @scottjehl
/*!
{
"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.
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('display-table', ret);
},2);
}, 2);
});
11 changes: 10 additions & 1 deletion feature-detects/css/filters.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
/*!
{
"name": "CSS Filters",
"property": "cssfilters",
"caniuse": "css-filters",
"polyfills": ["polyfilter"],
"tags": ["css"]
}
!*/
define(['Modernizr', 'createElement', 'prefixes'], function( Modernizr, createElement, prefixes ) {
// https://github.com/Modernizr/Modernizr/issues/615
// documentMode is needed for false positives in oldIE, please see issue above
Modernizr.addTest('cssfilters', function() {
var el = createElement('div');
el.style.cssText = prefixes.join('filter' + ':blur(2px); ');
el.style.cssText = prefixes.join('filter:blur(2px); ');
return !!el.style.length && ((document.documentMode === undefined || document.documentMode > 9));
});

Expand Down
2 changes: 1 addition & 1 deletion lib/generate-meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var file = require('file');
var marked = require('marked');
var polyfills = require('./polyfills.json');

var viewRoot = file.path.abspath(__dirname + '/feature-detects');
var viewRoot = file.path.abspath(__dirname + '/../feature-detects');
var tests = [];
file.walkSync(viewRoot, function (start, dirs, files) {
files.forEach(function (file) {
Expand Down
7 changes: 7 additions & 0 deletions lib/polyfills.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,12 @@
"Supported Properties: column-count, column-width, column-gap, column-rule.",
"Unsupported Properties: column-rule-width (use column-rule instead), column-rule-style (use column-rule instead), column-rule-color (use column-rule instead), column-span, column-width-policy, column-space-distribution"
]
},
"polyfilter": {
"name": "Polyfilter",
"authors": ["Christian \"Schepp\" Schaefer"],
"href": "https://github.com/Schepp/CSS-Filters-Polyfill",
"licenses": ["MIT"],
"notes": ["CSS filter effects for Chrome 20+, Safari 6+, Firefox 4+, IE 6 - 9 and some mobile browsers."]
}
}

0 comments on commit 894062d

Please sign in to comment.