Add data for CSS Highlight Inheritance (::selection, ::target-text)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 66/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- css, json
- Domain
- data
Research direction
Start with css/selectors/selection.json and the existing text-decoration subfeature. Compare the proposed inheritance entry with the spec and linked Chrome and Mozilla reports to establish browser version data, including Chrome’s removal and re-enablement. Done when the ::selection and ::target-text compatibility data captures the inheritance behavior and is consistent with the confirmed browser support.
Written by the indexing model from the issue text.
Description
What type of issue is this?
Missing compatibility data
What information was incorrect, unhelpful, or incomplete?
BCD has no entry for CSS highlight inheritance. So, the ::selection compat table can not show that browsers differ on this behavior.
In browsers that implement the spec’s highlight inheritance model, a child’s ::selection inherits from its parent’s ::selection. In browsers that don’t, it uses the older originating-element model. This changes the result of the example in MDN’s Pseudo-elements article in Firefox. Selected text in the child stays green instead of inheriting red from the parent.
In Firefox:
Current state of support, as far as I can tell:
-
Chrome: the Chrome blog says the change shipped in 131, was removed because of compatibility issues, and was re-enabled in 134 for
::selectionand::target-text -
Firefox: not implemented. Mozilla bug [also check the bug cited in #22218]
-
Safari: I did not test for it.
Spec: https://drafts.csswg.org/css-pseudo-4/#highlight-cascade
What browsers does this problem apply to, if applicable?
Firefox
What did you expect to see?
A compat entry for CSS highlight inheritance under ::selection (and ::target-text), so the table shows which browsers use the spec’s highlight inheritance model (a child’s ::selection inherits from its parent’s ::selection) and which still use originating-element inheritance. Firefox should be listed as not supporting it (version_added: false), with Chrome’s support starting in the version the data confirms (the Chrome blog says 134, after a removal from 131).
In Chrome / Brave:
Did you test this? If so, how?
Yes. I ran the example from MDN’s Pseudo-elements article in Firefox [v158.0] and Chrome [v155.0] / Brave [v155.1].
In Chrome and Brave, selected text in the child inherits red from the parent’s ::selection. In Firefox, the child’s selected text stays green because it inherits from the child element instead.
I did not test for Safari.
Can you link to any release notes, bugs, pull requests, or MDN pages related to this?
- Chrome blog post: highlight inheritance shipped in 131, removed, re-enabled in 134
- Mozilla bug 1999628
- Previous BCD PR #22218 (closed unmerged)
- MDN content issues: #44722 and #36458
- Spec: highlight cascade
- Existing
text-decorationsubfeature inselection.json, as a model 134)
Do you have anything more you want to share?
Related History: #22218 proposed this data but was closed unmerged, apparently because Chrome’s status changed. MDN content issues #44722 and #36458 discuss the documentation side, and #44722 points to BCD as the place for browser differences.
Proposal: Add an inheritance subfeature, following the structure of #22218 and the existing text-decoration subfeature in css/selectors/selection.json.
Questions:
-
How should Chrome’s 131 release and removal be recorded, versus 134?
-
Is this the right structure? I’m happy to submit a PR once you confirm.
MDN URL
No response
MDN metadata
No response
- Dominant language
- JSON
- Stars
- 5.8k
- Forks
- 2.7k
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 160
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from mdn/browser-compat-data
-
Web extensions - Safari Technology Preview 257 data and the message_serialization manifest keyPossibly taken @xeenon claimed this today. Openneeds triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
mdn/browser-compat-data#31192 ·
Maintainers usually reply within 1 day
-
api.WGSLLanguageFeatures - Firefox supports three featuresPossibly taken @Manishram-ai claimed this 1 day ago. Opendata:api needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
mdn/browser-compat-data#31175 ·
Maintainers usually reply within 1 day
-
needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
mdn/browser-compat-data#31069 · 1 comment ·
Maintainers usually reply within 1 day
-
needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
mdn/browser-compat-data#31057 · 2 comments ·
Maintainers usually reply within 1 day
-
api.Window.devicePixelRatio - Does change with page zoom in Safari (webkit)Possibly taken @Manishram-ai claimed this 1 day ago. Opendata:api needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
mdn/browser-compat-data#31039 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
All issues in mdn/browser-compat-data
Similar issues
-
author-page correction move-papers
Difficulty 1/5 Under an hour Newbie friendliness 78/100
acl-org/acl-anthology#10978 · 1 comment ·
Maintainers usually reply within 1 day
-
Missing ToCsOpen
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
davwheat/rail-announcements#395 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
soroswap/token-list#125 ·
Maintainers usually reply within 1 day
-
module/data.csv Type/Bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
ballerina-platform/ballerina-library#9792 ·
Maintainers usually reply within 1 day
-
automation missing-model model-sync provider:github-copilot
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
anomalyco/models.dev#14022 ·
Maintainers usually reply within 1 day