Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit655c0ed

Browse files
authored
CSS: Justify use of rtrim on CSS property values
CSS does not acknowledge carriage return or form feed charactersas whitespace but it does replace them with whitespace, making itacceptable to use `rtrim`.Closesgh-4956
1 parent5f4d449 commit655c0ed

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

‎src/css/curCSS.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ function curCSS( elem, name, computed ) {
1616

1717
// trim whitespace for custom property (issue gh-4926)
1818
if(isCustomProp){
19+
20+
// rtrim treats U+000D CARRIAGE RETURN and U+000C FORM FEED
21+
// as whitespace while CSS does not, but this is not a problem
22+
// because CSS preprocessing replaces them with U+000A LINE FEED
23+
// (which *is* CSS whitespace)
24+
// https://www.w3.org/TR/css-syntax-3/#input-preprocessing
1925
ret=ret.replace(rtrim,"$1");
2026
}
2127

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp