diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/mod/epub-type-attr.rnc b/src/main/resources/com/adobe/epubcheck/schema/30/mod/epub-type-attr.rnc
index eefb00fe5..b35845db7 100644
--- a/src/main/resources/com/adobe/epubcheck/schema/30/mod/epub-type-attr.rnc
+++ b/src/main/resources/com/adobe/epubcheck/schema/30/mod/epub-type-attr.rnc
@@ -6,7 +6,7 @@
## to reset the definition of the class of attributes
## where epub:type is added in the nav doc schema, and
## common.attrs.other is augmented by other schemas.
- ## We therefore augment common.attrs (and also attrobute
+ ## We therefore augment common.attrs (and also attribute
## lists that are not based on common.attrs)
common.attrs.basic &= epub.type.attr?
diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/mod/epub-xhtml-mathml3.rnc b/src/main/resources/com/adobe/epubcheck/schema/30/mod/epub-xhtml-mathml3.rnc
index ad272e6aa..b988f39ac 100644
--- a/src/main/resources/com/adobe/epubcheck/schema/30/mod/epub-xhtml-mathml3.rnc
+++ b/src/main/resources/com/adobe/epubcheck/schema/30/mod/epub-xhtml-mathml3.rnc
@@ -2,4 +2,9 @@ namespace math = "http://www.w3.org/1998/Math/MathML"
include "epub-mathml3.rnc"
-common.elem.phrasing |= math
\ No newline at end of file
+common.elem.phrasing |= math
+
+math.attributes &=
+ ( common.attrs.aria.role.math
+ | common.attrs.aria.implicit.math
+ )?
diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/README b/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/README
index d32a0826c..2b220f747 100644
--- a/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/README
+++ b/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/README
@@ -3,7 +3,12 @@ The modules in this directory are part of the schema that defines
a vocabulary and grammar for EPUB3 XHTML Content Documents [1],
based on W3C HTML [2], with EPUB extensions.
-The modules are derived from the schemas used in the Nu Html Checker [3].
+The modules are derived from the schemas used in the Nu Html Checker [3],
+up-to-date with commit d00d51a585175f09c67c150aeb6891d3695bfebf
+
+The file `epubcheck.patch` was created when first importing the HTML schemas,
+to document how the type system was adapted. It is not intended to be applied
+automatically as a patch file.
[1] p://www.idpf.org/epub3/latest/contentdocs
[2] https://www.w3.org/TR/html/
diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/applications.rnc b/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/applications.rnc
index b7491c972..609d79f9d 100644
--- a/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/applications.rnc
+++ b/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/applications.rnc
@@ -98,18 +98,7 @@
( common.attrs
& dialog.attrs.open?
& ( common.attrs.aria.implicit.dialog
- | common.attrs.aria.role.alert
| common.attrs.aria.role.alertdialog
- | common.attrs.aria.role.application
- | common.attrs.aria.role.contentinfo
- | common.attrs.aria.role.dialog
- | common.attrs.aria.role.log
- | common.attrs.aria.role.marquee
- | common.attrs.aria.role.region
- | common.attrs.aria.role.status
- | common.attrs.aria.landmark.document
- | common.attrs.aria.landmark.main
- | common.attrs.aria.landmark.search
)?
)
dialog.attrs.open =
@@ -126,12 +115,14 @@
element menu { menu.inner & menu.attrs }
menu.attrs =
( common.attrs
- & ( common.attrs.aria.implicit.toolbar
+ & ( common.attrs.aria.implicit.list
| common.attrs.aria.role.directory
+ | common.attrs.aria.role.group
| common.attrs.aria.role.list
| common.attrs.aria.role.listbox
| common.attrs.aria.role.menu
| common.attrs.aria.role.menubar
+ | common.attrs.aria.role.radiogroup
| common.attrs.aria.role.tablist
| common.attrs.aria.role.toolbar
| common.attrs.aria.role.tree
diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/aria.rnc b/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/aria.rnc
index a0b2474a1..adf32917d 100644
--- a/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/aria.rnc
+++ b/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/aria.rnc
@@ -104,6 +104,9 @@ common.attrs.aria.implicit.listitem |=
& aria.state.expanded?
)
+common.attrs.aria.implicit.math |=
+ ( aria.state.expanded? )
+
common.attrs.aria.implicit.option |=
( aria.prop.posinset?
& aria.prop.setsize?
@@ -146,6 +149,14 @@ common.attrs.aria.implicit.searchbox |=
& aria.prop.required?
)
+common.attrs.aria.implicit.separator |=
+ ( aria.prop.valuemax?
+ & aria.prop.valuemin?
+ & aria.prop.valuenow?
+ & aria.prop.valuetext?
+ & aria.prop.orientation?
+ )
+
common.attrs.aria.implicit.slider |=
( aria.prop.valuemax?
& aria.prop.valuemin?
@@ -276,34 +287,9 @@ common.attrs.aria.implicit.navigation |= common.attrs.aria.implicit.landmark
## dropeffect
aria.state.dropeffect =
attribute aria-dropeffect
- { token "none" #default
- | token "popup"
- | token "execute"
- | list
- { ( string "copy" )
- , ( string "execute" )?
- }
- | list
- { ( string "move" )
- , ( string "execute" )?
- }
- | list
- { ( string "link" )
- , ( string "execute" )?
- }
- | list
- { ( string "execute" )
- , ( string "copy" )
- }
- | list
- { ( string "execute" )
- , ( string "move" )
- }
- | list
- { ( string "execute" )
- , ( string "link" )
- }
- }
+ {
+ list { ("copy" | "execute" | "link" | "move" | "none" | "popup") + }
+ }
## expanded
aria.state.expanded =
@@ -1047,6 +1033,7 @@ common.attrs.aria.implicit.navigation |= common.attrs.aria.implicit.landmark
attribute role { string "math" }
common.attrs.aria |= aria.math
+ common.attrs.aria.role.math |= aria.math
## menu
aria.menu =
@@ -1292,6 +1279,7 @@ common.attrs.aria.implicit.navigation |= common.attrs.aria.implicit.landmark
attribute role { string "scrollbar" }
common.attrs.aria |= aria.scrollbar
+ common.attrs.aria.role.scrollbar |= aria.scrollbar
## search
aria.search =
diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/block.rnc b/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/block.rnc
index 850e64c34..714531882 100644
--- a/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/block.rnc
+++ b/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/block.rnc
@@ -1,4 +1,5 @@
+
# #####################################################################
## RELAX NG Schema for HTML 5: Basic Prose Markup #
# #####################################################################
@@ -25,7 +26,8 @@
element hr { hr.inner & hr.attrs }
hr.attrs =
( common.attrs
- & ( common.attrs.aria.role.separator
+ & ( common.attrs.aria.implicit.separator
+ | common.attrs.aria.role.separator
| common.attrs.aria.role.presentation
| common.attrs.aria.role.doc-pagebreak
)?
@@ -278,4 +280,11 @@
)
legend.inner =
( common.inner.phrasing
+ & h1.elem?
+ & h2.elem?
+ & h3.elem?
+ & h4.elem?
+ & h5.elem?
+ & h6.elem?
+ & hgroup.elem?
)
diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/common.rnc b/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/common.rnc
index bb1c4a91d..7eb2d1ecb 100644
--- a/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/common.rnc
+++ b/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/common.rnc
@@ -1,4 +1,5 @@
+
# #####################################################################
## RELAX NG Schema for HTML 5: Common Definitions #
# #####################################################################
@@ -200,7 +201,25 @@ common.attrs.present =
}
common.attrs.other =
- empty
+ ( common.attrs.autofocus?
+ & common.attrs.inputmode?
+ & common.attrs.nonce?
+ )
+
+ common.attrs.autofocus =
+ attribute autofocus {
+ "autofocus" | ""
+ }
+
+ common.attrs.inputmode =
+ attribute inputmode {
+ string
+ }
+
+ common.attrs.nonce =
+ attribute nonce {
+ string
+ }
# #####################################################################
## Common Datatypes #
@@ -459,7 +478,6 @@ common.attrs.aria.role.cell |= ( notAllowed )
common.attrs.aria.role.checkbox = ( notAllowed )
common.attrs.aria.role.combobox = ( notAllowed )
common.attrs.aria.role.complementary = ( notAllowed )
-common.attrs.aria.role.contentinfo = ( notAllowed )
common.attrs.aria.role.dialog = ( notAllowed )
common.attrs.aria.role.directory = ( notAllowed )
common.attrs.aria.role.document = ( notAllowed )
@@ -480,7 +498,6 @@ common.attrs.aria.role.menubar = ( notAllowed )
common.attrs.aria.role.menuitem = ( notAllowed )
common.attrs.aria.role.menuitemcheckbox = ( notAllowed )
common.attrs.aria.role.menuitemradio = ( notAllowed )
-common.attrs.aria.role.note = ( notAllowed )
common.attrs.aria.role.option = ( notAllowed )
common.attrs.aria.role.presentation = ( notAllowed )
common.attrs.aria.role.progressbar = ( notAllowed )
@@ -525,6 +542,7 @@ common.attrs.aria.implicit.list = ( notAllowed )
common.attrs.aria.implicit.listbox = ( notAllowed )
common.attrs.aria.implicit.listitem = ( notAllowed )
common.attrs.aria.implicit.main = ( notAllowed )
+common.attrs.aria.implicit.math |= ( notAllowed )
common.attrs.aria.implicit.navigation = ( notAllowed )
common.attrs.aria.implicit.option = ( notAllowed )
common.attrs.aria.implicit.progressbar = ( notAllowed )
@@ -535,6 +553,7 @@ common.attrs.aria.implicit.rowgroup |= ( notAllowed )
common.attrs.aria.implicit.searchbox |= ( notAllowed )
common.attrs.aria.implicit.section = ( notAllowed )
common.attrs.aria.implicit.select = ( notAllowed )
+common.attrs.aria.implicit.separator = ( notAllowed )
common.attrs.aria.implicit.slider = ( notAllowed )
common.attrs.aria.implicit.spinbutton = ( notAllowed )
common.attrs.aria.implicit.status = ( notAllowed )
diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/core-scripting.rnc b/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/core-scripting.rnc
index c77fd864d..dd5d87e71 100644
--- a/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/core-scripting.rnc
+++ b/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/core-scripting.rnc
@@ -1,4 +1,5 @@
+
# #####################################################################
## RELAX NG Schema for HTML 5: Core Scripting #
# #####################################################################
@@ -16,11 +17,8 @@
& script.attrs.nomodule?
& script.attrs.language? # restricted in Schematron
& script.attrs.integrity?
- & script.attrs.nonce?
& embedded.content.attrs.crossorigin?
- & ( common.attrs.aria.role.presentation
- | common.attrs.aria.role.menuitem
- )?
+ & referrerpolicy?
)
script.elem.imported =
element script { script.inner.imported & script.attrs.imported }
@@ -34,11 +32,8 @@
& script.attrs.charset?
& script.attrs.language? # restricted in Schematron
& script.attrs.integrity?
- & script.attrs.nonce?
& embedded.content.attrs.crossorigin?
- & ( common.attrs.aria.role.presentation
- | common.attrs.aria.role.menuitem
- )?
+ & referrerpolicy?
)
script.attrs.src =
attribute src {
@@ -72,10 +67,6 @@
attribute integrity {
common.data.integrity
}
- script.attrs.nonce =
- attribute nonce{
- string
- }
script.inner.embedded =
( common.inner.anything )
script.inner.imported =
@@ -111,11 +102,7 @@
noscript.inner.flow =
( common.inner.flow )
noscript.attrs =
- ( common.attrs
- & ( common.attrs.aria.role.presentation
- | common.attrs.aria.role.menuitem
- )?
- )
+ ( common.attrs )
common.elem.metadata |= noscript.elem.head
common.elem.phrasing |= noscript.elem.phrasing
@@ -126,8 +113,7 @@
common.attrs.scripting &=
( scripting.attr.onabort?
- & scripting.attr.onautocomplete?
- & scripting.attr.onautocompleteerror?
+ & scripting.attr.onauxclick?
& scripting.attr.onblur?
& scripting.attr.oncancel?
& scripting.attr.oncanplay?
@@ -135,8 +121,10 @@
& scripting.attr.onchange?
& scripting.attr.onclick?
& scripting.attr.onclose?
- & scripting.attr.oncuechange?
& scripting.attr.oncontextmenu?
+ & scripting.attr.oncopy?
+ & scripting.attr.oncuechange?
+ & scripting.attr.oncut?
& scripting.attr.ondblclick?
& scripting.attr.ondrag?
& scripting.attr.ondragend?
@@ -151,8 +139,7 @@
& scripting.attr.onended?
& scripting.attr.onerror?
& scripting.attr.onfocus?
- & scripting.attr.onfocusin?
- & scripting.attr.onfocusout?
+ & scripting.attr.onformdata?
& scripting.attr.oninput?
& scripting.attr.oninvalid?
& scripting.attr.onkeydown?
@@ -169,7 +156,7 @@
& scripting.attr.onmouseout?
& scripting.attr.onmouseover?
& scripting.attr.onmouseup?
- & scripting.attr.onwheel?
+ & scripting.attr.onpaste?
& scripting.attr.onpause?
& scripting.attr.onplay?
& scripting.attr.onplaying?
@@ -178,10 +165,11 @@
& scripting.attr.onreset?
& scripting.attr.onresize?
& scripting.attr.onscroll?
+ & scripting.attr.onsecuritypolicyviolation?
& scripting.attr.onseeked?
& scripting.attr.onseeking?
& scripting.attr.onselect?
- & scripting.attr.onsort?
+ & scripting.attr.onslotchange?
& scripting.attr.onstalled?
& scripting.attr.onsubmit?
& scripting.attr.onsuspend?
@@ -189,16 +177,15 @@
& scripting.attr.ontoggle?
& scripting.attr.onvolumechange?
& scripting.attr.onwaiting?
+ & scripting.attr.onwheel?
)
common.attrs.other &= common.attrs.scripting
scripting.attr.onabort =
attribute onabort { common.data.functionbody }
- scripting.attr.onautocomplete =
- attribute onautocomplete { common.data.functionbody }
- scripting.attr.onautocompleteerror =
- attribute onautocompleteerror { common.data.functionbody }
+ scripting.attr.onauxclick =
+ attribute onauxclick { common.data.functionbody }
scripting.attr.onblur =
attribute onblur { common.data.functionbody }
scripting.attr.oncanplay =
@@ -215,8 +202,12 @@
attribute onclose { common.data.functionbody }
scripting.attr.oncontextmenu =
attribute oncontextmenu { common.data.functionbody }
+ scripting.attr.oncopy =
+ attribute oncopy { common.data.functionbody }
scripting.attr.oncuechange =
attribute oncuechange { common.data.functionbody }
+ scripting.attr.oncut =
+ attribute oncut { common.data.functionbody }
scripting.attr.ondblclick =
attribute ondblclick { common.data.functionbody }
scripting.attr.ondrag =
@@ -245,12 +236,10 @@
attribute onerror { common.data.functionbody }
scripting.attr.onfocus =
attribute onfocus { common.data.functionbody }
- scripting.attr.onfocusin =
- attribute onfocusin { common.data.functionbody }
- scripting.attr.onfocusout =
- attribute onfocusout { common.data.functionbody }
scripting.attr.onformchange =
attribute onformchange { common.data.functionbody }
+ scripting.attr.onformdata =
+ attribute onformdata { common.data.functionbody }
scripting.attr.onforminput =
attribute onforminput { common.data.functionbody }
scripting.attr.oninput =
@@ -287,6 +276,8 @@
attribute onmouseup { common.data.functionbody }
scripting.attr.onwheel =
attribute onwheel { common.data.functionbody }
+ scripting.attr.onpaste =
+ attribute onpaste { common.data.functionbody }
scripting.attr.onpause =
attribute onpause { common.data.functionbody }
scripting.attr.onplay =
@@ -303,14 +294,16 @@
attribute onresize { common.data.functionbody }
scripting.attr.onscroll =
attribute onscroll { common.data.functionbody }
+ scripting.attr.onsecuritypolicyviolation =
+ attribute onsecuritypolicyviolation { common.data.functionbody }
scripting.attr.onseeked =
attribute onseeked { common.data.functionbody }
scripting.attr.onseeking =
attribute onseeking { common.data.functionbody }
scripting.attr.onselect =
attribute onselect { common.data.functionbody }
- scripting.attr.onsort =
- attribute onsort { common.data.functionbody }
+ scripting.attr.onslotchange =
+ attribute onslotchange { common.data.functionbody }
scripting.attr.onstalled =
attribute onstalled { common.data.functionbody }
scripting.attr.onsubmit =
diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/data.rnc b/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/data.rnc
index 3878e65a2..fc5592c9f 100644
--- a/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/data.rnc
+++ b/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/data.rnc
@@ -1,4 +1,5 @@
+
# #####################################################################
## RELAX NG Schema for HTML 5: Static Data Markup #
# #####################################################################
@@ -64,9 +65,6 @@
& meter.attrs.high?
& meter.attrs.max?
& meter.attrs.optimum?
- & ( common.attrs.aria.implicit.progressbar
- | common.attrs.aria.role.progressbar
- )?
)
meter.attrs.value =
attribute value {
diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/embed.rnc b/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/embed.rnc
index b2bc678d5..5bbff8827 100644
--- a/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/embed.rnc
+++ b/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/embed.rnc
@@ -1,3 +1,4 @@
+
namespace local = ""
# #####################################################################
@@ -9,26 +10,53 @@ namespace local = ""
## Images:
- img.elem =
- element img { img.inner & img.attrs }
- img.attrs =
+ shared-img.attrs =
( common.attrs
& img.attrs.src
& img.attrs.srcset?
& img.attrs.sizes?
- & img.attrs.alt? # ARIA: if alt empty, only allowed role value is "presentation"; check in assertions
+ & img.attrs.generator-unable-to-provide-required-alt?
& img.attrs.height?
& img.attrs.width?
& img.attrs.usemap?
& img.attrs.ismap?
& img.attrs.decoding?
+ & img.attrs.loading?
& img.attrs.border? # obsolete
& referrerpolicy?
& embedded.content.attrs.crossorigin?
+ )
+
+ no-alt-img.elem =
+ element img { img.inner & shared-img.attrs }
+
+ img.elem =
+ element img { img.inner & img.attrs }
+ img.attrs =
+ ( shared-img.attrs
+ & img.attrs.alt
& ( common.attrs.aria.implicit.img
- | common.attrs.aria
+ | common.attrs.aria.implicit.img
+ | common.attrs.aria.role.button
+ | common.attrs.aria.role.checkbox
+ | common.attrs.aria.role.img
+ | common.attrs.aria.role.link
+ | common.attrs.aria.role.menuitem
+ | common.attrs.aria.role.menuitemcheckbox
+ | common.attrs.aria.role.menuitemradio
+ | common.attrs.aria.role.none
+ | common.attrs.aria.role.option
+ | common.attrs.aria.role.presentation
+ | common.attrs.aria.role.progressbar
+ | common.attrs.aria.role.scrollbar
+ | common.attrs.aria.role.separator
+ | common.attrs.aria.role.slider
+ | common.attrs.aria.role.switch
+ | common.attrs.aria.role.tab
+ | common.attrs.aria.role.treeitem
)?
)
+
img.attrs.src =
attribute src {
common.data.uri.non-empty
@@ -45,6 +73,10 @@ namespace local = ""
attribute alt {
text
}
+ img.attrs.generator-unable-to-provide-required-alt =
+ attribute generator-unable-to-provide-required-alt {
+ string ""
+ }
img.attrs.height =
attribute height {
common.data.integer.non-negative
@@ -68,6 +100,10 @@ namespace local = ""
| string "auto"
)
}
+ img.attrs.loading =
+ attribute loading {
+ string "lazy" | string "eager"
+ }
img.attrs.border =
attribute border {
common.data.zero
@@ -75,6 +111,7 @@ namespace local = ""
img.inner =
empty
+ common.elem.phrasing |= no-alt-img.elem
common.elem.phrasing |= img.elem
## Image with multiple sources: