Skip to content

Commit

Permalink
fix: a11y:pageBreakSource without prefix, revert 8691948 and added co…
Browse files Browse the repository at this point in the history
…mments, Fixes #403
  • Loading branch information
danielweck committed Dec 2, 2024
1 parent c15a34d commit 3c96999
Show file tree
Hide file tree
Showing 19 changed files with 33 additions and 28 deletions.
9 changes: 7 additions & 2 deletions packages/ace-core/src/checker/checker-epub.js
Original file line number Diff line number Diff line change
Expand Up @@ -510,10 +510,15 @@ function checkPageSource(assertion, epub) {
&& (
(!epub.metadata['dc:source'] || epub.metadata['dc:source'].toString() === '')
&&
// https://github.com/daisy/ace/issues/403
// a11y: pageBreakSource vs. pageBreakSource?? (examples were inconsistent, now fixed)
// https://www.w3.org/publishing/a11y/page-source-id/#examples
// https://www.w3.org/TR/epub-a11y-tech-11/#pageSource
// a11y:pageBreakSource or pageBreakSource?? (inconsistent examples)
(!epub.metadata['a11y:pageBreakSource'] || epub.metadata['a11y:pageBreakSource'].toString() === '')
// https://www.w3.org/TR/epub/#sec-default-vocab
// https://github.com/w3c/epub-specs/issues/2667
// https://github.com/w3c/epub-specs/pull/2668
// EPUBCHECK: https://github.com/w3c/epubcheck/issues/1491 + https://github.com/w3c/epubcheck/issues/1491 + https://github.com/w3c/epubcheck/pull/1507
(!epub.metadata['pageBreakSource'] || epub.metadata['pageBreakSource'].toString() === '')
&&
(!epub.metadata['rendition:layout'] || epub.metadata['rendition:layout'].toString() !== "pre-paginated")
)
Expand Down
4 changes: 2 additions & 2 deletions packages/ace-core/src/l10n/locales/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
},
"pagesourceviolation": {
"kbtitle": "Sidenavigation",
"resdesc": "Tilføj et 'dc:source / a11y:pageBreakSource' metadata-element til pakke-dokumentet",
"ruledesc": "Publikationer med sideskift skal angive et 'dc:source / a11y:pageBreakSource' metadata-element",
"resdesc": "Tilføj et 'dc:source / pageBreakSource' metadata-element til pakke-dokumentet",
"ruledesc": "Publikationer med sideskift skal angive et 'dc:source / pageBreakSource' metadata-element",
"testdesc": "Sikrer at kilden til sideskift er identificeret"
},
"titleviolation": {
Expand Down
4 changes: 2 additions & 2 deletions packages/ace-core/src/l10n/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
},
"pagesourceviolation": {
"kbtitle": "Seitennavigation",
"resdesc": "Eine 'dc:source / a11y:pageBreakSource' Metadateneigenschaft zum Dokumentenpaket hinzufügen",
"ruledesc": "Veröffentlichungen mit Seitenumbrüchen müssen die Metadaten 'dc:source / a11y:pageBreakSource' angeben",
"resdesc": "Eine 'dc:source / pageBreakSource' Metadateneigenschaft zum Dokumentenpaket hinzufügen",
"ruledesc": "Veröffentlichungen mit Seitenumbrüchen müssen die Metadaten 'dc:source / pageBreakSource' angeben",
"testdesc": "Stellt sicher, dass die Quelle von Seitenumbrüchen identifiziert wird"
},
"titleviolation": {
Expand Down
4 changes: 2 additions & 2 deletions packages/ace-core/src/l10n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@
},
"pagesourceviolation": {
"kbtitle": "Page Navigation",
"resdesc": "Add a 'dc:source / a11y:pageBreakSource' metadata property to the Package Document",
"ruledesc": "Publications with page breaks must declare the 'dc:source / a11y:pageBreakSource' metadata",
"resdesc": "Add a 'dc:source / pageBreakSource' metadata property to the Package Document",
"ruledesc": "Publications with page breaks must declare the 'dc:source / pageBreakSource' metadata",
"testdesc": "Ensures the source of page breaks is identified"
},
"titleviolation": {
Expand Down
4 changes: 2 additions & 2 deletions packages/ace-core/src/l10n/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
},
"pagesourceviolation": {
"kbtitle": "Navegación por páginas",
"resdesc": "Añadir una propiedad de metadatos 'dc:source / a11y:pageBreakSource' al documento package",
"ruledesc": "Las publicaciones con saltos de página deben declarar 'dc:source / a11y:pageBreakSource' en los metadatos",
"resdesc": "Añadir una propiedad de metadatos 'dc:source / pageBreakSource' al documento package",
"ruledesc": "Las publicaciones con saltos de página deben declarar 'dc:source / pageBreakSource' en los metadatos",
"testdesc": "Garantiza que la fuente de los saltos de página está identificada"
},
"titleviolation": {
Expand Down
4 changes: 2 additions & 2 deletions packages/ace-core/src/l10n/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
},
"pagesourceviolation": {
"kbtitle": "Navigation par page",
"resdesc": "Ajouter la métadonnée 'dc:source / a11y:pageBreakSource' au Document de Package",
"ruledesc": "Une publication avec des sauts de page doit déclarer la métadonnée 'dc:source / a11y:pageBreakSource'",
"resdesc": "Ajouter la métadonnée 'dc:source / pageBreakSource' au Document de Package",
"ruledesc": "Une publication avec des sauts de page doit déclarer la métadonnée 'dc:source / pageBreakSource'",
"testdesc": "Vérifie que la source des sauts de page est identifiée"
},
"titleviolation": {
Expand Down
4 changes: 2 additions & 2 deletions packages/ace-core/src/l10n/locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@
},
"pagesourceviolation": {
"kbtitle": "ページナビゲーション",
"resdesc": "「dc:source / a11y:pageBreakSource」メタデータプロパティをパッケージドキュメントに追加する",
"ruledesc": "改ページのある出版物は、「dc:source / a11y:pageBreakSource」メタデータを宣言する必要があります",
"resdesc": "「dc:source / pageBreakSource」メタデータプロパティをパッケージドキュメントに追加する",
"ruledesc": "改ページのある出版物は、「dc:source / pageBreakSource」メタデータを宣言する必要があります",
"testdesc": "改ページのソースが特定されていることを確認する"
},
"titleviolation": {
Expand Down
4 changes: 2 additions & 2 deletions packages/ace-core/src/l10n/locales/pt_BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
},
"pagesourceviolation": {
"kbtitle": "Navegação de Páginas",
"resdesc": "Adicione a propriedade 'dc:source / a11y:pageBreakSource' ao arquivo OPF",
"ruledesc": "Publicações com quebras de página devem declarar o metadado 'dc:source / a11y:pageBreakSource'",
"resdesc": "Adicione a propriedade 'dc:source / pageBreakSource' ao arquivo OPF",
"ruledesc": "Publicações com quebras de página devem declarar o metadado 'dc:source / pageBreakSource'",
"testdesc": "Certifique-se de que a fonte de quebra de páginas foi identificada"
},
"titleviolation": {
Expand Down
4 changes: 2 additions & 2 deletions packages/ace-core/src/l10n/locales/zh_TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
},
"pagesourceviolation": {
"kbtitle": "頁面導覽",
"resdesc": "在包裝文件中提供詮釋資料「dc:source / a11y:pageBreakSource」特性",
"ruledesc": "具備頁面列表的出版品,必須在詮釋資料中宣告「dc:source / a11y:pageBreakSource」",
"resdesc": "在包裝文件中提供詮釋資料「dc:source / pageBreakSource」特性",
"ruledesc": "具備頁面列表的出版品,必須在詮釋資料中宣告「dc:source / pageBreakSource」",
"testdesc": "確保能識別換頁位置的來源"
},
"titleviolation": {
Expand Down
2 changes: 1 addition & 1 deletion tests/data/axerule-pagebreak-label/EPUB/package.opf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<dc:source id="pg-src">urn:isbn:9781234567891</dc:source>
<meta property="source-of" refines="#pg-src">pagination</meta>
<!-- meta property="a11y:pageBreakSource">urn:isbn:9781234567891</meta -->
<!-- meta property="pageBreakSource">urn:isbn:9781234567891</meta -->

<meta property="dcterms:modified">2017-01-01T00:00:01Z</meta>
<meta property="schema:accessibilityFeature">structuralNavigation</meta>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<dc:source id="pg-src">urn:isbn:9781234567891</dc:source>
<meta property="source-of" refines="#pg-src">pagination</meta>
<!-- meta property="a11y:pageBreakSource">urn:isbn:9781234567891</meta -->
<!-- meta property="pageBreakSource">urn:isbn:9781234567891</meta -->

<meta property="dcterms:modified">2017-01-01T00:00:01Z</meta>
<meta property="schema:accessibilityFeature">structuralNavigation</meta>
Expand Down
2 changes: 1 addition & 1 deletion tests/data/epubrules-pagelist-newsource/EPUB/package.opf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<!-- dc:source id="pg-src">urn:isbn:9781234567891</dc:source>
<meta property="source-of" refines="#pg-src">pagination</meta -->
<meta property="a11y:pageBreakSource">urn:isbn:9781234567891</meta>
<meta property="pageBreakSource">urn:isbn:9781234567891</meta>

<meta property="dcterms:modified">2017-01-01T00:00:01Z</meta>
<meta property="schema:accessibilityFeature">structuralNavigation</meta>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<dc:source id="pg-src">urn:isbn:9781234567891</dc:source>
<meta property="source-of" refines="#pg-src">pagination</meta>
<!-- meta property="a11y:pageBreakSource">urn:isbn:9781234567891</meta -->
<!-- meta property="pageBreakSource">urn:isbn:9781234567891</meta -->

<meta property="dcterms:modified">2017-01-01T00:00:01Z</meta>
<meta property="schema:accessibilityFeature">structuralNavigation</meta>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<dc:source id="pg-src">urn:isbn:9781234567891</dc:source>
<meta property="source-of" refines="#pg-src">pagination</meta>
<!-- meta property="a11y:pageBreakSource">urn:isbn:9781234567891</meta -->
<!-- meta property="pageBreakSource">urn:isbn:9781234567891</meta -->

<meta property="dcterms:modified">2017-01-01T00:00:01Z</meta>
<meta property="schema:accessibilityFeature">structuralNavigation</meta>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<dc:source id="pg-src">urn:isbn:9781234567891</dc:source>
<meta property="source-of" refines="#pg-src">pagination</meta>
<!-- meta property="a11y:pageBreakSource">urn:isbn:9781234567891</meta -->
<!-- meta property="pageBreakSource">urn:isbn:9781234567891</meta -->

<meta property="dcterms:modified">2017-01-01T00:00:01Z</meta>
<meta property="schema:accessibilityFeature">structuralNavigation</meta>
Expand Down
2 changes: 1 addition & 1 deletion tests/data/epubrules-pagelist/EPUB/package.opf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<dc:source id="pg-src">urn:isbn:9781234567891</dc:source>
<meta property="source-of" refines="#pg-src">pagination</meta>
<!-- meta property="a11y:pageBreakSource">urn:isbn:9781234567891</meta -->
<!-- meta property="pageBreakSource">urn:isbn:9781234567891</meta -->

<meta property="dcterms:modified">2017-01-01T00:00:01Z</meta>
<meta property="schema:accessibilityFeature">structuralNavigation</meta>
Expand Down
2 changes: 1 addition & 1 deletion tests/data/issue-290/E%PU B/pa&c%26kag%2Feè_.opf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<!-- see package@version="2.0" which is used here in the unzipped version, note that the zipped version of this test is 3.0 and activates the conformsTo below to pass the missing @refines for dc:source -->
<dc:source id="pg-src">urn:isbn:9781234567891</dc:source>
<!-- meta property="source-of" refines="#pg-src">pagination</meta -->
<!-- meta property="a11y:pageBreakSource">urn:isbn:9781234567891</meta -->
<!-- meta property="pageBreakSource">urn:isbn:9781234567891</meta -->
<!-- <link rel="dcterms:conformsTo" href="http://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-aa"/> -->
<!-- <meta property="dcterms:conformsTo">http://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-aa</meta> -->

Expand Down
2 changes: 1 addition & 1 deletion tests/data/issue-85/EPUB/package.opf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<dc:source id="pg-src">urn:isbn:9781234567891</dc:source>
<meta property="source-of" refines="#pg-src">pagination</meta>
<!-- meta property="a11y:pageBreakSource">urn:isbn:9781234567891</meta -->
<!-- meta property="pageBreakSource">urn:isbn:9781234567891</meta -->

<meta property="dcterms:modified">2017-01-01T00:00:01Z</meta>
<meta property="schema:accessibilityFeature">structuralNavigation</meta>
Expand Down
2 changes: 1 addition & 1 deletion website/content/rules/epub.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ In addition to the [HTML rules]({{<ref "html.md">}}), Ace implements EPUB-specif
* Mismatched authored table of contents and reading order of elements inside HTML documents (impact = "serious"): `epub-toc-order`
* Missing publication title metadata (impact = "serious"): `epub-title`
* Missing OPF lang attribute (impact = "serious"): `epub-lang`
* Missing `dc:source` / `a11y:pageBreakSource` publication metadata when reflowable EPUB has authored page list (impact = "serious"): `epub-pagesource`
* Missing `dc:source` / `pageBreakSource` publication metadata when reflowable EPUB has authored page list (impact = "serious"): `epub-pagesource`

0 comments on commit 3c96999

Please sign in to comment.