Repository navigation
Closed
Labels
topic: renderingHow elements are expected to render: the user agent style sheet
Description
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; }>
Reacted by Pauline Nemchak, FaisalRaihan777 and T1ckbase
Reacted by Mr Beedell, Roke Julian Lockhart
Metadata
Metadata
Assignees
Labels
topic: renderingHow elements are expected to render: the user agent style sheet
Activity
domenic commentedon Apr 28, 2022
Seems extremely unlikely.
annevk commentedon May 3, 2022
Unlikely, but also quite unfortunate. I'd certainly support someone investigating this.
cc @whatwg/css
zcorpan commentedon May 3, 2022
The
hgroupspecial styling could probably be removed sincehgroupusage is a lot lower than the sectioning elements, and multiple headings inhgroupis 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.
HTML: Test UA style for h1..h6, hgroup, sectioning elements
Remove UA style for h2-h5 in hgroup
Remove UA style for h2-h5 in hgroup
zcorpan commentedon May 3, 2022
h2-h5inhgroupstyling removed in #7886zcorpan commentedon May 3, 2022
Adding
agenda+to check interest in adding a use counter forh1with a sectioning element ancestor and no Author Origin style forfont-size.zcorpan commentedon May 5, 2022
We didn't get to this issue in the triage meeting today. Optimistically tagging @mfreed7 :)
mfreed7 commentedon Jun 2, 2022
Sorry for the delay responding here. +@lilles because such an applied-styles use counter (at least in Chromium) would fall more onto his domain.
Remove UA style for h2-h5 in hgroup
lilles commentedon Jun 7, 2022
@mfreed7 I need an executive summary of what to respond to. I'm totally out of context.
49 remaining items
zcorpan commentedon May 12, 2025
Yeah, no need to tweak the use counter IMO.
zcorpan commentedon May 13, 2025
Status update: still no broken site reports. Rollout is now active for 10% of release.
zcorpan commentedon May 20, 2025
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.
zcorpan commentedon Jun 24, 2025
Firefox 140 shipped today!
mfreed7 commentedon Jun 27, 2025
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.
AtkinsSJ commentedon Jul 9, 2025
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
emilio commentedon Jul 9, 2025
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 usingxinstead, 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?
domenic commentedon Jul 10, 2025
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.
mfreed7 commentedon Jul 10, 2025
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.
Remove UA styles for h1 in article, aside, nav, section
Disable "special H1 behavior" by default
mfreed7 commentedon Jul 23, 2025
The special rules will be disabled in Chromium as of M140.
layout: Remove legacy UA stylesheet rules for h1-h6 in section
layout: Replace UA stylesheet usage of legacy :matches by :is (servo#…