html - 伪元素中的 "searchable, selectable, and available"是否不一致?

标签 html css

我正在搜索::before/::after 伪元素并找到了这个 description ...

1.1. Accessibility of Generated Content

Generated content should be searchable, selectable, and available to assistive technologies. The content property applies to speech and generated content must be rendered for speech output. [CSS3-SPEECH]

在另一个place ...

Since they are not restricted to fitting into the document tree, they can be used to select and style portions of the document that do not necessarily map to the document’s tree structure.

and

Like pseudo-classes pseudo-elements do not appear in or modify the document source or document tree. Accordingly, they also do not affect the interpretation of structural pseudo-classes or other selectors pertaining to their originating element or its tree.

确保未映射到文档且不存在的内容“可搜索、可选择和可用”是否一致?如果它不在文档树中,则它不应该是可选的。

如果该内容已经在 CSSWG 中讨论过(或总结过),请告诉我该主题讨论的位置,以及如何实现与当前规范一致的“可搜索、可选择和可用”。

或者,如果您有更好的讨论这个问题的地方,请发表评论。

最佳答案

@Alohci 的 comments ...

There's a difference between the current state of the art, and what is possible. "Searchable and selectable" are probably limited to the document tree at the current time, but there's no fundamental reason why that needs to be the case. That's kind of the point of the phrase that you quote at the start of your question - that those actions need to be moved to be actions on the render tree instead. But that's a big change and hasn't happened yet.

On the other hand, it's not that radical. for instance you can't select or search parts of the document tree that are display:none, so browsers already take some account of the render tree.

如果您有答案,请另外发布以供将来引用。

关于html - 伪元素中的 "searchable, selectable, and available"是否不一致?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60012684/

相关文章:

css - 如何使用 CSS 分别为列表项添加下划线?

jquery - Owl Carousel 不显示视频

html - 左右对齐一个div内的两个div

python - BeautifulSoup 不读取请求获得的整个 HTML

css - html5 Up Highlights-添加不同风格的 float 导航栏

php - 在 PHP 中使用 echo 后不显示 HTML 元素

css - 无法在 Chrome 开发者工具中保存 style.css

javascript - 使用 JavaScript 动态显示数组数据

javascript - 出现错误 : Cannot set property 'innerHTML' of null

html - 不可能的? HTML <TD> 鼠标悬停边框颜色随边框折叠而变化?