v150 · HTML · DOM
XML Compat Demo
Processing instructions were common in XHTML and XML documents. Chrome 150 now preserves them in the HTML parser too. Explore three real-world PI targets: xml-stylesheet (associating a stylesheet), streaming anchors (start/end), and custom application metadata PIs.
The xml-stylesheet PI is a W3C recommendation for associating a stylesheet with an XML document. Chrome 150 now preserves it in HTML too — the browser sees it as a ProcessingInstruction node with target="xml-stylesheet".
Chrome 150's declarative out-of-order streaming uses processing instructions as range markers. The browser inserts a chunk of HTML at the range defined by matching start and end PIs, replacing any placeholder template.
start and end PIs serve as bookmarks the streaming runtime can locate via a TreeWalker filtered to SHOW_PROCESSING_INSTRUCTION, matching by .data (the slot name).
Any <?target data?> form is now preserved. Applications can use them for server-to-client configuration, feature flags, or metadata embedded in the HTML stream.
- None injected yet.
Use DOMParser.parseFromString(html, 'text/html') to parse markup containing PIs. Inspect which nodes survive.
see also
- PI DOM Explorer — inject markup, inspect PI nodes
- PI Query Lab — create and traverse PI nodes via JS API
- Streaming Use Case — start/end PIs for out-of-order streaming
- ChromeStatus entry
implementation reference
Need the exact API surface, compatibility boundaries, errors, lifecycle, and source links? Read the matching gendn reference ↗