-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
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; }>
https://html.spec.whatwg.org/multipage/rendering.html#sections-and-headings
PaulineNemchak and FaisalRaihan777RokeJulianLockhart
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
Select code repository
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
hgroup
special styling could probably be removed sincehgroup
usage is a lot lower than the sectioning elements, and multiple headings inhgroup
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.
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
-h5
inhgroup
styling removed in #7886zcorpan commentedon May 3, 2022
Adding
agenda+
to check interest in adding a use counter forh1
with 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 :)
63 remaining items
zcorpan commentedon May 9, 2025
I think the Chromium use counter has some amount of false positives because some sites have a flash of unstyled content (due to forcing layout or loading CSS async). See GoogleChrome/lighthouse#16404 (comment)
mfreed7 commentedon May 9, 2025
Thanks for the link - I hadn't seen that bug report. (Makes me happy that the deprecation->Lighthouse->developer path is working!) At first I was thinking about how to avoid providing the deprecation message in that FOUC case, but I think maybe the counter/message is working as expected. 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?
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 usingx
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?
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.