Skip to content

Commit dfd1de0

Browse files
committed
HTML API: Add TEMPLATE and related support in HTML Processor.
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
1 parent a16d9ee commit dfd1de0

File tree

4 files changed

+384
-17
lines changed

4 files changed

+384
-17
lines changed

src/wp-includes/html-api/class-wp-html-open-elements.php

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,20 @@ public function has_element_in_scope( string $tag_name ): bool {
308308
'MARQUEE',
309309
'OBJECT',
310310
'TEMPLATE',
311-
// @todo: Support SVG and MathML nodes when support for foreign content is added.
311+
312+
/*
313+
* @todo Support SVG and MathML nodes when support for foreign content is added.
314+
*
315+
* - MathML mi
316+
* - MathML mo
317+
* - MathML mn
318+
* - MathML ms
319+
* - MathML mtext
320+
* - MathML annotation-xml
321+
* - SVG foreignObject
322+
* - SVG desc
323+
* - SVG title
324+
*/
312325
)
313326
);
314327
}
@@ -349,7 +362,20 @@ public function has_element_in_list_item_scope( string $tag_name ): bool {
349362
'OL',
350363
'TEMPLATE',
351364
'UL',
352-
// @todo: Support SVG and MathML nodes when support for foreign content is added.
365+
366+
/*
367+
* @todo Support SVG and MathML nodes when support for foreign content is added.
368+
*
369+
* - MathML mi
370+
* - MathML mo
371+
* - MathML mn
372+
* - MathML ms
373+
* - MathML mtext
374+
* - MathML annotation-xml
375+
* - SVG foreignObject
376+
* - SVG desc
377+
* - SVG title
378+
*/
353379
)
354380
);
355381
}
@@ -386,7 +412,20 @@ public function has_element_in_button_scope( string $tag_name ): bool {
386412
'MARQUEE',
387413
'OBJECT',
388414
'TEMPLATE',
389-
// @todo: Support SVG and MathML nodes when support for foreign content is added.
415+
416+
/*
417+
* @todo Support SVG and MathML nodes when support for foreign content is added.
418+
*
419+
* - MathML mi
420+
* - MathML mo
421+
* - MathML mn
422+
* - MathML ms
423+
* - MathML mtext
424+
* - MathML annotation-xml
425+
* - SVG foreignObject
426+
* - SVG desc
427+
* - SVG title
428+
*/
390429
)
391430
);
392431
}

0 commit comments

Comments
 (0)