-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Add :heading and :heading() pseudo-classes #11413
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Should we revisit the UA style sheet at this point as well? Coupling them makes some sense to me.
I guess leaving out the change to the individual I'm double checking whether WebKit is interested, but I suspect so. |
<code>h1</code>, <code>h2</code>, <code>h3</code>, <code>h4</code>, <code>h5</code>, and | ||
<code>h6</code> elements.</p></dd> | ||
|
||
<dt><dfn selector noexport data-x="selector-heading-functional">:heading(<var>An+B</var>#)</dfn></dt> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider linking these to https://www.w3.org/TR/css-syntax-3/#anb-microsyntax and maybe https://www.w3.org/TR/css-values-3/#mult-comma as these are both parts of CSS syntax that aren't otherwise mentioned in the HTML spec as far as I can tell.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added references to these specs. Is that good enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I was thinking was the style the CSS specs use, where the parts of the syntax would be links to the spec section describing them. (Eg, the #
would link to directly to the section saying what # does.)
But it looks like HTML doesn't link directly to CSS specs? If that's the case I think this should be fine, but I'm not an expert.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That could be done, but not inside a dfn
since they are interactive. The code
is also turned into a link, so can't use links inside.
HTML doesn't define the syntax, that is defined in https://drafts.csswg.org/selectors-5/#headings so I think it's OK.
@fantasai pointed out to me that in w3c/csswg-drafts#10296 (comment) there was discussion about a different specificity for these pseudo-classes, but this does not appear to be reflected in the changes to the Selectors specification, despite claims back in April that it would be. Can someone clarify this for me? |
The spec states: https://drafts.csswg.org/selectors-5/#headings
This was updated in w3c/csswg-drafts#12404 which while not updated in April as claimed, was updated today! AIUI this is per the resolution in w3c/csswg-drafts#10296 (comment).
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can consider WebKit supportive of adding these. @LeaVerou since you commented on the CSS issue regarding specificity, any final thoughts from you?
<code>h5</code>, and <code>h6</code> elements that have a <span>heading level</span> among | ||
<var>An+B</var>. <ref>CSSSYNTAX</ref> <ref>CSSVALUES</ref></p></dd> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This last part is quite vague, but I guess it's good enough?
I still don't have a strong opinion, I can see arguments for both class-level specificity and tag-level specificity. |
Fixes #11412.
(See WHATWG Working Mode: Changes for more details.)
/rendering.html ( diff )
/semantics-other.html ( diff )