HTML API: Fix typo setting the wrong self-closing flag.

The HTML Processor tracks whether a token was found with the self-closing flag.
Depending on the context, this flag may or may not indicate that the element is
self closing. Unfortunately it's been tracking the wrong flag: it's been tracking
the end-tag flag, which indicates that a token is an end tag.

In this patch the right flag is set in the HTML Processor. This hasn't been an
issue because the HTML Processor doesn't yet read that stored flag, but it's an
important fix to make before adding support for foreign content (SVG and MathML)
since that behavior depends on reading the correct flag.

Follow-up to [56274].

Props dmsnell.



git-svn-id: https://develop.svn.wordpress.org/trunk@57528 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dennis Snell 2024-02-02 23:25:56 +00:00
parent f80516dfab
commit 324f2d70b8

View File

@ -548,7 +548,7 @@ class WP_HTML_Processor extends WP_HTML_Tag_Processor {
$this->state->current_token = new WP_HTML_Token(
$this->bookmark_tag(),
$this->get_tag(),
$this->is_tag_closer(),
$this->has_self_closing_flag(),
$this->release_internal_bookmark_on_destruct
);