CSS: Remove the opacity CSS hook

The consequence is `.css( "opacity" )` will now return an empty string for
detached elements in standard-compliant browsers and "1" in IE & the legacy
Edge. That behavior is shared by most other CSS properties which we're not
normalizing either.

Closes gh-4593
This commit is contained in:
Michał Gołębiowski-Owczarek 2020-01-21 14:11:06 +01:00 committed by GitHub
parent 89a18de64c
commit 865469f5e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -185,18 +185,7 @@ jQuery.extend( {
// Add in style property hooks for overriding the default
// behavior of getting and setting a style property
cssHooks: {
opacity: {
get: function( elem, computed ) {
if ( computed ) {
// We should always get a number back from opacity
var ret = curCSS( elem, "opacity" );
return ret === "" ? "1" : ret;
}
}
}
},
cssHooks: {},
// Get and set the style property on a DOM Node
style: function( elem, name, value, extra ) {