Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

Commit 83a250f

Browse files
committed
Adds test for unprefixed perspective property."
1 parent 17ce0a7 commit 83a250f

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

css/structure/jquery.mobile.transition.turn.css

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
*/
77

88
.viewport-turn {
9-
-webkit-perspective: 1000;
10-
-moz-perspective: 1000;
11-
perspective: 1000;
9+
-webkit-perspective: 200px;
10+
-moz-perspective: 200px;
11+
-ms-perspective: 200px;
12+
perspective: 200px;
1213
position: absolute;
1314
}
1415
.turn {

js/jquery.mobile.support.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function propExists( prop ) {
2020

2121
var fakeBody = $( "<body>" ).prependTo( "html" ),
2222
fbCSS = fakeBody[ 0 ].style,
23-
vendors = [ "Webkit", "Moz", "O" ],
23+
vendors = [ "Webkit", "Moz", "O", "ms", "" ],
2424
webos = "palmGetResource" in window, //only used to rule out scrollTop
2525
opera = window.opera,
2626
operamini = window.operamini && ({}).toString.call( window.operamini ) === "[object OperaMini]",
@@ -33,20 +33,24 @@ function validStyle( prop, value, check_vend ) {
3333
return txt.charAt( 0 ).toUpperCase() + txt.substr( 1 );
3434
},
3535
vend_pref = function( vend ) {
36-
return "-" + vend.charAt( 0 ).toLowerCase() + vend.substr( 1 ) + "-";
36+
if( vend === "" ) {
37+
return "";
38+
} else {
39+
return "-" + vend.charAt( 0 ).toLowerCase() + vend.substr( 1 ) + "-";
40+
}
3741
},
3842
check_style = function( vend ) {
3943
var vend_prop = vend_pref( vend ) + prop + ": " + value + ";",
4044
uc_vend = uc( vend ),
41-
propStyle = uc_vend + uc( prop );
45+
propStyle = uc_vend + ( uc_vend === "" ? prop : uc( prop ) );
4246

4347
div.setAttribute( "style", vend_prop );
4448

4549
if ( !!div.style[ propStyle ] ) {
4650
ret = true;
4751
}
4852
},
49-
check_vends = check_vend ? [ check_vend ] : vendors,
53+
check_vends = check_vend ? check_vend : vendors,
5054
ret;
5155

5256
for( var i = 0; i < check_vends.length; i++ ) {
@@ -55,10 +59,10 @@ function validStyle( prop, value, check_vend ) {
5559
return !!ret;
5660
}
5761

58-
// Thanks to Modernizr src for this test idea. `perspective` check is limited to Moz to prevent a false positive for 3D transforms on Android.
62+
// Thanks to Modernizr src for this test idea. `perspective` check is limited to Moz/unprefixed to prevent a false positive for 3D transforms on Android.
5963
function transform3dTest() {
6064
var prop = "transform-3d";
61-
return validStyle( 'perspective', '10px', 'moz' ) || $.mobile.media( "(-" + vendors.join( "-" + prop + "),(-" ) + "-" + prop + "),(" + prop + ")" );
65+
return validStyle( 'perspective', '10px', ['moz', ''] ) || $.mobile.media( "(-" + vendors.join( "-" + prop + "),(-" ) + "-" + prop + "),(" + prop + ")" );
6266
}
6367

6468
// Test for dynamic-updating base tag support ( allows us to avoid href,src attr rewriting )

0 commit comments

Comments
 (0)