From: Stefan Monnier Date: Thu, 14 Jan 2016 19:11:18 +0000 (-0500) Subject: Add 'packages/html5-schema/' from commit '6e7c7c331e7f6692be6c7d39fb9485792f0d3513' X-Git-Url: https://code.delx.au/gnu-emacs-elpa/commitdiff_plain/07bcdb8deee88ab740108cb7ff6bd9f75b5d349f?hp=9ac55abceb5888cca4942380ffddef1aab6275fc Add 'packages/html5-schema/' from commit '6e7c7c331e7f6692be6c7d39fb9485792f0d3513' git-subtree-dir: packages/html5-schema git-subtree-mainline: 9ac55abceb5888cca4942380ffddef1aab6275fc git-subtree-split: 6e7c7c331e7f6692be6c7d39fb9485792f0d3513 --- diff --git a/packages/html5-schema/.htaccess b/packages/html5-schema/.htaccess new file mode 100644 index 000000000..8727307e5 --- /dev/null +++ b/packages/html5-schema/.htaccess @@ -0,0 +1,10 @@ +AddDescription "RelaxNG Schema for HTML 5 Core (XML)" xhtml5core.rnc +AddDescription "RelaxNG Schema for HTML 5 Core (HTML)" html5core.rnc +AddDescription "RelaxNG Schema for HTML 5 Exclusions" html5exclusions.rnc + +AddDescription "RelaxNG Schema for HTML 5: Common Definitions" common.rnc +AddDescription "RelaxNG Schema for HTML 5: Global Structure & Meta Data" meta.rnc +AddDescription "RelaxNG Schema for HTML 5: (Inline) Phrase Markup" phrase.rnc +AddDescription "RelaxNG Schema for HTML 5: Basic Block Markup" block.rnc +AddDescription "Schema Testing Scripts and Instances" tests + diff --git a/packages/html5-schema/LICENSE b/packages/html5-schema/LICENSE new file mode 100644 index 000000000..0a2a5e0dc --- /dev/null +++ b/packages/html5-schema/LICENSE @@ -0,0 +1,23 @@ +The RELAX NG Schema for (X)HTML 5 is licensed under the MIT open source license. +The following legal notice applies to all files in this directory: + +Copyright (c) 2005-2007 Elika J. Etemad (fantasai) and Henri Sivonen (hsivonen) +Copyright (c) 2007-2012 Mozilla Foundation + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/packages/html5-schema/applications.rnc b/packages/html5-schema/applications.rnc new file mode 100644 index 000000000..618814d33 --- /dev/null +++ b/packages/html5-schema/applications.rnc @@ -0,0 +1,405 @@ +datatypes w = "http://whattf.org/datatype-draft" + +# ##################################################################### +## RELAX NG Schema for HTML 5: Web Application Features # +# ##################################################################### + +## Additions to Common Attributes + + common.attrs.interact &= + ( common.attrs.contextmenu? + & common.attrs.contenteditable? + & common.attrs.draggable? + & common.attrs.dropzone? + & common.attrs.hidden? + & common.attrs.spellcheck? + ) + + common.attrs.other &= common.attrs.interact + +## Context Menu: contextmenu + + common.attrs.contextmenu = + attribute contextmenu { + common.data.idref + } + +## Editable Content: contenteditable + + common.attrs.contenteditable = + attribute contenteditable { + w:string "true" | w:string "false" | w:string "" + } + +## Draggable Element: draggable + + common.attrs.draggable = + attribute draggable { + w:string "true" | w:string "false" + } + +## Dropzone: dropzone + + common.attrs.dropzone = + attribute dropzone { + list { + ( xsd:string { pattern = "[sS][tT][rR][iI][nN][gG]:.+" } + | xsd:string { pattern = "[fF][iI][lL][eE]:.+" } + )* + , + ( w:string "copy" + | w:string "move" + | w:string "link" + )? + , + ( xsd:string { pattern = "[sS][tT][rR][iI][nN][gG]:.+" } + | xsd:string { pattern = "[fF][iI][lL][eE]:.+" } + )* + } + } + +## Hidden Element: hidden + + common.attrs.hidden = + attribute hidden { + w:string "hidden" | w:string "" + } + +## Spellchecking and grammar checking: spellcheck + + common.attrs.spellcheck = + attribute spellcheck{ + w:string "true" | w:string "false" | w:string "" + } + +## Application Cache: manifest + + html.attrs.manifest = + attribute manifest { + common.data.uri.non-empty + } + + html.attrs &= html.attrs.manifest? + +## Progess Indicator: + + progress.elem = + element progress { progress.inner & progress.attrs } + progress.attrs = + ( common.attrs + & progress.attrs.value? + & progress.attrs.max? + & ( common.attrs.aria.implicit.progressbar + | common.attrs.aria.role.progressbar + )? + ) + progress.attrs.value = + attribute value { + common.data.float.non-negative + } + progress.attrs.max = + attribute max { + common.data.float.positive + } + progress.inner = + ( common.inner.phrasing ) #Cannot enforce textContent format here + + common.elem.phrasing |= progress.elem + +## Dialog box, inspector, or window: + dialog.elem = + element dialog { dialog.inner & dialog.attrs } + dialog.attrs = + ( common.attrs + & dialog.attrs.open? + & ( common.attrs.aria.implicit.dialog + | common.attrs.aria.role.alert + | common.attrs.aria.role.alertdialog + | 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.application + | common.attrs.aria.landmark.document + | common.attrs.aria.landmark.main + | common.attrs.aria.landmark.search + )? + ) + dialog.attrs.open = + attribute open { + w:string "open" | w:string "" + } + dialog.inner = + ( common.inner.flow ) + common.elem.flow |= dialog.elem + +## Toolbar: + + menu.toolbar.elem = + element menu { menu.toolbar.inner & menu.toolbar.attrs } + menu.toolbar.attrs = + ( common.attrs + & menu.toolbar.attrs.type? + & ( common.attrs.aria.implicit.toolbar + | common.attrs.aria.role.directory + | common.attrs.aria.role.list + | common.attrs.aria.role.listbox + | common.attrs.aria.role.menu + | common.attrs.aria.role.menubar + | common.attrs.aria.role.tablist + | common.attrs.aria.role.toolbar + | common.attrs.aria.role.tree + | common.attrs.aria.role.presentation + )? + ) + menu.toolbar.attrs.type = + attribute type { + w:string "toolbar" + } + menu.toolbar.inner = + ( mli.elem* + | common.inner.flow + ) + menu.elem |= menu.toolbar.elem + +## Toolbar item:
  • + + mli.elem = + element li { mli.inner & mli.attrs } + mli.attrs = + ( common.attrs + & ( ( common.attrs.aria.role.listitem + | common.attrs.aria.role.menuitem + | common.attrs.aria.role.menuitemcheckbox + | common.attrs.aria.role.menuitemradio + | common.attrs.aria.role.option + | common.attrs.aria.role.tab + | common.attrs.aria.role.treeitem + | common.attrs.aria.role.presentation + ) + )? + ) + mli.inner = + ( common.inner.flow ) + +## Popup menu: + + menu.popup.elem = + element menu { menu.popup.inner & menu.popup.attrs } + menu.popup.attrs = + ( common.attrs + & menu.popup.attrs.type? + & menu.attrs.label? + & common.attrs.aria? + ) + menu.popup.attrs.type = + attribute type { + w:string "popup" + } + menu.attrs.label = + attribute label { + string + } + menu.popup.inner = + ( menuitem.elem* + & hr.elem* + & menu.popup.elem* + & common.elem.script-supporting* + ) + menu.elem |= menu.popup.elem + +## Ambiguous menu: (with no "type" attribute) + menu.ambiguous.elem = + element menu { menu.ambiguous.inner & menu.ambiguous.attrs } + menu.ambiguous.attrs = + ( common.attrs + & menu.attrs.label? + & common.attrs.aria? + ) + menu.ambiguous.inner = + ( ( menuitem.elem* + & hr.elem* + & menu.ambiguous.elem* + & common.elem.script-supporting* + ) + | ( mli.elem* + | common.inner.flow + ) + ) + menu.elem |= menu.ambiguous.elem + + common.elem.flow |= menu.elem + # REVISIT allow nested menus + +## Explicit command in popup menu: + menuitem.explicit.command.elem = + element menuitem { menuitem.inner & menuitem.explicit.command.attrs } + menuitem.explicit.command.attrs = + ( common.attrs + & menuitem.explicit.command.attrs.type? + & menuitem.attrs.label? + & menuitem.attrs.icon? + & menuitem.attrs.disabled? + & menuitem.attrs.default? + & common.attrs.aria? + ) + menuitem.explicit.command.attrs.type = + attribute type { + w:string "command" + } + menuitem.attrs.label = + attribute label { + w:non-empty-string + } + menuitem.attrs.icon = + attribute icon { + common.data.uri.non-empty + } + menuitem.attrs.disabled = + attribute disabled { + w:string "" | w:string "disabled" + } + menuitem.attrs.default = + attribute default { + w:string "" | w:string "default" + } + menuitem.elem |= menuitem.explicit.command.elem + +## Checkbox in popup menu: + menuitem.checkbox.elem = + element menuitem { menuitem.inner & menuitem.checkbox.attrs } + menuitem.checkbox.attrs = + ( common.attrs + & menuitem.checkbox.attrs.type + & menuitem.attrs.label? + & menuitem.attrs.icon? + & menuitem.attrs.disabled? + & menuitem.attrs.checked? + & menuitem.attrs.radiogroup? + & menuitem.attrs.default? + & common.attrs.aria? + ) + menuitem.checkbox.attrs.type = + attribute type { + w:string "checkbox" + } + menuitem.attrs.checked = + attribute checked { + w:string "checked" | w:string "" + } + menuitem.attrs.radiogroup = + attribute radiogroup { + string + } + menuitem.elem |= menuitem.checkbox.elem + +## Radio button in popup menu: + menuitem.radio.elem = + element menuitem { menuitem.inner & menuitem.radio.attrs } + menuitem.radio.attrs = + ( common.attrs + & menuitem.radio.attrs.type + & menuitem.attrs.label? + & menuitem.attrs.icon? + & menuitem.attrs.disabled? + & menuitem.attrs.checked? + & menuitem.attrs.radiogroup? + & menuitem.attrs.default? + & common.attrs.aria? + ) + menuitem.radio.attrs.type = + attribute type { + w:string "radio" + } + menuitem.elem |= menuitem.radio.elem + +## Indirect command in popup menu: + menuitem.indirect.command.elem = + element menuitem { menuitem.inner & menuitem.indirect.command.attrs } + menuitem.indirect.command.attrs = + ( common.attrs + & menuitem.attrs.default? + & menuitem.attrs.command + & common.attrs.aria? + ) + menuitem.attrs.command = + attribute command { + common.data.idref + } + menuitem.elem |= menuitem.indirect.command.elem + + menuitem.inner = + ( empty ) + +## Canvas for Dynamic Graphics: + + canvas.elem.flow = + element canvas { canvas.inner.flow & canvas.attrs } + canvas.elem.phrasing = + element canvas { canvas.inner.phrasing & canvas.attrs } + canvas.attrs = + ( common.attrs + & canvas.attrs.height? + & canvas.attrs.width? + & common.attrs.aria? + ) + canvas.attrs.height = + attribute height { + common.data.integer.non-negative + } + canvas.attrs.width = + attribute width { + common.data.integer.non-negative + } + canvas.inner.flow = + ( common.inner.transparent.flow ) + canvas.inner.phrasing = + ( common.inner.phrasing ) + + common.elem.flow |= canvas.elem.flow + common.elem.phrasing |= canvas.elem.phrasing + +## Additional On-Demand Information:
    + + details.elem = + element details { details.inner & details.attrs } + details.attrs = + ( common.attrs + & details.attrs.open? + & ( common.attrs.aria.implicit.group # aria-expanded must be true if open attr present; check by assertions + | common.attrs.aria.role.group + )? + ) + details.attrs.open = + attribute open { + w:string "open" | w:string "" + } + details.inner = + ( summary.elem + , common.inner.flow + ) + + common.elem.flow |= details.elem + +## Caption/summary for details element: + + summary.elem = + element summary { summary.inner & summary.attrs } + summary.attrs = + ( common.attrs + & ( common.attrs.aria.implicit.button + | common.attrs.aria.role.button + )? + ) + summary.inner = + ( common.inner.phrasing + | h1.elem + | h2.elem + | h3.elem + | h4.elem + | h5.elem + | h6.elem + | hgroup.elem + ) diff --git a/packages/html5-schema/aria.rnc b/packages/html5-schema/aria.rnc new file mode 100644 index 000000000..61e007bac --- /dev/null +++ b/packages/html5-schema/aria.rnc @@ -0,0 +1,1251 @@ +# ##################################################################### +## RELAX NG Schema for HTML 5: Accessible Rich Internet Applications # +# ##################################################################### +# +# history: http://hsivonen.iki.fi/aria-html5-bis/ + +# ##################################################################### +## ARIA + +## Global states and properties + +aria.global = + ( aria.prop.atomic? + & aria.state.busy? + & aria.prop.controls? + & aria.prop.describedby? + & aria.state.disabled? + & aria.state.dropeffect? + & aria.prop.flowto? + & aria.state.grabbed? + & aria.prop.haspopup? + & aria.state.hidden? + & aria.state.invalid? + & aria.prop.label? + & aria.prop.labelledby? + & aria.prop.live? + & aria.prop.owns? + & aria.prop.relevant? + ) + +common.attrs.other &= aria.global? + +## States and Properties for Native Roles + +common.attrs.aria.implicit.button |= + ( aria.state.expanded? + & aria.state.pressed? + ) + +common.attrs.aria.implicit.checkbox |= + ( aria.state.checked? ) + +common.attrs.aria.implicit.combobox |= + ( aria.state.expanded? + & aria.prop.autocomplete? + & aria.prop.required? + & aria.prop.activedescendant? + ) + +common.attrs.aria.implicit.dialog |= + ( aria.state.expanded? ) + +common.attrs.aria.implicit.document |= + ( aria.state.expanded? ) + +common.attrs.aria.implicit.form |= + ( aria.state.expanded? ) + +common.attrs.aria.implicit.group |= + ( aria.state.expanded? + & aria.prop.activedescendant? + ) + +common.attrs.aria.implicit.heading |= + ( aria.state.expanded? + & aria.prop.level? + ) + +common.attrs.aria.implicit.img |= + ( aria.state.expanded? ) + +common.attrs.aria.implicit.link |= + ( aria.state.expanded? ) + +common.attrs.aria.implicit.listbox |= + ( aria.prop.multiselectable? + & aria.prop.required? + & aria.prop.activedescendant? + & aria.state.expanded? + ) + +common.attrs.aria.implicit.listitem |= + ( aria.prop.level? + & aria.prop.posinset? + & aria.prop.setsize? + & aria.state.expanded? + ) + +common.attrs.aria.implicit.option |= + ( aria.prop.posinset? + & aria.prop.setsize? + & aria.state.checked? + & aria.state.selected? + ) + +common.attrs.aria.implicit.progressbar |= + ( aria.prop.valuemax? + & aria.prop.valuemin? + & aria.prop.valuenow? + & aria.prop.valuetext? + ) + +common.attrs.aria.implicit.radio |= + ( aria.prop.posinset? + & aria.prop.setsize? + & aria.state.checked? + & aria.state.selected? + ) + +common.attrs.aria.implicit.slider |= + ( aria.prop.valuemax? + & aria.prop.valuemin? + & aria.prop.valuenow? + & aria.prop.valuetext? + & aria.prop.orientation? + ) + +common.attrs.aria.implicit.spinbutton |= + ( aria.prop.valuemax? + & aria.prop.valuemin? + & aria.prop.valuenow? + & aria.prop.valuetext? + & aria.prop.required? + ) + +common.attrs.aria.implicit.textbox |= + ( aria.prop.activedescendant? + & aria.prop.autocomplete? + & aria.prop.multiline? + & aria.prop.readonly? + & aria.prop.required? + ) + +common.attrs.aria.implicit.toolbar |= + ( aria.state.expanded? + & aria.prop.activedescendant? + ) + +common.attrs.aria.implicit.column-or-row-header |= + ( aria.prop.sort? + & aria.prop.readonly? + & aria.prop.required? + & aria.state.selected? + & aria.state.expanded? + ) + +#common.attrs.aria.implicit.select |= +# ( aria.state.invalid? +# & aria.prop.required? +# & aria.prop.atomic? +# & aria.state.busy? +# & aria.prop.channel? +# & aria.prop.controls? +# & aria.prop.live? +# & aria.prop.relevant? +# ) + +# section +# | +# |_ region +# | +# |_ article +# | +# |_ landmark +# | |_ banner +# | |_ complementary +# | |_ contentinfo +# | |_ main +# | |_ navigation +# | +# |_ list +# | +# |_ status + +common.attrs.aria.implicit.section |= + ( aria.state.expanded? ) + +common.attrs.aria.implicit.region |= common.attrs.aria.implicit.section + +common.attrs.aria.implicit.article |= common.attrs.aria.implicit.region +common.attrs.aria.implicit.landmark |= common.attrs.aria.implicit.region +common.attrs.aria.implicit.list |= common.attrs.aria.implicit.region +common.attrs.aria.implicit.status |= common.attrs.aria.implicit.region + +common.attrs.aria.implicit.banner |= common.attrs.aria.implicit.landmark +common.attrs.aria.implicit.complementary |= common.attrs.aria.implicit.landmark +common.attrs.aria.implicit.contentinfo |= common.attrs.aria.implicit.landmark +common.attrs.aria.implicit.main |= common.attrs.aria.implicit.landmark +common.attrs.aria.implicit.navigation |= common.attrs.aria.implicit.landmark + +# ##################################################################### +## States + +## busy + aria.state.busy = + attribute aria-busy + { string "true" + | string "false" #default + } + +## checked + aria.state.checked = + attribute aria-checked + { string "true" + | string "false" + | string "mixed" + | string "undefined" #default + } + +## disabled + aria.state.disabled = + attribute aria-disabled + { string "true" + | string "false" #default + } + +## 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" ) + } + } + +## expanded + aria.state.expanded = + attribute aria-expanded + { string "true" + | string "false" + | string "undefined" #default + } + +## grabbed + aria.state.grabbed = + attribute aria-grabbed + { string "true" + | string "false" + | string "undefined" #default + } + +## hidden + aria.state.hidden = + attribute aria-hidden + { string "true" + | string "false" #default + } + +## invalid + aria.state.invalid = + attribute aria-invalid + { string "true" + | string "false" #default + | string "grammar" + | string "spelling" + } + +## pressed + aria.state.pressed = + attribute aria-pressed + { string "true" + | string "false" + | string "mixed" + | string "undefined" #default + } + +## selected + aria.state.selected = + attribute aria-selected + { string "true" + | string "false" + | string "undefined" #default + } + + + +# ##################################################################### +## Properties + +## activedescendant + aria.prop.activedescendant = + attribute aria-activedescendant { + common.data.idref #REVISIT add Schematron check + } + +## atomic + aria.prop.atomic = + attribute aria-atomic + { string "true" + | string "false" #default + } + +## autocomplete + aria.prop.autocomplete = + attribute aria-autocomplete + { string "inline" + | string "list" + | string "both" + | string "none" #default + } + +## controls + aria.prop.controls = + attribute aria-controls { + common.data.idrefs #REVISIT add Schematron check + } + +## describedby + aria.prop.describedby = + attribute aria-describedby { + common.data.idrefs #REVISIT add Schematron check + } + +## flowto + aria.prop.flowto = + attribute aria-flowto { + common.data.idrefs #REVISIT add Schematron check + } + +## haspopup + aria.prop.haspopup = + attribute aria-haspopup + { string "true" #REVISIT check owns or descendant + | string "false" #default + } + +## label + aria.prop.label = + attribute aria-label { + string + } + +## labelledby + aria.prop.labelledby = + attribute aria-labelledby { + common.data.idrefs #REVISIT add Schematron check + } + +## level + aria.prop.level = + attribute aria-level { + common.data.integer.positive + } + +## live + aria.prop.live = + attribute aria-live + { string "off" #default + | string "polite" + | string "assertive" + } + +## multiline + aria.prop.multiline = + attribute aria-multiline + { string "true" + | string "false" #default + } + +## multiselectable + aria.prop.multiselectable = + attribute aria-multiselectable + { string "true" + | string "false" #default + } + +## orientation + aria.prop.orientation = + attribute aria-orientation + { string "vertical" + | string "horizontal" #default + } + +## owns + aria.prop.owns = + attribute aria-owns { + common.data.idrefs #REVISIT add Schematron check + } + +## posinset + aria.prop.posinset = + attribute aria-posinset { + common.data.integer.positive + } + +## readonly + aria.prop.readonly = + attribute aria-readonly + { string "true" + | string "false" #default + } + common.attrs.aria.prop.readonly |= aria.prop.readonly + +## relevant + aria.prop.relevant = + attribute aria-relevant + { token "all" + | list + { ( string "additions" ) + , ( string "removals" )? + , ( string "text" )? + } + | list + { ( string "additions" ) + , ( string "text" )? + , ( string "removals" )? + } + | list + { ( string "removals" ) + , ( string "additions" )? + , ( string "text" )? + } + | list + { ( string "removals" ) + , ( string "text" )? + , ( string "additions" )? + } + | list + { ( string "text" ) + , ( string "additions" )? + , ( string "removals" )? + } + | list + { ( string "text" ) + , ( string "removals" )? + , ( string "additions" )? + } + } + +## required + aria.prop.required = + attribute aria-required + { string "true" + | string "false" #default + } + +## setsize + aria.prop.setsize = + attribute aria-setsize { + common.data.integer.non-negative + } + +## sort + aria.prop.sort = + attribute aria-sort + { string "ascending" + | string "descending" + | string "none" #default + | string "other" + } + +## valuemax + aria.prop.valuemax = + attribute aria-valuemax { + common.data.float #REVISIT + } + +## valuemin + aria.prop.valuemin = + attribute aria-valuemin { + common.data.float #REVISIT + } + +## valuenow + aria.prop.valuenow = + attribute aria-valuenow { + common.data.float #REVISIT + } + +## valuetext + aria.prop.valuetext = + attribute aria-valuetext { + string + } + +# ##################################################################### +## Roles + +## alert + aria.alert = + ( aria.role.alert + & aria.state.expanded? + ) + aria.role.alert = + attribute role { string "alert" } + + common.attrs.aria |= aria.alert + common.attrs.aria.role.alert |= aria.alert + +## alertdialog + aria.alertdialog = + ( aria.role.alertdialog + & aria.state.expanded? + ) + aria.role.alertdialog = + attribute role { string "alertdialog" } + + common.attrs.aria |= aria.alertdialog + common.attrs.aria.role.alertdialog |= aria.alertdialog + +## application + aria.application = + ( aria.role.application + & aria.state.expanded? + ) + aria.role.application = + attribute role { string "application" } + + common.attrs.aria |= aria.application + common.attrs.aria.landmark.application |= aria.application + +## article + aria.article = + ( aria.role.article + & aria.state.expanded? + ) + aria.role.article = + attribute role { string "article" } + + common.attrs.aria |= aria.article + common.attrs.aria.landmark.article |= aria.article + +## banner + aria.banner = + ( aria.role.banner + & aria.state.expanded? + ) + aria.role.banner = + attribute role { string "banner" } + + common.attrs.aria |= aria.banner + common.attrs.aria.landmark.banner |= aria.banner + +## button + aria.button = + ( aria.role.button + & aria.state.expanded? + & aria.state.pressed? # not inherited + ) + aria.role.button = + attribute role { string "button" } + + common.attrs.aria |= aria.button + common.attrs.aria.role.button |= aria.button + +## checkbox + aria.checkbox = + ( aria.role.checkbox + & aria.state.checked #required! + ) + aria.role.checkbox = + attribute role { string "checkbox" } + + common.attrs.aria |= aria.checkbox + common.attrs.aria.role.checkbox |= aria.checkbox + +# columnheader + aria.columnheader = + ( aria.role.columnheader + & aria.prop.sort? # not inherited + & aria.prop.readonly? # not inherited + & aria.state.selected? # not inherited + & aria.state.expanded? + & aria.prop.required? + ) + aria.role.columnheader = + attribute role { string "columnheader" } + + common.attrs.aria |= aria.columnheader + +## combobox + aria.combobox = + ( aria.role.combobox + & aria.prop.activedescendant? + & aria.state.expanded #required! + & aria.prop.autocomplete? + & aria.prop.required? + ) + aria.role.combobox = + attribute role { string "combobox" } + + common.attrs.aria |= aria.combobox + common.attrs.aria.role.combobox |= aria.combobox + +## complementary + aria.complementary = + ( aria.role.complementary + & aria.state.expanded? + ) + aria.role.complementary = + attribute role { string "complementary" } + + common.attrs.aria |= aria.complementary + common.attrs.aria.landmark.complementary |= aria.complementary + +## contentinfo + aria.contentinfo = + ( aria.role.contentinfo + & aria.state.expanded? + ) + aria.role.contentinfo = + attribute role { string "contentinfo" } + + common.attrs.aria |= aria.contentinfo + common.attrs.aria.landmark.contentinfo |= aria.contentinfo + +## definition + aria.definition = + ( aria.role.definition + & aria.state.expanded? + ) + aria.role.definition = + attribute role { string "definition" } + + common.attrs.aria |= aria.definition + +## dialog + aria.dialog = + ( aria.role.dialog + & aria.state.expanded? + ) + aria.role.dialog = + attribute role { string "dialog" } + + common.attrs.aria |= aria.dialog + common.attrs.aria.role.dialog |= aria.dialog + +## directory + aria.directory = + ( aria.role.directory + & aria.state.expanded? + ) + aria.role.directory = + attribute role { string "directory" } + + common.attrs.aria |= aria.directory + common.attrs.aria.role.directory |= aria.directory + +## document + aria.document = + ( aria.role.document + & aria.state.expanded? + ) + aria.role.document = + attribute role { string "document" } + + common.attrs.aria |= aria.document + common.attrs.aria.landmark.document |= aria.document + +## form + aria.form = + ( aria.role.form + & aria.state.expanded? + ) + aria.role.form = + attribute role { string "form" } + + common.attrs.aria |= aria.form + common.attrs.aria.landmark.form |= aria.form + +## grid + aria.grid = + ( aria.role.grid + & aria.prop.level? # not inherited + & aria.prop.multiselectable? # not inherited + & aria.prop.readonly? # not inherited + & aria.prop.activedescendant? + & aria.state.expanded? + ) + aria.role.grid = + attribute role { string "grid" } + + common.attrs.aria |= aria.grid + +## gridcell + aria.gridcell = + ( aria.role.gridcell + & aria.prop.level? # net inherited + & aria.prop.readonly? # not inherited + & aria.state.selected? # not inherited + & aria.state.expanded? + & aria.prop.required? + ) + aria.role.gridcell = + attribute role { string "gridcell" } + + common.attrs.aria |= aria.gridcell + +## group + aria.group = + ( aria.role.group + & aria.prop.activedescendant? # not inherited + & aria.state.expanded? # not inherited + ) + aria.role.group = + attribute role { string "group" } + + common.attrs.aria |= aria.group + common.attrs.aria.role.group |= aria.group + +## heading + aria.heading = + ( aria.role.heading + & aria.prop.level ? # not inherited + & aria.state.expanded? + ) + aria.role.heading = + attribute role { string "heading" } + + common.attrs.aria |= aria.heading + common.attrs.aria.role.heading |= aria.heading + +## img + aria.img = + ( aria.role.img + & aria.state.expanded? + ) + aria.role.img = + attribute role { string "img" } + + common.attrs.aria |= aria.img + common.attrs.aria.role.img |= aria.img + +## link + aria.link = + ( aria.role.link + & aria.state.expanded? + ) + aria.role.link = + attribute role { string "link" } + + common.attrs.aria |= aria.link + common.attrs.aria.role.link |= aria.link + +## list + aria.list = + ( aria.role.list + & aria.state.expanded? + ) + aria.role.list = + attribute role { string "list" } + + common.attrs.aria |= aria.list + common.attrs.aria.role.list |= aria.list + +## listbox + aria.listbox = + ( aria.role.listbox + & aria.prop.multiselectable? # not inherited + & aria.prop.required? + & aria.prop.activedescendant? + & aria.state.expanded? + ) + aria.role.listbox = + attribute role { string "listbox" } + + common.attrs.aria |= aria.listbox + common.attrs.aria.role.listbox |= aria.listbox + +## listitem + aria.listitem = + ( aria.role.listitem + & aria.prop.posinset? # not inherited + & aria.prop.setsize? # not inherited + & aria.prop.level? # not inherited + & aria.state.expanded? + ) + aria.role.listitem = + attribute role { string "listitem" } + + common.attrs.aria |= aria.listitem + common.attrs.aria.role.listitem |= aria.listitem + +## log + aria.log = + ( aria.role.log + & aria.state.expanded? + ) + aria.role.log = + attribute role { string "log" } + + common.attrs.aria |= aria.log + common.attrs.aria.role.log |= aria.log + +## main + aria.main = + ( aria.role.main + & aria.state.expanded? + ) + aria.role.main = + attribute role { string "main" } + + common.attrs.aria |= aria.main + common.attrs.aria.landmark.main |= aria.main + +## marquee + aria.marquee = + ( aria.role.marquee + & aria.state.expanded? + ) + aria.role.marquee = + attribute role { string "marquee" } + + common.attrs.aria |= aria.marquee + common.attrs.aria.role.marquee |= aria.marquee + +## math + aria.math = + ( aria.role.math + & aria.state.expanded? + ) + aria.role.math = + attribute role { string "math" } + + common.attrs.aria |= aria.math + +## menu + aria.menu = + ( aria.role.menu + & aria.prop.activedescendant? + & aria.state.expanded? + ) + aria.role.menu = + attribute role { string "menu" } + + common.attrs.aria |= aria.menu + common.attrs.aria.role.menu |= aria.menu + +## menubar + aria.menubar = + ( aria.role.menubar + & aria.prop.activedescendant? + & aria.state.expanded? + ) + aria.role.menubar = + attribute role { string "menubar" } + + common.attrs.aria |= aria.menubar + common.attrs.aria.role.menubar |= aria.menubar + + +## menuitem + aria.menuitem = + ( aria.role.menuitem ) + aria.role.menuitem = + attribute role { string "menuitem" } + + common.attrs.aria |= aria.menuitem + common.attrs.aria.role.menuitem |= aria.menuitem + +## menuitemcheckbox + aria.menuitemcheckbox = + ( aria.role.menuitemcheckbox + & aria.state.checked #required + ) + aria.role.menuitemcheckbox = + attribute role { string "menuitemcheckbox" } + + common.attrs.aria |= aria.menuitemcheckbox + common.attrs.aria.role.menuitemcheckbox |= aria.menuitemcheckbox + +## menuitemradio + aria.menuitemradio = + ( aria.role.menuitemradio + & aria.state.checked #required + & aria.state.selected? + & aria.prop.posinset? + & aria.prop.setsize? + ) + aria.role.menuitemradio = + attribute role { string "menuitemradio" } + + common.attrs.aria |= aria.menuitemradio + common.attrs.aria.role.menuitemradio |= aria.menuitemradio + +## navigation + aria.navigation = + ( aria.role.navigation + & aria.state.expanded? + ) + aria.role.navigation = + attribute role { string "navigation" } + + common.attrs.aria |= aria.navigation + common.attrs.aria.landmark.navigation |= aria.navigation + +## note + aria.note = + ( aria.role.note + & aria.state.expanded? + ) + aria.role.note = + attribute role { string "note" } + + common.attrs.aria |= aria.note + common.attrs.aria.landmark.note |= aria.note + +## option + aria.option = + ( aria.role.option + & aria.state.checked? # not inherited + & aria.state.selected? # not inherited + & aria.prop.posinset? + & aria.prop.setsize? + ) + aria.role.option = + attribute role { string "option" } + + common.attrs.aria |= aria.option + common.attrs.aria.role.option |= aria.option + + +## presentation + aria.presentation = + ( aria.role.presentation + & aria.state.expanded? + ) + aria.role.presentation = + attribute role { string "presentation" } + + common.attrs.aria |= aria.presentation + common.attrs.aria.role.presentation |= aria.presentation + +## progressbar + aria.progressbar = + ( aria.role.progressbar + & aria.prop.valuemax? # not inherited + & aria.prop.valuemin? # not inherited + & aria.prop.valuenow? # not inherited + & aria.prop.valuetext? # not inherited + ) + aria.role.progressbar = + attribute role { string "progressbar" } + + common.attrs.aria |= aria.progressbar + common.attrs.aria.role.progressbar |= aria.progressbar + +## radio + aria.radio = + ( aria.role.radio + & aria.state.checked #required! + & aria.state.selected? + & aria.prop.posinset? + & aria.prop.setsize? + ) + aria.role.radio = + attribute role { string "radio" } + + common.attrs.aria |= aria.radio + common.attrs.aria.role.radio |= aria.radio + +## radiogroup + aria.radiogroup = + ( aria.role.radiogroup + & aria.prop.activedescendant? + & aria.state.expanded? + & aria.prop.required? + ) + aria.role.radiogroup = + attribute role { string "radiogroup" } + + common.attrs.aria |= aria.radiogroup + +## region + aria.region = + ( aria.role.region + & aria.state.expanded? + ) + aria.role.region = + attribute role { string "region" } + + common.attrs.aria |= aria.region + common.attrs.aria.role.region |= aria.region + +## row + aria.row = + ( aria.role.row + & aria.prop.level? # not inherited + & aria.state.selected? # not inherited + & aria.prop.activedescendant? + & aria.state.expanded? + ) + aria.role.row = + attribute role { string "row" } + + common.attrs.aria |= aria.row + +## rowgroup + aria.rowgroup = + ( aria.role.rowgroup + & aria.prop.activedescendant? + & aria.state.expanded? + ) + aria.role.rowgroup = + attribute role { string "rowgroup" } + + common.attrs.aria |= aria.rowgroup + +# rowheader + aria.rowheader = + ( aria.role.rowheader + & aria.prop.sort? # not inherited + & aria.prop.readonly? # not inherited + & aria.state.selected? # not inherited + & aria.state.expanded? + & aria.prop.required? + ) + aria.role.rowheader = + attribute role { string "rowheader" } + + common.attrs.aria |= aria.rowheader + +## scrollbar + aria.scrollbar = + ( aria.role.scrollbar + & aria.prop.orientation + & aria.prop.valuemax + & aria.prop.valuemin + & aria.prop.valuenow + & aria.prop.valuetext? + ) + aria.role.scrollbar = + attribute role { string "scrollbar" } + + common.attrs.aria |= aria.scrollbar + +## search + aria.search = + ( aria.role.search + & aria.state.expanded? + ) + aria.role.search = + attribute role { string "search" } + + common.attrs.aria |= aria.search + common.attrs.aria.landmark.search |= aria.search + +## separator + aria.separator = + ( aria.role.separator + & aria.state.expanded? + & aria.prop.orientation? + ) + aria.role.separator = + attribute role { string "separator" } + + common.attrs.aria |= aria.separator + common.attrs.aria.role.separator |= aria.separator + +## slider + aria.slider = + ( aria.role.slider + & aria.prop.valuemax + & aria.prop.valuemin + & aria.prop.valuenow + & aria.prop.valuetext? + & aria.prop.orientation? + ) + aria.role.slider = + attribute role { string "slider" } + + common.attrs.aria |= aria.slider + common.attrs.aria.role.slider |= aria.slider + +## spinbutton + aria.spinbutton = + ( aria.role.spinbutton + & aria.prop.valuemax + & aria.prop.valuemin + & aria.prop.valuenow + & aria.prop.valuetext? + & aria.prop.required? + ) + aria.role.spinbutton = + attribute role { string "spinbutton" } + + common.attrs.aria |= aria.spinbutton + common.attrs.aria.role.spinbutton |= aria.spinbutton + +## status + aria.status = + ( aria.role.status + & aria.state.expanded? + ) + aria.role.status = + attribute role { string "status" } + + common.attrs.aria |= aria.status + common.attrs.aria.role.status |= aria.status + +## switch + aria.switch = + ( aria.role.switch + & aria.state.checked #required! + ) + aria.role.switch = + attribute role { string "switch" } + + common.attrs.aria |= aria.switch + common.attrs.aria.role.switch |= aria.switch + +## tab + aria.tab = + ( aria.role.tab + & aria.state.selected? + & aria.state.expanded? + ) + aria.role.tab = + attribute role { string "tab" } + + common.attrs.aria |= aria.tab + common.attrs.aria.role.tab |= aria.tab + +## tablist + aria.tablist = + ( aria.role.tablist + & aria.prop.activedescendant? + & aria.state.expanded? + & aria.prop.level? + & aria.prop.multiselectable? + ) + aria.role.tablist = + attribute role { string "tablist" } + common.attrs.aria |= aria.tablist + common.attrs.aria.role.tablist |= aria.tablist + +## tabpanel + aria.tabpanel = + ( aria.role.tabpanel + & aria.state.expanded? + ) + aria.role.tabpanel = + attribute role { string "tabpanel" } + + common.attrs.aria |= aria.tabpanel + common.attrs.aria.role.tabpanel |= aria.tabpanel + +## textbox + aria.textbox = + ( aria.role.textbox + & aria.prop.activedescendant? + & aria.prop.autocomplete? # not inherited + & aria.prop.multiline? # not inherited + & aria.prop.readonly? # not inherited + & aria.prop.required? + ) + aria.role.textbox = + attribute role { string "textbox" } + + common.attrs.aria |= aria.textbox + common.attrs.aria.role.textbox |= aria.textbox + +## timer + aria.timer = + ( aria.role.timer + & aria.state.expanded? + ) + aria.role.timer = + attribute role { string "timer" } + + common.attrs.aria |= aria.timer + +## toolbar + aria.toolbar = + ( aria.role.toolbar + & aria.prop.activedescendant? + & aria.state.expanded? + ) + aria.role.toolbar = + attribute role { string "toolbar" } + + common.attrs.aria |= aria.toolbar + common.attrs.aria.role.toolbar |= aria.toolbar + +## tooltip + aria.tooltip = + ( aria.role.tooltip + & aria.state.expanded? + ) + aria.role.tooltip = + attribute role { string "tooltip" } + + common.attrs.aria |= aria.tooltip + +## tree + aria.tree = + ( aria.role.tree + & aria.prop.multiselectable? # not inherited + & aria.prop.activedescendant? + & aria.state.expanded? + & aria.prop.required? + ) + aria.role.tree = + attribute role { string "tree" } + + common.attrs.aria |= aria.tree + common.attrs.aria.role.tree |= aria.tree + +## treegrid + aria.treegrid = + ( aria.role.treegrid + & aria.prop.activedescendant? + & aria.state.expanded? + & aria.prop.level? + & aria.prop.multiselectable? + & aria.prop.readonly? + & aria.prop.required? + ) + aria.role.treegrid = + attribute role { string "treegrid" } + + common.attrs.aria |= aria.treegrid + +## treeitem + aria.treeitem = + ( aria.role.treeitem + & aria.state.checked? + & aria.state.expanded? + & aria.prop.level? + & aria.prop.posinset? + & aria.state.selected? + & aria.prop.setsize? + ) + aria.role.treeitem = + attribute role { string "treeitem" } + + common.attrs.aria |= aria.treeitem + common.attrs.aria.role.treeitem |= aria.treeitem diff --git a/packages/html5-schema/assertions.sch b/packages/html5-schema/assertions.sch new file mode 100644 index 000000000..2b34fcc01 --- /dev/null +++ b/packages/html5-schema/assertions.sch @@ -0,0 +1,1235 @@ + + + + + + + + + + + + + + + + + + + A “bdo” element must have a + “dir” attribute. + + + + + An “img” element must have an + “alt” attribute, except under certain + conditions. For details, consult guidance on + providing text alternatives for images. + http://www.w3.org/wiki/HTML/Usage/TextAlternatives + + + + + + + + + + + The “” element must not contain any nested + “” elements. + + + + + + The “” element must not contain any nested + “” elements. + + + The “label” element may contain at most one descendant + “input” element, + “button” element, + “select” element, + or “textarea” element. + + + The “for” attribute of the “label” + element must refer to a form control. + + + + + + The sectioning element “” must not + appear as a descendant of the “address” element. + + + + + + The element “footer” must not + appear as a descendant of the “header” element. + + + The element “footer” must not + appear as a descendant of the “footer” element. + + + The element “footer” must not + appear as a descendant of the “address” element. + + + + + + The “” element must not appear as a + descendant of the “address” element. + + + + + + The “” element must not appear as a + descendant of the “footer” element. + + + The “” element must not appear as a + descendant of the “address” element. + + + The “header” element must not appear as a + descendant of the “header” element. + + + + + + The element “table” must not appear as a + descendant of the “caption” element. + + + The “summary” attribute on the + “table” element is obsolete. + Consider describing the structure of the table + in a “caption” element or + in a “figure” element containing + the “table” element; or, simplify + the structue of the table so that no + description is needed. + + + + + + + + + + + + The interactive element “” must not + appear as a descendant of the “a” element. + + + The interactive element “” must not + appear as a descendant of the “button” element. + + + + + + The interactive element “” must not + appear as a descendant of the “a” element. + + + The interactive element “” must not + appear as a descendant of the “button” element. + + + Any “” element descendant of a “label” element + with a “for” attribute must have an + ID value that matches that “for” attribute. + + + + + + The interactive element “” + with the attribute “controls” must not + appear as a descendant of the “a” element. + + + The interactive element “” + with the attribute “controls” must not + appear as a descendant of the “button” element. + + + + + + The element “menu” + with the attribute “type” whose value is “toolbar” must not + appear as a descendant of the “a” element. + + + The element “menu” + with the attribute “type” whose value is “toolbar” must not + appear as a descendant of the “button” element. + + + + + + The element “img” + with the attribute “usemap” must not + appear as a descendant of the “a” element. + + + The element “img” + with the attribute “usemap” must not + appear as a descendant of the “button” element. + + + + + + The element “object” + with the attribute “usemap” must not + appear as a descendant of the “a” element. + + + The element “object” + with the attribute “usemap” must not + appear as a descendant of the “button” element. + + + + + + + + + + + + The “area” element must have an ancestor + “map” element. + + + + + + The “img” element with the + “ismap” attribute set must have an ancestor + “a” element with the “href” attribute. + + + + + + The “list” attribute of the “input” + element must refer to a “datalist” element. + + + Element “input” with attribute “type” + whose value is “button” must have non-empty attribute + “value”. + + + + + + Attribute “label” for element “track” + must have non-empty value. + + + The “default” attribute must not occur on more than one + “track” element within the same “audio” + element or “video” element. + + + + + + The “id” attribute on a “map” element must have + the same value as the “name” attribute. + + + + + + The “select” element cannot have more than one + selected “option” element descendant unless the + “multiple” attribute is specified. + + + A “select” element with + a “required” attribute and without + a “multiple” attribute, and whose + size is “1”, must have a child + “option” element. + + + + + + The first child “option” element + of a “select” element with + a “required” attribute and without + a “multiple” attribute, and whose + size is “1”, must have either an + empty “value” attribute, or must + have no text content. + + + + + + Element “script” with attribute + “language” whose value is “JavaScript” + must not have attribute “type” whose value is not + “text/javascript”. + + + Element “script” must not have attribute + “charset” unless attribute “src” is + also specified. + + + Element “script” must not have attribute + “defer” unless attribute “src” is + also specified. + + + Element “script” must not have attribute + “async” unless attribute “src” is + also specified. + + + + + + The element “time” must not + appear as a descendant of the “time” element. + + + + + + The element “progress” must not + appear as a descendant of the “progress” element. + + + The value of the “value” attribute must be less than or equal to + the value of the “max” attribute. + + + The value of the “value” attribute must be less than or equal to + one when the “max” attribute is absent. + + + + + + + + The element “meter” must not + appear as a descendant of the “meter” element. + + + The value of the “min” attribute must be less than or equal to + the value of the “value” attribute. + + + The value of the “value” attribute must be greater than or equal to + zero when the “min” attribute is absent. + + + The value of the “value” attribute must be less than or equal to + the value of the “max” attribute. + + + The value of the “value” attribute must be less than or equal to + one when the “max” attribute is absent. + + + The value of the “min” attribute must be less than or equal to + the value of the “max” attribute. + + + The value of the “max” attribute must be greater than or equal to + zero when the “min” attribute is absent. + + + The value of the “min” attribute must be less than or equal to + one when the “max” attribute is absent. + + + The value of the “min” attribute must be less than or equal to + the value of the “low” attribute. + + + The value of the “low” attribute must be greater than or equal to + zero when the “min” attribute is absent. + + + The value of the “min” attribute must be less than or equal to + the value of the “high” attribute. + + + The value of the “high” attribute must be greater than or equal to + zero when the “min” attribute is absent. + + + The value of the “low” attribute must be less than or equal to + the value of the “high” attribute. + + + The value of the “high” attribute must be less than or equal to + the value of the “max” attribute. + + + The value of the “high” attribute must be less than or equal to + one when the “max” attribute is absent. + + + The value of the “low” attribute must be less than or equal to + the value of the “max” attribute. + + + The value of the “low” attribute must be less than or equal to + one when the “max” attribute is absent. + + + The value of the “min” attribute must be less than or equal to + the value of the “optimum” attribute. + + + The value of the “optimum” attribute must be greater than or equal to + zero when the “min” attribute is absent. + + + The value of the “optimum” attribute must be less than or equal to + the value of the “max” attribute. + + + The value of the “optimum” attribute must be less than or equal to + one when the “max” attribute is absent. + + + + + + + + + The “acronym” element is obsolete. Use the “abbr” element instead. + + + + + + The “applet” element is obsolete. Use the “object” element instead. + + + + + + The “” element is obsolete. + Use CSS instead. http://wiki.whatwg.org/wiki/Presentational_elements_and_attributes + + + + + + The “dir” element is obsolete. Use the “ul” element instead. + + + + + + The “” element is obsolete. + Use the “iframe” element and CSS instead, or use server-side includes. + + + + + + + + + + The “coords” attribute on the “” element is obsolete. + For image maps, use the “area” element instead of the “a” element. + + + The “shape” attribute on the “” element is obsolete. + For image maps, use the “area” element instead of the “a” element. + + + The “urn” attribute on the “” element is obsolete. + Specify the preferred persistent identifier using the “href” attribute instead. + + + The “charset” attribute on the “” element is obsolete. + Use an HTTP Content-Type header on the linked resource instead. + + + The “methods” attribute on the “” element is obsolete. + Use the HTTP OPTIONS feature instead. + + + The “rev” attribute on the “” element is obsolete. + Use the “rel” attribute instead, with a term having the opposite meaning. + + + + + + The “target” attribute on the “” element is obsolete. + You can safely omit it. + + + The “urn” attribute on the “” element is obsolete. + Specify the preferred persistent identifier using the “href” attribute instead. + + + The “charset” attribute on the “” element is obsolete. + Use an HTTP Content-Type header on the linked resource instead. + + + The “methods” attribute on the “” element is obsolete. + Use the HTTP OPTIONS feature instead. + + + The “rev” attribute on the “” element is obsolete. + Use the “rel” attribute instead, with a term having the opposite meaning. + + + + + + The “nohref” attribute on the “” element is obsolete. + Omitting the “href” attribute is sufficient. + + + + + + The “name” attribute on the “” element is obsolete. + Use the “id” attribute instead. + + + + + + The “profile” attribute on the “” element is obsolete. + To declare which “meta” element terms are used in the document, instead register the + names as meta extensions. <http://wiki.whatwg.org/wiki/MetaExtensions> + To trigger specific UA behaviors, use a “link” element instead. + + + + + + The “version” attribute on the “” element is obsolete. + You can safely omit it. + + + + + + The “longdesc” attribute on the “” element is obsolete. + Use a regular “a” element to link to the description. + + + + + + The “longdesc” attribute on the “” element is obsolete. + Use a regular “a” element to link to the description. + + + The “name” attribute on the “” element is obsolete. + Use the “id” attribute instead. + + + + + + The “usemap” attribute on the “” element is obsolete. + Use the “img” element instead of the “input” element for image maps. + + + + + + The “type” attribute on the “” element is obsolete. + Use CSS instead. http://wiki.whatwg.org/wiki/Presentational_elements_and_attributes + + + + + + The “scheme” attribute on the “” element is obsolete. + Use only one scheme per field, or make the scheme declaration part of the value. + + + Using the “meta” element to specify the document-wide default language is obsolete. + Consider specifying the language on the root element instead. + + + + + + The “archive” attribute on the “” element is obsolete. + Use the “data” attribute and “type” attribute to invoke plugins. + To set a parameter with the name “archive”, use the “param” element. + + + The “classid” attribute on the “” element is obsolete. + Use the “data” attribute and “type” attribute to invoke plugins. + To set a parameter with the name “classid”, use the “param” element. + + + The “code” attribute on the “” element is obsolete. + Use the “data” attribute and “type” attribute to invoke plugins. + To set a parameter with the name “code”, use the “param” element. + + + The “codebase” attribute on the “” element is obsolete. + Use the “data” attribute and “type” attribute to invoke plugins. + To set a parameter with the name “codebase”, use the “param” element. + + + The “codetype” attribute on the “” element is obsolete. + Use the “data” attribute and “type” attribute to invoke plugins. + To set a parameter with the name “codetype”, use the “param” element. + + + The “declare” attribute on the “” element is obsolete. + Repeat the “object” element completely each time the resource is to be reused. + + + The “standby” attribute on the “” element is obsolete. + Optimize the linked resource so that it loads quickly or, at least, incrementally. + + + + + + The “name” attribute on the “” element is obsolete. + Use the “id” attribute instead. + + + + + + The “type” attribute on the “” element is obsolete. + Use the “name” attribute and “value” attribute without declaring value types. + + + The “valuetype” attribute on the “” element is obsolete. + Use the “name” attribute and “value” attribute without declaring value types. + + + + + + The “language” attribute on the “script” element is obsolete. + Use the “type” attribute instead. + + + + + + The “scope” attribute on the “td” element is obsolete. + Use the “scope” attribute on a “th” element instead. + + + The “abbr” attribute on the “” element is obsolete. + Consider instead beginning the cell contents with concise text, followed by further elaboration if needed. + + + The “axis” attribute on the “” element is obsolete. + Use the “scope” attribute instead. + + + + + + + + The “align” attribute on the “” element is obsolete. + Use CSS instead. http://wiki.whatwg.org/wiki/Presentational_elements_and_attributes + + + + + + + + The “width” attribute on the “” element is obsolete. + Use CSS instead. http://wiki.whatwg.org/wiki/Presentational_elements_and_attributes + + + + + + + + The “char” attribute on the “” element is obsolete. + Use CSS instead. http://wiki.whatwg.org/wiki/Presentational_elements_and_attributes + + + The “charoff” attribute on the “” element is obsolete. + Use CSS instead. http://wiki.whatwg.org/wiki/Presentational_elements_and_attributes + + + The “valign” attribute on the “” element is obsolete. + Use CSS instead. http://wiki.whatwg.org/wiki/Presentational_elements_and_attributes + + + + + + + + The “alink” attribute on the “” element is obsolete. + Use CSS instead. http://wiki.whatwg.org/wiki/Presentational_elements_and_attributes + + + The “background” attribute on the “” element is obsolete. + Use CSS instead. http://wiki.whatwg.org/wiki/Presentational_elements_and_attributes + + + The “bgcolor” attribute on the “” element is obsolete. + Use CSS instead. http://wiki.whatwg.org/wiki/Presentational_elements_and_attributes + + + The “link” attribute on the “” element is obsolete. + Use CSS instead. http://wiki.whatwg.org/wiki/Presentational_elements_and_attributes + + + The “marginbottom” attribute on the “” element is obsolete. + Use CSS instead. http://wiki.whatwg.org/wiki/Presentational_elements_and_attributes + + + The “marginheight” attribute on the “” element is obsolete. + Use CSS instead. http://wiki.whatwg.org/wiki/Presentational_elements_and_attributes + + + The “marginleft” attribute on the “” element is obsolete. + Use CSS instead. http://wiki.whatwg.org/wiki/Presentational_elements_and_attributes + + + The “marginright” attribute on the “” element is obsolete. + Use CSS instead. http://wiki.whatwg.org/wiki/Presentational_elements_and_attributes + + + The “margintop” attribute on the “” element is obsolete. + Use CSS instead. http://wiki.whatwg.org/wiki/Presentational_elements_and_attributes + + + The “marginwidth” attribute on the “” element is obsolete. + Use CSS instead. http://wiki.whatwg.org/wiki/Presentational_elements_and_attributes + + + The “text” attribute on the “” element is obsolete. + Use CSS instead. http://wiki.whatwg.org/wiki/Presentational_elements_and_attributes + + + The “vlink” attribute on the “” element is obsolete. + Use CSS instead. http://wiki.whatwg.org/wiki/Presentational_elements_and_attributes + + + + + + The “clear” attribute on the “” element is obsolete. + Use CSS instead. http://wiki.whatwg.org/wiki/Presentational_elements_and_attributes + + + + + + The “hspace” attribute on the “” element is obsolete. + Use CSS instead. http://wiki.whatwg.org/wiki/Presentational_elements_and_attributes + + + The “vspace” attribute on the “” element is obsolete. + Use CSS instead. http://wiki.whatwg.org/wiki/Presentational_elements_and_attributes + + + + + + The “noshade” attribute on the “” element is obsolete. + Use CSS instead. http://wiki.whatwg.org/wiki/Presentational_elements_and_attributes + + + The “size” attribute on the “” element is obsolete. + Use CSS instead. http://wiki.whatwg.org/wiki/Presentational_elements_and_attributes + + + The “color” attribute on the “” element is obsolete. + Use CSS instead. http://wiki.whatwg.org/wiki/Presentational_elements_and_attributes + + + + + + The “compact” attribute on the “” element is obsolete. + Use CSS instead. http://wiki.whatwg.org/wiki/Presentational_elements_and_attributes + + + + + + The “allowtransparency” attribute on the “” element is obsolete. + Use CSS instead. http://wiki.whatwg.org/wiki/Presentational_elements_and_attributes + + + The “frameborder” attribute on the “” element is obsolete. + Use CSS instead. http://wiki.whatwg.org/wiki/Presentational_elements_and_attributes + + + The “marginheight” attribute on the “” element is obsolete. + Use CSS instead. http://wiki.whatwg.org/wiki/Presentational_elements_and_attributes + + + The “marginwidth” attribute on the “” element is obsolete. + Use CSS instead. http://wiki.whatwg.org/wiki/Presentational_elements_and_attributes + + + The “scrolling” attribute on the “” element is obsolete. + Use CSS instead. http://wiki.whatwg.org/wiki/Presentational_elements_and_attributes + + + + + + The “hspace” attribute on the “” element is obsolete. + Use CSS instead. http://wiki.whatwg.org/wiki/Presentational_elements_and_attributes + + + The “vspace” attribute on the “” element is obsolete. + Use CSS instead. http://wiki.whatwg.org/wiki/Presentational_elements_and_attributes + + + The “border” attribute on the “” element is obsolete. + Use CSS instead. http://wiki.whatwg.org/wiki/Presentational_elements_and_attributes + + + + + + The “bgcolor” attribute on the “” element is obsolete. + Use CSS instead. http://wiki.whatwg.org/wiki/Presentational_elements_and_attributes + + + The value of the “border” attribute on the “” element + must be either “1” or the empty string. To regulate the thickness of table borders, + Use CSS instead. http://wiki.whatwg.org/wiki/Presentational_elements_and_attributes + + + The “cellpadding” attribute on the “” element is obsolete. + Use CSS instead. http://wiki.whatwg.org/wiki/Presentational_elements_and_attributes + + + The “cellspacing” attribute on the “” element is obsolete. + Use CSS instead. http://wiki.whatwg.org/wiki/Presentational_elements_and_attributes + + + The “frame” attribute on the “” element is obsolete. + Use CSS instead. http://wiki.whatwg.org/wiki/Presentational_elements_and_attributes + + + The “rules” attribute on the “” element is obsolete. + Use CSS instead. http://wiki.whatwg.org/wiki/Presentational_elements_and_attributes + + + + + + The “bgcolor” attribute on the “” element is obsolete. + Use CSS instead. http://wiki.whatwg.org/wiki/Presentational_elements_and_attributes + + + The “height” attribute on the “” element is obsolete. + Use CSS instead. http://wiki.whatwg.org/wiki/Presentational_elements_and_attributes + + + The “nowrap” attribute on the “” element is obsolete. + Use CSS instead. http://wiki.whatwg.org/wiki/Presentational_elements_and_attributes + + + + + + The “bgcolor” attribute on the “” element is obsolete. + Use CSS instead. http://wiki.whatwg.org/wiki/Presentational_elements_and_attributes + + + + + + + + + + When the attribute “lang” in no namespace and the attribute “lang” + in the XML namespace are both present, they must have the same value. + + + + + + + + + + + + The “contextmenu” attribute must refer to a + “menu” element. + + + + + + + + + + + + + + + + + + + + + An element with “role=option” requires + “role=listbox” on the parent. + + + + + + An element with “role=menuitem” requires + “role=menu” on the parent. + + + + + + An element with “role=menuitemcheckbox” requires + “role=menu” on the parent. + + + + + + An element with “role=menuitemradio” requires + “role=menu” on the parent. + + + + + + An element with “role=tab” requires + “role=tablist” on the parent. + + + + + + An element with “role=treeitem” requires + “role=tree” on the parent. + + + + + + An element with “role=listitem” requires + “role=list” on the parent. + + + + + + An element with “role=row” requires + “role=treegrid” or “role=grid” on the parent or grandparent. + + + + + + + An element with “role=gridcell” requires + “role=row” on the parent. + + + + + + + + + + An element must not be a child of + “role=listbox” unless it has “role=option”. + + + + + + + + An element must not be a child of + “role=menu” unless it has + “role=menuitem”, + “role=menuitemcheckbox” or + “role=menuitemradio”. + + + + + + + + An element must not be a child of + “role=tree” unless it has + “role=treeitem”. + + + + + + + + An element must not be a child of + “role=list” unless it has + “role=listitem”. + + + + + + + + + An element must not be a child of + “role=radiogroup” unless it has + “role=radio”. + + + + + + + + An element must not be a child of + “role=row” unless it has + “role=gridcell”. + + + + + + + + An element must not be a child of + “role=tablist” unless it has + “role=role”. + + + + + + + + + + The “aria-activedescendant” attribute must refer to a + descendant element. + + + + + + + + The “aria-controls” attribute must point to an element in the + same document. + + + + + + + + The “aria-describedby” attribute must point to an element in the + same document. + + + + + + + + The “aria-flowto” attribute must point to an element in the + same document. + + + + + + + + The “aria-labelledby” attribute must point to an element in the + same document. + + + + + + + + The “aria-owns” attribute must point to an element in the + same document. + + + + + + + + + + + The “border” attribute on the “img” element is obsolete. + Consider specifying “img { border: 0; }“ in CSS instead. + + + + + The “language” attribute on the “script” element is obsolete. You can safely omit it. + + + + + The “name” attribute on the “a” element is obsolete. Consider putting an + “id” attribute on the nearest container instead. + + + + + + + + “” element has more than one “track” + child element with a “default” attribute. + + + + + diff --git a/packages/html5-schema/block.rnc b/packages/html5-schema/block.rnc new file mode 100644 index 000000000..6d0eb0d80 --- /dev/null +++ b/packages/html5-schema/block.rnc @@ -0,0 +1,250 @@ +datatypes w = "http://whattf.org/datatype-draft" + +# ##################################################################### +## RELAX NG Schema for HTML 5: Basic Prose Markup # +# ##################################################################### + +# ##################################################################### +## Paragraph-Level + +## Paragraph:

    + + p.elem = + element p { p.inner & p.attrs } + p.attrs = + ( common.attrs + & common.attrs.aria? + ) + p.inner = + ( common.inner.phrasing ) # REVISIT lists in span? + + common.elem.flow |= p.elem + +## Hint Transition:


    + + hr.elem = + element hr { hr.inner & hr.attrs } + hr.attrs = + ( common.attrs + & common.attrs.aria.role.separator? + ) + hr.inner = + ( empty ) + + common.elem.flow |= hr.elem + +# ##################################################################### +## Preformatting Blocks + +## Preformatted Text:
    +
    +	pre.elem =
    +		element pre { pre.inner & pre.attrs }
    +	pre.attrs =
    +		(	common.attrs
    +		&	common.attrs.aria?
    +		)
    +	pre.inner =
    +		( common.inner.phrasing )
    +
    +	common.elem.flow |= pre.elem
    +
    +# #####################################################################
    +## Simple Lists
    +
    +## Unordered List: 
      + + ul.elem = + element ul { ul.inner & ul.attrs } + ul.attrs = + ( common.attrs + & ( ( 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.tablist + | common.attrs.aria.role.toolbar + | common.attrs.aria.role.tree + | common.attrs.aria.role.presentation + ) + | common.attrs.aria.implicit.list + )? + ) + ul.inner = + ( li.elem* + & common.elem.script-supporting* + ) + + common.elem.flow |= ul.elem + +## Unordered List Item:
    • + + li.elem = + element li { li.inner & li.attrs } + li.attrs = + ( common.attrs + & ( common.attrs.aria.implicit.listitem + | common.attrs.aria.role.listitem + | common.attrs.aria.role.menuitem + | common.attrs.aria.role.menuitemcheckbox + | common.attrs.aria.role.menuitemradio + | common.attrs.aria.role.option + | common.attrs.aria.role.tab + | common.attrs.aria.role.treeitem + | common.attrs.aria.role.separator + | common.attrs.aria.role.presentation + )? + ) + li.inner = + ( common.inner.flow ) + +## Ordered List:
        + + ol.elem = + element ol { ol.inner & ol.attrs } + ol.attrs = + ( common.attrs + & ol.attrs.start? + & ol.attrs.reversed? + & ol.attrs.type? + & ( ( 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.tablist + | common.attrs.aria.role.toolbar + | common.attrs.aria.role.tree + | common.attrs.aria.role.presentation + ) + | common.attrs.aria.implicit.list + )? + ) + ol.attrs.start = + attribute start { + common.data.integer + } + ol.attrs.reversed = + attribute reversed { + w:string "reversed" | w:string "" + } + ol.attrs.type = + attribute type { + w:string "1" | w:string "a" | w:string "A" | w:string "i" | w:string "I" + } + ol.inner = + ( oli.elem* + & common.elem.script-supporting* + ) + + common.elem.flow |= ol.elem + +## Ordered List Item:
      1. + + oli.elem = + element li { oli.inner & oli.attrs } + oli.attrs = + ( common.attrs + & oli.attrs.value? + & ( common.attrs.aria.implicit.listitem + | common.attrs.aria.role.listitem + | common.attrs.aria.role.menuitem + | common.attrs.aria.role.menuitemcheckbox + | common.attrs.aria.role.menuitemradio + | common.attrs.aria.role.option + | common.attrs.aria.role.tab + | common.attrs.aria.role.treeitem + | common.attrs.aria.role.separator + | common.attrs.aria.role.presentation + )? + ) + oli.attrs.value = + attribute value { + common.data.integer + } + oli.inner = + ( common.inner.flow ) + +# ##################################################################### +## Definition Lists + +## Definition List:
        + + dl.elem = + element dl { dl.inner & dl.attrs } + dl.attrs = + ( common.attrs + & ( common.attrs.aria.implicit.list + | common.attrs.aria.role.list + )? + ) + dl.inner = + ( ( ( dt.elem + & common.elem.script-supporting* + )+ + , + ( dd.elem + & common.elem.script-supporting* + )+ + )* + ) + + common.elem.flow |= dl.elem + +## Definition Term:
        + + dt.elem = + element dt { dt.inner & dt.attrs } + dt.attrs = + ( common.attrs + & common.attrs.aria? + ) + dt.inner = + ( common.inner.flow ) + +## Definition Description:
        + + dd.elem = + element dd { dd.inner & dd.attrs } + dd.elem.phrasing = + element dd { dd.inner.phrasing & dd.attrs } + dd.attrs = + ( common.attrs + & common.attrs.aria? + ) + dd.inner = + ( common.inner.flow ) + dd.inner.phrasing = + ( common.inner.phrasing ) + +# ##################################################################### +## Miscellaneous Elements + +## Generic Container:
        + + div.elem = + element div { div.inner & div.attrs } + div.attrs = + ( common.attrs + & common.attrs.aria? + ) + div.inner = + ( common.inner.flow ) + + common.elem.flow |= div.elem + +## Title or Explanatory Caption: + + legend.elem = + element legend { legend.inner & legend.attrs } + legend.attrs = + ( common.attrs + & ( common.attrs.aria.role.presentation + | common.attrs.aria.role.menuitem + )? + ) + legend.inner = + ( common.inner.phrasing ) diff --git a/packages/html5-schema/common.rnc b/packages/html5-schema/common.rnc new file mode 100644 index 000000000..68d9acc5f --- /dev/null +++ b/packages/html5-schema/common.rnc @@ -0,0 +1,526 @@ +datatypes w = "http://whattf.org/datatype-draft" + +# ##################################################################### +## RELAX NG Schema for HTML 5: Common Definitions # +# ##################################################################### + + +# ##################################################################### +## Language Parameters - redefine in inclusion block as necessary # +# ##################################################################### + +## HTML vs. XHTML restrictions + + XMLonly = empty + HTMLonly = notAllowed + +## HTML 4 Compatibility - set to notAllowed to disallow markup introduced in HTML 5 +# (This only affects mixed-version modules; wholly HTML5 +# modules should simply be left out of the inclusion list.) + + v5only = empty + +## HTML Compatibility Switches - set to notAllowed to disallow + + ## XML features that can't be roundtripped HTML <-> XHTML + # (xml:base on elements other than ) + nonRoundtrippable = empty + + ## XML features that can't be serialized as HTML + nonHTMLizable = empty + +## features that are not part of the W3C HTML spec + nonW3C = empty + +# ##################################################################### +## Wildcards # +# ##################################################################### + +## Any attribute from any namespace + + common.attr.anything = + attribute * { text }* + +## Any element from any namespace + + common.elem.anything = + element * { common.inner.anything & common.attr.anything } + +## Any content from any namespace + + common.inner.anything = + ( text + & common.elem.anything* + ) + +# ##################################################################### +## Common Element Classes # +# ##################################################################### + +## Metadata Elements + + common.elem.metadata = + ( notAllowed ) + +## Phrase Elements + + common.elem.phrasing = + ( notAllowed ) + +## Prose Elements + + common.elem.flow = + ( common.elem.phrasing ) + + +# ##################################################################### +## Common Content Models # +# ##################################################################### + +## Metadata Content + + common.inner.metadata = + ( common.elem.metadata* ) + +## Phrase Content + + common.inner.phrasing = + ( text & common.elem.phrasing* ) + +## Prose Content + + common.inner.transparent.flow = + ( text & common.elem.flow* ) + + common.inner.flow = + ( style.elem.scoped*, + ( text + & common.elem.flow* + ) + ) + +# ##################################################################### +## Common Attributes # +# ##################################################################### + +# When updating, check definition too + +common.attrs = + ( common.attrs.basic + & common.attrs.i18n + & common.attrs.present + & common.attrs.other + ) + +common.attrs.basic = + ( common.attrs.id? + & common.attrs.class? + & common.attrs.title? + & common.attrs.base? + & common.attrs.space? + ) + common.attrs.id = + attribute id { + common.data.id + } + common.attrs.class = + attribute class { + common.data.tokens + } + common.attrs.title = + attribute title { + text + } + common.attrs.base = + common.attrs.xmlbase + & nonRoundtrippable + common.attrs.xmlbase = + attribute xml:base { + common.data.uri + } & XMLonly + common.attrs.space = + common.attrs.xmlspace + common.attrs.xmlspace = + attribute xml:space { + string "preserve" | string "default" + } & XMLonly + +common.attrs.i18n = + ( common.attrs.dir? + & common.attrs.language? + & common.attrs.translate? + ) + common.attrs.dir = + attribute dir { + w:string "ltr" | w:string "rtl" | w:string "auto" + } + # This lang definition is a hack for enviroments where + # the HTML5 parser maps lang to xml:lang. + # Sameness check left to Schematron + common.attrs.language = + ( common.attrs.xmllang? + & common.attrs.lang? + ) + common.attrs.lang = + attribute lang { + common.data.langcode + } & XMLonly + common.attrs.xmllang = + attribute xml:lang { + common.data.langcode + } +# common.attrs.language = +# ( common.attrs.lang +# | common.attrs.xmllang +# ) +# common.attrs.lang = +# attribute lang { +# common.data.langcode +# } & HTMLonly +# common.attrs.xmllang = +# attribute xml:lang { +# common.data.langcode +# } & XMLonly + common.attrs.translate = + attribute translate { + w:string "" | w:string "yes" | w:string "no" + } + +common.attrs.present = + ( common.attrs.style? + & common.attrs.tabindex? + & common.attrs.accesskey? + ) + common.attrs.style = + attribute style { + string + } + common.attrs.tabindex = + attribute tabindex { + common.data.integer + } + # REVISIT move style to a module and bundle tabindex with ARIA + common.attrs.accesskey = + attribute accesskey { + common.data.keylabellist + } + +common.attrs.other = + empty + +# ##################################################################### +## Common Datatypes # +# ##################################################################### + +## Names and Tokens + + common.data.tokens = + list { token* } + + common.data.browsing-context = + w:browsing-context + + common.data.browsing-context-or-keyword = + w:browsing-context-or-keyword +# xsd:string { +# pattern = "()|([^_].*)|(_[bB][lL][aA][nN][kK])|(_[sS][eE][lL][fF])|(_[pP][aA][rR][eE][nN][tT])|(_[tT][oO][pP])" +# } + + +## IDs and IDREFs + + common.data.id = + w:ID +# xsd:string { +# pattern = "\S+" +# } + + common.data.idref = + w:IDREF + + common.data.idrefs = + w:IDREFS + + common.data.name = + w:ID #FIXME + + common.data.hash-name = + w:hash-name +# xsd:string { +# pattern = "#.+" +# } + +## Numerical + + common.data.integer = + w:integer +# xsd:string { +# pattern = "-?[0-9]+" +# } + + common.data.integer.positive = + w:integer-positive +# xsd:string { +# pattern = "0*[1-9][0-9]*" +# } + + common.data.integer.non-negative = + w:integer-non-negative +# xsd:string { +# pattern = "[0-9]+" +# } + +# common.data.percent = +# xsd:string { +# pattern = "(100)|([1-9]?[0-9](\.[0-9]+)?)%" +# } + + common.data.float = + w:float +# xsd:string { +# pattern = "-?[0-9]+(\.[0-9]+)?([eE]-?[0-9]+)?" +# } + + common.data.float.positive = + w:float-positive +# xsd:string { +# pattern = "(0*[1-9][0-9]*(\.[0-9]+)?)|([0-9]+(\.0*[1-9][0-9]*)?)([eE]-?[0-9]+)?" +# } + + common.data.float.non-negative = + w:float-non-negative +# xsd:string { +# pattern = "[0-9]+(\.[0-9]+)?([eE]-?[0-9]+)?" +# } + +## Temporal + + common.data.datetime = + w:datetime-tz + + common.data.date-or-time = + w:date-or-time + + common.data.date = + w:date + + common.data.time-datetime = + w:time-datetime + +## IRIs + + common.data.uri = + # allow either a non-empty IRI ref or zero or more HTML + # space characters (which are: space, tab, LF, FF, CR) + ( w:iri-ref + | xsd:string { + pattern = "[ \x{0A}-\x{0D}]*" + # NOTE The range above incorrectly allows U+000B + # in addition to the HTML space characters; but + # that's not a problem in practice because HTML + # and XML parsers will both catch any U+000B + # and report an error for it before that pattern + # ever gets evaluated. + } + ) + + common.data.uri.non-empty = + w:iri-ref + + common.data.uris = + list { w:iri-ref* } + + common.data.uri.absolute = + w:iri + +## sizes + + common.data.sizes = +# list { w:sizes } + list { + xsd:string { + pattern = "[1-9][0-9]*x[1-9][0-9]*" + }+ + } + +## MIME types + + common.data.mimetype = + w:mime-type + +## Encodings + + common.data.charset = + w:charset + + common.data.meta-charset = + w:meta-charset + +## Refresh + + common.data.refresh = + w:refresh + +## Default style + + common.data.default-style = + string +# w:default-style + +## X-UA-Compatible + + common.data.x-ua-compatible = + string + +## Media Queries + + common.data.mediaquery = + w:media-query + +## Language Codes + + common.data.langcode = + w:string "" | w:language + +## List of Key Labels + common.data.keylabellist = + w:keylabellist + +## List of Source Sizes + common.data.source.size.list = + w:source-size-list + +## Subresource Integrity + common.data.integrity = + w:integrity-metadata + +## Content Security Policy + common.data.content-security-policy = + w:content-security-policy + +## List of sandbox keywords + common.data.sandbox-allow-list = + w:string "" | w:sandbox-allow-list + +## Microdata Properties + common.data.microdata-properties = + list { w:microdata-property+ } + +## Zero + common.data.zero = + w:zero + +## ECMAScript FunctionBody + common.data.functionbody = + w:functionbody + +# ##################################################################### +## WF2 Module Hook # +# ##################################################################### + +common-form.attrs.form = ( notAllowed ) + +# ##################################################################### +## Script-supporting elements +# ##################################################################### + +common.elem.script-supporting = ( notAllowed ) + +# ##################################################################### +## ARIA Module Hooks # +# ##################################################################### + +common.attrs.aria = ( notAllowed ) +common.attrs.aria.role.alert = ( notAllowed ) +common.attrs.aria.role.alertdialog = ( notAllowed ) +common.attrs.aria.role.application = ( notAllowed ) +common.attrs.aria.role.article = ( notAllowed ) +common.attrs.aria.role.banner = ( notAllowed ) +common.attrs.aria.role.button = ( 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 ) +common.attrs.aria.role.group = ( notAllowed ) +common.attrs.aria.role.heading = ( notAllowed ) +common.attrs.aria.role.img = ( notAllowed ) +common.attrs.aria.role.link = ( notAllowed ) +common.attrs.aria.role.list = ( notAllowed ) +common.attrs.aria.role.listitem = ( notAllowed ) +common.attrs.aria.role.log = ( notAllowed ) +common.attrs.aria.role.listbox = ( notAllowed ) +common.attrs.aria.role.main = ( notAllowed ) +common.attrs.aria.role.marquee = ( notAllowed ) +common.attrs.aria.role.menu = ( notAllowed ) +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 ) +common.attrs.aria.role.radio = ( notAllowed ) +common.attrs.aria.role.region = ( notAllowed ) +common.attrs.aria.role.search = ( notAllowed ) +common.attrs.aria.role.separator = ( notAllowed ) +common.attrs.aria.role.slider = ( notAllowed ) +common.attrs.aria.role.spinbutton = ( notAllowed ) +common.attrs.aria.role.status = ( notAllowed ) +common.attrs.aria.role.switch = ( notAllowed ) +common.attrs.aria.role.tab = ( notAllowed ) +common.attrs.aria.role.tablist = ( notAllowed ) +common.attrs.aria.role.tabpanel = ( notAllowed ) +common.attrs.aria.role.textbox = ( notAllowed ) +common.attrs.aria.role.toolbar = ( notAllowed ) +common.attrs.aria.role.tree = ( notAllowed ) +common.attrs.aria.role.treeitem = ( notAllowed ) +common.attrs.aria.implicit.article = ( notAllowed ) +common.attrs.aria.implicit.banner = ( notAllowed ) +common.attrs.aria.implicit.button = ( notAllowed ) +common.attrs.aria.implicit.checkbox = ( notAllowed ) +common.attrs.aria.implicit.column-or-row-header = ( notAllowed ) +common.attrs.aria.implicit.combobox = ( notAllowed ) +common.attrs.aria.implicit.complementary = ( notAllowed ) +common.attrs.aria.implicit.contentinfo = ( notAllowed ) +common.attrs.aria.implicit.dialog = ( notAllowed ) +common.attrs.aria.implicit.document = ( notAllowed ) +common.attrs.aria.implicit.form = ( notAllowed ) +common.attrs.aria.implicit.group = ( notAllowed ) +common.attrs.aria.implicit.heading = ( notAllowed ) +common.attrs.aria.implicit.img = ( notAllowed ) +common.attrs.aria.implicit.landmark = ( notAllowed ) +common.attrs.aria.implicit.link = ( notAllowed ) +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.navigation = ( notAllowed ) +common.attrs.aria.implicit.option = ( notAllowed ) +common.attrs.aria.implicit.progressbar = ( notAllowed ) +common.attrs.aria.implicit.radio = ( notAllowed ) +common.attrs.aria.implicit.region = ( notAllowed ) +common.attrs.aria.implicit.section = ( notAllowed ) +common.attrs.aria.implicit.select = ( notAllowed ) +common.attrs.aria.implicit.slider = ( notAllowed ) +common.attrs.aria.implicit.spinbutton = ( notAllowed ) +common.attrs.aria.implicit.status = ( notAllowed ) +common.attrs.aria.implicit.structure = ( notAllowed ) +common.attrs.aria.implicit.textbox = ( notAllowed ) +common.attrs.aria.implicit.toolbar = ( notAllowed ) +common.attrs.aria.prop.readonly = ( notAllowed ) +common.attrs.aria.landmark.application = ( notAllowed ) +common.attrs.aria.landmark.banner = ( notAllowed ) +common.attrs.aria.landmark.complementary = ( notAllowed ) +common.attrs.aria.landmark.contentinfo = ( notAllowed ) +common.attrs.aria.landmark.form = ( notAllowed ) +common.attrs.aria.landmark.main = ( notAllowed ) +common.attrs.aria.landmark.navigation = ( notAllowed ) +common.attrs.aria.landmark.search = ( notAllowed ) +# per ARIA spec: article, document, and note are not actually landmarks +common.attrs.aria.landmark.article = ( notAllowed ) +common.attrs.aria.landmark.document = ( notAllowed ) +common.attrs.aria.landmark.note = ( notAllowed ) diff --git a/packages/html5-schema/core-scripting.rnc b/packages/html5-schema/core-scripting.rnc new file mode 100644 index 000000000..33e8ff705 --- /dev/null +++ b/packages/html5-schema/core-scripting.rnc @@ -0,0 +1,386 @@ +datatypes w = "http://whattf.org/datatype-draft" + +# ##################################################################### +## RELAX NG Schema for HTML 5: Core Scripting # +# ##################################################################### + +# ##################################################################### +## Scripting Elements + +## Inline Scripts: