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

fix: report HTML discouraged constructs as "usage" #1458

Merged
merged 1 commit into from
Dec 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ private void initialize()
severities.put(MessageId.HTM_052, Severity.ERROR);
severities.put(MessageId.HTM_053, Severity.SUPPRESSED);
severities.put(MessageId.HTM_054, Severity.ERROR);
severities.put(MessageId.HTM_055, Severity.WARNING);
severities.put(MessageId.HTM_055, Severity.USAGE);
severities.put(MessageId.HTM_056, Severity.ERROR);
severities.put(MessageId.HTM_057, Severity.ERROR);
severities.put(MessageId.HTM_058, Severity.ERROR);
Expand Down
7 changes: 2 additions & 5 deletions src/test/resources/epub3/03-resources/resources.feature
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,14 @@
And no errors or warnings are reported

@spec @xref:sec-foreign-resources
Scenario: Report a foreign resource in HTML `embed` with a manifest fallback
Scenario: Allow a foreign resource in HTML `embed` with a manifest fallback
When checking EPUB 'foreign-xhtml-embed-fallback-valid'
And warning HTM-055 is reported (using embed is discouraged)
And no other errors or warnings are reported
Then no errors or warnings are reported

@spec @xref:sec-foreign-resources
Scenario: Report a foreign resource in HTML `embed` with no fallback
When checking EPUB 'foreign-xhtml-embed-no-fallback-error'
Then error RSC-032 is reported
And warning HTM-055 is reported (using embed is discouraged)
And no other errors or warnings are reported

@spec @xref:sec-foreign-resources
Expand Down Expand Up @@ -652,5 +650,4 @@
Scenario: Report an `embed` element with a `type` attribute not matching the publication resource type
When checking EPUB 'type-mismatch-in-embed-warning'
Then warning OPF-013 is reported
And warning HTM-055 is reported (using embed is discouraged)
And no other errors or warnings are reported
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,10 @@ Feature: EPUB 3 — Content Documents — XHTML

Scenario: Verify that a base url can be set
When checking EPUB 'content-xhtml-base-url-valid'
Then warning HTM-055 is reported (side effect of `base` being discouraged)
Then no errors or warnings are reported

Scenario: Report relative paths as remote resources when HTML `base` is set to an extenal URL (issue 155)
When checking EPUB 'content-xhtml-base-url-remote-relative-path-error'
Then warning HTM-055 is reported (side effect of `base` being discouraged)
Then error RSC-006 is reported
And no other errors or warnings are reported

Expand Down Expand Up @@ -978,20 +976,23 @@ Feature: EPUB 3 — Content Documents — XHTML
#### 6.1.4.3 Discouraged Constructs

Scenario: Report `base` as a discouraged construct
Given the reporting level is set to usage
When checking document 'discouraged-base-warning.xhtml'
Then warning HTM-055 is reported
Then usage HTM-055 is reported
And the message contains 'base'
And no other errors or warnings are reported
And no errors or warnings are reported

Scenario: Report `embed` as a discouraged construct
Given the reporting level is set to usage
When checking document 'discouraged-embed-warning.xhtml'
Then warning HTM-055 is reported
Then usage HTM-055 is reported
And the message contains 'embed'
And no other errors or warnings are reported

Scenario: Report `rp` as a discouraged construct
Given the reporting level is set to usage
When checking document 'discouraged-rp-warning.xhtml'
Then warning HTM-055 is reported 2 times
Then usage HTM-055 is reported 2 times
And the message contains 'rp'
And no other errors or warnings are reported