Make WordPress Core


Ignore:
Timestamp:
01/20/2024 12:13:19 AM (9 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

File:
1 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 ||
Note: See TracChangeset for help on using the changeset viewer.