| 1 |
<?php |
| 2 |
|
| 3 |
declare(strict_types=1); |
| 4 |
|
| 5 |
namespace AcyMailing\Libraries\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 |
* @var non-empty-string |
| 15 |
* |
| 16 |
* @internal since 8.5.2 |
| 17 |
*/ |
| 18 |
public const SELECTOR_VALIDATION_RX = '/ |
| 19 |
^( |
| 20 |
(?: |
| 21 |
# any sequence of valid unescaped characters, except quotes |
| 22 |
[a-zA-Z0-9\\x{00A0}-\\x{FFFF}_^$|*=~\\[\\]()\\-\\s\\.:#+>]++ |
| 23 |
| |
| 24 |
# one or more escaped characters |
| 25 |
(?:\\\\.)++ |
| 26 |
| |
| 27 |
# quoted text, like in `[id="example"]` |
| 28 |
(?: |
| 29 |
# opening quote |
| 30 |
([\'"]) |
| 31 |
(?: |
| 32 |
# sequence of characters except closing quote or backslash |
| 33 |
(?:(?!\\g{-1}|\\\\).)++ |
| 34 |
| |
| 35 |
# one or more escaped characters |
| 36 |
(?:\\\\.)++ |
| 37 |
)*+ # zero or more times |
| 38 |
# closing quote or end (unmatched quote is currently allowed) |
| 39 |
(?:\\g{-1}|$) |
| 40 |
) |
| 41 |
)*+ # zero or more times |
| 42 |
| |
| 43 |
# keyframe animation progress percentage (e.g. 50%), untrimmed |
| 44 |
\\s*+(\\d++%)\\s*+ |
| 45 |
)$ |
| 46 |
/ux'; |
| 47 |
} |
| 48 |
|