Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML API: Active format reconstruction with noah's ark #19

Draft
wants to merge 7 commits into
base: html-api/improve-active-element-reconstruction
Choose a base branch
from
Prev Previous commit
Next Next commit
Ensure we get bookmark_name on tokens
  • Loading branch information
sirreal committed Aug 29, 2024
commit d366f163c791b80b5113fa4ffec129a6fe8f01c3
6 changes: 3 additions & 3 deletions src/wp-includes/html-api/class-wp-html-token.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class WP_HTML_Token {
*
* @var string
*/
public $bookmark_name = null;
public $bookmark_name;

/**
* Name of node; lowercase names such as "marker" are not HTML elements.
Expand Down Expand Up @@ -90,13 +90,13 @@ class WP_HTML_Token {
*
* @since 6.4.0
*
* @param string|null $bookmark_name Name of bookmark corresponding to location in HTML where token is found,
* @param string $bookmark_name Name of bookmark corresponding to location in HTML where token is found,
* or `null` for markers and nodes without a bookmark.
* @param string $node_name Name of node token represents; if uppercase, an HTML element; if lowercase, a special value like "marker".
* @param bool $has_self_closing_flag Whether the source token contains the self-closing flag, regardless of whether it's valid.
* @param callable|null $on_destroy Optional. Function to call when destroying token, useful for releasing the bookmark.
*/
public function __construct( ?string $bookmark_name, string $node_name, bool $has_self_closing_flag, ?callable $on_destroy = null ) {
public function __construct( string $bookmark_name, string $node_name, bool $has_self_closing_flag, ?callable $on_destroy = null ) {
$this->bookmark_name = $bookmark_name;
$this->namespace = 'html';
$this->node_name = $node_name;
Expand Down