Skip to content

Commit

Permalink
HTML API: Add TEMPLATE and related support in HTML Processor.
Browse files Browse the repository at this point in the history
As part of work to add more spec support to the HTML API, this patch adds
support for the IN TEMPLATE and IN HEAD insertion modes. These changes are
primarily about adding support for TEMPLATE elements in the HTML Processor,
but include support for other tags commonly found in the document head, such
as LINK, META, SCRIPT, STYLE, and TITLE.

Developed in WordPress#7046
Discussed in https://core.trac.wordpress.org/ticket/61576

Props: dmsnell, jonsurrell, westonruter.
See #61576.


git-svn-id: https://develop.svn.wordpress.org/trunk@58833 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
dmsnell committed Jul 30, 2024
1 parent a16d9ee commit dfd1de0
Show file tree
Hide file tree
Showing 4 changed files with 384 additions and 17 deletions.
45 changes: 42 additions & 3 deletions src/wp-includes/html-api/class-wp-html-open-elements.php
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,20 @@ public function has_element_in_scope( string $tag_name ): bool {
'MARQUEE',
'OBJECT',
'TEMPLATE',
// @todo: Support SVG and MathML nodes when support for foreign content is added.

/*
* @todo Support SVG and MathML nodes when support for foreign content is added.
*
* - MathML mi
* - MathML mo
* - MathML mn
* - MathML ms
* - MathML mtext
* - MathML annotation-xml
* - SVG foreignObject
* - SVG desc
* - SVG title
*/
)
);
}
Expand Down Expand Up @@ -349,7 +362,20 @@ public function has_element_in_list_item_scope( string $tag_name ): bool {
'OL',
'TEMPLATE',
'UL',
// @todo: Support SVG and MathML nodes when support for foreign content is added.

/*
* @todo Support SVG and MathML nodes when support for foreign content is added.
*
* - MathML mi
* - MathML mo
* - MathML mn
* - MathML ms
* - MathML mtext
* - MathML annotation-xml
* - SVG foreignObject
* - SVG desc
* - SVG title
*/
)
);
}
Expand Down Expand Up @@ -386,7 +412,20 @@ public function has_element_in_button_scope( string $tag_name ): bool {
'MARQUEE',
'OBJECT',
'TEMPLATE',
// @todo: Support SVG and MathML nodes when support for foreign content is added.

/*
* @todo Support SVG and MathML nodes when support for foreign content is added.
*
* - MathML mi
* - MathML mo
* - MathML mn
* - MathML ms
* - MathML mtext
* - MathML annotation-xml
* - SVG foreignObject
* - SVG desc
* - SVG title
*/
)
);
}
Expand Down
Loading

0 comments on commit dfd1de0

Please sign in to comment.