Skip to content

Epubcheck error caused by CSS pseudo class :has #1605

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

Open
siddoib opened this issue Mar 14, 2025 · 2 comments
Open

Epubcheck error caused by CSS pseudo class :has #1605

siddoib opened this issue Mar 14, 2025 · 2 comments
Assignees
Labels
priority: high To be processed and published in the next release status: accepted Ready to be further processed type: false-positive This issue is about valid content being incorrectly rejected

Comments

@siddoib
Copy link

siddoib commented Mar 14, 2025

In a CSS file, we have the following lines:

section.chunk.other div:has(img) 
{
  display: flex; 
  border-bottom: 1px solid #D7D2CB;
}

Any ePub file containing this CSS are being flagged by epubCheck 5.2.1 with the following error:

Validating using EPUB version 3.3 rules.
ERROR(CSS-008): 10.1093_45103.001.0001.epub/OEBPS/css/style.css(395,29): An error occurred while parsing the CSS: Token "img" not allowed here.
ERROR(CSS-008): 10.1093_45103.001.0001.epub/OEBPS/css/style.css(395,29): An error occurred while parsing the CSS: Token "img" not allowed here.
Check finished with errors
Messages: 0 fatals / 2 errors / 0 warnings / 0 infos

I can't see anything wrong with the ePub or the CSS, so this is possibility a false positive error message with epubCheck application. Maybe related to #1354?

@rdeltour
Copy link
Member

Thanks for the report!
EPUBCheck's parser predates the :has pseudo-class, so yeah it's probably a false-positive. And yeas it is likely similar to #1354.

I'll fix it for the next maintenance release, and will make sure other functional pseudo-classes are covered too.

@rdeltour rdeltour self-assigned this Mar 24, 2025
@rdeltour rdeltour added status: accepted Ready to be further processed priority: high To be processed and published in the next release type: false-positive This issue is about valid content being incorrectly rejected labels Mar 24, 2025
@rdeltour rdeltour added this to the Next maintenance release milestone Mar 24, 2025
@siddoib
Copy link
Author

siddoib commented Mar 24, 2025

@rdeltour, thank you so much for the confirmation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: high To be processed and published in the next release status: accepted Ready to be further processed type: false-positive This issue is about valid content being incorrectly rejected
Projects
None yet
Development

No branches or pull requests

2 participants