From 05a6a204858fd69e09d887e541e8360eb64b3141 Mon Sep 17 00:00:00 2001 From: MattGarrish Date: Wed, 29 Jul 2020 10:11:59 -0300 Subject: [PATCH] feat: check playback properties do not have 'refines' attribute --- .../adobe/epubcheck/schema/30/package-30.sch | 76 +++++++++++-------- ...diaoverlays-active-class-refines-error.opf | 21 +++++ ...ys-playback-active-class-refines-error.opf | 21 +++++ .../mediaoverlays-package-document.feature | 16 +++- 4 files changed, 102 insertions(+), 32 deletions(-) create mode 100644 src/test/resources/epub3/files/package-document/mediaoverlays-active-class-refines-error.opf create mode 100644 src/test/resources/epub3/files/package-document/mediaoverlays-playback-active-class-refines-error.opf diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/package-30.sch b/src/main/resources/com/adobe/epubcheck/schema/30/package-30.sch index 07d09354d..de969e3fd 100644 --- a/src/main/resources/com/adobe/epubcheck/schema/30/package-30.sch +++ b/src/main/resources/com/adobe/epubcheck/schema/30/package-30.sch @@ -99,36 +99,6 @@ - - - - - - media overlay items must be of - the "application/smil+xml" type (given type was "") - - - - - - global - media:duration meta element not set - - - - - - - - - - item - media:duration meta element not set (expecting: meta property='media:duration' - refines='') - - - @@ -302,6 +272,52 @@ + + + + + + + + media overlay items must be of + the "application/smil+xml" type (given type was "") + + + + + + global + media:duration meta element not set + + + + + + + + + + item + media:duration meta element not set (expecting: meta property='media:duration' + refines='') + + + + + + @refines must not be used with the media:active-class property + + + + + + @refines must not be used with the media:playback-active-class property + + + + + diff --git a/src/test/resources/epub3/files/package-document/mediaoverlays-active-class-refines-error.opf b/src/test/resources/epub3/files/package-document/mediaoverlays-active-class-refines-error.opf new file mode 100644 index 000000000..746ae478b --- /dev/null +++ b/src/test/resources/epub3/files/package-document/mediaoverlays-active-class-refines-error.opf @@ -0,0 +1,21 @@ + + + + Title + en + NOID + 2019-01-01T12:00:00Z + -epub-media-overlay-active + + 10min + 10min + + + + + + + + + \ No newline at end of file diff --git a/src/test/resources/epub3/files/package-document/mediaoverlays-playback-active-class-refines-error.opf b/src/test/resources/epub3/files/package-document/mediaoverlays-playback-active-class-refines-error.opf new file mode 100644 index 000000000..620b0393e --- /dev/null +++ b/src/test/resources/epub3/files/package-document/mediaoverlays-playback-active-class-refines-error.opf @@ -0,0 +1,21 @@ + + + + Title + en + NOID + 2019-01-01T12:00:00Z + -epub-media-overlay-playing + + 10min + 10min + + + + + + + + + \ No newline at end of file diff --git a/src/test/resources/epub3/mediaoverlays-package-document.feature b/src/test/resources/epub3/mediaoverlays-package-document.feature index 4ab7b6628..0910087ed 100644 --- a/src/test/resources/epub3/mediaoverlays-package-document.feature +++ b/src/test/resources/epub3/mediaoverlays-package-document.feature @@ -43,7 +43,19 @@ Feature: EPUB 3 ▸ Media Overlays ▸ Package Document Checks Scenario: the 'media:duration' property can be expressed as a full clock value When checking file 'mediaoverlays-duration-fullclock-valid.opf' Then no errors or warnings are reported - + Scenario: the 'media:duration' property can be expressed as a timecount value When checking file 'mediaoverlays-duration-timecount-valid.opf' - Then no errors or warnings are reported \ No newline at end of file + Then no errors or warnings are reported + + Scenario: Report a 'media:active-class' property with a refines attribute + When checking file 'mediaoverlays-active-class-refines-error.opf' + Then error RSC-005 is reported + And the message contains "must not be used with the media:active-class property" + And no other errors or warnings are reported + + Scenario: Report a 'media:playback-active-class' property with a refines attribute + When checking file 'mediaoverlays-playback-active-class-refines-error.opf' + Then error RSC-005 is reported + And the message contains "must not be used with the media:playback-active-class property" + And no other errors or warnings are reported