Debian Codegraph @

vendor/sabberworm/php-css-parser/src/Property/KeyframeSelector.php

raw
1 <?php
2
3 declare(strict_types=1);
4
5 namespace Sabberworm\CSS\Property;
6
7 class KeyframeSelector extends Selector
8 {
9 /**
10 * This differs from the parent class:
11 * - comma is not allowed unless escaped or quoted;
12 * - percentage value is allowed by itself.
13 *
14 * @internal since 8.5.2
15 */
16 public const SELECTOR_VALIDATION_RX = '/
17 ^(
18 (?:
19 # any sequence of valid unescaped characters, except quotes
20 [a-zA-Z0-9\\x{00A0}-\\x{FFFF}_^$|*=~\\[\\]()\\-\\s\\.:#+>]++
21 |
22 # one or more escaped characters
23 (?:\\\\.)++
24 |
25 # quoted text, like in `[id="example"]`
26 (?:
27 # opening quote
28 ([\'"])
29 (?:
30 # sequence of characters except closing quote or backslash
31 (?:(?!\\g{-1}|\\\\).)++
32 |
33 # one or more escaped characters
34 (?:\\\\.)++
35 )*+ # zero or more times
36 # closing quote or end (unmatched quote is currently allowed)
37 (?:\\g{-1}|$)
38 )
39 )*+ # zero or more times
40 |
41 # keyframe animation progress percentage (e.g. 50%), untrimmed
42 \\s*+(\\d++%)\\s*+
43 )$
44 /ux';
45 }