-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Remove UA style for h1-h6 in section (et. al.) and hgroup #7867
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Seems extremely unlikely. |
Unlikely, but also quite unfortunate. I'd certainly support someone investigating this. cc @whatwg/css |
The Demo: 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. |
Not including the special styling of h2-h5 in hgroup which is not implemented in browsers. See whatwg/html#7867
|
Adding |
We didn't get to this issue in the triage meeting today. Optimistically tagging @mfreed7 :) |
Sorry for the delay responding here. +@lilles because such an applied-styles use counter (at least in Chromium) would fall more onto his domain. |
This was introduced in f729a76 but was not implemented in browsers. Part of whatwg#7867.
@mfreed7 I need an executive summary of what to respond to. I'm totally out of context. |
Summary: If it's web-compatible, I think we should remove this part of the spec:
To determine web compatibility, is there interest in adding a use counter for When such a use counter exists on Stable, I can query for pages in httparchive that hit the use counter and analyze the compat impact. |
Thanks! Looking at the UA sheet and our impl it seems that a counter shouldn't be too tricky to add. Reported: https://crbug.com/1334570 |
Counter landed (for M105):
https://chromium-review.googlesource.com/c/chromium/src/+/3698090
ons. 8. jun. 2022 kl. 11:44 skrev Simon Pieters ***@***.***>:
… Summary:
If it's web-compatible, I think we should remove this part of the spec:
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; }
To determine web compatibility, is there interest in adding a use counter
for h1 with a sectioning element ancestor and no Author Origin style for
font-size? (I assume that changes to margin are more acceptable than
font-size.)
When such a use counter exists on Stable, I can query for pages in
httparchive that hit the use counter and analyze the compat impact.
—
Reply to this email directly, view it on GitHub
<#7867 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAGZFVLC77YL2SOELQRPHPLVOBTPTANCNFSM5USM32CQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Rune Lillesveen
|
Thanks @lilles! Per https://chromiumdash.appspot.com/schedule it should reach stable on August 30. With some luck it will be included in the September 1st HTTP Archive run. |
Data so far is not that encouraging: https://chromestatus.com/metrics/feature/timeline/popularity/4272 |
Removes the idea of sectioning content influencing the document's outline. Instead, the outline is derived from all of the document's h1-h6 elements. (Sectioning content still plays a role in scoping header and footer elements.) This ensures that the outline generated by the outline algorithm, i.e. the document's semantics for authors, better aligns with the way screen reader users navigate through headings and the corresponding normative requirements for implementations in the HTML-AAM specification. Updates the hgroup element to have a new content model, to use p elements for related content such as subheadings, alternative titles, or taglines (instead of using heading elements for those). Updates all of the spec's examples to have proper outlines, according to the new outline algorithm. This includes preferring h2 to h1 in markup fragment cases, so as to better suggest that they are part of a larger document whose outline contains a h1. Closes #83. Closes #3499 by superseding it. Closes #6462 by updating hgroup's suggested usage instead of obsoleting it. See #7867 for potential followup work in avoiding sectioning content and hgroup influencing the style of h1-h6 elements. Co-authored-by: Anne van Kesteren <[email protected]> Co-authored-by: Domenic Denicola <[email protected]>
Hi, I'm a teacher, and the other day I talked about the section element and the outline algorithm that was in the spec but never implemented. I also showed students how the font size of nested section headings still decreases visually. They found that confusing. Is this the right place to keep track of the progress? The last comment was a year ago. Are there any updates? Thank you, |
Thanks for pinging this thread. Per the above data, it looks like removing this would break about 0.6% of the web. I suspect no browsers are enthusiastic about doing that. So, shall we close this? |
Make sense, thank you for clarifying! |
Stylesheet for web developers to opt in to the new (or original) styling now:
If you want to add this to a reset stylesheet but don't want to override any other style rule, use
|
* Suggest specifying font-size and margin-block on h1 See whatwg/html#7867 * Apply suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Chris Mills <[email protected]> * Update files/en-us/web/html/element/heading_elements/index.md Co-authored-by: Simon Pieters <[email protected]> * Update files/en-us/web/html/element/heading_elements/index.md Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Chris Mills <[email protected]> Co-authored-by: Estelle Weyl <[email protected]>
Gecko will now show a console warning when there's no author-specified font-size or margin: https://bugzilla.mozilla.org/show_bug.cgi?id=1937568
I've filed https://issues.chromium.org/issues/394111284 |
Hey so I've finally gotten around to marking this deprecated. One question: all of the announcements and discussion has been around "h1 within section". But the spec talks about |
Thank you! Yes, should be h1 in any of article, aside, nav, section. |
Thanks! Is there a spec PR to actually remove the section in question? Even if it doesn't land, it'd be helpful for my intent to deprecate, which requests links to the spec or spec PR. Since I think this is a serious attempt to remove this stuff, it seems like we should put up a PR to do so. |
There is now: #11102 |
See the I2D: https://groups.google.com/a/chromium.org/g/blink-dev/c/OWd80XhwHrI/m/I0ewlsF0AQAJ And the spec discussion: whatwg/html#7867 This CL will register a deprecation on any site that relies on the UA-provided non-2-em font rule on H1's within <article>, <aside>, <nav>, or <section>. Bug: 394111284 Change-Id: Ib8ceebadf861a2dc591f60b0da8d6288f647a828 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6318939 Commit-Queue: Mason Freed <[email protected]> Reviewed-by: Rune Lillesveen <[email protected]> Cr-Commit-Position: refs/heads/main@{#1429280}
Thanks! And just a quick update that Chrome v136 will now show deprecation warnings for ![]() Can you comment on the timeline for removal of this behavior from stable Firefox? There were questions from the Blink API owners about that. I'd like to follow your lead, letting Firefox turn them off for a bit and see what problems surface, and then if not too bad, disable in Blink. |
Great! We're planning to start a staged rollout soon (bug). There's no set timeline yet, I can comment here when I know. |
The current plan is:
Intent to unship: https://groups.google.com/a/mozilla.org/g/dev-platform/c/CzG_pVa7pws/m/Ab3Bwsg2BQAJ |
We published an article on MDN https://developer.mozilla.org/en-US/blog/h1-element-styles/ (comments on Hacker News) |
Status update: we have received 0 broken site reports due to this change since starting the rollout in beta. We'll continue with the rollout in release as planned. |
Status update: the change has been rolled out to 5% of Firefox 138 release since April 29. Still no broken site reports. The rollout will continue as planned and we have landed the pref flip now which is targeting v140. |
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) |
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? |
Yeah, no need to tweak the use counter IMO. |
Status update: still no broken site reports. Rollout is now active for 10% of release. |
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. |
If/when #7829 is merged, the following UA style doesn't make sense. Can it be removed?
https://html.spec.whatwg.org/multipage/rendering.html#sections-and-headings
The text was updated successfully, but these errors were encountered: