From 3c96999d39e2eebd26ef0a65b12ebf21994d94a4 Mon Sep 17 00:00:00 2001
From: Daniel Weck <daniel.weck@gmail.com>
Date: Mon, 2 Dec 2024 16:12:01 +0000
Subject: [PATCH] fix: a11y:pageBreakSource without prefix, revert
 8691948abb5a8a79f52c75859af75a97b10c7d71 and added comments, Fixes #403

---
 packages/ace-core/src/checker/checker-epub.js            | 9 +++++++--
 packages/ace-core/src/l10n/locales/da.json               | 4 ++--
 packages/ace-core/src/l10n/locales/de.json               | 4 ++--
 packages/ace-core/src/l10n/locales/en.json               | 4 ++--
 packages/ace-core/src/l10n/locales/es.json               | 4 ++--
 packages/ace-core/src/l10n/locales/fr.json               | 4 ++--
 packages/ace-core/src/l10n/locales/ja.json               | 4 ++--
 packages/ace-core/src/l10n/locales/pt_BR.json            | 4 ++--
 packages/ace-core/src/l10n/locales/zh_TW.json            | 4 ++--
 tests/data/axerule-pagebreak-label/EPUB/package.opf      | 2 +-
 .../EPUB/package.opf                                     | 2 +-
 tests/data/epubrules-pagelist-newsource/EPUB/package.opf | 2 +-
 .../epubrules-pagelist-smil-pagebreak/EPUB/package.opf   | 2 +-
 .../epubrules-pagelist-toc-order-fail/EPUB/package.opf   | 2 +-
 .../epubrules-pagelist-toc-order-pass/EPUB/package.opf   | 2 +-
 tests/data/epubrules-pagelist/EPUB/package.opf           | 2 +-
 .../data/issue-290/E%PU B/pa&c%26kag%2Fe\303\250_.opf"   | 2 +-
 tests/data/issue-85/EPUB/package.opf                     | 2 +-
 website/content/rules/epub.md                            | 2 +-
 19 files changed, 33 insertions(+), 28 deletions(-)

diff --git a/packages/ace-core/src/checker/checker-epub.js b/packages/ace-core/src/checker/checker-epub.js
index 979d3229..817997ab 100644
--- a/packages/ace-core/src/checker/checker-epub.js
+++ b/packages/ace-core/src/checker/checker-epub.js
@@ -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")
     )
diff --git a/packages/ace-core/src/l10n/locales/da.json b/packages/ace-core/src/l10n/locales/da.json
index a343d7ab..024c14b2 100644
--- a/packages/ace-core/src/l10n/locales/da.json
+++ b/packages/ace-core/src/l10n/locales/da.json
@@ -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": {
diff --git a/packages/ace-core/src/l10n/locales/de.json b/packages/ace-core/src/l10n/locales/de.json
index 584acd4a..87e938aa 100644
--- a/packages/ace-core/src/l10n/locales/de.json
+++ b/packages/ace-core/src/l10n/locales/de.json
@@ -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": {
diff --git a/packages/ace-core/src/l10n/locales/en.json b/packages/ace-core/src/l10n/locales/en.json
index d439c663..233c5657 100644
--- a/packages/ace-core/src/l10n/locales/en.json
+++ b/packages/ace-core/src/l10n/locales/en.json
@@ -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": {
diff --git a/packages/ace-core/src/l10n/locales/es.json b/packages/ace-core/src/l10n/locales/es.json
index bd6ffb85..cc620de9 100644
--- a/packages/ace-core/src/l10n/locales/es.json
+++ b/packages/ace-core/src/l10n/locales/es.json
@@ -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": {
diff --git a/packages/ace-core/src/l10n/locales/fr.json b/packages/ace-core/src/l10n/locales/fr.json
index 7868ed07..48d779a5 100644
--- a/packages/ace-core/src/l10n/locales/fr.json
+++ b/packages/ace-core/src/l10n/locales/fr.json
@@ -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": {
diff --git a/packages/ace-core/src/l10n/locales/ja.json b/packages/ace-core/src/l10n/locales/ja.json
index 2f51ba17..a4895d17 100644
--- a/packages/ace-core/src/l10n/locales/ja.json
+++ b/packages/ace-core/src/l10n/locales/ja.json
@@ -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": {
diff --git a/packages/ace-core/src/l10n/locales/pt_BR.json b/packages/ace-core/src/l10n/locales/pt_BR.json
index 29bc794b..c88b9d31 100644
--- a/packages/ace-core/src/l10n/locales/pt_BR.json
+++ b/packages/ace-core/src/l10n/locales/pt_BR.json
@@ -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": {
diff --git a/packages/ace-core/src/l10n/locales/zh_TW.json b/packages/ace-core/src/l10n/locales/zh_TW.json
index 518a9802..2370e492 100644
--- a/packages/ace-core/src/l10n/locales/zh_TW.json
+++ b/packages/ace-core/src/l10n/locales/zh_TW.json
@@ -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": {
diff --git a/tests/data/axerule-pagebreak-label/EPUB/package.opf b/tests/data/axerule-pagebreak-label/EPUB/package.opf
index b6899618..38d38e47 100644
--- a/tests/data/axerule-pagebreak-label/EPUB/package.opf
+++ b/tests/data/axerule-pagebreak-label/EPUB/package.opf
@@ -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>
diff --git a/tests/data/epubrules-pagelist-missing-pagebreak/EPUB/package.opf b/tests/data/epubrules-pagelist-missing-pagebreak/EPUB/package.opf
index 8a24fc2e..f41a41c9 100644
--- a/tests/data/epubrules-pagelist-missing-pagebreak/EPUB/package.opf
+++ b/tests/data/epubrules-pagelist-missing-pagebreak/EPUB/package.opf
@@ -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>
diff --git a/tests/data/epubrules-pagelist-newsource/EPUB/package.opf b/tests/data/epubrules-pagelist-newsource/EPUB/package.opf
index 64948b77..0fb57ce9 100644
--- a/tests/data/epubrules-pagelist-newsource/EPUB/package.opf
+++ b/tests/data/epubrules-pagelist-newsource/EPUB/package.opf
@@ -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>
diff --git a/tests/data/epubrules-pagelist-smil-pagebreak/EPUB/package.opf b/tests/data/epubrules-pagelist-smil-pagebreak/EPUB/package.opf
index 729ba1d1..4d07c755 100644
--- a/tests/data/epubrules-pagelist-smil-pagebreak/EPUB/package.opf
+++ b/tests/data/epubrules-pagelist-smil-pagebreak/EPUB/package.opf
@@ -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>
diff --git a/tests/data/epubrules-pagelist-toc-order-fail/EPUB/package.opf b/tests/data/epubrules-pagelist-toc-order-fail/EPUB/package.opf
index 8a24fc2e..f41a41c9 100644
--- a/tests/data/epubrules-pagelist-toc-order-fail/EPUB/package.opf
+++ b/tests/data/epubrules-pagelist-toc-order-fail/EPUB/package.opf
@@ -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>
diff --git a/tests/data/epubrules-pagelist-toc-order-pass/EPUB/package.opf b/tests/data/epubrules-pagelist-toc-order-pass/EPUB/package.opf
index 8a24fc2e..f41a41c9 100644
--- a/tests/data/epubrules-pagelist-toc-order-pass/EPUB/package.opf
+++ b/tests/data/epubrules-pagelist-toc-order-pass/EPUB/package.opf
@@ -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>
diff --git a/tests/data/epubrules-pagelist/EPUB/package.opf b/tests/data/epubrules-pagelist/EPUB/package.opf
index b6899618..38d38e47 100644
--- a/tests/data/epubrules-pagelist/EPUB/package.opf
+++ b/tests/data/epubrules-pagelist/EPUB/package.opf
@@ -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>
diff --git "a/tests/data/issue-290/E%PU B/pa&c%26kag%2Fe\303\250_.opf" "b/tests/data/issue-290/E%PU B/pa&c%26kag%2Fe\303\250_.opf"
index 3cde7b5c..ff0c077e 100644
--- "a/tests/data/issue-290/E%PU B/pa&c%26kag%2Fe\303\250_.opf"	
+++ "b/tests/data/issue-290/E%PU B/pa&c%26kag%2Fe\303\250_.opf"	
@@ -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> -->
 
diff --git a/tests/data/issue-85/EPUB/package.opf b/tests/data/issue-85/EPUB/package.opf
index 1735f441..68f83d55 100644
--- a/tests/data/issue-85/EPUB/package.opf
+++ b/tests/data/issue-85/EPUB/package.opf
@@ -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>
diff --git a/website/content/rules/epub.md b/website/content/rules/epub.md
index 9a33749d..6cb111e0 100644
--- a/website/content/rules/epub.md
+++ b/website/content/rules/epub.md
@@ -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`