Skip to content

Commit d24aed3

Browse files
committed
HTML API: Support INPUT tags.
Adds support for the following HTML elements to the HTML Processor: - INPUT Previously this element was not supported and the HTML Processor would bail when encountering one. Now, with this patch applied, it will proceed to parse the HTML document. Developed in WordPress/wordpress-develop#5907 Discussed in https://core.trac.wordpress.org/ticket/60283 Props jonsurrell See #60283 Built from https://develop.svn.wordpress.org/trunk@57343 git-svn-id: https://core.svn.wordpress.org/trunk@56849 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 parent ed25fda commit d24aed3

2 files changed

Lines changed: 23 additions & 7 deletions

File tree

wp-includes/html-api/class-wp-html-processor.php

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,18 +101,18 @@
101101
*
102102
* - Containers: ADDRESS, BLOCKQUOTE, DETAILS, DIALOG, DIV, FOOTER, HEADER, MAIN, MENU, SPAN, SUMMARY.
103103
* - Custom elements: All custom elements are supported. :)
104-
* - Form elements: BUTTON, DATALIST, FIELDSET, LABEL, LEGEND, METER, PROGRESS, SEARCH.
104+
* - Form elements: BUTTON, DATALIST, FIELDSET, INPUT, LABEL, LEGEND, METER, PROGRESS, SEARCH.
105105
* - Formatting elements: B, BIG, CODE, EM, FONT, I, PRE, SMALL, STRIKE, STRONG, TT, U, WBR.
106106
* - Heading elements: H1, H2, H3, H4, H5, H6, HGROUP.
107107
* - Links: A.
108-
* - Lists: DD, DL, DT, LI, OL, LI.
109-
* - Media elements: AUDIO, CANVAS, EMBED, FIGCAPTION, FIGURE, IMG, MAP, PARAM, PICTURE, SOURCE, VIDEO, TRACK.
108+
* - Lists: DD, DL, DT, LI, OL, UL.
109+
* - Media elements: AUDIO, CANVAS, EMBED, FIGCAPTION, FIGURE, IMG, MAP, PICTURE, SOURCE, TRACK, VIDEO.
110110
* - Paragraph: BR, P.
111-
* - Phrasing elements: AREA, ABBR, BDI, BDO, CITE, DATA, DEL, DFN, INS, MARK, OUTPUT, Q, SAMP, SUB, SUP, TIME, VAR.
111+
* - Phrasing elements: ABBR, AREA, BDI, BDO, CITE, DATA, DEL, DFN, INS, MARK, OUTPUT, Q, SAMP, SUB, SUP, TIME, VAR.
112112
* - Sectioning elements: ARTICLE, ASIDE, HR, NAV, SECTION.
113113
* - Templating elements: SLOT.
114114
* - Text decoration: RUBY.
115-
* - Deprecated elements: ACRONYM, BLINK, CENTER, DIR, ISINDEX, KEYGEN, LISTING, MULTICOL, NEXTID, SPACER.
115+
* - Deprecated elements: ACRONYM, BLINK, CENTER, DIR, ISINDEX, KEYGEN, LISTING, MULTICOL, NEXTID, PARAM, SPACER.
116116
*
117117
* ### Supported markup
118118
*
@@ -972,6 +972,23 @@ private function step_in_body() {
972972
$this->state->frameset_ok = false;
973973
return true;
974974

975+
/*
976+
* > A start tag whose tag name is "input"
977+
*/
978+
case '+INPUT':
979+
$this->reconstruct_active_formatting_elements();
980+
$this->insert_html_element( $this->state->current_token );
981+
$type_attribute = $this->get_attribute( 'type' );
982+
/*
983+
* > If the token does not have an attribute with the name "type", or if it does,
984+
* > but that attribute's value is not an ASCII case-insensitive match for the
985+
* > string "hidden", then: set the frameset-ok flag to "not ok".
986+
*/
987+
if ( ! is_string( $type_attribute ) || 'hidden' !== strtolower( $type_attribute ) ) {
988+
$this->state->frameset_ok = false;
989+
}
990+
return true;
991+
975992
/*
976993
* > A start tag whose tag name is "hr"
977994
*/
@@ -1024,7 +1041,6 @@ private function step_in_body() {
10241041
case 'HEAD':
10251042
case 'HTML':
10261043
case 'IFRAME':
1027-
case 'INPUT':
10281044
case 'LINK':
10291045
case 'MARQUEE':
10301046
case 'MATH':

wp-includes/version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* @global string $wp_version
1818
*/
19-
$wp_version = '6.5-alpha-57342';
19+
$wp_version = '6.5-alpha-57343';
2020

2121
/**
2222
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

0 commit comments

Comments
 (0)