Skip to content

Add missing HTML attributes from the HTML Standard (invoker commands, declarative shadow DOM, fetchpriority, …) - #147

Open
Arron Eicholz (arronei) wants to merge 3 commits into
microsoft:mainfrom
arronei:html/baseline-attributes
Open

Arron Eicholz (arronei) wants to merge 3 commits into
microsoft:mainfrom
arronei:html/baseline-attributes

Conversation

@arronei

Copy link
Copy Markdown

The HTML element list in web-data/html/htmlTags.json is maintained by hand. Several attributes from the WHATWG HTML Standard that now ship in browsers were never added, so VS Code gives no completion, value completion or hover for them. This PR adds 17 of them.

Element Attribute(s) Value set Baseline
<area> referrerpolicy referrerpolicy (existing) Widely available
<button> command, commandfor command (new) Newly available (2025)
<form> rel Widely available
<iframe> loading loading (existing) Newly available (2023)
<link> disabled boolean Widely available
<link> fetchpriority fetchpriority (existing) Newly available (2024)
<link> imagesizes, imagesrcset Newly available (2023)
<script> fetchpriority fetchpriority (existing) Newly available (2024)
<source> width, height Widely available
<template> shadowrootmode shadowrootmode (new) Newly available (2024)
<template> shadowrootclonable, shadowrootdelegatesfocus boolean Newly available (2024)
<template> shadowrootserializable boolean Limited (Chromium, WebKit)
<video> playsinline boolean Limited (Chromium, WebKit)

Baseline status comes from the regenerated data (compute-baseline / web-features), so the hovers show it.

Other changes

  • The loading value set descriptions now say "resource" instead of "image", because <iframe> now shares the set.
  • data/browsers.html-data.json was regenerated with node html/generateData.mjs. No dependency versions changed, and the CSS data was not regenerated.

How these were found: I compared the shipped data against @mdn/browser-compat-data 8.1.5, @webref/elements 2.9.1 and web-features 3.42.0. I kept attributes that are in the HTML Standard and ship in at least two engines. I left out <input webkitdirectory> (WICG, not the HTML Standard) and attributes that ship only in Chromium (interestfor, closedby, blocking, …).

Testing

  • Packed this branch and fed it to vscode-html-languageservice (npm i -D <tgz> && node build/generateData.js). The full test suite passes (178/178).
  • Ran completion checks against the built language service. All 12 fail on main and pass with this branch:
    • <button comm| offers command, commandfor
    • <button command="|" offers show-modal, close, request-close, show-popover, hide-popover, toggle-popover
    • <template shadowroot| offers all four shadowroot* attributes; shadowrootmode="|" offers open, closed
    • <iframe loading="|" → eager, lazy; <link fetch|, <link image|, <script fetchpriority="|", <source wi|, <form re|, <area referrer|, <video plays| all complete
  • Hovers show the description and the Baseline badge, e.g. commandfor: Newly available across major browsers (Baseline since 2025).

Adds 17 attributes that are defined in the WHATWG HTML Standard but were
missing from the HTML data, so VS Code did not offer completions, value
completions or hovers for them:

- <area referrerpolicy>
- <button command>, <button commandfor> (invoker commands)
- <form rel>
- <iframe loading>
- <link disabled>, <link fetchpriority>, <link imagesizes>, <link imagesrcset>
- <script fetchpriority>
- <source width>, <source height>
- <template shadowrootmode>, <template shadowrootclonable>,
  <template shadowrootdelegatesfocus>, <template shadowrootserializable>
  (declarative shadow DOM)
- <video playsinline>

All are Baseline except <template shadowrootserializable> and
<video playsinline>, which ship in Chromium and WebKit and are marked
"Limited availability" by the generated data.

New value sets: `command` (show-modal, close, request-close,
show-popover, hide-popover, toggle-popover) and `shadowrootmode`
(open, closed). The `loading` value set descriptions now say
"resource" instead of "image" because <iframe> shares the set.

Regenerated data/browsers.html-data.json with `node html/generateData.mjs`.
Arron Eicholz (arronei) added a commit to arronei/vscode-syntax that referenced this pull request Nov 15, 2026
Record the draft PR links in docs/upstream-prs.md and the README:
microsoft/vscode-custom-data#147 and #148, mdn/data#1121 and
microsoft/vscode-css-languageservice#547.

Drop the Claude attribution and session lines from the PR folders'
COMMIT_MSG.txt and PR.md, and update the doc-paths PR body: the Nov 12
web custom data update filled the cited descriptions by hand, but the
lookup still returns nothing on main.
@arronei

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

@arronei
Arron Eicholz (arronei) marked this pull request as ready for review November 16, 2026 17:37
Copilot AI balanced review requested due to automatic review settings November 16, 2026 17:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Copilot was unable to complete this review at the selected tier due to model policy or plan restrictions.

🟡 Changes recommended

The change still has unresolved review comments identifying ungrammatical wording (“between showing and hidden”) in two files, so it needs minor edits before approval.

2 open issues
What changed in this PR

Adds recently shipped HTML Standard attributes to the curated HTML web-data so VS Code can provide attribute/value completion and updated hover/Baseline information.

Changes:

  • Added new value sets (command, shadowrootmode) and generalized loading value-set wording to apply beyond images.
  • Expanded per-element attribute metadata to include newer attributes (e.g., invoker commands, declarative shadow DOM attrs, fetchpriority, imagesrcset/imagesizes, playsinline).
  • Regenerated the bundled browser/Baseline data snapshot to reflect the updated HTML metadata and descriptions.
File Description
web-data/​html/​valueSets.json Adds new value sets for attribute value completion and updates the loading value descriptions to be more broadly applicable.
web-data/​html/​mdnTagDescriptions.json Updates and adds MDN-style descriptions for newly supported attributes so hover text stays in sync with the metadata.
web-data/​html/​htmlTags.json Extends HTML tag metadata with the newly added HTML Standard attributes and associates value sets where appropriate.
web-data/​data/​browsers.html-data.json Regenerates the consolidated browser compatibility/Baseline dataset to incorporate the new attributes, value sets, and updated descriptions.

Review effort: Balanced

Comment thread web-data/data/browsers.html-data.json Resolved
Comment thread web-data/html/valueSets.json Resolved
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.

2 participants