Skip to content

Commit 129c006

Browse files
t-hamanoclaude
andcommitted
Tests: Use spec-compliant RGB(A) values in safecss_filter_attr tests.
`rgb(255, 50%, 0)` mixes numbers and percentages within the legacy comma-separated syntax, which is invalid per CSS Color Level 4 — only the modern space-separated syntax permits mixing. Switch the case to `rgb(255 50% 0)`. Also bring `rgba(100, 200, 300, 0.8)` into the 0–255 range (`250`) so the fixtures reflect realistic, valid colors rather than relying on browser clamping. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
1 parent 0f20120 commit 129c006

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

tests/phpunit/tests/kses.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1362,8 +1362,8 @@ public function data_safecss_filter_attr() {
13621362
'expected' => 'color: rgb(100%, 0%, 50%)',
13631363
),
13641364
array(
1365-
'css' => 'color: rgb(255, 50%, 0)',
1366-
'expected' => 'color: rgb(255, 50%, 0)',
1365+
'css' => 'color: rgb(255 50% 0)',
1366+
'expected' => 'color: rgb(255 50% 0)',
13671367
),
13681368
// RGBA color.
13691369
array(
@@ -1386,8 +1386,8 @@ public function data_safecss_filter_attr() {
13861386
),
13871387
// RGBA border color.
13881388
array(
1389-
'css' => 'border-color: rgba(100, 200, 300, 0.8)',
1390-
'expected' => 'border-color: rgba(100, 200, 300, 0.8)',
1389+
'css' => 'border-color: rgba(100, 200, 250, 0.8)',
1390+
'expected' => 'border-color: rgba(100, 200, 250, 0.8)',
13911391
),
13921392
// RGB color in `border` shorthand.
13931393
array(

0 commit comments

Comments
 (0)