Skip to content

Commit

Permalink
Fix #22, feature detect instead
Browse files Browse the repository at this point in the history
  • Loading branch information
codler committed Feb 23, 2013
1 parent 86380b1 commit 5a00fea
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 29 deletions.
6 changes: 5 additions & 1 deletion README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ If you don't want the script to automatically load and parse then you could set

## Tests

This script has been tested in <code>IE 9</code>, <code>FF</code>, <code>Chrome</code>, <code>Safari</code>, <code>Opera</code> on windows
This script has been tested in <code>IE 9-10</code>, <code>FF</code>, <code>Webkit</code>

<http://jsfiddle.net/UmquE/>

Expand All @@ -74,6 +74,10 @@ I appreciate all feedback, thanks! If you would like to donate you can send to t

## Change log ##

2013-02-23 - **v3.3**

* Fix for jQuery 1.9 ([codler](https://github.com/codler) [#22](https://github.com/codler/jQuery-Css3-Finalize/issues/22))

2012-11-30 - **v3.2**

* Fix detect shorthand properties in webkit. ([codler](https://github.com/codler) [#20](https://github.com/codler/jQuery-Css3-Finalize/issues/20))
Expand Down
2 changes: 1 addition & 1 deletion build/options.bkp
Original file line number Diff line number Diff line change
@@ -1 +1 @@
jquery:1.7.1
jquery:1.8.3
2 changes: 1 addition & 1 deletion build/options.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
jquery:1.8.3
jquery:1.9.1
4 changes: 2 additions & 2 deletions build/versions.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
js:jquery:1.8.3:jquery-1.8.3.min.js
js:css3finalize:3.1:jquery.css3finalize-v3.x.min.js
js:jquery:1.9.1:jquery-1.9.1.min.js
js:css3finalize:3.2:jquery.css3finalize-v3.x.min.js
rar:kirby:0.7:kirby.rar
php:smush:1.0:smush.php
php:fetch_url:1.1:fetch_url.class.php
Expand Down
19 changes: 10 additions & 9 deletions jquery.css3finalize.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*! CSS3 Finalize - v3.2 - 2012-11-30 - Automatically add vendor prefixes.
/*! CSS3 Finalize - v3.3 - 2013-02-23 - Automatically add vendor prefixes.
* https://github.com/codler/jQuery-Css3-Finalize
* Copyright (c) 2012 Han Lin Yap http://yap.nu; http://creativecommons.org/licenses/by-sa/3.0/ */
* Copyright (c) 2013 Han Lin Yap http://yap.nu; http://creativecommons.org/licenses/by-sa/3.0/ */
(function ($) {
// Prevent to read twice
if ($.cssFinalize) {
Expand All @@ -27,7 +27,8 @@

$.cssFinalize = function(options) {
var div = document.createElement('div');

div.style.cssText = 'background-image:linear-gradient(#9f9, white);';

options = $.extend({}, $.cssFinalizeSetup, options);

var deCamelCase = function(str) {
Expand Down Expand Up @@ -67,7 +68,7 @@
}

// IE9 do have transform but the code above didnt detect it so I added manually
if (currentPrefix == 'ms' && $.browser.version == 9) {
if (currentPrefix == 'ms' && supportRules.indexOf('transform') === -1) {
supportRules.push('transform');
supportRules.push('transform-origin');
} else if (currentPrefix == 'webkit') {
Expand Down Expand Up @@ -344,8 +345,8 @@
}

if (property == 'display') {
// flex
if (currentPrefix == 'ms' && $.browser.version == 10) {
// flex - Convert newer standard to IE compability
if (currentPrefix == 'ms' && 'msFlexWrap' in div.style) {
if (value.indexOf('flex') === 0) {
return '-ms-flexbox';
}
Expand All @@ -356,10 +357,10 @@

if (value.indexOf('grid') === 0 ||
value.indexOf('inline-grid') === 0 ||
// Old
// Old - IE10 - http://www.w3.org/TR/2012/WD-css3-flexbox-20120322/
value.indexOf('flexbox') === 0 ||
value.indexOf('inline-flexbox') === 0 ||
// Editor’s Draft, 13th August 2012 - http://dev.w3.org/csswg/css3-flexbox/
// W3C Candidate Recommendation, 18 September 2012 - http://www.w3.org/TR/2012/CR-css3-flexbox-20120918/
value.indexOf('flex') === 0 ||
value.indexOf('inline-flex') === 0
) {
Expand All @@ -372,7 +373,7 @@
if (value.indexOf('linear-gradient') === 0) {
// Only for IE9 - border-radius + gradient bug
// http://stackoverflow.com/questions/4692686/ie9-border-radius-and-background-gradient-bleeding
if (currentPrefix == 'ms' && $.browser.version == 9) {
if (currentPrefix == 'ms' && div.style.backgroundImage.indexOf('gradient') === -1) {
// Example
// value = linear-gradient(rgba(0, 0, 0, 1), rgba(0, 0, 0, .5))
var da = value.replace(/^linear-gradient\s?\(\s?(.*?)\s?\)$/, '$1'),
Expand Down
6 changes: 3 additions & 3 deletions jquery.css3finalize.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions test/libs/jquery-1.8.3.min.js

This file was deleted.

5 changes: 5 additions & 0 deletions test/libs/jquery-1.9.1.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 5a00fea

Please sign in to comment.