#60390 closed enhancement (invalid)
HTML API: Indicate if a given tag name represents an HTML tag.
Reported by: | dmsnell | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 6.5 |
Component: | HTML API | Keywords: | |
Focuses: | Cc: |
Description
The HTML5 living specification defines three kinds of elements:
- HTML elements.
- Foreign elements, those which are part of MathML and SVG content.
- Custom elements.
The HTML API should be able to indicate if a given tag name is possibly an HTML element or not, so that dependent functions can make appropriate decisions for self-closing elements.
HTML treats the self-closing flag differently for HTML and foreign elements. In HTML elements the flag is ignored, but in foreign content the flag indicates that the tag is self-closing or void. HTML itself does not contain self-closing elements; only some void elements.
Change History (3)
This ticket was mentioned in PR #5981 on WordPress/wordpress-develop by @dmsnell.
9 months ago
#1
- Keywords has-patch added
#2
@
9 months ago
- Keywords has-patch removed
- Milestone Awaiting Review deleted
- Resolution set to invalid
- Status changed from new to closed
This may not be necessary; based on what I'm seeing in the spec, what matters isn't whether an element is an HTML element, but whether we're inside foreign content.
https://html.spec.whatwg.org/#parsing-main-inforeign
So maybe this shouldn't appear and instead we need to push ahead on supporting foreign content.
Trac ticket: Core-60390
## Questions
## Description
The HTML5 living specification defines three kinds of elements:
The HTML API should be able to indicate if a given tag name is possibly an HTML element or not, so that dependent functions can make appropriate decisions for self-closing elements.
HTML treats the self-closing flag differently for HTML and foreign elements. In HTML elements the flag is ignored, but in foreign content the flag indicates that the tag is self-closing or void. HTML itself does not contain self-closing elements; only some void elements.
This patch introduces
WP_HTML_Processor::is_html_tag( $tag_name )
to answer this question.