Skip to content

Chrome 151 / Firefox Nightly add headingoffset/headingreset HTML attrs behind flag#29931

Merged
caugner merged 9 commits into
mdn:mainfrom
Th3S4mur41:feat/headingoffset
Jul 3, 2026
Merged

Chrome 151 / Firefox Nightly add headingoffset/headingreset HTML attrs behind flag#29931
caugner merged 9 commits into
mdn:mainfrom
Th3S4mur41:feat/headingoffset

Conversation

@Th3S4mur41

Copy link
Copy Markdown
Contributor

Summary

Firefox and Chrome are prototyping headingoffset and headingreset attributes behind flags

The feature is currently available in:

  • Firefox Nightly (153) with the flag dom.headingoffset.enabled
  • Chrome 151 behind #enable-experimental-web-platform-features

Test results and supporting details

Verified support with the Following CodePen: https://codepen.io/editor/th3s4mur41/pen/019e8da3-90df-7090-ae14-3e4541413757

@github-actions github-actions Bot added the data:html Compat data for HTML elements. https://developer.mozilla.org/docs/Web/HTML label Jun 26, 2026
@github-actions github-actions Bot added the size:m [PR only] 25-100 LoC changed label Jun 26, 2026
@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Tip: Review these changes grouped by change (recommended for most PRs), or grouped by feature (for large PRs).

@caugner caugner changed the title Add compat data for headingoffset and headingreset attributes Chrome 151 / Firefox Nightly add headingoffset/headingreset HTML attrs behind flag Jul 1, 2026
Comment thread html/global_attributes.json Outdated
Comment thread html/global_attributes.json Outdated
Comment thread html/global_attributes.json Outdated
Comment thread html/global_attributes.json Outdated
Comment thread html/global_attributes.json Outdated
Comment thread html/global_attributes.json Outdated
Th3S4mur41 and others added 2 commits July 1, 2026 16:51
Co-authored-by: Claas Augner <495429+caugner@users.noreply.github.com>
@Th3S4mur41

Copy link
Copy Markdown
Contributor Author

Thanks @caugner, I've applied the suggested changes

@Th3S4mur41 Th3S4mur41 requested a review from caugner July 2, 2026 08:07

@caugner caugner left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's add data for the corresponding HTMLElement properties at the same time:

Implementations:

@github-actions github-actions Bot added size:l [PR only] 101-1000 LoC changed and removed size:m [PR only] 25-100 LoC changed labels Jul 3, 2026
@Th3S4mur41

Copy link
Copy Markdown
Contributor Author

Done, should we keep still keep them as global attributes, or only on corresponding Elements?

@Th3S4mur41 Th3S4mur41 requested a review from caugner July 3, 2026 10:09
@caugner

caugner commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Done, should we keep still keep them as global attributes, or only on corresponding Elements?

Sorry, I should have been more precise:

  • html.global_attributes.headingoffset refers to <h1 id="foo" headingoffset="…">,
  • whereas api.HTMLElement.headingOffset refers to accessing the value in the DOM: document.getElementById('foo').headingOffset

@github-actions github-actions Bot added the data:api Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API label Jul 3, 2026
@Th3S4mur41

Copy link
Copy Markdown
Contributor Author

Thanks for the clarification, that makes sense.
Should there be a note regarding Chrome implementing it on Element considering this still might change?

@caugner

caugner commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Should there be a note regarding Chrome implementing it on Element considering this still might change?

Good point. There seems to be prior art, so it's worth adding a note ("Implemented on the `Element` interface instead of the `HTMLElement` interface."):

"firefox": {
"version_added": "1",
"notes": "Before Firefox 35, it was implemented on the `Node` interface."
},

It doesn't warrant setting partial implementation though.

@Th3S4mur41

Copy link
Copy Markdown
Contributor Author

Done ☺️

Comment thread api/HTMLElement.json Outdated
Comment thread api/HTMLElement.json Outdated
Co-authored-by: Claas Augner <495429+caugner@users.noreply.github.com>
@caugner

caugner commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Thank you! 🙌

@caugner caugner enabled auto-merge (squash) July 3, 2026 11:21
@caugner caugner merged commit f56127f into mdn:main Jul 3, 2026
9 checks passed
@mdn-bot mdn-bot mentioned this pull request Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

data:api Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API data:html Compat data for HTML elements. https://developer.mozilla.org/docs/Web/HTML size:l [PR only] 101-1000 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants