diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/edupub/edu-structure.sch b/src/main/resources/com/adobe/epubcheck/schema/30/edupub/edu-structure.sch index 3f55f8092..ce1a13b1d 100644 --- a/src/main/resources/com/adobe/epubcheck/schema/30/edupub/edu-structure.sch +++ b/src/main/resources/com/adobe/epubcheck/schema/30/edupub/edu-structure.sch @@ -2,92 +2,148 @@ - + - - + + - + - - + + - - + + - - - + + + - - - + + + Empty aria-label attribute found. - - The body element requires a heading when it is used as an implied section. - + + The body element requires a + heading when it is used as an implied section. + - - More than one ranked heading found as direct descendant of body. - - Empty ranked heading detected. - - The value of the "aria-label" attribute must not be the same as the content of the heading. + + More than one ranked heading found as direct descendant + of body. + + Empty ranked heading detected. + + The + value of the "aria-label" attribute must not be the same as the content of the + heading. - - - + + + - - + + Empty aria-label attribute found. - - does not have a heading. - + + + does not have a heading. + - - More than one ranked heading found as direct descendant of . - - Empty ranked heading detected. - - The value of the "aria-label" attribute must not be the same as the content of the heading. + + More than one ranked heading found as direct descendant + of . + + Empty ranked heading detected. + + The + value of the "aria-label" attribute must not be the same as the content of the + heading. - - + + - - + + - - + + - - + + - Ranked headings are not valid in figure or blockquote - + Ranked headings are not + valid in figure or blockquote + - The heading rank h does not match the current nesting level (). - + The heading rank + h does not match the current nesting level (). + - The current heading rank should be h6. + The current heading rank should + be h6. - + - Non-section elements not allowed between or after section elements. + Non-section elements not allowed between or + after section elements. - + - - Section subtitles must be wrapped in a header element. + + Section subtitles must be wrapped in a header + element. diff --git a/src/test/resources/epub-edupub/edupub-content-document-xhtml.feature b/src/test/resources/epub-edupub/edupub-content-document-xhtml.feature index f6f95c8cd..e6426b13d 100644 --- a/src/test/resources/epub-edupub/edupub-content-document-xhtml.feature +++ b/src/test/resources/epub-edupub/edupub-content-document-xhtml.feature @@ -41,6 +41,25 @@ Feature: EPUB for Education ▸ XHTML Content Document Checks And the message contains 'The body element requires a heading when it is used as an implied section' And no other errors or warnings are reported + Scenario: Report a missing section heading + When checking document 'edupub-heading-missing-error.xhtml' + Then error RSC-005 is reported + And the message contains 'section does not have a heading' + But no other errors or warnings are reported + + Scenario: Allow a section heading specified as ARIA heading role + When checking document 'edupub-heading-aria-role-valid.xhtml' + Then no errors or warnings are reported + + Scenario: Verify a heading with only an `img` that has alternative text + When checking document 'edupub-heading-img-alt-valid.xhtml' + Then no errors or warnings are reported + + Scenario: Report a heading with only an `img` without alternative text + When checking document 'edupub-heading-img-no-alt-error.xhtml' + Then error RSC-005 is reported + And the message contains 'Empty ranked heading detected' + And no other errors or warnings are reported ## 4.3 Titles and Headings @@ -84,15 +103,3 @@ Feature: EPUB for Education ▸ XHTML Content Document Checks And no other errors or warnings are reported - # No matching section - - Scenario: Verify a heading with only an `img` that has alternative text - When checking document 'edupub-heading-img-alt-valid.xhtml' - Then no errors or warnings are reported - - Scenario: Report a heading with only an `img` without alternative text - When checking document 'edupub-heading-img-no-alt-error.xhtml' - Then error RSC-005 is reported - And the message contains 'Empty ranked heading detected' - And no other errors or warnings are reported - diff --git a/src/test/resources/epub-edupub/files/content-document-xhtml/edupub-heading-aria-role-valid.xhtml b/src/test/resources/epub-edupub/files/content-document-xhtml/edupub-heading-aria-role-valid.xhtml new file mode 100644 index 000000000..de61d843a --- /dev/null +++ b/src/test/resources/epub-edupub/files/content-document-xhtml/edupub-heading-aria-role-valid.xhtml @@ -0,0 +1,12 @@ + + + + Test + + + +
+ Heading +
+ + diff --git a/src/test/resources/epub-edupub/files/content-document-xhtml/edupub-heading-missing-error.xhtml b/src/test/resources/epub-edupub/files/content-document-xhtml/edupub-heading-missing-error.xhtml new file mode 100644 index 000000000..258c14a18 --- /dev/null +++ b/src/test/resources/epub-edupub/files/content-document-xhtml/edupub-heading-missing-error.xhtml @@ -0,0 +1,12 @@ + + + + Test + + + +
+ +
+ +