Skip to content
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

Possible incorrect error reported with inline SVG and external CSS #1198

Closed
garconvacher opened this issue Dec 2, 2020 · 1 comment · Fixed by #1208
Closed

Possible incorrect error reported with inline SVG and external CSS #1198

garconvacher opened this issue Dec 2, 2020 · 1 comment · Fixed by #1208
Assignees
Labels
status: has PR The issue is being processed in a pull request type: false-positive This issue is about valid content being incorrectly rejected
Milestone

Comments

@garconvacher
Copy link

garconvacher commented Dec 2, 2020

Hi,

Inline SVG in XHTML has a filter with and ID (<filter id="issue">)

In an external CSS file, the line filter: url(#issue); produces a "Fragment identifier is not defined" (RSC-012) error.

EPUB sample

@rdeltour rdeltour self-assigned this Dec 2, 2020
@rdeltour rdeltour added this to the v4.2.5 milestone Dec 2, 2020
@rdeltour rdeltour added status: accepted Ready to be further processed type: false-positive This issue is about valid content being incorrectly rejected labels Dec 2, 2020
@rdeltour
Copy link
Member

rdeltour commented Dec 2, 2020

The issue does look like a false-positive to me. Thanks for the report @garconvacher!

rdeltour added a commit that referenced this issue Feb 26, 2021
CSS defines a special processing for the resolution of fragment-only URLs.
These are resolved based on the HTML document, not relative to the
stylesheet.

For example, an SVG filter inlined in the HTML can be refered in CSS as:

```
* {
  filter: url(#filter);
}
```

Such fragment-only URLs were previously reported as errors in EPUBCheck,
since the related fragment could not be found in the CSS document!

This change fixes the issue by ignoring fragment-only URLs in CSS. In
other words, these URLs will not be registered to the XRefChecker.

Fixes #1198
@rdeltour rdeltour added status: has PR The issue is being processed in a pull request and removed status: accepted Ready to be further processed labels Feb 26, 2021
rdeltour added a commit that referenced this issue Feb 26, 2021
CSS defines a special processing for the resolution of fragment-only URLs.
These are resolved based on the HTML document, not relative to the
stylesheet.

For example, an SVG filter inlined in the HTML can be refered in CSS as:

```
* {
  filter: url(#filter);
}
```

Such fragment-only URLs were previously reported as errors in EPUBCheck,
since the related fragment could not be found in the CSS document!

This change fixes the issue by ignoring fragment-only URLs in CSS. In
other words, these URLs will not be registered to the XRefChecker.

Fixes #1198
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: has PR The issue is being processed in a pull request type: false-positive This issue is about valid content being incorrectly rejected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants