Skip to content

Commit e0fb30f

Browse files
tstarlingjenkins-bot
authored andcommitted
Update all referenced specs
A systematic update of all referenced specifications to the latest published version. Change-Id: I38eafd7ee0de8c6a8ad7dfa8e5b1e021c060e2d2
1 parent fe79913 commit e0fb30f

21 files changed

+263
-169
lines changed

HISTORY.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,44 @@
11
# Release History
22

33
## css-sanitizer x.x.x (not yet released)
4+
5+
New modules:
46
* Add support for CSS Box Sizing Level 4 (as seen in draft from 2025-02-24)
57
- values: stretch, fit-content, and contain;
68
- properties: aspect-ratio, contain-intrinsic-* (size, width, height,
79
block-size, inline-size), min-intrinsic-size;
810
* Update Color to Level 4 (2025-04-24)
911
* Update Values and Units to Level 4 (WD 2024-03-12)
10-
* Update Display Level 3 to CR 2023-03-30
1112
* Add support for Ruby Level 1 (WD 2022-12-31)
1213
* Add support for Transforms Level 2 (WD 2021-11-09)
1314
* Update Overflow Level 3 to WD 2023-03-29 and add support for Overflow Level 4
1415
(WD 2023-03-21)
1516
* Add support for Lists and Counters Level 3 (WD 2020-11-17) and Counter Styles
1617
Level 3 (WD 2021-07-27)
1718

19+
Substantive updates:
20+
* Update Align Level 3 to WD 2025-03-11
21+
* Update Backgrounds Level 3 to CRD 2024-03-11
22+
* Update Display Level 3 to CR 2023-03-30
23+
* Update Compositing Level 1 to CRD 2024-03-21
24+
* Update Images Level 3 to CRD 2023-12-18
25+
* Update Masking Level 1 to CRD 2021-08-05
26+
* Update Paged Media Level 3 to WD 2023-09-14
27+
* Update Position Level 3 to WD 2025-03-11
28+
* Update Pseudo-Elements Level 4 to WD 2022-12-30
29+
* Update Shapes Level 1 to CRD 2022-11-15
30+
* Update User Interface Level 4 to WD 2021-03-16
31+
32+
Documentation-only updates:
33+
* Update Animations Level 1 to WD 2023-03-02
34+
* Update Cascade Level 4 to CR 2022-01-13
35+
* Update Easing Level 1 to CRD 2023-02-13
36+
* Update Grid Level 1 to CRD 2025-03-26
37+
* Update Multi-column Layout Level 1 to CR 2024-05-16
38+
* Update Syntax Level 3 to CRD 2021-12-24
39+
* Update Text Level 3 to CRD 2024-09-30
40+
* Update Text Decoration Level 3 to CRD 2022-05-05
41+
1842
## css-sanitizer 5.5.0 (2025-01-27)
1943
* Ensure <-token and identifiers are always separated as a security
2044
paranoia measure

README.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -61,42 +61,42 @@ The library follows the following grammar specifications:
6161

6262
The sanitizer recognizes the following CSS modules:
6363

64-
* [Align Level 3, 2018-12-06](https://www.w3.org/TR/2018/WD-css-align-3-20181206/)
65-
* [Animations Level 1, 2018-10-11](https://www.w3.org/TR/2018/WD-css-animations-1-20181011/)
66-
* [Backgrounds Level 3, 2017-10-17](https://www.w3.org/TR/2017/CR-css-backgrounds-3-20171017/)
64+
* [Align Level 3, 2025-03-11](https://www.w3.org/TR/2025/WD-css-align-3-20250311/)
65+
* [Animations Level 1, 2023-03-02](https://www.w3.org/TR/2023/WD-css-animations-1-20230302/)
66+
* [Backgrounds Level 3, 2024-03-11](https://www.w3.org/TR/2024/CRD-css-backgrounds-3-20240311/)
6767
* [Break Level 3, 2018-12-04](https://www.w3.org/TR/2018/CR-css-break-3-20181204/)
68-
* [Cascade Level 4, 2018-08-28](https://www.w3.org/TR/2018/CR-css-cascade-4-20180828)
68+
* [Cascade Level 4, 2022-01-13](https://www.w3.org/TR/2022/CR-css-cascade-4-20220113/)
6969
* [Color Level 4, 2025-04-24](https://www.w3.org/TR/2025/CRD-css-color-4-20250424)
70-
* [Compositing Level 1, 2015-01-13](https://www.w3.org/TR/2015/CR-compositing-1-20150113/)
70+
* [Compositing Level 1, 2024-03-21](https://www.w3.org/TR/2024/CRD-compositing-1-20240321/)
7171
* [Counter Styles Level 3, 2021-07-27](https://www.w3.org/TR/2021/CR-css-counter-styles-3-20210727/)
7272
* [CSS Level 2, 2011-06-07](https://www.w3.org/TR/2011/REC-CSS2-20110607/)
7373
* [Display Level 3, 2023-03-30](https://www.w3.org/TR/2023/CR-css-display-3-20230330/)
74+
* [Easing Level 1, 2023-02-13](https://www.w3.org/TR/2023/CRD-css-easing-1-20230213/)
7475
* [Filter Effects Level 1, 2018-12-18](https://www.w3.org/TR/2018/WD-filter-effects-1-20181218)
7576
* [Flexbox Level 1, 2018-11-19](https://www.w3.org/TR/2018/CR-css-flexbox-1-20181119)
7677
* [Fonts Level 3, 2018-09-20](https://www.w3.org/TR/2018/REC-css-fonts-3-20180920)
77-
* [Grid Level 1, 2017-12-14](https://www.w3.org/TR/2017/CR-css-grid-1-20171214/)
78-
* [Images Level 3, 2019-10-10](https://www.w3.org/TR/2019/CR-css-images-3-20191010)
78+
* [Grid Level 1, 2025-03-26](https://www.w3.org/TR/2025/CRD-css-grid-1-20250326/)
79+
* [Images Level 3, 2023-12-18](https://www.w3.org/TR/2023/CRD-css-images-3-20231218/)
7980
* [Lists and Counters Level 3, 2020-11-17](https://www.w3.org/TR/2020/WD-css-lists-3-20201117/)
8081
* [Logical Properties and Values Level 1, 2018-08-27](https://www.w3.org/TR/2018/WD-css-logical-1-20180827/)
81-
* [Masking Level 1, 2014-08-26](https://www.w3.org/TR/2014/CR-css-masking-1-20140826/)
82-
* [Multicol Level 1, 2019-10-15](https://www.w3.org/TR/2019/WD-css-multicol-1-20191015)
82+
* [Masking Level 1, 2021-08-05](https://www.w3.org/TR/2021/CRD-css-masking-1-20210805/)
83+
* [Multicol Level 1, 2019-10-15](https://www.w3.org/TR/2024/CR-css-multicol-1-20240516/)
8384
* [Overflow Level 3, 2023-03-29](https://www.w3.org/TR/2023/WD-css-overflow-3-20230329/)
8485
* [Overflow Level 4, 2023-03-21](https://www.w3.org/TR/2023/WD-css-overflow-4-20230321/)
85-
* [Page Level 3, 2018-10-18](https://www.w3.org/TR/2018/WD-css-page-3-20181018)
86-
* [Position Level 3, 2016-05-17](https://www.w3.org/TR/2016/WD-css-position-3-20160517/)
86+
* [Page Level 3, 2023-09-14](https://www.w3.org/TR/2023/WD-css-page-3-20230914/)
87+
* [Position Level 3, 2025-03-11](https://www.w3.org/TR/2025/WD-css-position-3-20250311/)
88+
* [Pseudo-Elements Level 4, 2022-12-30](https://www.w3.org/TR/2022/WD-css-pseudo-4-20221230/)
8789
* [Ruby Level 1, 2022-12-31](https://www.w3.org/TR/2022/WD-css-ruby-1-20221231/)
88-
* [Selectors Level 4, 2019-02-25](https://www.w3.org/TR/2019/WD-css-pseudo-4-20190225/)
89-
* [Shapes Level 1, 2014-03-20](https://www.w3.org/TR/2014/CR-css-shapes-1-20140320/)
90+
* [Shapes Level 1, 2022-11-15](https://www.w3.org/TR/2022/CRD-css-shapes-1-20221115/)
9091
* [Sizing Level 3, 2021-12-17](https://www.w3.org/TR/2021/WD-css-sizing-3-20211217/)
9192
* [Sizing Level 4, 2025-02-24](https://drafts.csswg.org/css-sizing-4/)
92-
* [Text Level 3, 2019-11-13](https://www.w3.org/TR/2019/WD-css-text-3-20191113)
93-
* [Text Decorations Level 3, 2019-08-13](https://www.w3.org/TR/2019/CR-css-text-decor-3-20190813)
94-
* [Easing Level 1, 2019-04-30](https://www.w3.org/TR/2019/CR-css-easing-1-20190430/)
93+
* [Text Level 3, 2024-09-30](https://www.w3.org/TR/2024/CRD-css-text-3-20240930/)
94+
* [Text Decorations Level 3, 2022-05-05](https://www.w3.org/TR/2022/CRD-css-text-decor-3-20220505/)
9595
* [Transforms Level 1, 2019-02-14](https://www.w3.org/TR/2019/CR-css-transforms-1-20190214)
9696
* [Transforms Level 2, 2021-11-09](https://www.w3.org/TR/2021/WD-css-transforms-2-20211109/)
9797
* [Transitions Level 1, 2018-10-11](https://www.w3.org/TR/2018/WD-css-transitions-1-20181011)
9898
* [UI 3 Level 3, 2018-06-21](https://www.w3.org/TR/2018/REC-css-ui-3-20180621)
99-
* [UI 4 Level 4, 2020-01-02](https://www.w3.org/TR/2020/WD-css-ui-4-20200102)
99+
* [UI 4 Level 4, 2021-03-16](https://www.w3.org/TR/2021/WD-css-ui-4-20210316/)
100100
* [Writing Modes Level 4, 2019-07-30](https://www.w3.org/TR/2019/CR-css-writing-modes-4-20190730)
101101

102102
And also,
@@ -181,7 +181,7 @@ Additional release history is in [`HISTORY.md`](./HISTORY.md).
181181
---
182182
[Latest Stable Version]: https://poser.pugx.org/wikimedia/css-sanitizer/v/stable.svg
183183
[License]: https://poser.pugx.org/wikimedia/css-sanitizer/license.svg
184-
[CSSSYN]: https://www.w3.org/TR/2019/CR-css-syntax-3-20190716/
184+
[CSSSYN]: https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/
185185
[CSSVAL]: https://www.w3.org/TR/2024/WD-css-values-4-20240312/
186186
[CSSSEL]: https://www.w3.org/TR/2018/REC-selectors-3-20181106/
187187
[CSSWORK]: https://www.w3.org/Style/CSS/current-work

src/Grammar/AnythingMatcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* Matcher that matches anything except bad strings, bad urls, and unmatched
1818
* left-paren, left-brace, or left-bracket.
1919
* @warning Be very careful using this!
20-
* @see https://www.w3.org/TR/2019/CR-css-syntax-3-20190716/#any-value
20+
* @see https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#any-value
2121
*/
2222
class AnythingMatcher extends Matcher {
2323

src/Grammar/Matcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* object that will determine whether a ComponentValueList actually matches
2222
* this grammar.
2323
*
24-
* [SYN3]: https://www.w3.org/TR/2019/CR-css-syntax-3-20190716/
24+
* [SYN3]: https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/
2525
* [VAL4]: https://www.w3.org/TR/2024/WD-css-values-4-20240312/
2626
*/
2727
abstract class Matcher {

src/Grammar/MatcherFactory.php

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public function customIdent( array $exclude = [] ) {
116116
$exclude = array_merge( [
117117
// https://www.w3.org/TR/2024/WD-css-values-4-20240312/#common-keywords
118118
'initial', 'inherit', 'unset', 'default',
119-
// https://www.w3.org/TR/2018/CR-css-cascade-4-20180828/#all-shorthand
119+
// https://www.w3.org/TR/2022/CR-css-cascade-4-20220113/#all-shorthand
120120
'revert'
121121
], $exclude );
122122
return new TokenMatcher( Token::T_IDENT, static function ( Token $t ) use ( $exclude ) {
@@ -167,7 +167,7 @@ public function cssWideKeywords() {
167167
??= new KeywordMatcher( [
168168
// https://www.w3.org/TR/2024/WD-css-values-4-20240312/#common-keywords
169169
'initial', 'inherit', 'unset',
170-
// added by https://www.w3.org/TR/2018/CR-css-cascade-4-20180828/#all-shorthand
170+
// added by https://www.w3.org/TR/2022/CR-css-cascade-4-20220113/#all-shorthand
171171
'revert'
172172
] );
173173
}
@@ -774,14 +774,14 @@ public function color() {
774774

775775
/**
776776
* Matcher for an image value
777-
* @see https://www.w3.org/TR/2019/CR-css-images-3-20191010/#image-values
777+
* @see https://www.w3.org/TR/2023/CRD-css-images-3-20231218/#image-values
778778
* @return Matcher
779779
*/
780780
public function image() {
781781
if ( !isset( $this->cache[__METHOD__] ) ) {
782-
// https://www.w3.org/TR/2019/CR-css-images-3-20191010/#gradients
782+
// https://www.w3.org/TR/2023/CRD-css-images-3-20231218/#gradients
783783
$c = $this->comma();
784-
$colorStop = UnorderedGroup::allOf( [
784+
$colorStop = new Juxtaposition( [
785785
$this->color(),
786786
Quantifier::optional( $this->lengthPercentage() ),
787787
] );
@@ -891,7 +891,7 @@ public function position() {
891891

892892
/**
893893
* Matcher for a bg-position value
894-
* @see https://www.w3.org/TR/2017/CR-css-backgrounds-3-20171017/#typedef-bg-position
894+
* @see https://www.w3.org/TR/2024/CRD-css-backgrounds-3-20240311/#typedef-bg-position
895895
* @return Matcher
896896
*/
897897
public function bgPosition() {
@@ -1135,7 +1135,7 @@ static function ( ComponentValueList $list, GrammarMatch $match, array $options
11351135

11361136
/**
11371137
* Matcher for single easing functions from CSS Easing Functions Level 1
1138-
* @see https://www.w3.org/TR/2019/CR-css-easing-1-20190430/#typedef-easing-function
1138+
* @see https://www.w3.org/TR/2023/CRD-css-easing-1-20230213/#typedef-easing-function
11391139
* @return Matcher
11401140
*/
11411141
public function cssSingleEasingFunction() {
@@ -1486,7 +1486,7 @@ public function cssAttrib() {
14861486
* Although this actually only matches the pseudo-selectors defined in the
14871487
* following sources:
14881488
* - https://www.w3.org/TR/2018/REC-selectors-3-20181106/#pseudo-classes
1489-
* - https://www.w3.org/TR/2019/WD-css-pseudo-4-20190225/
1489+
* - https://www.w3.org/TR/2022/WD-css-pseudo-4-20221230/
14901490
* - https://www.w3.org/TR/2022/WD-selectors-4-20221111/#the-dir-pseudo
14911491
*
14921492
* @return Matcher
@@ -1519,9 +1519,18 @@ public function cssPseudo() {
15191519
new Juxtaposition( [
15201520
$colon,
15211521
$colon,
1522-
new KeywordMatcher( [
1523-
'first-line', 'first-letter', 'before', 'after', 'selection', 'inactive-selection',
1524-
'spelling-error', 'grammar-error', 'marker', 'placeholder'
1522+
new Alternative( [
1523+
new Juxtaposition( [
1524+
new KeywordMatcher( 'first-letter' ),
1525+
$colon,
1526+
$colon,
1527+
new KeywordMatcher( [ 'prefix', 'postfix' ] ),
1528+
] ),
1529+
new KeywordMatcher( [
1530+
'first-line', 'first-letter', 'before', 'after', 'selection', 'target-text',
1531+
'spelling-error', 'grammar-error', 'marker', 'placeholder',
1532+
'file-selector-button',
1533+
] ),
15251534
] ),
15261535
] ),
15271536
] );
@@ -1533,7 +1542,7 @@ public function cssPseudo() {
15331542
/**
15341543
* An "AN+B" form
15351544
*
1536-
* https://www.w3.org/TR/2019/CR-css-syntax-3-20190716/#anb-microsyntax
1545+
* https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#anb-microsyntax
15371546
*
15381547
* @return Matcher
15391548
*/

src/Grammar/UrangeMatcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* "start" and "end" holding T_NUMBER tokens representing the starting and
1717
* ending codepoints in the range.
1818
*
19-
* @see https://www.w3.org/TR/2019/CR-css-syntax-3-20190716/#urange
19+
* @see https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#urange
2020
*/
2121
class UrangeMatcher extends Matcher {
2222
/** @var Matcher Syntax matcher */

src/Objects/Token.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ public function __toString() {
468468

469469
/**
470470
* Indicate whether the two tokens need to be separated
471-
* @see https://www.w3.org/TR/2019/CR-css-syntax-3-20190716/#serialization
471+
* @see https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#serialization
472472
* @param Token $firstToken
473473
* @param Token $secondToken
474474
* @return bool

0 commit comments

Comments
 (0)