Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 273372b18f20a2b50a395d63aee56d18c7675748
Merge: 375aba0 901fc80
Author: Stu Cox <stuart.cox@gmail.com>
Date:   Thu Aug 1 07:18:25 2013 +0100

    Merge branch 'supports' of https://github.com/Modernizr/Modernizr into supports

    Conflicts:
    	feature-detects/css/flexbox.js

commit 375aba0d7a2e8b6503b2c602c16170b9a9f494f5
Author: Stu Cox <stuart.cox@gmail.com>
Date:   Thu Aug 1 07:10:45 2013 +0100

    Squashed commit of the following:

    commit 1a916b843e7896fe3ea71b4cb9d32f40bd41664f
    Merge: 901fc80 8cc5f1c
    Author: Stu Cox <stuart.cox@gmail.com>
    Date:   Thu Aug 1 07:09:18 2013 +0100

        Merge branch 'master' into supports

        Conflicts:
        	feature-detects/css/flexbox.js

    commit 901fc80
    Author: Stu Cox <stuart.cox@gmail.com>
    Date:   Mon May 20 08:15:49 2013 +0100

        Added some comments about corner cases in `src/testProps`

    commit 29df5d9
    Merge: ef920a5 98d877f
    Author: Stu Cox <stuart.cox@gmail.com>
    Date:   Thu May 16 19:07:40 2013 +0100

        Merge branch 'master' into supports

        Conflicts:
        	feature-detects/css/resize.js
        	feature-detects/css/userselect.js
        	feature-detects/css/wrapflow.js

    commit ef920a5
    Merge: 03fa4e0 3c46f00
    Author: Stu Cox <stuart.cox@gmail.com>
    Date:   Thu May 16 18:58:04 2013 +0100

        Merge branch 'supports' of https://github.com/Modernizr/Modernizr into supports

    commit 03fa4e0
    Author: Stu Cox <stuart.cox@gmail.com>
    Date:   Thu May 16 18:57:44 2013 +0100

        Revert "Revert "Added detect for <template> HTML tag""

        This reverts commit ea9d5f3.

    commit 3c46f00
    Merge: 0af0315 899ee2f
    Author: Stu Cox <stu@stucox.co.uk>
    Date:   Thu May 16 10:54:20 2013 -0700

        Merge pull request #932 from stucox/supports

        Corrected polarity of `skipValueTest` param in detects using `testAllProps()`

    commit 899ee2f
    Author: Stu Cox <stuart.cox@gmail.com>
    Date:   Thu May 16 18:37:02 2013 +0100

        Corrected polarity of `skipValueTest` param in detects using `testAllProps()`

    commit 0af0315
    Merge: 16c8bc5 ee1fd0c
    Author: Stu Cox <stu@stucox.co.uk>
    Date:   Wed May 15 05:55:51 2013 -0700

        Merge pull request #927 from stucox/supports

        Changed nativeTestProps to only support a single value (no prefixing)...

    commit ee1fd0c
    Author: Stu Cox <stuart.cox@gmail.com>
    Date:   Tue May 14 11:18:10 2013 +0100

        Changed nativeTestProps to only support a single value (no prefixing) and caveated a test which is only relevant when native detection *not* supported

    commit 16c8bc5
    Author: Stu Cox <stuart.cox@gmail.com>
    Date:   Tue May 14 10:11:42 2013 +0100

        Updated comment re. try..catch in testProps

    commit 50bbbf6
    Merge: edd7b9c 7ab17c1
    Author: Stu Cox <stuart.cox@gmail.com>
    Date:   Tue May 14 10:10:16 2013 +0100

        Merge branch 'supports' of https://github.com/Modernizr/Modernizr into supports

    commit 7ab17c1
    Merge: 8cd9a02 3f5f372
    Author: Stu Cox <stu@stucox.co.uk>
    Date:   Tue May 14 02:09:55 2013 -0700

        Merge pull request #926 from ausi/fix/test-props

        Fixed bug with setting a style property to a unknown value in IE8 and lower

    commit 3f5f372
    Author: Martin Auswöger <martin@auswoeger.com>
    Date:   Mon May 13 22:09:13 2013 +0200

        Fixed bug with setting a style property to a unknown value in IE8 and lower

    commit edd7b9c
    Author: Stu Cox <stuart.cox@gmail.com>
    Date:   Fri Apr 26 18:23:49 2013 +0100

        Tweak to border-image test value to pass correctly in Opera 12.15

    commit 8cd9a02
    Merge: 439fca4 429cb96
    Author: Stu Cox <stuart.cox@gmail.com>
    Date:   Thu Apr 18 15:35:47 2013 +0100

        Merge branch 'master' into supports

    commit 439fca4
    Author: Stu Cox <stuart.cox@gmail.com>
    Date:   Thu Apr 18 15:13:42 2013 +0100

        Corrected tests following last commit

    commit 0684b4b
    Author: Stu Cox <stuart.cox@gmail.com>
    Date:   Thu Apr 18 14:45:24 2013 +0100

        Changed `useValue` to `skipValueTest` and flipped its polarity, because that makes more sense

    commit f5dd9cd
    Author: Stu Cox <stuart.cox@gmail.com>
    Date:   Thu Apr 18 08:15:33 2013 +0100

        Clarified `useValue=false` test

    commit c5bc87e
    Author: Stu Cox <stuart.cox@gmail.com>
    Date:   Thu Apr 18 08:07:11 2013 +0100

        Updated detects to use the `useValue` attribute of `testAllProps()` where necessary

    commit 525c8bf
    Author: Stu Cox <stuart.cox@gmail.com>
    Date:   Thu Apr 18 00:37:08 2013 +0100

        Corrected `testProp()` to handle the `useValue` argument correctly and added a test for it

    commit 12d1b41
    Author: Stu Cox <stuart.cox@gmail.com>
    Date:   Thu Apr 18 00:24:02 2013 +0100

        Removed ability to test multiple values at once; that just confused the API

    commit 528ecf5
    Author: Stu Cox <stuart.cox@gmail.com>
    Date:   Thu Apr 18 00:17:38 2013 +0100

        Revert "Changed testAllPropse to take an options argument, rather than a handful of flags"

        This reverts commit 6d7136f.

    commit 1c268fc
    Merge: 180337f 24909eb
    Author: Stu Cox <stuart.cox@gmail.com>
    Date:   Wed Apr 17 22:51:03 2013 +0100

        Merge branch 'master' into supports

        Conflicts:
        	feature-detects/css/flexbox.js
        	feature-detects/css/flexboxlegacy.js
        	feature-detects/css/mask.js
        	feature-detects/css/wrapflow.js
        	src/testProp.js

    commit 180337f
    Merge: 0042ecd e81ed15
    Author: Stu Cox <stuart.cox@gmail.com>
    Date:   Sat Mar 9 15:15:13 2013 -0600

        Merge branch 'supports-featureupdates' into supports

    commit 0042ecd
    Author: Stu Cox <stuart.cox@gmail.com>
    Date:   Sat Mar 9 15:13:42 2013 -0600

        Added a note about `undefined` return value from `nativeTestProps()`

    commit e81ed15
    Author: Stu Cox <stuart.cox@gmail.com>
    Date:   Sat Mar 9 15:08:14 2013 -0600

        Updated other feature detects to use native detection

    commit 2d1bc6c
    Merge: 6d7136f 1d11554
    Author: Stu Cox <stuart.cox@gmail.com>
    Date:   Fri Mar 8 17:21:40 2013 -0600

        Merge branch 'supports' of https://github.com/Modernizr/Modernizr into supports

    commit 6d7136f
    Author: Stu Cox <stuart.cox@gmail.com>
    Date:   Fri Mar 8 17:11:20 2013 -0600

        Changed testAllPropse to take an options argument, rather than a handful of flags

    commit 11b8846
    Merge: 9dc96a0 b466c5e
    Author: Stu Cox <stuart.cox@gmail.com>
    Date:   Fri Mar 8 13:34:05 2013 -0600

        Merge branch 'master' into supports

    commit 9dc96a0
    Author: Stu Cox <stuart.cox@gmail.com>
    Date:   Fri Mar 8 13:30:29 2013 -0600

        Changed testProps' set-and-check to just return true on a *change* of a property for a given value, because browsers often reformat (e.g. '#ABCDEF' -> 'rgb(whatever)')

    commit 45f054e
    Author: Stu Cox <stuart.cox@gmail.com>
    Date:   Fri Mar 8 13:27:56 2013 -0600

        Added values to mask, reflections and resize detects required for native detection

    commit cc22178
    Author: Stu Cox <stuart.cox@gmail.com>
    Date:   Fri Mar 8 09:33:03 2013 -0600

        Fixed a bug where property values with spaces (e.g. "1px 1px")  passed into `testAllProps` would be broken up

    commit 4a64270
    Author: Stu Cox <stuart.cox@gmail.com>
    Date:   Wed Mar 6 13:42:48 2013 +0000

        Tweaked a couple of `testAllProps()` values to fix some false negatives

    commit 821ea66
    Author: Stu Cox <stuart.cox@gmail.com>
    Date:   Wed Mar 6 13:32:27 2013 +0000

        Changed most detects using `testAllProps()` to define a property value, in order to be able to use `window.CSS.supports()` when available

    commit 1d11554
    Merge: 7bd7100 6acf06c
    Author: Stu Cox <stu@stucox.co.uk>
    Date:   Tue Feb 26 15:19:49 2013 -0800

        Merge pull request #842 from stucox/supports

        Use `CSS.supports()` internally (#818)

    commit 6acf06c
    Author: Stu Cox <stuart.cox@gmail.com>
    Date:   Tue Feb 26 23:17:34 2013 +0000

        Stylistic tweaks following review comments

    commit 5f6cf2c
    Author: Stu Cox <stuart.cox@gmail.com>
    Date:   Tue Feb 26 22:20:19 2013 +0000

        Added `domToHyphenated` module which I forgot...

    commit fdbea7e
    Author: Stu Cox <stuart.cox@gmail.com>
    Date:   Tue Feb 26 20:03:51 2013 +0000

        Removed some logging

    commit ea9d5f3
    Author: Stu Cox <stuart.cox@gmail.com>
    Date:   Tue Feb 26 19:45:04 2013 +0000

        Revert "Added detect for <template> HTML tag"

        This reverts commit 0252b52.

    commit b850d2c
    Author: Stu Cox <stuart.cox@gmail.com>
    Date:   Tue Feb 26 19:44:06 2013 +0000

        Updated `testProp()` and `testAllProps()` tests to cover value testing and removed some unneeded dependencies

    commit 1ca3a01
    Author: Stu Cox <stuart.cox@gmail.com>
    Date:   Tue Feb 26 19:38:18 2013 +0000

        Made it so `testProp(prop, value)` and `testAllProps(prop, value)` will use a manual set-and-check to verify that the provided value is valid for the named property

    commit 0cc5d3d
    Merge: 6518dd6 0252b52
    Author: Stu Cox <stuart.cox@gmail.com>
    Date:   Tue Feb 26 18:38:46 2013 +0000

        Merge branch 'master' into supports

    commit 6518dd6
    Author: Stu Cox <stuart.cox@gmail.com>
    Date:   Wed Feb 20 13:48:22 2013 +0000

        Updated `testAllProps()` to accept a 2nd 'value' arg, and updated the `flexbox` and `flexboxlegacy` detects to demonstrate its use

    commit 2372af5
    Author: Stu Cox <stuart.cox@gmail.com>
    Date:   Wed Feb 20 10:04:23 2013 +0000

        Updated `testProp()` to accept a 2nd `value` arg for native feature detection, and rejigged (and renamed) the native wrapper to suit

    commit a60c727
    Author: Stu Cox <stuart.cox@gmail.com>
    Date:   Wed Feb 20 10:01:21 2013 +0000

        Rolled `flexbox` and `flexboxlegacy` detects back to original format (just using `testAllProps()`)

    commit 82c9a43
    Author: Stu Cox <stuart.cox@gmail.com>
    Date:   Tue Feb 19 23:24:49 2013 +0000

        Revised version of nativeCSSDetect - this time only allows `(prop, value)` interface, because it's probably more common. Also updated `flexbox` and `flexboxlegacy` tests to show how it could be used.

    commit 90b1874
    Merge: 70ba7de fe93b62
    Author: Stu Cox <stuart.cox@gmail.com>
    Date:   Tue Feb 19 22:09:15 2013 +0000

        Merge branch 'master' into supports

    commit 70ba7de
    Author: Stu Cox <stuart.cox@gmail.com>
    Date:   Tue Feb 19 21:47:24 2013 +0000

        Initial version of `nativeCSSDetect()` - only accepts a string e.g. `'(flex-wrap:reverse)'`; would quite like to overload the interface

commit 901fc80
Author: Stu Cox <stuart.cox@gmail.com>
Date:   Mon May 20 08:15:49 2013 +0100

    Added some comments about corner cases in `src/testProps`

commit 29df5d9
Merge: ef920a5 98d877f
Author: Stu Cox <stuart.cox@gmail.com>
Date:   Thu May 16 19:07:40 2013 +0100

    Merge branch 'master' into supports

    Conflicts:
    	feature-detects/css/resize.js
    	feature-detects/css/userselect.js
    	feature-detects/css/wrapflow.js

commit ef920a5
Merge: 03fa4e0 3c46f00
Author: Stu Cox <stuart.cox@gmail.com>
Date:   Thu May 16 18:58:04 2013 +0100

    Merge branch 'supports' of https://github.com/Modernizr/Modernizr into supports

commit 03fa4e0
Author: Stu Cox <stuart.cox@gmail.com>
Date:   Thu May 16 18:57:44 2013 +0100

    Revert "Revert "Added detect for <template> HTML tag""

    This reverts commit ea9d5f3.

commit 3c46f00
Merge: 0af0315 899ee2f
Author: Stu Cox <stu@stucox.co.uk>
Date:   Thu May 16 10:54:20 2013 -0700

    Merge pull request #932 from stucox/supports

    Corrected polarity of `skipValueTest` param in detects using `testAllProps()`

commit 899ee2f
Author: Stu Cox <stuart.cox@gmail.com>
Date:   Thu May 16 18:37:02 2013 +0100

    Corrected polarity of `skipValueTest` param in detects using `testAllProps()`

commit 0af0315
Merge: 16c8bc5 ee1fd0c
Author: Stu Cox <stu@stucox.co.uk>
Date:   Wed May 15 05:55:51 2013 -0700

    Merge pull request #927 from stucox/supports

    Changed nativeTestProps to only support a single value (no prefixing)...

commit ee1fd0c
Author: Stu Cox <stuart.cox@gmail.com>
Date:   Tue May 14 11:18:10 2013 +0100

    Changed nativeTestProps to only support a single value (no prefixing) and caveated a test which is only relevant when native detection *not* supported

commit 16c8bc5
Author: Stu Cox <stuart.cox@gmail.com>
Date:   Tue May 14 10:11:42 2013 +0100

    Updated comment re. try..catch in testProps

commit 50bbbf6
Merge: edd7b9c 7ab17c1
Author: Stu Cox <stuart.cox@gmail.com>
Date:   Tue May 14 10:10:16 2013 +0100

    Merge branch 'supports' of https://github.com/Modernizr/Modernizr into supports

commit 7ab17c1
Merge: 8cd9a02 3f5f372
Author: Stu Cox <stu@stucox.co.uk>
Date:   Tue May 14 02:09:55 2013 -0700

    Merge pull request #926 from ausi/fix/test-props

    Fixed bug with setting a style property to a unknown value in IE8 and lower

commit 3f5f372
Author: Martin Auswöger <martin@auswoeger.com>
Date:   Mon May 13 22:09:13 2013 +0200

    Fixed bug with setting a style property to a unknown value in IE8 and lower

commit edd7b9c
Author: Stu Cox <stuart.cox@gmail.com>
Date:   Fri Apr 26 18:23:49 2013 +0100

    Tweak to border-image test value to pass correctly in Opera 12.15

commit 8cd9a02
Merge: 439fca4 429cb96
Author: Stu Cox <stuart.cox@gmail.com>
Date:   Thu Apr 18 15:35:47 2013 +0100

    Merge branch 'master' into supports

commit 439fca4
Author: Stu Cox <stuart.cox@gmail.com>
Date:   Thu Apr 18 15:13:42 2013 +0100

    Corrected tests following last commit

commit 0684b4b
Author: Stu Cox <stuart.cox@gmail.com>
Date:   Thu Apr 18 14:45:24 2013 +0100

    Changed `useValue` to `skipValueTest` and flipped its polarity, because that makes more sense

commit f5dd9cd
Author: Stu Cox <stuart.cox@gmail.com>
Date:   Thu Apr 18 08:15:33 2013 +0100

    Clarified `useValue=false` test

commit c5bc87e
Author: Stu Cox <stuart.cox@gmail.com>
Date:   Thu Apr 18 08:07:11 2013 +0100

    Updated detects to use the `useValue` attribute of `testAllProps()` where necessary

commit 525c8bf
Author: Stu Cox <stuart.cox@gmail.com>
Date:   Thu Apr 18 00:37:08 2013 +0100

    Corrected `testProp()` to handle the `useValue` argument correctly and added a test for it

commit 12d1b41
Author: Stu Cox <stuart.cox@gmail.com>
Date:   Thu Apr 18 00:24:02 2013 +0100

    Removed ability to test multiple values at once; that just confused the API

commit 528ecf5
Author: Stu Cox <stuart.cox@gmail.com>
Date:   Thu Apr 18 00:17:38 2013 +0100

    Revert "Changed testAllPropse to take an options argument, rather than a handful of flags"

    This reverts commit 6d7136f.

commit 1c268fc
Merge: 180337f 24909eb
Author: Stu Cox <stuart.cox@gmail.com>
Date:   Wed Apr 17 22:51:03 2013 +0100

    Merge branch 'master' into supports

    Conflicts:
    	feature-detects/css/flexbox.js
    	feature-detects/css/flexboxlegacy.js
    	feature-detects/css/mask.js
    	feature-detects/css/wrapflow.js
    	src/testProp.js

commit 180337f
Merge: 0042ecd e81ed15
Author: Stu Cox <stuart.cox@gmail.com>
Date:   Sat Mar 9 15:15:13 2013 -0600

    Merge branch 'supports-featureupdates' into supports

commit 0042ecd
Author: Stu Cox <stuart.cox@gmail.com>
Date:   Sat Mar 9 15:13:42 2013 -0600

    Added a note about `undefined` return value from `nativeTestProps()`

commit e81ed15
Author: Stu Cox <stuart.cox@gmail.com>
Date:   Sat Mar 9 15:08:14 2013 -0600

    Updated other feature detects to use native detection

commit 2d1bc6c
Merge: 6d7136f 1d11554
Author: Stu Cox <stuart.cox@gmail.com>
Date:   Fri Mar 8 17:21:40 2013 -0600

    Merge branch 'supports' of https://github.com/Modernizr/Modernizr into supports

commit 6d7136f
Author: Stu Cox <stuart.cox@gmail.com>
Date:   Fri Mar 8 17:11:20 2013 -0600

    Changed testAllPropse to take an options argument, rather than a handful of flags

commit 11b8846
Merge: 9dc96a0 b466c5e
Author: Stu Cox <stuart.cox@gmail.com>
Date:   Fri Mar 8 13:34:05 2013 -0600

    Merge branch 'master' into supports

commit 9dc96a0
Author: Stu Cox <stuart.cox@gmail.com>
Date:   Fri Mar 8 13:30:29 2013 -0600

    Changed testProps' set-and-check to just return true on a *change* of a property for a given value, because browsers often reformat (e.g. '#ABCDEF' -> 'rgb(whatever)')

commit 45f054e
Author: Stu Cox <stuart.cox@gmail.com>
Date:   Fri Mar 8 13:27:56 2013 -0600

    Added values to mask, reflections and resize detects required for native detection

commit cc22178
Author: Stu Cox <stuart.cox@gmail.com>
Date:   Fri Mar 8 09:33:03 2013 -0600

    Fixed a bug where property values with spaces (e.g. "1px 1px")  passed into `testAllProps` would be broken up

commit 4a64270
Author: Stu Cox <stuart.cox@gmail.com>
Date:   Wed Mar 6 13:42:48 2013 +0000

    Tweaked a couple of `testAllProps()` values to fix some false negatives

commit 821ea66
Author: Stu Cox <stuart.cox@gmail.com>
Date:   Wed Mar 6 13:32:27 2013 +0000

    Changed most detects using `testAllProps()` to define a property value, in order to be able to use `window.CSS.supports()` when available

commit 1d11554
Merge: 7bd7100 6acf06c
Author: Stu Cox <stu@stucox.co.uk>
Date:   Tue Feb 26 15:19:49 2013 -0800

    Merge pull request #842 from stucox/supports

    Use `CSS.supports()` internally (#818)

commit 6acf06c
Author: Stu Cox <stuart.cox@gmail.com>
Date:   Tue Feb 26 23:17:34 2013 +0000

    Stylistic tweaks following review comments

commit 5f6cf2c
Author: Stu Cox <stuart.cox@gmail.com>
Date:   Tue Feb 26 22:20:19 2013 +0000

    Added `domToHyphenated` module which I forgot...

commit fdbea7e
Author: Stu Cox <stuart.cox@gmail.com>
Date:   Tue Feb 26 20:03:51 2013 +0000

    Removed some logging

commit ea9d5f3
Author: Stu Cox <stuart.cox@gmail.com>
Date:   Tue Feb 26 19:45:04 2013 +0000

    Revert "Added detect for <template> HTML tag"

    This reverts commit 0252b52.

commit b850d2c
Author: Stu Cox <stuart.cox@gmail.com>
Date:   Tue Feb 26 19:44:06 2013 +0000

    Updated `testProp()` and `testAllProps()` tests to cover value testing and removed some unneeded dependencies

commit 1ca3a01
Author: Stu Cox <stuart.cox@gmail.com>
Date:   Tue Feb 26 19:38:18 2013 +0000

    Made it so `testProp(prop, value)` and `testAllProps(prop, value)` will use a manual set-and-check to verify that the provided value is valid for the named property

commit 0cc5d3d
Merge: 6518dd6 0252b52
Author: Stu Cox <stuart.cox@gmail.com>
Date:   Tue Feb 26 18:38:46 2013 +0000

    Merge branch 'master' into supports

commit 6518dd6
Author: Stu Cox <stuart.cox@gmail.com>
Date:   Wed Feb 20 13:48:22 2013 +0000

    Updated `testAllProps()` to accept a 2nd 'value' arg, and updated the `flexbox` and `flexboxlegacy` detects to demonstrate its use

commit 2372af5
Author: Stu Cox <stuart.cox@gmail.com>
Date:   Wed Feb 20 10:04:23 2013 +0000

    Updated `testProp()` to accept a 2nd `value` arg for native feature detection, and rejigged (and renamed) the native wrapper to suit

commit a60c727
Author: Stu Cox <stuart.cox@gmail.com>
Date:   Wed Feb 20 10:01:21 2013 +0000

    Rolled `flexbox` and `flexboxlegacy` detects back to original format (just using `testAllProps()`)

commit 82c9a43
Author: Stu Cox <stuart.cox@gmail.com>
Date:   Tue Feb 19 23:24:49 2013 +0000

    Revised version of nativeCSSDetect - this time only allows `(prop, value)` interface, because it's probably more common. Also updated `flexbox` and `flexboxlegacy` tests to show how it could be used.

commit 90b1874
Merge: 70ba7de fe93b62
Author: Stu Cox <stuart.cox@gmail.com>
Date:   Tue Feb 19 22:09:15 2013 +0000

    Merge branch 'master' into supports

commit 70ba7de
Author: Stu Cox <stuart.cox@gmail.com>
Date:   Tue Feb 19 21:47:24 2013 +0000

    Initial version of `nativeCSSDetect()` - only accepts a string e.g. `'(flex-wrap:reverse)'`; would quite like to overload the interface
  • Loading branch information
stucox committed Aug 1, 2013
1 parent 8cc5f1c commit 8729ddc
Show file tree
Hide file tree
Showing 28 changed files with 204 additions and 102 deletions.
2 changes: 1 addition & 1 deletion feature-detects/css/animations.js
Expand Up @@ -13,5 +13,5 @@
}
!*/
define(['Modernizr', 'testAllProps'], function( Modernizr, testAllProps ) {
Modernizr.addTest('cssanimations', testAllProps('animationName'));
Modernizr.addTest('cssanimations', testAllProps('animationName', 'a', true));
});
11 changes: 3 additions & 8 deletions feature-detects/css/backgroundposition-xy.js
Expand Up @@ -13,13 +13,8 @@
}]
}
!*/
define(['Modernizr', 'testStyles'], function( Modernizr, testStyles ) {
Modernizr.addTest('bgpositionxy', function() {
return testStyles('#modernizr {background-position: 3px 5px;}', function( elem ) {
var cssStyleDeclaration = window.getComputedStyle ? getComputedStyle(elem, null) : elem.currentStyle;
var xSupport = (cssStyleDeclaration.backgroundPositionX == '3px') || (cssStyleDeclaration['background-position-x'] == '3px');
var ySupport = (cssStyleDeclaration.backgroundPositionY == '5px') || (cssStyleDeclaration['background-position-y'] == '5px');
return xSupport && ySupport;
});
define(['Modernizr', 'testAllProps'], function( Modernizr, testAllProps ) {
Modernizr.addTest('bgpositionxy', function () {
return testAllProps('backgroundPositionX', '3px', true) && testAllProps('backgroundPositionY', '5px', true);
});
});
20 changes: 4 additions & 16 deletions feature-detects/css/backgroundrepeat.js
Expand Up @@ -16,20 +16,8 @@
}]
}
!*/
define(['Modernizr', 'testStyles'], function( Modernizr, testStyles ) {

function getBgRepeatValue( elem ) {
return (window.getComputedStyle ?
getComputedStyle(elem, null).getPropertyValue('background') :
elem.currentStyle['background']);
}

testStyles(' #modernizr { background-repeat: round; } ', function( elem, rule ) {
Modernizr.addTest('bgrepeatround', getBgRepeatValue(elem) == 'round');
});

testStyles(' #modernizr { background-repeat: space; } ', function( elem, rule ) {
Modernizr.addTest('bgrepeatspace', getBgRepeatValue(elem) == 'space');
});

define(['Modernizr', 'testAllProps'], function( Modernizr, testAllProps ) {
// Must value-test these
Modernizr.addTest('bgrepeatround', testAllProps('backgroundRepeat', 'round'));
Modernizr.addTest('bgrepeatspace', testAllProps('backgroundRepeat', 'space'));
});
2 changes: 1 addition & 1 deletion feature-detects/css/backgroundsize.js
Expand Up @@ -11,5 +11,5 @@
}
!*/
define(['Modernizr', 'testAllProps'], function( Modernizr, testAllProps ) {
Modernizr.addTest('backgroundsize', testAllProps('backgroundSize'));
Modernizr.addTest('backgroundsize', testAllProps('backgroundSize', '100%', true));
});
13 changes: 3 additions & 10 deletions feature-detects/css/backgroundsizecover.js
Expand Up @@ -9,14 +9,7 @@
}]
}
!*/
define(['Modernizr', 'testStyles'], function( Modernizr, testStyles ) {

testStyles('#modernizr{background-size:cover}', function( elem ) {
var style = window.getComputedStyle ?
window.getComputedStyle(elem, null)
: elem.currentStyle;

Modernizr.addTest('bgsizecover', style.backgroundSize == 'cover' );
});

define(['Modernizr', 'testAllProps'], function( Modernizr, testAllProps ) {
// Must test value, as this specifically tests the `cover` value
Modernizr.addTest('bgsizecover', testAllProps('backgroundSize', 'cover'));
});
2 changes: 1 addition & 1 deletion feature-detects/css/borderimage.js
Expand Up @@ -8,5 +8,5 @@
}
!*/
define(['Modernizr', 'testAllProps'], function( Modernizr, testAllProps ) {
Modernizr.addTest('borderimage', testAllProps('borderImage'));
Modernizr.addTest('borderimage', testAllProps('borderImage', 'url() 1', true));
});
2 changes: 1 addition & 1 deletion feature-detects/css/borderradius.js
Expand Up @@ -12,5 +12,5 @@
}
!*/
define(['Modernizr', 'testAllProps'], function( Modernizr, testAllProps ) {
Modernizr.addTest('borderradius', testAllProps('borderRadius'));
Modernizr.addTest('borderradius', testAllProps('borderRadius', '0px', true));
});
2 changes: 1 addition & 1 deletion feature-detects/css/boxshadow.js
Expand Up @@ -8,5 +8,5 @@
}
!*/
define(['Modernizr', 'testAllProps'], function( Modernizr, testAllProps ) {
Modernizr.addTest('boxshadow', testAllProps('boxShadow'));
Modernizr.addTest('boxshadow', testAllProps('boxShadow', '1px 1px', true));
});
2 changes: 1 addition & 1 deletion feature-detects/css/boxsizing.js
Expand Up @@ -15,5 +15,5 @@
}
!*/
define(['Modernizr', 'testAllProps'], function( Modernizr, testAllProps ) {
Modernizr.addTest('boxsizing', testAllProps('boxSizing') && (document.documentMode === undefined || document.documentMode > 7));
Modernizr.addTest('boxsizing', testAllProps('boxSizing', 'border-box', true) && (document.documentMode === undefined || document.documentMode > 7));
});
2 changes: 1 addition & 1 deletion feature-detects/css/columns.js
Expand Up @@ -8,5 +8,5 @@
}
!*/
define(['Modernizr', 'testAllProps'], function( Modernizr, testAllProps ) {
Modernizr.addTest('csscolumns', testAllProps('columnCount'));
Modernizr.addTest('csscolumns', testAllProps('columnCount', '1', true));
});
11 changes: 3 additions & 8 deletions feature-detects/css/displayrunin.js
Expand Up @@ -13,12 +13,7 @@
}]
}
!*/
define(['Modernizr', 'testStyles'], function( Modernizr, testStyles ) {
testStyles(' #modernizr { display: run-in; } ', function( elem, rule ) {
var ret = (window.getComputedStyle ?
getComputedStyle(elem, null).getPropertyValue('display') :
elem.currentStyle['display']);

Modernizr.addTest('displayrunin', ret == 'run-in', { aliases: ['display-runin'] });
});
define(['Modernizr', 'testAllProps'], function( Modernizr, testAllProps ) {
Modernizr.addTest('displayrunin', testAllProps('display', 'run-in'),
{ aliases: ['display-runin'] });
});
2 changes: 1 addition & 1 deletion feature-detects/css/hyphens.js
Expand Up @@ -193,7 +193,7 @@ define(['Modernizr', 'prefixes', 'createElement', 'testAllProps', 'addTest'], fu

addTest("csshyphens", function() {

if (!testAllProps('hyphens')) return false;
if (!testAllProps('hyphens', 'auto', true)) return false;

/* Chrome lies about its hyphens support so we need a more robust test
crbug.com/107111
Expand Down
2 changes: 1 addition & 1 deletion feature-detects/css/mask.js
Expand Up @@ -26,5 +26,5 @@
}
!*/
define(['Modernizr', 'testAllProps'], function( Modernizr, testAllProps ) {
Modernizr.addTest('cssmask', testAllProps('maskRepeat'));
Modernizr.addTest('cssmask', testAllProps('maskRepeat', 'repeat-x', true));
});
2 changes: 1 addition & 1 deletion feature-detects/css/overflow-scrolling.js
Expand Up @@ -11,5 +11,5 @@
}
!*/
define(['Modernizr', 'testAllProps'], function( Modernizr, testAllProps ) {
Modernizr.addTest('overflowscrolling', testAllProps('overflowScrolling'));
Modernizr.addTest('overflowscrolling', testAllProps('overflowScrolling', 'touch', true));
});
2 changes: 1 addition & 1 deletion feature-detects/css/reflections.js
Expand Up @@ -7,5 +7,5 @@
}
!*/
define(['Modernizr', 'testAllProps'], function( Modernizr, testAllProps ) {
Modernizr.addTest('cssreflections', testAllProps('boxReflect'));
Modernizr.addTest('cssreflections', testAllProps('boxReflect', 'above', true));
});
7 changes: 6 additions & 1 deletion feature-detects/css/resize.js
Expand Up @@ -13,6 +13,11 @@
}]
}
!*/
/* DOC
Test for CSS 3 UI "resize" property
*/
define(['Modernizr', 'testAllProps'], function( Modernizr, testAllProps ) {
Modernizr.addTest('cssresize', testAllProps('resize'));
Modernizr.addTest('cssresize', testAllProps('resize', 'both', true));
});
2 changes: 1 addition & 1 deletion feature-detects/css/transforms.js
Expand Up @@ -7,5 +7,5 @@
}
!*/
define(['Modernizr', 'testAllProps'], function( Modernizr, testAllProps ) {
Modernizr.addTest('csstransforms', !!testAllProps('transform'));
Modernizr.addTest('csstransforms', testAllProps('transform', 'scale(1)', true));
});
2 changes: 1 addition & 1 deletion feature-detects/css/transforms3d.js
Expand Up @@ -11,7 +11,7 @@
!*/
define(['Modernizr', 'testAllProps', 'testStyles', 'docElement'], function( Modernizr, testAllProps, testStyles, docElement ) {
Modernizr.addTest('csstransforms3d', function() {
var ret = !!testAllProps('perspective');
var ret = !!testAllProps('perspective', '1px', true);

// Webkit's 3D transforms are passed off to the browser's own graphics renderer.
// It works fine in Safari on Leopard and Snow Leopard, but not in Chrome in
Expand Down
2 changes: 1 addition & 1 deletion feature-detects/css/transitions.js
Expand Up @@ -7,5 +7,5 @@
}
!*/
define(['Modernizr', 'testAllProps'], function( Modernizr, testAllProps ) {
Modernizr.addTest('csstransitions', testAllProps('transition'));
Modernizr.addTest('csstransitions', testAllProps('transition', 'all', true));
});
3 changes: 2 additions & 1 deletion feature-detects/css/userselect.js
Expand Up @@ -12,5 +12,6 @@
}
!*/
define(['Modernizr', 'testAllProps'], function( Modernizr, testAllProps ) {
Modernizr.addTest('userselect', testAllProps('userSelect'));
//https://github.com/Modernizr/Modernizr/issues/250
Modernizr.addTest('userselect', testAllProps('userSelect', 'none', true));
});
19 changes: 11 additions & 8 deletions feature-detects/css/wrapflow.js
Expand Up @@ -3,17 +3,20 @@
"name": "CSS wrap-flow",
"property": "wrapflow",
"tags": ["css"],
"notes": [{
"name": "W3C Exclusions Spec",
"href": "http://www.w3.org/TR/css3-exclusions"
},{
"name": "Example by Adobe",
"href": "http://html.adobe.com/webstandards/cssexclusions"
}]
"notes": [
"This is a separate test from the rest of CSS Exclusions as as IE10 has just implemented this alone."
{
"name": "W3C Exclusions spec",
"href": "http://www.w3.org/TR/css3-exclusions"
},
{
"name": "Example by Adobe",
"href": "http://html.adobe.com/webstandards/cssexclusions"
}
]
}
!*/
define(['Modernizr', 'prefixed', 'docElement', 'createElement'], function( Modernizr, prefixed, docElement, createElement ) {
// Separate test for `wrap-flow` property as IE10 has just implemented this alone
Modernizr.addTest('wrapflow', function () {
var prefixedProperty = prefixed('wrapFlow');
if (!prefixedProperty)
Expand Down
9 changes: 9 additions & 0 deletions src/domToHyphenated.js
@@ -0,0 +1,9 @@
define(function() {
// Helper function for e.g. boxSizing -> box-sizing
function domToHyphenated( name ) {
return name.replace(/([A-Z])/g, function(str, m1) {
return '-' + m1.toLowerCase();
}).replace(/^ms-/, '-ms-');
}
return domToHyphenated;
});
34 changes: 34 additions & 0 deletions src/nativeTestProps.js
@@ -0,0 +1,34 @@
define(['injectElementWithStyles', 'domToHyphenated'], function ( injectElementWithStyles, domToHyphenated ) {
// Function to allow us to use native feature detection functionality if available.
// Accepts a list of property names and a single value
// Returns `undefined` if native detection not available
function nativeTestProps ( props, value ) {
var i = props.length;
// Start with the JS API: http://www.w3.org/TR/css3-conditional/#the-css-interface
if ('CSS' in window && 'supports' in window.CSS) {
// Try every prefixed variant of the property
while (i--) {
if (window.CSS.supports(domToHyphenated(props[i]), value)) {
return true;
}
}
return false;
}
// Otherwise fall back to at-rule (for FF 17 and Opera 12.x)
else if ('CSSSupportsRule' in window) {
// Build a condition string for every prefixed variant
var conditionText = [];
while (i--) {
conditionText.push('(' + domToHyphenated(props[i]) + ':' + value + ')');
}
conditionText = conditionText.join(' or ');
return injectElementWithStyles('@supports (' + conditionText + ') { #modernizr { position: absolute; } }', function( node ) {
return (window.getComputedStyle ?
getComputedStyle(node, null) :
node.currentStyle)['position'] == 'absolute';
});
}
return undefined;
}
return nativeTestProps;
});
21 changes: 19 additions & 2 deletions src/testAllProps.js
@@ -1,4 +1,21 @@
define(['ModernizrProto', 'testPropsAll'], function( ModernizrProto, testPropsAll ) {
var testAllProps = ModernizrProto.testAllProps = testPropsAll;
return testAllProps;
/**
* testAllProps determines whether a given CSS property, in some prefixed
* form, is supported by the browser. It can optionally be given a value; in
* which case testAllProps will only return true if the browser supports that
* value for the named property; this latter case will use native detection
* (via window.CSS.supports) if available. A boolean can be passed as a 3rd
* parameter to
*
* @param prop - String naming the property to test
* @param value - [optional] String of the value to test
* @param skipValueTest - [optional] Whether to skip testing that the value
* is supported when using non-native detection
* (default: false)
*/
function testAllProps (prop, value, skipValueTest) {
return testPropsAll(prop, undefined, undefined, value, skipValueTest);
}
ModernizrProto.testAllProps = testAllProps;
return testAllProps;
});
8 changes: 5 additions & 3 deletions src/testProp.js
@@ -1,9 +1,11 @@
define(['ModernizrProto', 'testProps'], function( ModernizrProto, testProps ) {
define(['ModernizrProto', 'testProps', 'is'], function( ModernizrProto, testProps, is ) {
// Modernizr.testProp() investigates whether a given style property is recognized
// Note that the property names must be provided in the camelCase variant.
// Modernizr.testProp('pointerEvents')
var testProp = ModernizrProto.testProp = function( prop ) {
return testProps([prop]);
// Also accepts optional 2nd arg, of a value to use for native feature detection, e.g.:
// Modernizr.testProp('pointerEvents', 'none')
var testProp = ModernizrProto.testProp = function( prop, value, useValue ) {
return testProps([prop], undefined, value, useValue);
};
return testProp;
});
52 changes: 45 additions & 7 deletions src/testProps.js
@@ -1,4 +1,4 @@
define(['contains', 'mStyle', 'createElement'], function( contains, mStyle, createElement ) {
define(['contains', 'mStyle', 'createElement', 'nativeTestProps', 'is'], function( contains, mStyle, createElement, nativeTestProps, is ) {
// testProps is a generic CSS / DOM property test.

// In testing support for a given CSS property, it's legit to test:
Expand All @@ -17,8 +17,19 @@ define(['contains', 'mStyle', 'createElement'], function( contains, mStyle, crea
// developing in WebKit or IE first don't end up with
// browser-specific content by accident.

function testProps( props, prefixed ) {
var afterInit;
function testProps( props, prefixed, value, skipValueTest ) {
skipValueTest = is(skipValueTest, 'undefined') ? false : skipValueTest;

// Try native detect first
if (!is(value, 'undefined')) {
var result = nativeTestProps(props, value);
if(!is(result, 'undefined')) {
return result;
}
}

// Otherwise do it properly
var afterInit, i, j, prop, before;

// If we don't have a style element, that means
// we're running async or after the core tests,
Expand All @@ -38,11 +49,38 @@ define(['contains', 'mStyle', 'createElement'], function( contains, mStyle, crea
}
}

for ( var i in props ) {
var prop = props[i];
for ( i in props ) {
prop = props[i];
before = mStyle.style[prop];

if ( !contains(prop, "-") && mStyle.style[prop] !== undefined ) {
cleanElems();
return prefixed == 'pfx' ? prop : true;

// If value to test has been passed in, do a set-and-check test.
// 0 (integer) is a valid property value, so check that `value` isn't
// undefined, rather than just checking it's truthy.
if (!skipValueTest && !is(value, 'undefined')) {

// Needs a try catch block because of old IE. This is slow, but will
// be avoided in most cases because `skipValueTest` will be used.
try {
mStyle.style[prop] = value;
} catch (e) {}

// If the property value has changed, we assume the value used is
// supported. If `value` is empty string, it'll fail here (because
// it hasn't changed), which matches how browsers have implemented
// CSS.supports()
if (mStyle.style[prop] != before) {
cleanElems();
return prefixed == 'pfx' ? prop : true;
}
}
// Otherwise just return true, or the property name if this is a
// `prefixed()` call
else {
cleanElems();
return prefixed == 'pfx' ? prop : true;
}
}
}
cleanElems();
Expand Down

0 comments on commit 8729ddc

Please sign in to comment.