Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update HTML schemas from the HTML Checker #1138

Merged
merged 1 commit into from
May 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,9 @@ namespace math = "http://www.w3.org/1998/Math/MathML"

include "epub-mathml3.rnc"

common.elem.phrasing |= math
common.elem.phrasing |= math

math.attributes &=
( common.attrs.aria.role.math
| common.attrs.aria.implicit.math
)?
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand All @@ -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
Expand Down
44 changes: 16 additions & 28 deletions src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/aria.rnc
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down Expand Up @@ -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?
Expand Down Expand Up @@ -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 =
Expand Down Expand Up @@ -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 =
Expand Down Expand Up @@ -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 =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@


# #####################################################################
## RELAX NG Schema for HTML 5: Basic Prose Markup #
# #####################################################################
Expand All @@ -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
)?
Expand Down Expand Up @@ -278,4 +280,11 @@
)
legend.inner =
( common.inner.phrasing
& h1.elem?
& h2.elem?
& h3.elem?
& h4.elem?
& h5.elem?
& h6.elem?
& hgroup.elem?
)
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@


# #####################################################################
## RELAX NG Schema for HTML 5: Common Definitions #
# #####################################################################
Expand Down Expand Up @@ -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 #
Expand Down Expand Up @@ -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 )
Expand All @@ -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 )
Expand Down Expand Up @@ -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 )
Expand All @@ -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 )
Expand Down
Loading