mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
CSS: Justify use of rtrim on CSS property values
CSS does not acknowledge carriage return or form feed characters as whitespace but it does replace them with whitespace, making it acceptable to use `rtrim`. Closes gh-4956
This commit is contained in:
parent
5f4d449aa8
commit
655c0ed5e2
@ -16,6 +16,12 @@ function curCSS( elem, name, computed ) {
|
||||
|
||||
// trim whitespace for custom property (issue gh-4926)
|
||||
if ( isCustomProp ) {
|
||||
|
||||
// rtrim 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( rtrim, "$1" );
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user