66import strings = require( 'vs/base/common/strings' ) ;
77import arrays = require( 'vs/base/common/arrays' ) ;
88
9- var emptyElements :string [ ] = [ 'area' , 'base' , 'basefont' , ' br', 'col' , 'command' , ' embed', 'frame' , ' hr', 'img' , 'input' , 'isindex ' , 'keygen ' , 'link ' , 'meta' , 'param' , 'source' , 'track' , 'wbr' ] ;
9+ var emptyElements :string [ ] = [ 'area' , 'base' , 'br' , 'col' , 'embed' , 'hr' , 'img' , 'input' , 'keygen ' , 'link ' , 'menuitem ' , 'meta' , 'param' , 'source' , 'track' , 'wbr' ] ;
1010
1111export function isEmptyElement ( e : string ) : boolean {
1212 return arrays . binarySearch ( emptyElements , e , ( s1 : string , s2 : string ) => s1 . localeCompare ( s2 ) ) >= 0 ;
@@ -26,6 +26,7 @@ export function getHTML5TagProvider(): IHTMLTagProvider {
2626 head : none ,
2727 title : none ,
2828 noscript : none ,
29+ main : none ,
2930 section : none ,
3031 nav : none ,
3132 article : none ,
@@ -44,7 +45,7 @@ export function getHTML5TagProvider(): IHTMLTagProvider {
4445 hr : none ,
4546 pre : none ,
4647 blockquote : [ 'cite' ] ,
47- ol : [ 'reversed:v' , 'start' ] ,
48+ ol : [ 'reversed:v' , 'start' , 'type:lt' ] ,
4849 ul : none ,
4950 li : [ 'value' ] ,
5051 dl : none ,
@@ -53,7 +54,7 @@ export function getHTML5TagProvider(): IHTMLTagProvider {
5354 figure : none ,
5455 figcaption : none ,
5556 div : none ,
56- a : [ 'href' , 'target' , 'ping ' , 'rel ' , 'media ' , 'hreflang' , 'type' ] ,
57+ a : [ 'href' , 'target' , 'download ' , 'ping ' , 'rel ' , 'hreflang' , 'type' ] ,
5758 em : none ,
5859 strong : none ,
5960 small : none ,
@@ -63,7 +64,7 @@ export function getHTML5TagProvider(): IHTMLTagProvider {
6364 dfn : none ,
6465 abbr : none ,
6566 data : [ 'value' ] ,
66- time : [ 'datetime' , 'pubdate' ] ,
67+ time : [ 'datetime' ] ,
6768 code : none ,
6869 var : none ,
6970 samp : none ,
@@ -75,8 +76,10 @@ export function getHTML5TagProvider(): IHTMLTagProvider {
7576 u : none ,
7677 mark : none ,
7778 ruby : none ,
78- rt : none ,
79+ rb : none ,
7980 rp : none ,
81+ rt : none ,
82+ rtc : none ,
8083 bdi : none ,
8184 bdo : none ,
8285 span : none ,
@@ -85,25 +88,26 @@ export function getHTML5TagProvider(): IHTMLTagProvider {
8588 ins : [ 'cite' , 'datetime' ] ,
8689 del : [ 'cite' , 'datetime' ] ,
8790 img : [ 'alt' , 'src' , 'srcset' , 'crossorigin:xo' , 'usemap' , 'ismap:v' , 'width' , 'height' ] ,
88- iframe : [ 'src' , 'srcdoc' , 'name' , 'sandbox' , 'seamless' , 'width' , 'height' ] ,
91+ iframe : [ 'src' , 'srcdoc' , 'name' , 'sandbox:sb ' , 'seamless:v' , 'allowfullscreen:v ', 'width' , 'height' ] ,
8992 embed : [ 'src' , 'type' , 'width' , 'height' ] ,
9093 object : [ 'data' , 'type' , 'typemustmatch:v' , 'name' , 'usemap' , 'form' , 'width' , 'height' ] ,
9194 param : [ 'name' , 'value' ] ,
92- video : [ 'src' , 'crossorigin:xo' , 'poster' , 'preload' , 'autoplay:v' , 'mediagroup' , 'loop:v' , 'muted:v' , 'controls:v' , 'width' , 'height' ] ,
93- audio : [ 'src' , 'crossorigin:xo' , 'preload' , 'autoplay:v' , 'mediagroup' , 'loop:v' , 'muted:v' , 'controls:v' ] ,
94- source : [ 'src' , 'type' , 'media' ] ,
95- track : [ 'default:v' , 'kind' , 'label' , 'src' , 'srclang' ] ,
95+ video : [ 'src' , 'crossorigin:xo' , 'poster' , 'preload:pl ' , 'autoplay:v' , 'mediagroup' , 'loop:v' , 'muted:v' , 'controls:v' , 'width' , 'height' ] ,
96+ audio : [ 'src' , 'crossorigin:xo' , 'preload:pl ' , 'autoplay:v' , 'mediagroup' , 'loop:v' , 'muted:v' , 'controls:v' ] ,
97+ source : [ 'src' , 'type' ] ,
98+ track : [ 'default:v' , 'kind:tk ' , 'label' , 'src' , 'srclang' ] ,
9699 canvas : [ 'width' , 'height' ] ,
97100 map : [ 'name' ] ,
98- area : [ 'alt' , 'coords' , 'shape' , 'href' , 'target' , 'ping ' , 'rel ' , 'media ' , 'hreflang' , 'type' ] ,
101+ area : [ 'alt' , 'coords' , 'shape:sh ' , 'href' , 'target' , 'download ' , 'ping ' , 'rel ' , 'hreflang' , 'type' ] ,
99102 base : [ 'href' , 'target' ] ,
100- link : [ 'href' , 'rel' , 'media' , 'hreflang' , 'type' , 'sizes' ] ,
103+ link : [ 'href' , 'crossorigin:xo' , ' rel', 'media' , 'hreflang' , 'type' , 'sizes' ] ,
101104 meta : [ 'name' , 'http-equiv' , 'content' , 'charset' ] ,
102- style : [ 'media' , 'type' , 'scoped:v' ] ,
103- script : [ 'src' , 'async:v' , 'defer:v' , 'type' , 'charset' ] ,
104- body : [ 'onafterprint' , 'onbeforeprint' , 'onbeforeunload' , 'onblur' , 'onerror' , 'onfocus' , 'onhashchange' , 'onload' , 'onmessage' ,
105- 'onoffline' , 'ononline' , 'onpagehide' , 'onpageshow' , 'onpopstate' , 'onresize' , 'onscroll' , 'onstorage' , 'onunload' ] ,
106- table : none ,
105+ style : [ 'media' , 'nonce' , 'type' , 'scoped:v' ] ,
106+ script : [ 'src' , 'type' , 'charset' , 'async:v' , 'defer:v' , 'crossorigin:xo' , 'nonce' ] ,
107+ template : none ,
108+ body : [ 'onafterprint' , 'onbeforeprint' , 'onbeforeunload' , 'onhashchange' , 'onlanguagechange' , 'onmessage' , 'onoffline' , 'ononline' , 'onpagehide' ,
109+ 'onpageshow' , 'onpopstate' , 'onstorage' , 'onunload' ] ,
110+ table : [ 'sortable:v' , 'border' ] ,
107111 caption : none ,
108112 colgroup : [ 'span' ] ,
109113 col : [ 'span' ] ,
@@ -112,28 +116,28 @@ export function getHTML5TagProvider(): IHTMLTagProvider {
112116 tfoot : none ,
113117 tr : none ,
114118 td : [ 'colspan' , 'rowspan' , 'headers' ] ,
115- th : [ 'colspan' , 'rowspan' , 'headers' , 'scope' , 'abbr' ] ,
116- form : [ 'accept-charset' , 'action' , 'autocomplete:o' , 'enctype' , 'method:m' , 'name' , 'novalidate:v' , 'target' ] ,
119+ th : [ 'colspan' , 'rowspan' , 'headers' , 'scope:s' , 'sorted ', 'abbr' ] ,
120+ form : [ 'accept-charset' , 'action' , 'autocomplete:o' , 'enctype:et ' , 'method:m' , 'name' , 'novalidate:v' , 'target' ] ,
117121 fieldset : [ 'disabled:v' , 'form' , 'name' ] ,
118122 legend : none ,
119123 label : [ 'form' , 'for' ] ,
120- input : [ 'accept' , 'alt' , 'autocomplete:o' , 'autofocus:v' , 'checked:v' , 'dirname' , 'disabled:v' , 'form' , 'formaction' , 'formenctype' ,
121- 'formmethod:m ' , 'formnovalidate:v' , 'formtarget' , 'height' , 'inputmode' , 'list' , 'max' , 'maxlength' , 'min' , 'multiple:v' , 'name' ,
122- 'pattern' , 'placeholder' , 'readonly:v' , 'required' , 'size' , 'src' , 'step' , 'type:t' , 'value' , 'width' ] ,
123- button : [ 'autofocus:v' , 'disabled:v' , 'form' , 'formaction' , 'formenctype' , 'formmethod:m ' , 'formnovalidate:v' , 'formtarget' , 'name' , 'type:bt' , 'value' ] ,
124- select : [ 'autofocus:v' , 'disabled:v' , 'form' , 'multiple:v' , 'name' , 'required:v' , 'size' ] ,
125- datalist : [ 'option' ] ,
124+ input : [ 'accept' , 'alt' , 'autocomplete:o' , 'autofocus:v' , 'checked:v' , 'dirname' , 'disabled:v' , 'form' , 'formaction' , 'formenctype:et ' ,
125+ 'formmethod:fm ' , 'formnovalidate:v' , 'formtarget' , 'height' , 'inputmode:im ' , 'list' , 'max' , 'maxlength' , 'min' , 'minlength ', 'multiple:v' , 'name' ,
126+ 'pattern' , 'placeholder' , 'readonly:v' , 'required:v ' , 'size' , 'src' , 'step' , 'type:t' , 'value' , 'width' ] ,
127+ button : [ 'autofocus:v' , 'disabled:v' , 'form' , 'formaction' , 'formenctype:et ' , 'formmethod:fm ' , 'formnovalidate:v' , 'formtarget' , 'name' , 'type:bt' , 'value' ] ,
128+ select : [ 'autocomplete:o' , ' autofocus:v', 'disabled:v' , 'form' , 'multiple:v' , 'name' , 'required:v' , 'size' ] ,
129+ datalist : none ,
126130 optgroup : [ 'disabled:v' , 'label' ] ,
127131 option : [ 'disabled:v' , 'label' , 'selected:v' , 'value' ] ,
128- textarea : [ 'autocomplete:o' , 'autofocus:v' , 'cols' , 'dirname' , 'disabled:v' , 'form' , 'inputmode' , 'maxlength' , 'name' , 'placeholder' , 'readonly:v' , 'required:v' , 'rows' , 'wrap' ] ,
132+ textarea : [ 'autocomplete:o' , 'autofocus:v' , 'cols' , 'dirname' , 'disabled:v' , 'form' , 'inputmode:im ' , 'maxlength' , 'minlength' , ' name', 'placeholder' , 'readonly:v' , 'required:v' , 'rows' , 'wrap:w ' ] ,
129133 keygen : [ 'autofocus:v' , 'challenge' , 'disabled:v' , 'form' , 'keytype' , 'name' ] ,
130134 output : [ 'for' , 'form' , 'name' ] ,
131135 progress : [ 'value' , 'max' ] ,
132136 meter : [ 'value' , 'min' , 'max' , 'low' , 'high' , 'optimum' ] ,
133137 details : [ 'open:v' ] ,
134138 summary : none ,
135- command : [ 'type' , 'label' , 'icon' , 'disabled:v ', 'checked:v' , 'radiogroup' , 'command '] ,
136- menu : [ 'type' , 'label' ] ,
139+ menu : [ 'type:mt ' , 'label ' ] ,
140+ menuitem : [ 'type:mit ' , 'label' , 'icon' , 'disabled:v' , 'checked:v' , 'radiogroup' , 'default:v' , 'command '] ,
137141 dialog : [ 'open:v' ]
138142 } ;
139143
@@ -142,24 +146,36 @@ export function getHTML5TagProvider(): IHTMLTagProvider {
142146 'aria-describedby' , 'aria-disabled:b' , 'aria-dropeffect:dropeffect' , 'aria-errormessage' , 'aria-expanded:u' , 'aria-flowto' , 'aria-grabbed:u' , 'aria-haspopup:b' , 'aria-hidden:b' , 'aria-invalid:invalid' , 'aria-kbdshortcuts' ,
143147 'aria-label' , 'aria-labelledby' , 'aria-level' , 'aria-live:live' , 'aria-modal:b' , 'aria-multiline:b' , 'aria-multiselectable:b' , 'aria-orientation:orientation' , 'aria-owns' , 'aria-placeholder' , 'aria-posinset' , 'aria-pressed:tristate' ,
144148 'aria-readonly:b' , 'aria-relevant:relevant' , 'aria-required:b' , 'aria-roledescription' , 'aria-rowcount' , 'aria-rowindex' , 'aria-rowspan' , 'aria-selected:u' , 'aria-setsize' , 'aria-sort:sort' , 'aria-valuemax' , 'aria-valuemin' , 'aria-valuenow' , 'aria-valuetext' ,
145- 'accesskey' , 'class' , 'contenteditable:b' , 'contextmenu' , 'dir:d' , 'draggable:a ' , 'dropzone' , 'hidden:v' , 'id' , 'inert:v ', 'itemid' , 'itemprop' , 'itemref' , 'itemscope:v' , 'itemtype' , 'lang' , 'role:roles' , 'spellcheck:b' , 'style' , 'tabindex' ,
146- 'title' , 'translate' ] ;
149+ 'accesskey' , 'class' , 'contenteditable:b' , 'contextmenu' , 'dir:d' , 'draggable:b ' , 'dropzone' , 'hidden:v' , 'id' , 'itemid' , 'itemprop' , 'itemref' , 'itemscope:v' , 'itemtype' , 'lang' , 'role:roles' , 'spellcheck:b' , 'style' , 'tabindex' ,
150+ 'title' , 'translate:y ' ] ;
147151
148152 var eventHandlers = [ 'onabort' , 'onblur' , 'oncanplay' , 'oncanplaythrough' , 'onchange' , 'onclick' , 'oncontextmenu' , 'ondblclick' , 'ondrag' , 'ondragend' , 'ondragenter' , 'ondragleave' , 'ondragover' , 'ondragstart' ,
149153 'ondrop' , 'ondurationchange' , 'onemptied' , 'onended' , 'onerror' , 'onfocus' , 'onformchange' , 'onforminput' , 'oninput' , 'oninvalid' , 'onkeydown' , 'onkeypress' , 'onkeyup' , 'onload' , 'onloadeddata' , 'onloadedmetadata' ,
150- 'onloadstart' , 'onmousedown' , 'onmousemove' , 'onmouseout' , 'onmouseover' , 'onmouseup' , 'onmousewheel' , 'onpause' , 'onplay' , 'onplaying' , 'onprogress' , 'onratechange' , 'onreset' , 'onreadystatechange' , 'onseeked ' ,
151- 'onseeking' , 'onselect' , 'onshow' , 'onstalled' , 'onsubmit' , 'onsuspend' , 'ontimeupdate' , 'onvolumechange' , 'onwaiting' ] ;
154+ 'onloadstart' , 'onmousedown' , 'onmousemove' , 'onmouseout' , 'onmouseover' , 'onmouseup' , 'onmousewheel' , 'onpause' , 'onplay' , 'onplaying' , 'onprogress' , 'onratechange' , 'onreset' , 'onresize' , ' onreadystatechange', 'onscroll ' ,
155+ 'onseeked' , ' onseeking', 'onselect' , 'onshow' , 'onstalled' , 'onsubmit' , 'onsuspend' , 'ontimeupdate' , 'onvolumechange' , 'onwaiting' ] ;
152156
153157 var valueSets : { [ tag :string ] : string [ ] } = {
154158 b : [ 'true' , 'false' ] ,
155- a : [ 'true' , 'false' , 'auto' ] ,
156159 u : [ 'true' , 'false' , 'undefined' ] ,
157- d : [ 'ltr' , 'rtl' ] ,
158- m : [ 'get' , 'post' ] ,
159160 o : [ 'on' , 'off' ] ,
161+ y : [ 'yes' , 'no' ] ,
162+ w : [ 'soft' , 'hard' ] ,
163+ d : [ 'ltr' , 'rtl' , 'auto' ] ,
164+ m : [ 'GET' , 'POST' , 'dialog' ] ,
165+ fm : [ 'GET' , 'POST' ] ,
166+ s : [ 'row' , 'col' , 'rowgroup' , 'colgroup' ] ,
160167 t : [ 'hidden' , 'text' , 'search' , 'tel' , 'url' , 'email' , 'password' , 'datetime' , 'date' , 'month' , 'week' , 'time' , 'datetime-local' , 'number' , 'range' , 'color' , 'checkbox' , 'radio' , 'file' , 'submit' , 'image' , 'reset' , 'button' ] ,
161- bt : [ 'button' , 'submit' , 'reset' ] ,
168+ im : [ 'verbatim' , 'latin' , 'latin-name' , 'latin-prose' , 'full-width-latin' , 'kana' , 'kana-name' , 'katakana' , 'numeric' , 'tel' , 'email' , 'url' ] ,
169+ bt : [ 'button' , 'submit' , 'reset' , 'menu' ] ,
170+ lt : [ '1' , 'a' , 'A' , 'i' , 'I' ] ,
171+ mt : [ 'context' , 'toolbar' ] ,
172+ mit : [ 'command' , 'checkbox' , 'radio' ] ,
173+ et : [ 'application/x-www-form-urlencoded' , 'multipart/form-data' , 'text/plain' ] ,
174+ tk : [ 'subtitles' , 'captions' , 'descriptions' , 'chapters' , 'metadata' ] ,
175+ pl : [ 'none' , 'metadata' , 'auto' ] ,
176+ sh : [ 'circle' , 'default' , 'poly' , 'rect' ] ,
162177 xo : [ 'anonymous' , 'use-credentials' ] ,
178+ sb : [ 'allow-forms' , 'allow-modals' , 'allow-pointer-lock' , 'allow-popups' , 'allow-popups-to-escape-sandbox' , 'allow-same-origin' , 'allow-scripts' , 'allow-top-navigation' ] ,
163179 tristate : [ 'true' , 'false' , 'mixed' , 'undefined' ] ,
164180 autocomplete : [ 'inline' , 'list' , 'both' , 'none' ] ,
165181 current : [ 'page' , 'step' , 'location' , 'date' , 'time' , 'true' , 'false' ] ,
0 commit comments