Make WordPress Core


Ignore:
Timestamp:
01/23/2024 01:49:06 AM (5 months ago)
Author:
dmsnell
Message:

HTML API: Support PARAM, SOURCE, and TRACK tags.

Adds support for the following HTML elements to the HTML Processor:

  • PARAM, SOURCE, TRACK

Previously these elements were not supported and the HTML Processor would bail when encountering them. Now, with this patch applied, it will proceed to parse an HTML document when encountering those tags.

Props jonsurrell, dmsnell
Fixes #60283

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/html-api/class-wp-html-processor.php

    r57319 r57326  
    107107 *  - Links: A.
    108108 *  - Lists: DD, DL, DT, LI, OL, LI.
    109  *  - Media elements: AUDIO, CANVAS, EMBED, FIGCAPTION, FIGURE, IMG, MAP, PICTURE, VIDEO.
     109 *  - Media elements: AUDIO, CANVAS, EMBED, FIGCAPTION, FIGURE, IMG, MAP, PARAM, PICTURE, SOURCE, VIDEO, TRACK.
    110110 *  - Paragraph: BR, P.
    111111 *  - Phrasing elements: AREA, ABBR, BDI, BDO, CITE, DATA, DEL, DFN, INS, MARK, OUTPUT, Q, SAMP, SUB, SUP, TIME, VAR.
     
    982982                $this->insert_html_element( $this->state->current_token );
    983983                $this->state->frameset_ok = false;
     984                return true;
     985
     986            /*
     987             * > A start tag whose tag name is one of: "param", "source", "track"
     988             */
     989            case '+PARAM':
     990            case '+SOURCE':
     991            case '+TRACK':
     992                $this->insert_html_element( $this->state->current_token );
    984993                return true;
    985994        }
     
    10281037            case 'OPTGROUP':
    10291038            case 'OPTION':
    1030             case 'PARAM':
    10311039            case 'PLAINTEXT':
    10321040            case 'RB':
     
    10371045            case 'SCRIPT':
    10381046            case 'SELECT':
    1039             case 'SOURCE':
    10401047            case 'STYLE':
    10411048            case 'SVG':
     
    10501057            case 'TITLE':
    10511058            case 'TR':
    1052             case 'TRACK':
    10531059            case 'XMP':
    10541060                $this->last_error = self::ERROR_UNSUPPORTED;
     
    17131719            'IMG' === $tag_name ||
    17141720            'INPUT' === $tag_name ||
     1721            'KEYGEN' === $tag_name || // Obsolete but still treated as void.
    17151722            'LINK' === $tag_name ||
    1716             'KEYGEN' === $tag_name || // Obsolete but still treated as void.
    17171723            'META' === $tag_name ||
    17181724            'PARAM' === $tag_name || // Obsolete but still treated as void.
Note: See TracChangeset for help on using the changeset viewer.