Skip to content
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

Add "Name from Content" accname step for ::marker pseudo-element #2419

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rahimabdi
Copy link
Contributor

Closes w3c/accname#203

Describe Change Here!

The accname algorithm should account for ::marker CSS-generated content. This PR for provides spec guidance on ensuring ::marker content (that is visible and where the current node supports it) is included in the accname computation.

Test, Documentation and Implementation tracking

Once this PR has been reviewed and has consensus from the working group, tests should be written and issues should be opened on browsers. Add N/A and check when not applicable.

  • "author MUST" tests:
  • "user agent MUST" tests:
  • Browser implementations (link to issue or commit):
    • WebKit:
    • Gecko:
    • Blink:
  • Does this need AT implementations?
  • Related APG Issue/PR:
  • MDN Issue/PR:

Copy link

netlify bot commented Jan 30, 2025

Deploy Preview for wai-aria ready!

Name Link
🔨 Latest commit 46f65ce
🔍 Latest deploy log https://app.netlify.com/sites/wai-aria/deploys/679af1d373876d0008b3af0d
😎 Deploy Preview https://deploy-preview-2419--wai-aria.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@@ -635,8 +635,12 @@ <h4>Computation steps</h4>
<span id="step2F.ii"><!-- Don't link to this legacy numbered ID. --></span><em>Name From Generated Content:</em> Check for
<abbr title="Cascading Style Sheets">CSS</abbr> generated textual content associated with the <code>current node</code> and include it in the <code>accumulated text</code>. The
<abbr title="Cascading Style Sheets">CSS</abbr> <a href="https://www.w3.org/TR/CSS2/generate.html#before-after-content"><code>::before</code> and <code>::after</code></a> pseudo
elements [[!CSS2]] can provide textual content for [=element|elements=] that have a content model.
elements [[!CSS2]] can provide textual content for [=element|elements=] that have a content model, in addition to [=element|elements=] that support the <a href="https://www.w3.org/TR/css-pseudo-4/#selectordef-marker"><code>::marker</code> pseudo element if it is visually rendered.
Copy link
Member

@scottaohara scottaohara Feb 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not opposed to the current wording, but this is how my mind had to translate what was said. just throwing it out as a suggestion as alternate wording.

Suggested change
elements [[!CSS2]] can provide textual content for [=element|elements=] that have a content model, in addition to [=element|elements=] that support the <a href="https://www.w3.org/TR/css-pseudo-4/#selectordef-marker"><code>::marker</code> pseudo element if it is visually rendered.
elements [[!CSS2]] can provide textual content for [=element|elements=] that have a content model. The CSS <a href="https://www.w3.org/TR/css-pseudo-4/#selectordef-marker"><code>::marker</code> pseudo element</a> can also provide textual content for [=element|elements=] that support the pseudo element.

I left out the "if it is visually rendered" bit since that wasn't part of the previous spec text - and it might get confused due to specifically saying "visually rendered" - which is only introduced here in the spec. e.g., opacity: 0; or scale: 0 would be rendered - but not "visually" since they'd be invisible or shrunk to the size of not being visible. does that mean it wouldn' be included then? (my answer would be no - opacity 0 or scale: 0 should not hide content from the a11y tree)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@scottaohara Agreed. My only concern would be for lists, where ::marker is automatically generated depending on list-style-type so I'm curious about the scenario where list-style-type: none visually suppresses the marker (and perhaps list semantics). For ::marker only (and not other CSS properties like opacity, scale), should it be conveyed if it's not visually present?

<ol>
<li id="comp_name_from_content_pseudo_element_marker">
For <code>::marker</code> pseudo elements, <a class="termref">User agents</a> MUST append <abbr title="Cascading Style Sheets">CSS</abbr> textual content, without a space,
to the textual content of the <code>current node</code> if the <code>::marker</code> is visually rendered and the <code>current node</code> supports <code>::marker</code>.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just not sure about "visually rendered" here, per my previous comment. but otherwise think this is fine.

Copy link
Contributor

@MelSumner MelSumner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the visually rendered part is fine, especially since this is related to CSS (which is all about what's visually rendered.

@scottaohara
Copy link
Member

I think the visually rendered part is fine, especially since this is related to CSS (which is all about what's visually rendered.

but as i've already mentioned, there are properties in CSS that do not visually render content (in that they are rendered, but not visible), but they are still included in the accName.

one can't even make the argument that "well they still take up space in the layout, so that counts as their visual rendering" because visibility: hidden content also still takes up space in the visual rendering of the layout - but THAT content is similar to display: none and not exposed to the a11y tree by default.

@rahimabdi
Copy link
Contributor Author

I think the visually rendered part is fine, especially since this is related to CSS (which is all about what's visually rendered.

but as i've already mentioned, there are properties in CSS that do not visually render content (in that they are rendered, but not visible), but they are still included in the accName.

one can't even make the argument that "well they still take up space in the layout, so that counts as their visual rendering" because visibility: hidden content also still takes up space in the visual rendering of the layout - but THAT content is similar to display: none and not exposed to the a11y tree by default.

Thank you @scottaohara @MelSumner. I'm happy to remove the "visually rendered" part. Scott brings up a good point that "visually rendered" isn't existing accname spec language so my only outstanding concern is with treatment of list-style-type: none and if ::marker should participate in accname for that case.

Also, since list-style supports unicode characters, a string value and even images (list-style-image), I'm curious if you think it would beneficial to call these out as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AccName algo probably needs an update for ::marker
3 participants