update html5 schema (WEB-26936)

This commit is contained in:
Dennis Ushakov
2017-08-18 11:50:06 +03:00
parent 53a287ce0b
commit 95096250a6
10 changed files with 63 additions and 84 deletions

View File

@@ -27,7 +27,7 @@ import com.intellij.xml.Html5SchemaProvider;
* @author Eugene.Kudelevsky
*/
public class DefaultHtmlDoctypeInitialConfigurator {
public static final int VERSION = 2;
public static final int VERSION = 3;
public DefaultHtmlDoctypeInitialConfigurator(ProjectManager projectManager,
PropertiesComponent propertiesComponent) {

View File

@@ -7,8 +7,7 @@ datatypes w = "http://whattf.org/datatype-draft"
## Additions to Common Attributes
common.attrs.interact &=
( common.attrs.contextmenu?
& common.attrs.contenteditable?
( common.attrs.contenteditable?
& common.attrs.draggable?
& common.attrs.dropzone?
& common.attrs.hidden?
@@ -17,13 +16,6 @@ datatypes w = "http://whattf.org/datatype-draft"
common.attrs.other &= common.attrs.interact
## Context Menu: contextmenu
common.attrs.contextmenu =
attribute contextmenu {
common.data.idref
}
## Editable Content: contenteditable
common.attrs.contenteditable =
@@ -135,13 +127,12 @@ datatypes w = "http://whattf.org/datatype-draft"
( common.inner.flow )
common.elem.flow |= dialog.elem
## Toolbar: <menu type=toolbar>
## Toolbar: <menu>
menu.toolbar.elem =
element menu { menu.toolbar.inner & menu.toolbar.attrs }
menu.toolbar.attrs =
menu.elem =
element menu { menu.inner & menu.attrs }
menu.attrs =
( common.attrs
& menu.toolbar.attrs.type?
& ( common.attrs.aria.implicit.toolbar
| common.attrs.aria.role.directory
| common.attrs.aria.role.list
@@ -154,16 +145,12 @@ datatypes w = "http://whattf.org/datatype-draft"
| common.attrs.aria.role.presentation
)?
)
menu.toolbar.attrs.type =
attribute type {
w:string "toolbar"
}
menu.toolbar.inner =
menu.inner =
( mli.elem*
| common.inner.flow
& common.elem.script-supporting*
)
menu.elem |= menu.toolbar.elem
common.elem.flow |= menu.elem
## Toolbar item: <li>
mli.elem =
@@ -184,55 +171,6 @@ datatypes w = "http://whattf.org/datatype-draft"
mli.inner =
( common.inner.flow )
## Popup menu: <menu type=context>
menu.context.elem =
element menu { menu.context.inner & menu.context.attrs }
menu.context.attrs =
( common.attrs
& menu.context.attrs.type?
& menu.attrs.label?
& common.attrs.aria?
)
menu.context.attrs.type =
attribute type {
w:string "context"
}
menu.attrs.label =
attribute label {
string
}
menu.context.inner =
( menuitem.elem*
& hr.elem*
& menu.context.elem*
& common.elem.script-supporting*
)
menu.elem |= menu.context.elem
## Ambiguous menu: <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 type=command>
menuitem.explicit.command.elem =
element menuitem { menuitem.inner & menuitem.explicit.command.attrs }

View File

@@ -26,7 +26,9 @@ datatypes w = "http://whattf.org/datatype-draft"
element hr { hr.inner & hr.attrs }
hr.attrs =
( common.attrs
& common.attrs.aria.role.separator?
& ( common.attrs.aria.role.separator
| common.attrs.aria.role.presentation
)?
)
hr.inner =
( empty )
@@ -183,6 +185,7 @@ datatypes w = "http://whattf.org/datatype-draft"
( common.attrs
& ( common.attrs.aria.implicit.list
| common.attrs.aria.role.list
| common.attrs.aria.role.presentation
)?
)
dl.inner =

View File

@@ -152,7 +152,7 @@ common.attrs.i18n =
attribute dir {
w:string "ltr" | w:string "rtl" | w:string "auto"
}
# This lang definition is a hack for enviroments where
# This lang definition is a hack for environments where
# the HTML5 parser maps lang to xml:lang.
# Sameness check left to Schematron
common.attrs.language =

View File

@@ -14,6 +14,7 @@ datatypes w = "http://whattf.org/datatype-draft"
script.attrs.embedded =
( common.attrs
& script.attrs.type?
& script.attrs.nomodule?
& script.attrs.language? # restricted in Schematron
& script.attrs.integrity?
& script.attrs.nonce?
@@ -30,6 +31,7 @@ datatypes w = "http://whattf.org/datatype-draft"
& script.attrs.defer?
& script.attrs.async?
& script.attrs.type?
& script.attrs.nomodule?
& script.attrs.charset?
& script.attrs.language? # restricted in Schematron
& script.attrs.integrity?
@@ -55,6 +57,10 @@ datatypes w = "http://whattf.org/datatype-draft"
attribute type {
w:string "module" | common.data.mimetype # XXX without charset parameter!
}
script.attrs.nomodule =
attribute nomodule {
w:string "nomodule" | w:string ""
}
script.attrs.charset =
attribute charset {
common.data.charset
@@ -174,7 +180,6 @@ datatypes w = "http://whattf.org/datatype-draft"
& scripting.attr.onseeked?
& scripting.attr.onseeking?
& scripting.attr.onselect?
& scripting.attr.onshow?
& scripting.attr.onsort?
& scripting.attr.onstalled?
& scripting.attr.onsubmit?
@@ -299,8 +304,6 @@ datatypes w = "http://whattf.org/datatype-draft"
attribute onseeking { common.data.functionbody }
scripting.attr.onselect =
attribute onselect { common.data.functionbody }
scripting.attr.onshow =
attribute onshow { common.data.functionbody }
scripting.attr.onsort =
attribute onsort { common.data.functionbody }
scripting.attr.onstalled =

View File

@@ -165,7 +165,6 @@ namespace local = ""
| translate
| style
| tabindex
| contextmenu
| contenteditable
| draggable
| dropzone
@@ -224,7 +223,6 @@ namespace local = ""
| onseeked
| onseeking
| onselect
| onshow
| onsort
| onstalled
| onsubmit

View File

@@ -163,6 +163,9 @@ datatypes w = "http://whattf.org/datatype-draft"
& referrerpolicy?
& link.attrs.sizes?
& link.attrs.color?
& link.attrs.scope?
& link.attrs.updateviacache?
& link.attrs.workertype?
# link.attrs.title included in common.attrs
& embedded.content.attrs.crossorigin?
& ( common.attrs.aria.role.link
@@ -212,6 +215,21 @@ datatypes w = "http://whattf.org/datatype-draft"
attribute color {
common.data.color
}
link.attrs.scope =
attribute scope {
common.data.uri
}
link.attrs.updateviacache =
attribute updateviacache {
string "imports"
| string "all"
| string "none"
}
link.attrs.workertype =
attribute workertype {
string "classic"
| string "module"
}
link.inner =
( empty )

View File

@@ -34,7 +34,6 @@ namespace c = "http://n.validator.nu/custom-elements/"
| fieldset.inner
| select.inner
| details.inner
| menu.context.inner
)
common.elem.metadata |= template.elem
common.elem.phrasing |= template.elem

View File

@@ -28,11 +28,15 @@ grammar {
SVG.base.attrib = attribute xml:base { URI.datatype }?
SVG.lang.attrib = attribute xml:lang { LanguageCode.datatype }?
SVG.space.attrib = attribute xml:space { string "default" | string "preserve" }?
SVG.tabindex.attrib = attribute tabindex { Integer.datatype }?
SVG.focusable.attrib = attribute focusable { string "true" | string "false" }?
SVG.Core.extra.attrib = empty
SVG.Core.attrib =
SVG.id.attrib,
SVG.base.attrib,
SVG.lang.attrib,
SVG.space.attrib,
SVG.tabindex.attrib,
SVG.focusable.attrib,
SVG.Core.extra.attrib
}

View File

@@ -28,7 +28,11 @@ grammar {
SVG.XLink.attrib &=
[ a:defaultValue = "simple" ]
attribute xlink:type { string "simple" }?,
attribute xlink:href { URI.datatype }?,
(
attribute xlink:href { URI.datatype }
|
attribute href { URI.datatype }
)?,
attribute xlink:role { URI.datatype }?,
attribute xlink:arcrole { URI.datatype }?,
attribute xlink:title { text }?,
@@ -40,7 +44,11 @@ grammar {
SVG.XLinkRequired.attrib &=
[ a:defaultValue = "simple" ]
attribute xlink:type { string "simple" }?,
attribute xlink:href { URI.datatype },
(
attribute xlink:href { URI.datatype }
|
attribute href { URI.datatype }
)?,
attribute xlink:role { URI.datatype }?,
attribute xlink:arcrole { URI.datatype }?,
attribute xlink:title { text }?,
@@ -52,7 +60,11 @@ grammar {
SVG.XLinkEmbed.attrib &=
[ a:defaultValue = "simple" ]
attribute xlink:type { string "simple" }?,
attribute xlink:href { URI.datatype },
(
attribute xlink:href { URI.datatype }
|
attribute href { URI.datatype }
)?,
attribute xlink:role { URI.datatype }?,
attribute xlink:arcrole { URI.datatype }?,
attribute xlink:title { text }?,
@@ -64,7 +76,11 @@ grammar {
SVG.XLinkReplace.attrib &=
[ a:defaultValue = "simple" ]
attribute xlink:type { string "simple" }?,
attribute xlink:href { URI.datatype },
(
attribute xlink:href { URI.datatype }
|
attribute href { URI.datatype }
)?,
attribute xlink:role { URI.datatype }?,
attribute xlink:arcrole { URI.datatype }?,
attribute xlink:title { text }?,