forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't allow new line chars as preceding char for ::first-letter.
Because CR and LF new line chars belong to C* unicode category, but allowed unicode categories as preceding chars are P* and Z*. But in the context of WhiteSpaceCollapse::kCollapse, space and new line chars are ignored, so apply the behavior specified above only Blink::ShouldPreserveBreaks() is true. Firefox 116.0.2 have this behavior, but Safari 16.6 shows the same behavior with Chrome of before this change. This change is per https://drafts.csswg.org/css-pseudo/#first-letter-pattern. Bug: 1477217 Change-Id: I80aa6a14ecd867f864eb49a12e229e5390dd9a30 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4825211 Reviewed-by: Kent Tamura <tkent@chromium.org> Commit-Queue: Joonghun Park <pjh0718@gmail.com> Cr-Commit-Position: refs/heads/main@{#1190634}
- Loading branch information
1 parent
7460920
commit 1091403
Showing
5 changed files
with
104 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
...rty/blink/web_tests/external/wpt/css/css-pseudo/first-letter-with-preceding-new-line.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>CSS Test: ::first-letter with preceding new line</title> | ||
<link rel="author" title="Joonghun Park" href="mailto:pjh0718@gmail.com"> | ||
<link rel="match" href="reference/first-letter-with-preceding-new-line-ref.html"> | ||
<link rel="help" href="https://drafts.csswg.org/css-pseudo/#first-letter-pattern"> | ||
<meta name="assert" content="Test checks if preceding new line character is allowed or not"> | ||
<style> | ||
body { font-size: 30px; } | ||
#sample { | ||
margin: 20px; | ||
white-space: pre; | ||
} | ||
#sample::first-line { | ||
color: red; | ||
} | ||
#sample::first-letter { | ||
color: green; | ||
border: solid 1px blue; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div id="sample"> | ||
The second line. | ||
The third line. | ||
</div> | ||
</body> | ||
</html> |
20 changes: 20 additions & 0 deletions
20
...tests/external/wpt/css/css-pseudo/reference/first-letter-with-preceding-new-line-ref.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>CSS Test: ::first-letter with preceding new line</title> | ||
<style> | ||
body { font-size: 30px; } | ||
#sample { | ||
margin: 20px; | ||
white-space: pre; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div id="sample"> | ||
The second line. | ||
The third line. | ||
</div> | ||
</body> | ||
</html> |