Make WordPress Core

Changeset 57319


Ignore:
Timestamp:
01/20/2024 12:13:19 AM (4 months ago)
Author:
dmsnell
Message:

HTML API: Cleanup tests and list of void elements.

This patch adds newly supported elements to tests that should have been updated
in recent PRs, but which were merged without that. Those PRs removed failing
tests showing that the elements were unsupported, but did not add the elements
to the list of supported ones.

It also removes some elements from the special-exclusion list of unsupported IN
BODY elements. These did not present in failing tests because earlier
conditions in the switch structure caught the tags before hitting the default
block.

Finally it adds some missing elements to the list of void elements. These
elements are not listed as void in the HTML specification because they are
deprecated. However, they are treated as void for the sake of HTML
serialization and the parsing rules indicate that they behave as void elements,
so it's safe to list them within the HTML API as void.

Developed in WordPress/wordpress-develop#5913

Fixes #60307

Location:
trunk
Files:
2 edited

Legend:

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

    r57317 r57319  
    10031003        switch ( $tag_name ) {
    10041004            case 'APPLET':
    1005             case 'AREA':
    10061005            case 'BASE':
    10071006            case 'BASEFONT':
     
    10111010            case 'COL':
    10121011            case 'COLGROUP':
    1013             case 'DD':
    1014             case 'DT':
    10151012            case 'FORM':
    10161013            case 'FRAME':
     
    10201017            case 'IFRAME':
    10211018            case 'INPUT':
    1022             case 'LI':
    10231019            case 'LINK':
    10241020            case 'MARQUEE':
     
    10301026            case 'NOSCRIPT':
    10311027            case 'OBJECT':
    1032             case 'OL':
    10331028            case 'OPTGROUP':
    10341029            case 'OPTION':
     
    10561051            case 'TR':
    10571052            case 'TRACK':
    1058             case 'UL':
    10591053            case 'XMP':
    10601054                $this->last_error = self::ERROR_UNSUPPORTED;
     
    17101704            'AREA' === $tag_name ||
    17111705            'BASE' === $tag_name ||
     1706            'BASEFONT' === $tag_name || // Obsolete but still treated as void.
     1707            'BGSOUND' === $tag_name || // Obsolete but still treated as void.
    17121708            'BR' === $tag_name ||
    17131709            'COL' === $tag_name ||
    17141710            'EMBED' === $tag_name ||
     1711            'FRAME' === $tag_name ||
    17151712            'HR' === $tag_name ||
    17161713            'IMG' === $tag_name ||
     
    17191716            'KEYGEN' === $tag_name || // Obsolete but still treated as void.
    17201717            'META' === $tag_name ||
     1718            'PARAM' === $tag_name || // Obsolete but still treated as void.
    17211719            'SOURCE' === $tag_name ||
    17221720            'TRACK' === $tag_name ||
  • trunk/tests/phpunit/tests/html-api/wpHtmlProcessorBreadcrumbs.php

    r57317 r57319  
    4141            'ACRONYM', // Neutralized.
    4242            'ADDRESS',
     43            'AREA',
    4344            'ARTICLE',
    4445            'ASIDE',
     
    4950            'BIG',
    5051            'BLINK', // Deprecated.
     52            'BR',
    5153            'BUTTON',
    5254            'CANVAS',
     
    6668            'DT',
    6769            'EM',
     70            'EMBED',
    6871            'FIELDSET',
    6972            'FIGCAPTION',
     
    7982            'HEADER',
    8083            'HGROUP',
     84            'HR',
    8185            'I',
    8286            'IMG',
    8387            'INS',
    8488            'LI',
    85             'ISINDEX', // Deprecated
     89            'ISINDEX', // Deprecated.
    8690            'KBD',
     91            'KEYGEN', // Deprecated.
    8792            'LABEL',
    8893            'LEGEND',
     94            'LISTING', // Deprecated.
    8995            'MAIN',
    9096            'MAP',
     
    9298            'MENU',
    9399            'METER',
    94             'MULTICOL', // Deprecated
     100            'MULTICOL', // Deprecated.
    95101            'NAV',
    96             'NEXTID', // Deprecated
     102            'NEXTID', // Deprecated.
    97103            'OL',
    98104            'OUTPUT',
     
    107113            'SLOT',
    108114            'SMALL',
    109             'SPACER', // Deprecated
     115            'SPACER', // Deprecated.
    110116            'SPAN',
    111117            'STRIKE',
Note: See TracChangeset for help on using the changeset viewer.