CSS pseudo class "has()" not supported
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 3.4k
- Forks
- 361
- Avg merge
- 3d 41m
- Merged PRs (30d)
- 2
Description
Hi!
I have a case with this CSS in an email:
p:has(br:only-child) {
margin: 0;
display: none;
}
I'm using
$config->set('Filter.ExtractStyleBlocks', true);
The result is:
p {
margin: 0;
display: none;
}
Looks like neither "has()" nor ":only-child" is supported? ":first-child" is supported as far as I saw.
Can I add those 2 missing CSS pseudo selectors/classes somehow via configuration?
Contributor guide
No contributing guide indexed for this repository
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.
Research direction
Start by tracing the ExtractStyleBlocks configuration into the CSS sanitization path and locating how pseudo-classes are handled. Use the supplied p:has(br:only-child) example as the acceptance case; done means these selectors are preserved or supported without regressing existing selectors such as :first-child.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css, php
- Domain
- security, web-dev
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 46/100