My dotfiles. Period.

aria.vim 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. " Vim completion for WAI-ARIA data file
  2. " Language: HTML + WAI-ARIA
  3. " Maintainer: othree <othree@gmail.com>
  4. " Last Change: 2010 Sep 09
  5. " WAI_ARIA: {{{
  6. " Ref: http://www.w3.org/TR/wai-aria/
  7. " Version: Draft 15 December 2009
  8. let abstract_role = {}
  9. let role_attributes = {}
  10. let default_role = {}
  11. " Ref: http://www.w3.org/TR/wai-aria/roles
  12. " Version: Draft 15 December 2009
  13. let widget_role = ['alert', 'alertdialog', 'button', 'checkbox', 'combobox', 'dialog', 'gridcell', 'link', 'log', 'marquee', 'menuitem', 'menuitemcheckbox', 'menuitemradio', 'option', 'progressbar', 'radio', 'radiogroup', 'scrollbar', 'slider', 'spinbutton', 'status', 'tab', 'tabpanel', 'textbox', 'timer', 'tooltip', 'treeitem', 'combobox', 'grid', 'listbox', 'menu', 'menubar', 'radiogroup', 'tablist', 'tree', 'treegrid']
  14. let document_structure = ['article', 'columnheader', 'definition', 'directory', 'document', 'group', 'heading', 'img', 'list', 'listitem', 'math', 'note', 'presentation', 'region', 'row', 'rowheader', 'separator']
  15. let landmark_role = ['application', 'banner', 'complementary', 'contentinfo', 'form', 'main', 'navigation', 'search']
  16. let role = extend(widget_role, document_structure)
  17. let role = extend(role, landmark_role)
  18. " http://www.w3.org/TR/wai-aria/states_and_properties#state_prop_taxonomy
  19. "let global_states_and_properties = {'aria-atomic': ['true', 'false'], 'aria-busy': ['true', 'false'], 'aria-controls': [], 'aria-describedby': [], 'aria-disabled': ['true', 'false'], 'aria-dropeffect': ['copy', 'move', 'link', 'execute', 'popup', 'none'], 'aria-flowto': [], 'aria-grabbed': ['true', 'false', 'undefined'], 'aria-haspopup': ['true', 'false'], 'aria-hidden': ['true', 'false'], 'aria-invalid': ['grammar', 'spelling', 'true', 'false'], 'aria-label': [], 'aria-labelledby': [], 'aria-live': ['off', 'polite', 'assertive'], 'aria-owns': [], 'aria-relevant': ['additions', 'removals', 'text', 'all']}
  20. let widget_attributes = {'aria-autocomplete': ['inline', 'list', 'both', 'none'], 'aria-checked': ['true', 'false', 'mixed', 'undefined'], 'aria-disabled': ['true', 'false'], 'aria-expanded': ['true', 'false', 'undefined'], 'aria-haspopup': ['true', 'false'], 'aria-hidden': ['true', 'false'], 'aria-invalid': ['grammar', 'spelling', 'true', 'false'], 'aria-label': [], 'aria-level': [], 'aria-multiline': ['true', 'false'], 'aria-multiselectable': ['true', 'false'], 'aria-orientation': ['horizontal', 'vertical'], 'aria-pressed': ['true', 'false', 'mixed', 'undefined'], 'aria-readonly': ['true', 'false'], 'aria-required': ['true', 'false'], 'aria-selected': ['true', 'false', 'undefined'], 'aria-sort': ['ascending', 'descending', 'none', 'other'], 'aria-valuemax': [], 'aria-valuemin': [], 'aria-valuenow': [], 'aria-valuetext': []}
  21. let live_region_attributes = {'aria-atomic': ['true', 'false'], 'aria-busy': ['true', 'false'], 'aria-live': ['off', 'polite', 'assertive'], 'aria-relevant': ['additions', 'removals', 'text', 'all', 'additions text']}
  22. let drag_and_drop_attributes = {'aria-dropeffect': ['copy', 'move', 'link', 'execute', 'popup', 'none'], 'aria-grabbed': ['true', 'false', 'undefined']}
  23. let relationship_attributes = {'aria-activedescendant': [], 'aria-controls': [], 'aria-describedby': [], 'aria-flowto': [], 'aria-labelledby': [], 'aria-owns': [], 'aria-posinset': [], 'aria-setsize': []}
  24. let aria_attributes = widget_attributes
  25. let aria_attributes = extend(aria_attributes, live_region_attributes)
  26. let aria_attributes = extend(aria_attributes, drag_and_drop_attributes)
  27. let aria_attributes = extend(aria_attributes, relationship_attributes)
  28. " Abstract Roles
  29. let abstract_role['roletype'] = ['aria-atomic', 'aria-busy', 'aria-controls', 'aria-describedby', 'aria-disabled', 'aria-dropeffect', 'aria-flowto', 'aria-grabbed', 'aria-haspopup', 'aria-hidden', 'aria-invalid', 'aria-label', 'aria-labelledby', 'aria-live', 'aria-owns', 'aria-relevant']
  30. let role_attributes['default'] = abstract_role['roletype']
  31. let abstract_role['structure'] = abstract_role['roletype']
  32. let abstract_role['widget'] = abstract_role['roletype']
  33. let abstract_role['window'] = abstract_role['roletype'] + ['aria-expanded']
  34. let abstract_role['composite'] = abstract_role['widget'] + ['aria-activedescendant']
  35. let abstract_role['input'] = abstract_role['widget']
  36. let abstract_role['section'] = abstract_role['structure'] + ['aria-expanded']
  37. let abstract_role['sectionhead'] = abstract_role['structure'] + ['aria-expanded']
  38. let role_attributes['group'] = abstract_role['section']
  39. let abstract_role['select'] = abstract_role['composite'] + role_attributes['group'] + abstract_role['input']
  40. let abstract_role['range'] = abstract_role['input'] + ['aria-valuemax', 'aria-valuemin', 'aria-valuenow', 'aria-valuetext']
  41. let role_attributes['region'] = abstract_role['section']
  42. let abstract_role['landmark'] = role_attributes['region']
  43. " Widget Roles
  44. let role_attributes['list'] = role_attributes['region']
  45. let role_attributes['listitem'] = abstract_role['section']
  46. let role_attributes['dialog'] = abstract_role['window']
  47. let role_attributes['menuitem'] = abstract_role['input']
  48. let role_attributes['checkbox'] = abstract_role['input'] + ['aria-checked']
  49. let role_attributes['menuitemcheckbox'] = role_attributes['menuitem'] + role_attributes['checkbox']
  50. let role_attributes['option'] = abstract_role['input'] + ['aria-checked', 'aria-posinset', 'aria-selected', 'aria-setsize']
  51. let role_attributes['radio'] = role_attributes['checkbox'] + role_attributes['option']
  52. let role_attributes['directory'] = role_attributes['list']
  53. let role_attributes['alert'] = role_attributes['region']
  54. let role_attributes['alertdialog'] = role_attributes['alert'] + role_attributes['dialog']
  55. let role_attributes['button'] = role_attributes['region'] + role_attributes['menuitemcheckbox']
  56. let role_attributes['combobox'] = abstract_role['select'] + ['aria-expanded', 'aria-required']
  57. let role_attributes['gridcell'] = abstract_role['section'] + abstract_role['widget']
  58. let role_attributes['link'] = abstract_role['widget']
  59. let role_attributes['log'] = role_attributes['region']
  60. let role_attributes['marquee'] = role_attributes['region']
  61. let role_attributes['menuitemradio'] = role_attributes['menuitemcheckbox'] + role_attributes['radio']
  62. let role_attributes['progressbar'] = abstract_role['widget'] + ['aria-valuemax', 'aria-valuemin', 'aria-valuenow', 'aria-valuetext']
  63. let role_attributes['radiogroup'] = abstract_role['select'] + ['aria-required']
  64. let role_attributes['scrollbar'] = abstract_role['range'] + ['aria-controls', 'aria-orientation', 'aria-valuemax', 'aria-valuemin', 'aria-valuenow']
  65. let role_attributes['slider'] = abstract_role['range'] + ['aria-valuemax', 'aria-valuemin', 'aria-valuenow']
  66. let role_attributes['spinbutton'] = abstract_role['composite'] + abstract_role['range'] + ['aria-required']
  67. let role_attributes['status'] = abstract_role['composite'] + role_attributes['region']
  68. let role_attributes['tab'] = abstract_role['sectionhead'] + abstract_role['widget'] + ['aria-selected']
  69. let role_attributes['tabpanel'] = role_attributes['region']
  70. let role_attributes['textbox'] = abstract_role['input'] + ['aria-autocomplete', 'aria-multiline', 'aria-readonly', 'aria-required']
  71. let role_attributes['timer'] = role_attributes['status']
  72. let role_attributes['tooltip'] = abstract_role['section']
  73. let role_attributes['treeitem'] = role_attributes['listitem'] + role_attributes['option']
  74. let role_attributes['grid'] = abstract_role['composite'] + role_attributes['region'] + ['aria-level', 'aria-multiselectable', 'aria-readonly']
  75. let role_attributes['listbox'] = role_attributes['list'] + abstract_role['select'] + ['aria-multiselectable', 'aria-required']
  76. let role_attributes['menu'] = role_attributes['list'] + abstract_role['select']
  77. let role_attributes['menubar'] = role_attributes['menu']
  78. let role_attributes['tablist'] = abstract_role['composite'] + role_attributes['directory']
  79. let role_attributes['toolbar'] = role_attributes['group']
  80. let role_attributes['tree'] = abstract_role['select'] + ['aria-multiselectable', 'aria-required']
  81. let role_attributes['treegrid'] = role_attributes['grid'] + role_attributes['tree']
  82. " Document Structure
  83. let role_attributes['document'] = abstract_role['structure'] + ['aria-expanded']
  84. let role_attributes['article'] = role_attributes['document'] + role_attributes['region']
  85. let role_attributes['columnheader'] = role_attributes['gridcell'] + abstract_role['sectionhead'] + ['aria-sort']
  86. let role_attributes['definition'] = abstract_role['section']
  87. let role_attributes['heading'] = abstract_role['sectionhead'] + ['aria-level']
  88. let role_attributes['img'] = abstract_role['section']
  89. let role_attributes['math'] = abstract_role['section']
  90. let role_attributes['note'] = abstract_role['section']
  91. let role_attributes['presentation'] = abstract_role['structure']
  92. let role_attributes['row'] = role_attributes['group'] + ['aria-level', 'aria-selected']
  93. let role_attributes['rowheader'] = role_attributes['gridcell'] + abstract_role['sectionhead']
  94. let role_attributes['separator'] = abstract_role['structure'] + ['aria-expanded']
  95. " Landmark Roles
  96. let role_attributes['application'] = abstract_role['landmark']
  97. let role_attributes['banner'] = abstract_role['landmark']
  98. let role_attributes['complementary'] = abstract_role['landmark']
  99. let role_attributes['contentinfo'] = abstract_role['landmark']
  100. let role_attributes['form'] = abstract_role['landmark']
  101. let role_attributes['main'] = abstract_role['landmark']
  102. let role_attributes['navigation'] = abstract_role['landmark']
  103. let role_attributes['search'] = abstract_role['landmark']
  104. " http://www.w3.org/TR/wai-aria/states_and_properties#state_prop_def
  105. let aria_attributes_value = {
  106. \ 'aria-autocomplete': ['ID', ''],
  107. \ 'aria-checked': ['Token', ''],
  108. \ 'aria-disabled': ['true/false', ''],
  109. \ 'aria-expanded': ['Token', ''],
  110. \ 'aria-haspopup': ['true/false', ''],
  111. \ 'aria-hidden': ['true/false', ''],
  112. \ 'aria-invalid': ['Token', ''],
  113. \ 'aria-label': ['String', ''],
  114. \ 'aria-level': ['Int', ''],
  115. \ 'aria-multiline': ['true/false', ''],
  116. \ 'aria-multiselectable': ['true/false', ''],
  117. \ 'aria-orientation': ['Token', ''],
  118. \ 'aria-pressed': ['Token', ''],
  119. \ 'aria-readonly': ['true/false', ''],
  120. \ 'aria-required': ['true/false', ''],
  121. \ 'aria-selected': ['Token', ''],
  122. \ 'aria-sort': ['Token', ''],
  123. \ 'aria-valuemax': ['Number', ''],
  124. \ 'aria-valuemin': ['Number', ''],
  125. \ 'aria-valuenow': ['Number', ''],
  126. \ 'aria-valuetext': ['String', ''],
  127. \ 'aria-atomic': ['true/false', ''],
  128. \ 'aria-busy': ['true/false', ''],
  129. \ 'aria-live': ['Token', ''],
  130. \ 'aria-relevant': ['*Token', ''],
  131. \ 'aria-dropeffect': ['*Token', ''],
  132. \ 'aria-grabbed': ['Token', ''],
  133. \ 'aria-activedescendant': ['ID', ''],
  134. \ 'aria-controls': ['*ID', ''],
  135. \ 'aria-describedby': ['*ID', ''],
  136. \ 'aria-flowto': ['*ID', ''],
  137. \ 'aria-labelledby': ['*ID', ''],
  138. \ 'aria-owns': ['*ID', ''],
  139. \ 'aria-posinset': ['Int', ''],
  140. \ 'aria-setsize': ['Int', '']
  141. \ }
  142. " http://dev.w3.org/html5/spec/content-models.html#annotations-for-assistive-technology-products-aria
  143. let default_role = {
  144. \ 'a': 'link',
  145. \ 'area': 'link',
  146. \ 'body': 'document',
  147. \ 'button': 'button',
  148. \ 'datalist': 'listbox',
  149. \ 'h1': 'heading',
  150. \ 'h2': 'heading',
  151. \ 'h3': 'heading',
  152. \ 'h4': 'heading',
  153. \ 'h5': 'heading',
  154. \ 'h6': 'heading',
  155. \ 'hgroup': 'heading',
  156. \ 'hr': 'separator',
  157. \ 'img[alt=]': 'presentation',
  158. \ 'input[type=button]': 'button',
  159. \ 'input[type=email]': 'textbox',
  160. \ 'input[type=image]': 'button',
  161. \ 'input[type=number]': 'spinbutton',
  162. \ 'input[type=password]': 'textbox',
  163. \ 'input[type=range]': 'slider',
  164. \ 'input[type=reset]': 'button',
  165. \ 'input[type=search]': 'textbox',
  166. \ 'input[type=submit]': 'button',
  167. \ 'input[type=tel]': 'textbox',
  168. \ 'input[type=text]': 'textbox',
  169. \ 'input[list]': 'combobox',
  170. \ 'input[type=url]': 'textbox',
  171. \ 'input': 'textbox',
  172. \ 'keygen': 'default',
  173. \ 'label': 'default',
  174. \ 'menu[type=list]': 'menu',
  175. \ 'menu[type=toolbar]': 'toolbar',
  176. \ 'menu': 'default',
  177. \ 'link': 'link',
  178. \ 'nav': 'navigation',
  179. \ 'optgroup': 'default',
  180. \ 'option': 'option',
  181. \ 'progress': 'progressbar',
  182. \ 'select': 'listbox',
  183. \ 'summary': 'heading',
  184. \ 'tbody': 'rowgroup',
  185. \ 'td': 'gridcell',
  186. \ 'textarea': 'textbox',
  187. \ 'tfoot': 'rowgroup',
  188. \ 'th[scope=col]': 'columnheader',
  189. \ 'th[scope=row]': 'rowheader',
  190. \ 'tr': 'row',
  191. \ 'address': 'default',
  192. \ 'article': 'article',
  193. \ 'aside': 'note',
  194. \ 'footer': 'default',
  195. \ 'header': 'default',
  196. \ 'details': 'group',
  197. \ 'img': 'img',
  198. \ 'input[type=checkbox]': 'checkbox',
  199. \ 'input[type=radio]': 'radio',
  200. \ 'li': 'listitem',
  201. \ 'ol': 'list',
  202. \ 'output': 'status',
  203. \ 'section': 'region',
  204. \ 'table': 'grid',
  205. \ 'ul': 'list',
  206. \ }
  207. " }}}
  208. let g:xmldata_aria = {
  209. \ 'aria_attributes': aria_attributes,
  210. \ 'role_attributes': role_attributes,
  211. \ 'default_role': default_role,
  212. \ 'vimariaattrinfo': aria_attributes_value
  213. \ }