Skip to content

Commit 22fa3b1

Browse files
committed
feat: update HTML schemas from the HTML Checker
Imported changes up to commit: - validator/validator@d00d51a Fixes #1111
1 parent e732068 commit 22fa3b1

28 files changed

+272
-257
lines changed

src/main/resources/com/adobe/epubcheck/schema/30/mod/epub-type-attr.rnc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
## to reset the definition of the class of attributes
77
## where epub:type is added in the nav doc schema, and
88
## common.attrs.other is augmented by other schemas.
9-
## We therefore augment common.attrs (and also attrobute
9+
## We therefore augment common.attrs (and also attribute
1010
## lists that are not based on common.attrs)
1111
common.attrs.basic &= epub.type.attr?
1212

src/main/resources/com/adobe/epubcheck/schema/30/mod/epub-xhtml-mathml3.rnc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,9 @@ namespace math = "http://www.w3.org/1998/Math/MathML"
22

33
include "epub-mathml3.rnc"
44

5-
common.elem.phrasing |= math
5+
common.elem.phrasing |= math
6+
7+
math.attributes &=
8+
( common.attrs.aria.role.math
9+
| common.attrs.aria.implicit.math
10+
)?

src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/README

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@ The modules in this directory are part of the schema that defines
33
a vocabulary and grammar for EPUB3 XHTML Content Documents [1],
44
based on W3C HTML [2], with EPUB extensions.
55

6-
The modules are derived from the schemas used in the Nu Html Checker [3].
6+
The modules are derived from the schemas used in the Nu Html Checker [3],
7+
up-to-date with commit d00d51a585175f09c67c150aeb6891d3695bfebf
8+
9+
The file `epubcheck.patch` was created when first importing the HTML schemas,
10+
to document how the type system was adapted. It is not intended to be applied
11+
automatically as a patch file.
712

813
[1] p://www.idpf.org/epub3/latest/contentdocs
914
[2] https://www.w3.org/TR/html/

src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/applications.rnc

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -98,18 +98,7 @@
9898
( common.attrs
9999
& dialog.attrs.open?
100100
& ( common.attrs.aria.implicit.dialog
101-
| common.attrs.aria.role.alert
102101
| common.attrs.aria.role.alertdialog
103-
| common.attrs.aria.role.application
104-
| common.attrs.aria.role.contentinfo
105-
| common.attrs.aria.role.dialog
106-
| common.attrs.aria.role.log
107-
| common.attrs.aria.role.marquee
108-
| common.attrs.aria.role.region
109-
| common.attrs.aria.role.status
110-
| common.attrs.aria.landmark.document
111-
| common.attrs.aria.landmark.main
112-
| common.attrs.aria.landmark.search
113102
)?
114103
)
115104
dialog.attrs.open =
@@ -126,12 +115,14 @@
126115
element menu { menu.inner & menu.attrs }
127116
menu.attrs =
128117
( common.attrs
129-
& ( common.attrs.aria.implicit.toolbar
118+
& ( common.attrs.aria.implicit.list
130119
| common.attrs.aria.role.directory
120+
| common.attrs.aria.role.group
131121
| common.attrs.aria.role.list
132122
| common.attrs.aria.role.listbox
133123
| common.attrs.aria.role.menu
134124
| common.attrs.aria.role.menubar
125+
| common.attrs.aria.role.radiogroup
135126
| common.attrs.aria.role.tablist
136127
| common.attrs.aria.role.toolbar
137128
| common.attrs.aria.role.tree

src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/aria.rnc

Lines changed: 16 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ common.attrs.aria.implicit.listitem |=
104104
& aria.state.expanded?
105105
)
106106

107+
common.attrs.aria.implicit.math |=
108+
( aria.state.expanded? )
109+
107110
common.attrs.aria.implicit.option |=
108111
( aria.prop.posinset?
109112
& aria.prop.setsize?
@@ -146,6 +149,14 @@ common.attrs.aria.implicit.searchbox |=
146149
& aria.prop.required?
147150
)
148151

152+
common.attrs.aria.implicit.separator |=
153+
( aria.prop.valuemax?
154+
& aria.prop.valuemin?
155+
& aria.prop.valuenow?
156+
& aria.prop.valuetext?
157+
& aria.prop.orientation?
158+
)
159+
149160
common.attrs.aria.implicit.slider |=
150161
( aria.prop.valuemax?
151162
& aria.prop.valuemin?
@@ -276,34 +287,9 @@ common.attrs.aria.implicit.navigation |= common.attrs.aria.implicit.landmark
276287
## dropeffect
277288
aria.state.dropeffect =
278289
attribute aria-dropeffect
279-
{ token "none" #default
280-
| token "popup"
281-
| token "execute"
282-
| list
283-
{ ( string "copy" )
284-
, ( string "execute" )?
285-
}
286-
| list
287-
{ ( string "move" )
288-
, ( string "execute" )?
289-
}
290-
| list
291-
{ ( string "link" )
292-
, ( string "execute" )?
293-
}
294-
| list
295-
{ ( string "execute" )
296-
, ( string "copy" )
297-
}
298-
| list
299-
{ ( string "execute" )
300-
, ( string "move" )
301-
}
302-
| list
303-
{ ( string "execute" )
304-
, ( string "link" )
305-
}
306-
}
290+
{
291+
list { ("copy" | "execute" | "link" | "move" | "none" | "popup") + }
292+
}
307293

308294
## expanded
309295
aria.state.expanded =
@@ -1047,6 +1033,7 @@ common.attrs.aria.implicit.navigation |= common.attrs.aria.implicit.landmark
10471033
attribute role { string "math" }
10481034

10491035
common.attrs.aria |= aria.math
1036+
common.attrs.aria.role.math |= aria.math
10501037

10511038
## menu
10521039
aria.menu =
@@ -1292,6 +1279,7 @@ common.attrs.aria.implicit.navigation |= common.attrs.aria.implicit.landmark
12921279
attribute role { string "scrollbar" }
12931280

12941281
common.attrs.aria |= aria.scrollbar
1282+
common.attrs.aria.role.scrollbar |= aria.scrollbar
12951283

12961284
## search
12971285
aria.search =

src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/block.rnc

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11

2+
23
# #####################################################################
34
## RELAX NG Schema for HTML 5: Basic Prose Markup #
45
# #####################################################################
@@ -25,7 +26,8 @@
2526
element hr { hr.inner & hr.attrs }
2627
hr.attrs =
2728
( common.attrs
28-
& ( common.attrs.aria.role.separator
29+
& ( common.attrs.aria.implicit.separator
30+
| common.attrs.aria.role.separator
2931
| common.attrs.aria.role.presentation
3032
| common.attrs.aria.role.doc-pagebreak
3133
)?
@@ -278,4 +280,11 @@
278280
)
279281
legend.inner =
280282
( common.inner.phrasing
283+
& h1.elem?
284+
& h2.elem?
285+
& h3.elem?
286+
& h4.elem?
287+
& h5.elem?
288+
& h6.elem?
289+
& hgroup.elem?
281290
)

src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/common.rnc

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11

2+
23
# #####################################################################
34
## RELAX NG Schema for HTML 5: Common Definitions #
45
# #####################################################################
@@ -200,7 +201,25 @@ common.attrs.present =
200201
}
201202

202203
common.attrs.other =
203-
empty
204+
( common.attrs.autofocus?
205+
& common.attrs.inputmode?
206+
& common.attrs.nonce?
207+
)
208+
209+
common.attrs.autofocus =
210+
attribute autofocus {
211+
"autofocus" | ""
212+
}
213+
214+
common.attrs.inputmode =
215+
attribute inputmode {
216+
string
217+
}
218+
219+
common.attrs.nonce =
220+
attribute nonce {
221+
string
222+
}
204223

205224
# #####################################################################
206225
## Common Datatypes #
@@ -459,7 +478,6 @@ common.attrs.aria.role.cell |= ( notAllowed )
459478
common.attrs.aria.role.checkbox = ( notAllowed )
460479
common.attrs.aria.role.combobox = ( notAllowed )
461480
common.attrs.aria.role.complementary = ( notAllowed )
462-
common.attrs.aria.role.contentinfo = ( notAllowed )
463481
common.attrs.aria.role.dialog = ( notAllowed )
464482
common.attrs.aria.role.directory = ( notAllowed )
465483
common.attrs.aria.role.document = ( notAllowed )
@@ -480,7 +498,6 @@ common.attrs.aria.role.menubar = ( notAllowed )
480498
common.attrs.aria.role.menuitem = ( notAllowed )
481499
common.attrs.aria.role.menuitemcheckbox = ( notAllowed )
482500
common.attrs.aria.role.menuitemradio = ( notAllowed )
483-
common.attrs.aria.role.note = ( notAllowed )
484501
common.attrs.aria.role.option = ( notAllowed )
485502
common.attrs.aria.role.presentation = ( notAllowed )
486503
common.attrs.aria.role.progressbar = ( notAllowed )
@@ -525,6 +542,7 @@ common.attrs.aria.implicit.list = ( notAllowed )
525542
common.attrs.aria.implicit.listbox = ( notAllowed )
526543
common.attrs.aria.implicit.listitem = ( notAllowed )
527544
common.attrs.aria.implicit.main = ( notAllowed )
545+
common.attrs.aria.implicit.math |= ( notAllowed )
528546
common.attrs.aria.implicit.navigation = ( notAllowed )
529547
common.attrs.aria.implicit.option = ( notAllowed )
530548
common.attrs.aria.implicit.progressbar = ( notAllowed )
@@ -535,6 +553,7 @@ common.attrs.aria.implicit.rowgroup |= ( notAllowed )
535553
common.attrs.aria.implicit.searchbox |= ( notAllowed )
536554
common.attrs.aria.implicit.section = ( notAllowed )
537555
common.attrs.aria.implicit.select = ( notAllowed )
556+
common.attrs.aria.implicit.separator = ( notAllowed )
538557
common.attrs.aria.implicit.slider = ( notAllowed )
539558
common.attrs.aria.implicit.spinbutton = ( notAllowed )
540559
common.attrs.aria.implicit.status = ( notAllowed )

0 commit comments

Comments
 (0)