Skip to content

HTML API: Update html5lib-tests to web-platform-tests#12423

Open
sirreal wants to merge 10 commits into
WordPress:trunkfrom
sirreal:html-api-update-html5lib-wpt
Open

HTML API: Update html5lib-tests to web-platform-tests#12423
sirreal wants to merge 10 commits into
WordPress:trunkfrom
sirreal:html-api-update-html5lib-wpt

Conversation

@sirreal

@sirreal sirreal commented Jul 6, 2026

Copy link
Copy Markdown
Member

Update html5lib-tests to web-platform-tests.

The HTML API uses an external test suite to test how it processes HTML. That test suite has become part of web-platform-tests/wpt where it will continue to be maintained.

This also updates the test data to the latest version: web-platform-tests/wpt@a315c38

Notably, the external tests have added a processing instruction test suite. Processing instructions were treated as bogus comments in HTML but now produce processing instructions. This entire suite is currently skipped. The HTML API will be updated to handle Processing Instructions in another PR.

Test diff with trunk:

-WP_TESTS_SKIP_INSTALL=1 ./vendor/bin/phpunit --group html-api-html5lib-tests
+WP_TESTS_SKIP_INSTALL=1 ./vendor/bin/phpunit --group html-api-web-platform-tests
 # OK, but incomplete, skipped, or risky tests!
-# Tests: 1508, Assertions: 1088, Skipped: 420.
+# Tests: 1513, Assertions: 1091, Skipped: 422.

Trac ticket: https://core.trac.wordpress.org/ticket/65581

html5lib-tests have been taken over by web-platform-tests (WPT).

Update the HTML API tests to point to WPT instead of legacy html5lib-tests.

The updated test suite in WPT can be found here.

Use of AI Tools

AI assistance: Yes
Used for: Initial migration.


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

@sirreal sirreal marked this pull request as ready for review July 6, 2026 16:04
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props jonsurrell.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@sirreal sirreal marked this pull request as draft July 6, 2026 16:05
sirreal added 3 commits July 6, 2026 18:10
The HTML standard has added Processing Instruction parsing. The HTML API needs updates to handle PI.
@sirreal sirreal marked this pull request as ready for review July 6, 2026 16:26
@sirreal sirreal requested review from dmsnell and westonruter July 6, 2026 16:28
@sirreal

sirreal commented Jul 6, 2026

Copy link
Copy Markdown
Member Author

Note that the HTML API tests are running on CI with the updated --group.

TEST_GROUPS: html-api-web-platform-tests

Tests: 1513, Assertions: 1091, Skipped: 422.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant