Skip to content

dom/nodes/MutationObserver-characterData.html: ProcessingInstruction case still expects pre-whatwg/html#12118 bogus-comment parsing #63811

Open

Description

@bcardarella

dom/nodes/MutationObserver-characterData.html has a subtest titled "characterData ProcessingInstruction: data mutations" whose node comes from the markup

<p id="n50"><?processing data?></p>

and whose first expected record is {type: "characterData", oldValue: "?processing data?"}.

That expectation dates from when the HTML parser turned <?...?> into a bogus comment, so n50.firstChild was a Comment with data ?processing data?. Despite its title, the subtest was testing a Comment.

Since whatwg/html#12118 ("Parse XML-style <?target data?> processing instructions", merged 2026-06-25), the parser creates a ProcessingInstruction with target processing and data data. Setting n50.data = "CHANGED" therefore records oldValue: "data", not "?processing data?".

Current results (wpt.fyi, aligned stable run at cc74d26):

  • Chrome, which ships PI parsing: 22/23. It fails only this subtest, with the oldValue mismatch.
  • Firefox and Safari, which still parse a bogus comment: 23/23.

Suggested fix: make the node independent of the parser, which also makes the subtest test what its title says. For example:

var n50 = document.createProcessingInstruction("processing", "data");

and expect oldValue: "data" for the first record. Alternatively, keep the markup and expect "data", which matches the current HTML spec.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions