diff options
author | Michał Gołębiowski-Owczarek <m.goleb@gmail.com> | 2024-11-26 00:23:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-26 00:23:19 +0100 |
commit | 640d5825df5ff223560c5690f1a268681c32f9fa (patch) | |
tree | 8122dd698b06a171a482e3bbab2bf07de39975ff /src/css/finalPropName.js | |
parent | e4b5e6227717039a9c695b12e40d3f73ffec31b0 (diff) | |
download | jquery-640d5825df5ff223560c5690f1a268681c32f9fa.tar.gz jquery-640d5825df5ff223560c5690f1a268681c32f9fa.zip |
CSS: Drop the cache in finalPropName
The `finalPropName` util caches properties detected to require a vendor
prefix. This used to cache unprefixed properties as well, but it was
reported that this logic broke accidentally during a refactor. Since
fewer & fewer properties require a vendor prefix and caching a few
basic checks likely has negligible perf benefits, opt to saving a few
bytes and remove the cache.
Closes gh-5583
Ref gh-5582
Diffstat (limited to 'src/css/finalPropName.js')
-rw-r--r-- | src/css/finalPropName.js | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/css/finalPropName.js b/src/css/finalPropName.js index b11e92394..f040e6976 100644 --- a/src/css/finalPropName.js +++ b/src/css/finalPropName.js @@ -1,8 +1,7 @@ import { document } from "../var/document.js"; var cssPrefixes = [ "Webkit", "Moz", "ms" ], - emptyStyle = document.createElement( "div" ).style, - vendorProps = {}; + emptyStyle = document.createElement( "div" ).style; // Return a vendor-prefixed property or undefined function vendorPropName( name ) { @@ -21,13 +20,8 @@ function vendorPropName( name ) { // Return a potentially-mapped vendor prefixed property export function finalPropName( name ) { - var final = vendorProps[ name ]; - - if ( final ) { - return final; - } if ( name in emptyStyle ) { return name; } - return vendorProps[ name ] = vendorPropName( name ) || name; + return vendorPropName( name ) || name; } |