Skip to content

False-positive with the CSS :not pseudo-class #1354

Closed

Description

@jeandeaual

With the following content:

<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" xml:lang="en">
  <head>
    <title>CSS test for :not</title>
    <style>
      @namespace epub "http://www.idpf.org/2007/ops";

      :not(nav.class) > h1 {
        color: blue;
      }

      :not(nav[epub|type="landmarks"]) > h1 {
        text-decoration: underline;
      }
    </style>
  </head>
  <body>
    <nav epub:type="toc">
      <h1>Table of Contents</h1>
    </nav>
    <nav epub:type="landmarks">
      <h1>Guide</h1>
    </nav>
  </body>
</html>

EPUBCheck lists these two errors:

Validating using EPUB version 3.2 rules.
ERROR(CSS-008): epubcheck-issue.epub/EPUB/xhtml/epubcheck-issue.xhtml(10,21): An error occurred while parsing the CSS: Token ")" not allowed here.
ERROR(CSS-008): epubcheck-issue.epub/EPUB/xhtml/epubcheck-issue.xhtml(14,25): An error occurred while parsing the CSS: Token "=" not allowed here.

Check finished with errors
Messages: 0 fatals / 2 errors / 0 warnings / 0 infos

EPUBCheck completed

The CSS appears to be correct, so I believe EPUBCheck should not report any errors.

Here's a small EPUB file that reproduces the issue (renamed to .zip, otherwise it wouldn't upload):
epubcheck-issue.zip

Activity

  1. added this to the v5.0.0-beta milestone on Nov 17, 2022
  2. self-assigned this
    on Nov 17, 2022
  3. added
    status: in progressThe issue is being implemented by the development team
    and removed on Nov 17, 2022
  4. added a commit that references this issue on Nov 28, 2022
    5635807
  5. added and removed
    status: in progressThe issue is being implemented by the development team
    on Dec 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

status: completedWork completed, can be closedtype: false-positiveThis issue is about valid content being incorrectly rejected

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    ⌂ 换网址