Skip to content

Commit 9c59014

Browse files
committed
Add HTML elements to has_element_in_scope handling
1 parent 6ef9df9 commit 9c59014

1 file changed

Lines changed: 21 additions & 6 deletions

File tree

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

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ public function has_element_in_specific_scope( $tag_name, $termination_list ) {
227227
* Returns whether a particular element is in scope.
228228
*
229229
* @since 6.4.0
230+
* @since 6.7.0 Add handling for all HTML elements.
230231
*
231232
* @see https://html.spec.whatwg.org/#has-an-element-in-scope
232233
*
@@ -237,13 +238,27 @@ public function has_element_in_scope( $tag_name ) {
237238
return $this->has_element_in_specific_scope(
238239
$tag_name,
239240
array(
240-
241+
'APPLET',
242+
'CAPTION',
243+
'HTML',
244+
'TABLE',
245+
'TD',
246+
'TH',
247+
'MARQUEE',
248+
'OBJECT',
249+
'TEMPLATE',
241250
/*
242-
* Because it's not currently possible to encounter
243-
* one of the termination elements, they don't need
244-
* to be listed here. If they were, they would be
245-
* unreachable and only waste CPU cycles while
246-
* scanning through HTML.
251+
* Foreign content not yet supported
252+
*
253+
* - MathML mi
254+
* - MathML mo
255+
* - MathML mn
256+
* - MathML ms
257+
* - MathML mtext
258+
* - MathML annotation-xml
259+
* - SVG foreignObject
260+
* - SVG desc
261+
* - SVG title
247262
*/
248263
)
249264
);

0 commit comments

Comments
 (0)