Skip to content

Remove UA style for h1-h6 in section (et. al.) and hgroup #7867

Closed

Description

@zcorpan

If/when #7829 is merged, the following UA style doesn't make sense. Can it be removed?

In the following CSS block, x is shorthand for the following selector: :is(article, aside, nav, section)

@namespace url(http://www.w3.org/1999/xhtml);

x h1 { margin-block-start: 0.83em; margin-block-end: 0.83em; font-size: 1.50em; }
x x h1 { margin-block-start: 1.00em; margin-block-end: 1.00em; font-size: 1.17em; }
x x x h1 { margin-block-start: 1.33em; margin-block-end: 1.33em; font-size: 1.00em; }
x x x x h1 { margin-block-start: 1.67em; margin-block-end: 1.67em; font-size: 0.83em; }
x x x x x h1 { margin-block-start: 2.33em; margin-block-end: 2.33em; font-size: 0.67em; }

x hgroup > h1 ~ h2 { margin-block-start: 1.00em; margin-block-end: 1.00em; font-size: 1.17em; }
x x hgroup > h1 ~ h2 { margin-block-start: 1.33em; margin-block-end: 1.33em; font-size: 1.00em; }
x x x hgroup > h1 ~ h2 { margin-block-start: 1.67em; margin-block-end: 1.67em; font-size: 0.83em; }
x x x x hgroup > h1 ~ h2 { margin-block-start: 2.33em; margin-block-end: 2.33em; font-size: 0.67em; }

x hgroup > h1 ~ h3 { margin-block-start: 1.33em; margin-block-end: 1.33em; font-size: 1.00em; }
x x hgroup > h1 ~ h3 { margin-block-start: 1.67em; margin-block-end: 1.67em; font-size: 0.83em; }
x x x hgroup > h1 ~ h3 { margin-block-start: 2.33em; margin-block-end: 2.33em; font-size: 0.67em; }

x hgroup > h1 ~ h4 { margin-block-start: 1.67em; margin-block-end: 1.67em; font-size: 0.83em; }
x x hgroup > h1 ~ h4 { margin-block-start: 2.33em; margin-block-end: 2.33em; font-size: 0.67em; }

x hgroup > h1 ~ h5 { margin-block-start: 2.33em; margin-block-end: 2.33em; font-size: 0.67em; }> 

https://html.spec.whatwg.org/multipage/rendering.html#sections-and-headings

Activity

  1. added
    topic: rendering
    on Apr 28, 2022
  2. domenic commented on Apr 28, 2022

    @domenic
    Member

    Seems extremely unlikely.

  3. annevk commented on May 3, 2022

    @annevk
    Member

    Unlikely, but also quite unfortunate. I'd certainly support someone investigating this.

    cc @whatwg/css

  4. zcorpan commented on May 3, 2022

    @zcorpan
    MemberAuthor

    The hgroup special styling could probably be removed since hgroup usage is a lot lower than the sectioning elements, and multiple headings in hgroup is non-conforming with #7829. And it's not implemented in any of Gecko, Chromium, WebKit!

    Demo:
    https://h1-ua-style.glitch.me/

    Maybe it's possible to remove the other rules also; author CSS to set the font-size was needed to get consistent style in older browsers (in particular IE8). But this would need some research.

  5. zcorpan commented on May 3, 2022

    @zcorpan
    MemberAuthor

    h2-h5 in hgroup styling removed in #7886

  6. added
    agenda+
    on May 3, 2022
  7. zcorpan commented on May 3, 2022

    @zcorpan
    MemberAuthor

    Adding agenda+ to check interest in adding a use counter for h1 with a sectioning element ancestor and no Author Origin style for font-size.

  8. zcorpan commented on May 5, 2022

    @zcorpan
    MemberAuthor

    We didn't get to this issue in the triage meeting today. Optimistically tagging @mfreed7 :)

  9. removed
    agenda+
    on Jun 2, 2022
  10. mfreed7 commented on Jun 2, 2022

    @mfreed7
    Contributor

    Sorry for the delay responding here. +@lilles because such an applied-styles use counter (at least in Chromium) would fall more onto his domain.

  11. added a commit that references this issue on Jun 3, 2022
  12. lilles commented on Jun 7, 2022

    @lilles
    Contributor

    @mfreed7 I need an executive summary of what to respond to. I'm totally out of context.

  13. 49 remaining items

  14. zcorpan commented on May 12, 2025

    @zcorpan
    MemberAuthor

    I agree that it likely means the counter is likely a bit higher than it should be, but maybe it's ok given the state of this removal?

    Yeah, no need to tweak the use counter IMO.

  15. zcorpan commented on May 13, 2025

    @zcorpan
    MemberAuthor

    Status update: still no broken site reports. Rollout is now active for 10% of release.

  16. zcorpan commented on May 20, 2025

    @zcorpan
    MemberAuthor

    Status update: still no reported regressions. I'm calling success on the rollout experiment. When 139 is released, I plan to increase the rollout on desktop to 100%. The pref flip will ride the trains for 140.

  17. zcorpan commented on Jun 24, 2025

    @zcorpan
    MemberAuthor

    Firefox 140 shipped today!

  18. mfreed7 commented on Jun 27, 2025

    @mfreed7
    Contributor

    Firefox 140 shipped today!

    Congrats! I'm sure you will, but just to be sure: can you please check in one more time when you think this change "stuck" in Firefox and you're sure it'll stay landed? At that point, I'll request shipment of the change in Blink.

  19. AtkinsSJ commented on Jul 9, 2025

    @AtkinsSJ
    Contributor

    Firefox updated the WPT for this ( web-platform-tests/wpt#53658 ) claiming that this part of the UA stylesheet has been removed when it hasn't? cc: @emilio

  20. emilio commented on Jul 9, 2025

    @emilio
    Contributor

    Ah, you're right, sorry! I think I glanced at https://html.spec.whatwg.org/multipage/rendering.html#sections-and-headings and didn't see :is(..) and assumed it was gone (but it's using x instead, of course :'/).

    So I guess at this point we can revert my change (happy to do that) or merge #11102. Both Firefox 139 and 140 have shipped with it at 100% with no regressions reported.

    @domenic / @annevk / @mfreed7: Slight preference to merge #11102, but let me know either way?

  21. domenic commented on Jul 10, 2025

    @domenic
    Member

    I think per discussions at #11102 (comment) we've reached the threshold for merging the spec PR, so let's do that within the next couple of days.

  22. mfreed7 commented on Jul 10, 2025

    @mfreed7
    Contributor

    @domenic / @annevk / @mfreed7: Slight preference to merge #11102, but let me know either way?

    Definitely let's merge #11102 - it feels like this change has sailed. (Or has ridden the trains?) I'll get started with the process to disable on Chromium.

  23. added a commit that references this issue on Jul 19, 2025
    1af7430
  24. mfreed7 commented on Jul 23, 2025

    @mfreed7
    Contributor

    Definitely let's merge #11102 - it feels like this change has sailed. (Or has ridden the trains?) I'll get started with the process to disable on Chromium.

    The special rules will be disabled in Chromium as of M140.

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

    topic: rendering

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions