From 16ce03813061b6f9c700c891f676238f64ee0de2 Mon Sep 17 00:00:00 2001 From: Noam Rosenthal Date: Wed, 11 Feb 2026 10:40:01 -0800 Subject: [PATCH] Support processing instructions in the HTML parser MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The parser now recognizes as a ProcessingInstruction and adds it to the DOM instead of a bogus comment. As per spec PR: - xml/xml-stylesheet are blocklisted, and stay a bogus comment. We can add more of these if there are compat issues. - A PI can appear wherever a comment appears. - ?> at the end ignores the ? Currently in this CL, PI targets are constrained to /^[A-Za-z][A-Za-z0-9-]*$/. Added a VTS that keeps current behavior, so that we don't lose some of the existing html5lib tests while this is in development. See spec PR: https://github.com/whatwg/html/pull/12118 I2P: https://groups.google.com/a/chromium.org/d/msgid/blink-dev/6981ee47.050a0220.baa59.0100.GAE%40google.com Bug: 481087638 Change-Id: I1dd22c09f0b2961d07e8d73a1de1c10c91655be0 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7532085 Commit-Queue: Noam Rosenthal Reviewed-by: Philip Jägenstedt Reviewed-by: Dominic Farolino Cr-Commit-Position: refs/heads/main@{#1583351} --- ...arse-processing-instruction.tentative.html | 286 ++++++++++++++++++ 1 file changed, 286 insertions(+) create mode 100644 html/syntax/parsing/parse-processing-instruction.tentative.html diff --git a/html/syntax/parsing/parse-processing-instruction.tentative.html b/html/syntax/parsing/parse-processing-instruction.tentative.html new file mode 100644 index 00000000000000..6541503d666b6e --- /dev/null +++ b/html/syntax/parsing/parse-processing-instruction.tentative.html @@ -0,0 +1,286 @@ + + + + Processing instructions in HTML + + + + + +