From 883cab35493cad1266b128b8989537b6fe658733 Mon Sep 17 00:00:00 2001 From: Jon Surrell Date: Mon, 26 Oct 2026 14:05:28 +0400 Subject: [PATCH 1/4] Replace deprecated on-async directives with on --- html-api-debugger/interactivity.php | 32 ++++++++++++++--------------- html-api-debugger/readme.txt | 1 + 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/html-api-debugger/interactivity.php b/html-api-debugger/interactivity.php index 59cc8be..56c4683 100644 --- a/html-api-debugger/interactivity.php +++ b/html-api-debugger/interactivity.php @@ -68,7 +68,7 @@ class="html-api-debugger-container html-api-debugger--grid"
- +
@@ -87,7 +87,7 @@ class="context-html" autocomplete="off" spellcheck="false" wrap="off" - data-wp-on-async--input="handleInput" + data-wp-on--input="handleInput" >
@@ -128,11 +128,11 @@ class="context-html"

Interpreted by HTML API

- +

 				
@@ -143,7 +143,7 @@ class="context-html"

Interpreted from DOM

- +
    @@ -152,17 +152,17 @@ class="context-html"
    - - - + + +
    - +
    -
    +

    - + Date: Mon, 26 Oct 2026 16:07:37 +0400 Subject: [PATCH 2/4] Fix tree views on WordPress 7.2 and require WordPress 6.9 WordPress 7.2 (Gutenberg #84098) ignores `data-wp-watch`, `data-wp-init` and `data-wp-run` directives with a two-hyphen suffix. The `--main` and `--url` watches stopped running, so after the first render the HTML API tree, DOM tree and rendered iframe no longer updated on edits. Use the three-hyphen unique ID form instead. WordPress 6.9 added that form on the client (Gutenberg #72161) and the server (r61020), so require 6.9. Remove `data-wp-ignore`. WordPress 6.9 deprecated it and 7.2 removed it; the elements were already hydrated on 7.2. Fix the misspelled `htmlApiDoctypeSystemId` server state key, which left the server-rendered doctype systemId empty. Replace the 6.7 Playground version option with 6.9, the new minimum. Tested in a browser with the 6.9, 7.1 and 7.2-beta1 Interactivity runtimes: edits, the show-closers toggle, hover highlighting, the context button, URL updates and playback all update both trees, with no console warnings. --- html-api-debugger/html-api-debugger.php | 4 ++-- html-api-debugger/interactivity.php | 14 +++++++------- html-api-debugger/readme.txt | 7 +++++-- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/html-api-debugger/html-api-debugger.php b/html-api-debugger/html-api-debugger.php index 5f80484..d8bd986 100644 --- a/html-api-debugger/html-api-debugger.php +++ b/html-api-debugger/html-api-debugger.php @@ -4,8 +4,8 @@ * Plugin URI: https://github.com/sirreal/html-api-debugger * Description: Add a page to wp-admin for debugging the HTML API. * Version: 2.9 - * Requires at least: 6.7 - * Tested up to: 6.8 + * Requires at least: 6.9 + * Tested up to: 7.2 * Author: Jon Surrell * Author URI: https://profiles.wordpress.org/jonsurrell/ * License: GPLv2 or later diff --git a/html-api-debugger/interactivity.php b/html-api-debugger/interactivity.php index 56c4683..e59c75c 100644 --- a/html-api-debugger/interactivity.php +++ b/html-api-debugger/interactivity.php @@ -47,7 +47,7 @@ function generate_page( string $html, array $options ): string { 'htmlApiDocumentTitle' => $htmlapi_response['result']['documentTitle'] ?? null, 'htmlApiDoctypeName' => $htmlapi_response['result']['doctypeName'] ?? null, 'htmlApiDoctypePublicId' => $htmlapi_response['result']['doctypePublicId'] ?? null, - 'htmlApiDoctypeSytemId' => $htmlapi_response['result']['doctypeSystemId'] ?? null, + 'htmlApiDoctypeSystemId' => $htmlapi_response['result']['doctypeSystemId'] ?? null, 'treeWarnings' => $htmlapi_response['result']['warnings'] ?? array(), 'normalizedHtml' => $htmlapi_response['normalizedHtml'] ?? '', @@ -60,8 +60,8 @@ function generate_page( string $html, array $options ): string { ?>

    @@ -145,7 +145,7 @@ class="context-html"

    Interpreted from DOM

    -
      +
        @@ -192,7 +192,7 @@ class="context-html" >
        -
        +

        @@ -201,7 +201,7 @@ class="context-html" - +
        diff --git a/html-api-debugger/readme.txt b/html-api-debugger/readme.txt index 4741753..cb8fc72 100644 --- a/html-api-debugger/readme.txt +++ b/html-api-debugger/readme.txt @@ -1,8 +1,8 @@ === HTML API Debugger === Contributors: jonsurrell, bernhard-reiter Tags: HTML API, development, debug -Requires at least: 6.7 -Tested up to: 6.8 +Requires at least: 6.9 +Tested up to: 7.2 Stable tag: 2.9 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html @@ -21,6 +21,9 @@ Please file issues and pull requests on the [GitHub repository](https://github.c * Fix fragment tree depth so nodes following atomic elements (`textarea`, `script`, `style`) nest correctly to match the DOM tree. * Use `get_full_comment_text()` to get comment text in the tree. * Change `on-async` (deprecated) directives to `on`. +* Fix tree views not updating after edits in WordPress 7.2, which ignores `data-wp-watch` directives with a two-hyphen suffix. +* Remove `data-wp-ignore` (deprecated) directives. +* Drop support for WordPress 6.7 and 6.8. = 2.9 = * Fix implicit nullable parameter. From 46acbfd498e3890d9f73aeb93206404b063d335c Mon Sep 17 00:00:00 2001 From: Jon Surrell Date: Mon, 26 Oct 2026 16:21:24 +0400 Subject: [PATCH 3/4] Remove compatibility code for WordPress before 6.9 WordPress 6.9 is now the minimum version. `WP_HTML_Processor::create_fragment_at_current_node()` exists since 6.8, so the `method_exists()` guards always passed. Remove them, along with the `create_fragment_advanced` support flag that hid the context HTML field and made the client ignore context HTML. WordPress 6.9 renamed `WP_HTML_Doctype_Info::$indicated_compatability_mode` to `$indicated_compatibility_mode` (r60647). Read the new name directly. The method is still private, so it is still called through reflection. Tested: tests/html-api-integration-regression.php passes against 6.9.0 and trunk; compat mode is CSS1Compat for `` and BackCompat for a quirks or missing doctype, with and without context HTML; in the browser the context field shows and a `` context gives matching HTML API and DOM trees. --- html-api-debugger/html-api-integration.php | 35 +++++----------------- html-api-debugger/interactivity.php | 2 +- html-api-debugger/main.mjs | 5 +--- 3 files changed, 10 insertions(+), 32 deletions(-) diff --git a/html-api-debugger/html-api-integration.php b/html-api-debugger/html-api-integration.php index 021a3d7..201ef3d 100644 --- a/html-api-debugger/html-api-integration.php +++ b/html-api-debugger/html-api-integration.php @@ -12,7 +12,6 @@ */ function get_supports(): array { return array( - 'create_fragment_advanced' => method_exists( WP_HTML_Processor::class, 'create_fragment_at_current_node' ), 'selectors' => class_exists( '\WP_CSS_Complex_Selector_List' ) || class_exists( '\WP_CSS_Compound_Selector_List' ), @@ -27,15 +26,10 @@ class_exists( '\WP_CSS_Complex_Selector_List' ) * @return string|null The normalized HTML or null if not supported. */ function get_normalized_html( string $html, array $options ): ?string { - if ( method_exists( WP_HTML_Processor::class, 'create_fragment_at_current_node' ) ) { - $cfacn = new ReflectionMethod( WP_HTML_Processor::class, 'create_fragment_at_current_node' ); - $cfacn->setAccessible( true ); - } + $cfacn = new ReflectionMethod( WP_HTML_Processor::class, 'create_fragment_at_current_node' ); + $cfacn->setAccessible( true ); - if ( - method_exists( WP_HTML_Processor::class, 'create_fragment_at_current_node' ) && - $options['context_html'] - ) { + if ( $options['context_html'] ) { $context_processor = WP_HTML_Processor::create_full_parser( $options['context_html'] ); add_filter( 'doing_it_wrong_trigger_error', __NAMESPACE__ . '\filter_doing_it_wrong_trigger_error', 10, 2 ); @@ -103,10 +97,8 @@ function get_tree( string $html, array $options ): array { $processor_bookmarks = new ReflectionProperty( WP_HTML_Processor::class, 'bookmarks' ); $processor_bookmarks->setAccessible( true ); - if ( method_exists( WP_HTML_Processor::class, 'create_fragment_at_current_node' ) ) { - $cfacn = new ReflectionMethod( WP_HTML_Processor::class, 'create_fragment_at_current_node' ); - $cfacn->setAccessible( true ); - } + $cfacn = new ReflectionMethod( WP_HTML_Processor::class, 'create_fragment_at_current_node' ); + $cfacn->setAccessible( true ); $is_fragment_processor = false; $processor_depth_offset = 0; @@ -117,10 +109,7 @@ function get_tree( string $html, array $options ): array { $doctype_public_identifier = null; $doctype_system_identifier = null; - if ( - method_exists( WP_HTML_Processor::class, 'create_fragment_at_current_node' ) && - $options['context_html'] - ) { + if ( $options['context_html'] ) { $context_processor = WP_HTML_Processor::create_full_parser( $options['context_html'] ); add_filter( 'doing_it_wrong_trigger_error', __NAMESPACE__ . '\filter_doing_it_wrong_trigger_error', 10, 2 ); @@ -131,11 +120,7 @@ function get_tree( string $html, array $options ): array { $doctype_name = $doctype->name; $doctype_public_identifier = $doctype->public_identifier; $doctype_system_identifier = $doctype->system_identifier; - if ( - ( property_exists( $doctype, 'indicated_compatibility_mode' ) - ? $doctype->indicated_compatibility_mode - : $doctype->indicated_compatability_mode ) !== 'quirks' - ) { + if ( $doctype->indicated_compatibility_mode !== 'quirks' ) { $compat_mode = 'CSS1Compat'; } break; @@ -267,11 +252,7 @@ function get_tree( string $html, array $options ): array { $doctype_name = $doctype->name; $doctype_public_identifier = $doctype->public_identifier; $doctype_system_identifier = $doctype->system_identifier; - if ( - ( property_exists( $doctype, 'indicated_compatibility_mode' ) - ? $doctype->indicated_compatibility_mode - : $doctype->indicated_compatability_mode ) !== 'quirks' - ) { + if ( $doctype->indicated_compatibility_mode !== 'quirks' ) { $compat_mode = 'CSS1Compat'; } diff --git a/html-api-debugger/interactivity.php b/html-api-debugger/interactivity.php index e59c75c..5b5ba87 100644 --- a/html-api-debugger/interactivity.php +++ b/html-api-debugger/interactivity.php @@ -65,7 +65,7 @@ function generate_page( string $html, array $options ): string { data-wp-init="run" class="html-api-debugger-container html-api-debugger--grid" > -
        +
        diff --git a/html-api-debugger/main.mjs b/html-api-debugger/main.mjs index 62515f4..62f97d4 100644 --- a/html-api-debugger/main.mjs +++ b/html-api-debugger/main.mjs @@ -49,7 +49,6 @@ let mutationObserver = null; * * * @typedef Supports - * @property {boolean} create_fragment_advanced * @property {boolean} selectors * * @@ -191,9 +190,7 @@ const store = createStore( NS, { }, get contextHTMLForUse() { - return store.state.htmlapiResponse.supports.create_fragment_advanced - ? store.state.contextHTML.trim() || null - : null; + return store.state.contextHTML.trim() || null; }, /** @type {Link|null} */ From 00f4636c05f49bfad1abacfa382a31f03c8de463 Mon Sep 17 00:00:00 2001 From: Jon Surrell Date: Mon, 26 Oct 2026 16:26:50 +0400 Subject: [PATCH 4/4] Shorten changelog lines to user-visible changes --- html-api-debugger/readme.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/html-api-debugger/readme.txt b/html-api-debugger/readme.txt index cb8fc72..3a386af 100644 --- a/html-api-debugger/readme.txt +++ b/html-api-debugger/readme.txt @@ -21,8 +21,7 @@ Please file issues and pull requests on the [GitHub repository](https://github.c * Fix fragment tree depth so nodes following atomic elements (`textarea`, `script`, `style`) nest correctly to match the DOM tree. * Use `get_full_comment_text()` to get comment text in the tree. * Change `on-async` (deprecated) directives to `on`. -* Fix tree views not updating after edits in WordPress 7.2, which ignores `data-wp-watch` directives with a two-hyphen suffix. -* Remove `data-wp-ignore` (deprecated) directives. +* Fix tree views not updating in WordPress 7.2. * Drop support for WordPress 6.7 and 6.8. = 2.9 =