diff --git a/src/wp-includes/html-api/class-wp-css-selectors.php b/src/wp-includes/html-api/class-wp-css-selectors.php
index fbccb55a5a0eb..4ea438b95d8ce 100644
--- a/src/wp-includes/html-api/class-wp-css-selectors.php
+++ b/src/wp-includes/html-api/class-wp-css-selectors.php
@@ -410,6 +410,13 @@ private function __construct( string $ident ) {
$this->ident = $ident;
}
+ /**
+ * Parse an ID selector
+ *
+ * > =
+ *
+ * https://www.w3.org/TR/selectors/#grammar
+ */
public static function parse( string $input, int &$offset ): ?self {
$ident = self::parse_hash_token( $input, $offset );
if ( null === $ident ) {
@@ -427,6 +434,13 @@ private function __construct( string $ident ) {
$this->ident = $ident;
}
+ /**
+ * Parse a class selector
+ *
+ * > = '.'
+ *
+ * https://www.w3.org/TR/selectors/#grammar
+ */
public static function parse( string $input, int &$offset ): ?self {
if ( $offset + 1 >= strlen( $input ) || '.' !== $input[ $offset ] ) {
return null;
@@ -437,7 +451,6 @@ public static function parse( string $input, int &$offset ): ?self {
if ( null === $result ) {
return null;
- $offset = $updated_offset;
}
$offset = $updated_offset;