diff options
| author | 2024-04-23 00:37:58 -0400 | |
|---|---|---|
| committer | 2024-04-23 00:37:58 -0400 | |
| commit | 9b0e86a8e74768c4fe848fb5ce8d754292db4e3e (patch) | |
| tree | cfd424be8ecb68357e6e572033f08bc534bf724f /npm_assets/node_modules/jquery/src/css | |
| parent | 393aa58f2c5afd51f92fd9bd4b6dfd0dc90cea41 (diff) | |
New upstream version 8.3.0.upstream/8.3.0upstream
Diffstat (limited to 'npm_assets/node_modules/jquery/src/css')
4 files changed, 47 insertions, 5 deletions
diff --git a/npm_assets/node_modules/jquery/src/css/curCSS.js b/npm_assets/node_modules/jquery/src/css/curCSS.js index 98a594a..cde40b6 100644 --- a/npm_assets/node_modules/jquery/src/css/curCSS.js +++ b/npm_assets/node_modules/jquery/src/css/curCSS.js @@ -4,13 +4,17 @@ define( [ "./var/rboxStyle", "./var/rnumnonpx", "./var/getStyles", + "./var/rcustomProp", + "../var/rtrimCSS", "./support" -], function( jQuery, isAttached, rboxStyle, rnumnonpx, getStyles, support ) { +], function( jQuery, isAttached, rboxStyle, rnumnonpx, getStyles, + rcustomProp, rtrimCSS, support ) { "use strict"; function curCSS( elem, name, computed ) { var width, minWidth, maxWidth, ret, + isCustomProp = rcustomProp.test( name ), // Support: Firefox 51+ // Retrieving style before computed somehow @@ -21,11 +25,42 @@ function curCSS( elem, name, computed ) { computed = computed || getStyles( elem ); // getPropertyValue is needed for: - // .css('filter') (IE 9 only, #12537) - // .css('--customProperty) (#3144) + // .css('filter') (IE 9 only, trac-12537) + // .css('--customProperty) (gh-3144) if ( computed ) { + + // Support: IE <=9 - 11+ + // IE only supports `"float"` in `getPropertyValue`; in computed styles + // it's only available as `"cssFloat"`. We no longer modify properties + // sent to `.css()` apart from camelCasing, so we need to check both. + // Normally, this would create difference in behavior: if + // `getPropertyValue` returns an empty string, the value returned + // by `.css()` would be `undefined`. This is usually the case for + // disconnected elements. However, in IE even disconnected elements + // with no styles return `"none"` for `getPropertyValue( "float" )` ret = computed.getPropertyValue( name ) || computed[ name ]; + if ( isCustomProp && ret ) { + + // Support: Firefox 105+, Chrome <=105+ + // Spec requires trimming whitespace for custom properties (gh-4926). + // Firefox only trims leading whitespace. Chrome just collapses + // both leading & trailing whitespace to a single space. + // + // Fall back to `undefined` if empty string returned. + // This collapses a missing definition with property defined + // and set to an empty string but there's no standard API + // allowing us to differentiate them without a performance penalty + // and returning `undefined` aligns with older jQuery. + // + // rtrimCSS treats U+000D CARRIAGE RETURN and U+000C FORM FEED + // as whitespace while CSS does not, but this is not a problem + // because CSS preprocessing replaces them with U+000A LINE FEED + // (which *is* CSS whitespace) + // https://www.w3.org/TR/css-syntax-3/#input-preprocessing + ret = ret.replace( rtrimCSS, "$1" ) || undefined; + } + if ( ret === "" && !isAttached( elem ) ) { ret = jQuery.style( elem, name ); } diff --git a/npm_assets/node_modules/jquery/src/css/support.js b/npm_assets/node_modules/jquery/src/css/support.js index 3a9d25c..9958f60 100644 --- a/npm_assets/node_modules/jquery/src/css/support.js +++ b/npm_assets/node_modules/jquery/src/css/support.js @@ -70,7 +70,7 @@ define( [ } // Support: IE <=9 - 11 only - // Style of cloned element affects source element cloned (#8908) + // Style of cloned element affects source element cloned (trac-8908) div.style.backgroundClip = "content-box"; div.cloneNode( true ).style.backgroundClip = ""; support.clearCloneStyle = div.style.backgroundClip === "content-box"; diff --git a/npm_assets/node_modules/jquery/src/css/var/getStyles.js b/npm_assets/node_modules/jquery/src/css/var/getStyles.js index 0b893ac..a2d5f3d 100644 --- a/npm_assets/node_modules/jquery/src/css/var/getStyles.js +++ b/npm_assets/node_modules/jquery/src/css/var/getStyles.js @@ -3,7 +3,7 @@ define( function() { return function( elem ) { - // Support: IE <=11 only, Firefox <=30 (#15098, #14150) + // Support: IE <=11 only, Firefox <=30 (trac-15098, trac-14150) // IE throws on elements created in popups // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" var view = elem.ownerDocument.defaultView; diff --git a/npm_assets/node_modules/jquery/src/css/var/rcustomProp.js b/npm_assets/node_modules/jquery/src/css/var/rcustomProp.js new file mode 100644 index 0000000..6f01b85 --- /dev/null +++ b/npm_assets/node_modules/jquery/src/css/var/rcustomProp.js @@ -0,0 +1,7 @@ +define( function() { + +"use strict"; + +return /^--/; + +} ); |
