Forced the test suite into standards mode. Fixed some issues with how opacity was handled in IE. Fixed a number of IE fx bugs.
This commit is contained in:
parent
ab2d10c6d6
commit
83b43a1e92
3 changed files with 24 additions and 21 deletions
|
@ -1,7 +1,9 @@
|
||||||
<html>
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
|
||||||
<head>
|
<head>
|
||||||
<title>Animation Test Suite</title>
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
<script src="../dist/jquery.js"></script>
|
<title>Animation Test Suite</title>
|
||||||
|
<script src="../dist/jquery.js"></script>
|
||||||
<style>
|
<style>
|
||||||
div#tests h4 {
|
div#tests h4 {
|
||||||
background: red;
|
background: red;
|
||||||
|
@ -232,8 +234,9 @@ $(document).ready(function(){
|
||||||
var cur_o = jQuery.attr(this.style, "opacity");
|
var cur_o = jQuery.attr(this.style, "opacity");
|
||||||
if ( cur_o !== "" ) cur_o = parseFloat( cur_o );
|
if ( cur_o !== "" ) cur_o = parseFloat( cur_o );
|
||||||
|
|
||||||
if ( (t_o == "hide"||t_o == "show") && cur_o != f_o )
|
if ( (t_o == "hide"||t_o == "show") && cur_o != f_o ) {
|
||||||
return msg(this, "Opacity not reset to " + f_o + ": " + cur_o);
|
return msg(this, "Opacity not reset to " + f_o + ": " + cur_o);
|
||||||
|
}
|
||||||
|
|
||||||
if ( t_w == "hide" && this.style.display != "none" )
|
if ( t_w == "hide" && this.style.display != "none" )
|
||||||
return msg(this, "Hiding, display not none: " + this.style.display);
|
return msg(this, "Hiding, display not none: " + this.style.display);
|
||||||
|
|
|
@ -462,7 +462,7 @@ jQuery.extend({
|
||||||
if ( !elem.orig ) elem.orig = {};
|
if ( !elem.orig ) elem.orig = {};
|
||||||
|
|
||||||
// Remember where we started, so that we can go back to it later
|
// Remember where we started, so that we can go back to it later
|
||||||
elem.orig[prop] = elem.style[prop];
|
elem.orig[prop] = jQuery.attr( elem.style, prop );
|
||||||
|
|
||||||
options.show = true;
|
options.show = true;
|
||||||
|
|
||||||
|
@ -479,7 +479,7 @@ jQuery.extend({
|
||||||
if ( !elem.orig ) elem.orig = {};
|
if ( !elem.orig ) elem.orig = {};
|
||||||
|
|
||||||
// Remember where we started, so that we can go back to it later
|
// Remember where we started, so that we can go back to it later
|
||||||
elem.orig[prop] = elem.style[prop];
|
elem.orig[prop] = jQuery.attr( elem.style, prop );
|
||||||
|
|
||||||
options.hide = true;
|
options.hide = true;
|
||||||
|
|
||||||
|
@ -492,7 +492,7 @@ jQuery.extend({
|
||||||
if ( !elem.orig ) elem.orig = {};
|
if ( !elem.orig ) elem.orig = {};
|
||||||
|
|
||||||
// Remember where we started, so that we can go back to it later
|
// Remember where we started, so that we can go back to it later
|
||||||
elem.orig[prop] = this.style[prop];
|
elem.orig[prop] = jQuery.attr( elem.style, prop );
|
||||||
|
|
||||||
if(oldDisplay == "none") {
|
if(oldDisplay == "none") {
|
||||||
options.show = true;
|
options.show = true;
|
||||||
|
|
28
src/jquery/jquery.js
vendored
28
src/jquery/jquery.js
vendored
|
@ -1402,12 +1402,12 @@ jQuery.extend({
|
||||||
|
|
||||||
curCSS: function(elem, prop, force) {
|
curCSS: function(elem, prop, force) {
|
||||||
var ret;
|
var ret;
|
||||||
|
|
||||||
if (prop == "opacity" && jQuery.browser.msie)
|
if (prop == "opacity" && jQuery.browser.msie)
|
||||||
return jQuery.attr(elem.style, "opacity");
|
return jQuery.attr(elem.style, "opacity");
|
||||||
|
|
||||||
if (prop == "float" || prop == "cssFloat")
|
if (prop == "float" || prop == "cssFloat")
|
||||||
prop = jQuery.browser.msie ? "styleFloat" : "cssFloat";
|
prop = jQuery.browser.msie ? "styleFloat" : "cssFloat";
|
||||||
|
|
||||||
if (!force && elem.style[prop])
|
if (!force && elem.style[prop])
|
||||||
ret = elem.style[prop];
|
ret = elem.style[prop];
|
||||||
|
@ -1431,10 +1431,8 @@ jQuery.extend({
|
||||||
});
|
});
|
||||||
|
|
||||||
} else if (elem.currentStyle) {
|
} else if (elem.currentStyle) {
|
||||||
|
|
||||||
var newProp = prop.replace(/\-(\w)/g,function(m,c){return c.toUpperCase();});
|
var newProp = prop.replace(/\-(\w)/g,function(m,c){return c.toUpperCase();});
|
||||||
ret = elem.currentStyle[prop] || elem.currentStyle[newProp];
|
ret = elem.currentStyle[prop] || elem.currentStyle[newProp];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -1527,18 +1525,20 @@ jQuery.extend({
|
||||||
};
|
};
|
||||||
|
|
||||||
// IE actually uses filters for opacity ... elem is actually elem.style
|
// IE actually uses filters for opacity ... elem is actually elem.style
|
||||||
if ( name == "opacity" && jQuery.browser.msie && value != undefined ) {
|
if ( name == "opacity" && jQuery.browser.msie ) {
|
||||||
// IE has trouble with opacity if it does not have layout
|
if ( value != undefined ) {
|
||||||
// Force it by setting the zoom level
|
// IE has trouble with opacity if it does not have layout
|
||||||
elem.zoom = 1;
|
// Force it by setting the zoom level
|
||||||
|
elem.zoom = 1;
|
||||||
|
|
||||||
// Set the alpha filter to set the opacity
|
// Set the alpha filter to set the opacity
|
||||||
return elem.filter = elem.filter.replace(/alpha\([^\)]*\)/gi,"") +
|
elem.filter = (elem.filter || "").replace(/alpha\([^)]*\)/,"") +
|
||||||
( value == 1 ? "" : "alpha(opacity=" + value * 100 + ")" );
|
(parseFloat(value).toString() == "NaN" ? "" : "alpha(opacity=" + value * 100 + ")");
|
||||||
|
}
|
||||||
|
|
||||||
} else if ( name == "opacity" && jQuery.browser.msie )
|
|
||||||
return elem.filter ?
|
return elem.filter ?
|
||||||
parseFloat( elem.filter.match(/alpha\(opacity=(.*)\)/)[1] ) / 100 : 1;
|
(parseFloat( elem.filter.match(/opacity=([^)]*)/)[1] ) / 100).toString() : "";
|
||||||
|
}
|
||||||
|
|
||||||
// Certain attributes only work when accessed via the old DOM 0 way
|
// Certain attributes only work when accessed via the old DOM 0 way
|
||||||
if ( fix[name] ) {
|
if ( fix[name] ) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue