-
Notifications
You must be signed in to change notification settings - Fork 402
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: improve fallback detection check
This commit updates fallback-related checks and refactors the code used for checking references to publication resources. The following checks are introduced or updated: - `RSC-032` (new): reports foreign resources with no fallback used in content documents. Replaces `MED-001`, `MED-002`, and `CSS-010` - `MED-003` now reports when an `img` element child of a `picture` element is not a core media type. - `MED-001` is suppressed. It was used to report a video `poster` attribute did not reference a core image media type. It is now reported as `RSC-032`. - `MED-002` is suppressed. It was used to report HTML elements referencing foreign resources without fallback. It is now reported as `RSC-032`. - `CSS-010` is suppressed. It was used to report references to foreign stylesheets with no fallback. It is now reported as `RSC-032`. - `OPF_040` is now reported when the `fallback` attribute of a package document `item` element does not points to an existing ID. This was previously implemented as a Schematron check (`RSC-005`) in EPUB 3.x. - `OPF-013` is now a warning. It is reported when a MIME type declared inline in content (for instance with an HTML `type` attribute) does not match the MIME type declared in the package document. The code is refactored as follows: - the reference/resource registry functionality of the `XRefChecker` class is extracted to new top-level classes in the (new) package `org.w3c.epubcheck.references`. - `Resource` represents a publication resource - `ResourceRegistry` is a registry of `Resource` instances - `Reference` represents a reference (URL) used anywhere in content - `ReferenceRegistry` is a registry of `Reference` instances - `XRefChecker` is renamed to `ResourceReferencesChecker`. - `ValidationContext` contains optional references to `ResourceRegistry` and `ReferenceRegistry`. - fallback chain resolution is now done in a new `FallbackChainResolver` class, when building `OPFItem` instances from the builders created when parsing the package document. - `XMLHandler` has convenience methods used to register references to the `ReferenceRegistry`. Fix #1304, Fix #1298.
- Loading branch information
Showing
351 changed files
with
3,065 additions
and
2,960 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.