Make WordPress Core


Ignore:
Timestamp:
07/10/2026 05:22:53 PM (2 months ago)
Author:
jonsurrell
Message:

HTML API: Update SELECT element parsing according to specification.

The HTML standard was updated to support customizable SELECT elements. Update HTML API parsing accordingly.

Developed in https://github.com/WordPress/wordpress-develop/pull/9298.

Props jonsurrell, dmsnell.
Fixes #63736.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/html-api/wpHtmlProcessor-serialize.php

    r62687 r62689  
    4242                        '<div></div>',
    4343                        'Should have provided the explicit closer to the un-closed DIV element.'
     44                );
     45        }
     46
     47        /**
     48         * Ensures that SELECTEDCONTENT is parsed like an ordinary element.
     49         *
     50         * @ticket 63736
     51         */
     52        public function test_selectedcontent_is_not_unsupported() {
     53                $this->assertSame(
     54                        WP_HTML_Processor::normalize( '<select><button><selectedcontent></button><option selected>Y' ),
     55                        '<select><button><selectedcontent></selectedcontent></button><option selected>Y</option></select>',
     56                        'Should not bail on SELECTEDCONTENT when selected OPTION cloning would be needed.'
    4457                );
    4558        }
Note: See TracChangeset for help on using the changeset viewer.