keywordSets.js 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817
  1. 'use strict';
  2. const keywordSets = {};
  3. keywordSets.nonLengthUnits = new Set([
  4. // Relative length units
  5. '%',
  6. // Time length units
  7. 's',
  8. 'ms',
  9. // Angle
  10. 'deg',
  11. 'grad',
  12. 'turn',
  13. 'rad',
  14. // Frequency
  15. 'Hz',
  16. 'kHz',
  17. // Resolution
  18. 'dpi',
  19. 'dpcm',
  20. 'dppx',
  21. ]);
  22. keywordSets.lengthUnits = new Set([
  23. // Relative length units
  24. 'em',
  25. 'ex',
  26. 'ch',
  27. 'rem',
  28. 'rlh',
  29. 'lh',
  30. // Viewport-percentage lengths
  31. 'dvh',
  32. 'dvmax',
  33. 'dvmin',
  34. 'dvw',
  35. 'lvh',
  36. 'lvmax',
  37. 'lvmin',
  38. 'lvw',
  39. 'svh',
  40. 'svmax',
  41. 'svmin',
  42. 'svw',
  43. 'vh',
  44. 'vw',
  45. 'vmin',
  46. 'vmax',
  47. 'vm',
  48. // Absolute length units
  49. 'px',
  50. 'mm',
  51. 'cm',
  52. 'in',
  53. 'pt',
  54. 'pc',
  55. 'q',
  56. 'mozmm',
  57. // Flexible length units
  58. 'fr',
  59. ]);
  60. keywordSets.units = uniteSets(keywordSets.nonLengthUnits, keywordSets.lengthUnits);
  61. keywordSets.camelCaseFunctionNames = new Set([
  62. 'translateX',
  63. 'translateY',
  64. 'translateZ',
  65. 'scaleX',
  66. 'scaleY',
  67. 'scaleZ',
  68. 'rotateX',
  69. 'rotateY',
  70. 'rotateZ',
  71. 'skewX',
  72. 'skewY',
  73. ]);
  74. keywordSets.basicKeywords = new Set(['initial', 'inherit', 'revert', 'revert-layer', 'unset']);
  75. keywordSets.systemFontValues = uniteSets(keywordSets.basicKeywords, [
  76. 'caption',
  77. 'icon',
  78. 'menu',
  79. 'message-box',
  80. 'small-caption',
  81. 'status-bar',
  82. ]);
  83. keywordSets.fontFamilyKeywords = uniteSets(keywordSets.basicKeywords, [
  84. 'serif',
  85. 'sans-serif',
  86. 'cursive',
  87. 'fantasy',
  88. 'monospace',
  89. 'system-ui',
  90. ]);
  91. keywordSets.fontWeightRelativeKeywords = new Set(['bolder', 'lighter']);
  92. keywordSets.fontWeightAbsoluteKeywords = new Set(['bold']);
  93. keywordSets.fontWeightNumericKeywords = new Set([
  94. '100',
  95. '200',
  96. '300',
  97. '400',
  98. '500',
  99. '600',
  100. '700',
  101. '800',
  102. '900',
  103. ]);
  104. keywordSets.fontWeightKeywords = uniteSets(
  105. keywordSets.basicKeywords,
  106. keywordSets.fontWeightRelativeKeywords,
  107. keywordSets.fontWeightAbsoluteKeywords,
  108. keywordSets.fontWeightNumericKeywords,
  109. );
  110. keywordSets.animationNameKeywords = uniteSets(keywordSets.basicKeywords, ['none']);
  111. keywordSets.animationTimingFunctionKeywords = uniteSets(keywordSets.basicKeywords, [
  112. 'linear',
  113. 'ease',
  114. 'ease-in',
  115. 'ease-in-out',
  116. 'ease-out',
  117. 'step-start',
  118. 'step-end',
  119. 'steps',
  120. 'cubic-bezier',
  121. ]);
  122. keywordSets.animationIterationCountKeywords = new Set(['infinite']);
  123. keywordSets.animationDirectionKeywords = uniteSets(keywordSets.basicKeywords, [
  124. 'normal',
  125. 'reverse',
  126. 'alternate',
  127. 'alternate-reverse',
  128. ]);
  129. keywordSets.animationFillModeKeywords = new Set(['none', 'forwards', 'backwards', 'both']);
  130. keywordSets.animationPlayStateKeywords = uniteSets(keywordSets.basicKeywords, [
  131. 'running',
  132. 'paused',
  133. ]);
  134. // cf. https://developer.mozilla.org/en-US/docs/Web/CSS/animation
  135. keywordSets.animationShorthandKeywords = uniteSets(
  136. keywordSets.basicKeywords,
  137. keywordSets.animationNameKeywords,
  138. keywordSets.animationTimingFunctionKeywords,
  139. keywordSets.animationIterationCountKeywords,
  140. keywordSets.animationDirectionKeywords,
  141. keywordSets.animationFillModeKeywords,
  142. keywordSets.animationPlayStateKeywords,
  143. );
  144. // These are the ones that can have single-colon notation
  145. keywordSets.levelOneAndTwoPseudoElements = new Set([
  146. 'before',
  147. 'after',
  148. 'first-line',
  149. 'first-letter',
  150. ]);
  151. keywordSets.levelThreeAndUpPseudoElements = new Set([
  152. 'before',
  153. 'after',
  154. 'first-line',
  155. 'first-letter',
  156. // These are the ones that require double-colon notation
  157. 'backdrop',
  158. 'content',
  159. 'cue',
  160. 'file-selector-button',
  161. 'grammar-error',
  162. 'marker',
  163. 'placeholder',
  164. 'selection',
  165. 'shadow',
  166. 'slotted',
  167. 'spelling-error',
  168. 'target-text',
  169. ]);
  170. keywordSets.shadowTreePseudoElements = new Set(['part']);
  171. keywordSets.webkitScrollbarPseudoElements = new Set([
  172. '-webkit-resizer',
  173. '-webkit-scrollbar',
  174. '-webkit-scrollbar-button',
  175. '-webkit-scrollbar-corner',
  176. '-webkit-scrollbar-thumb',
  177. '-webkit-scrollbar-track',
  178. '-webkit-scrollbar-track-piece',
  179. ]);
  180. keywordSets.vendorSpecificPseudoElements = new Set([
  181. '-moz-focus-inner',
  182. '-moz-focus-outer',
  183. '-moz-list-bullet',
  184. '-moz-meter-bar',
  185. '-moz-placeholder',
  186. '-moz-progress-bar',
  187. '-moz-range-progress',
  188. '-moz-range-thumb',
  189. '-moz-range-track',
  190. '-ms-browse',
  191. '-ms-check',
  192. '-ms-clear',
  193. '-ms-expand',
  194. '-ms-fill',
  195. '-ms-fill-lower',
  196. '-ms-fill-upper',
  197. '-ms-reveal',
  198. '-ms-thumb',
  199. '-ms-ticks-after',
  200. '-ms-ticks-before',
  201. '-ms-tooltip',
  202. '-ms-track',
  203. '-ms-value',
  204. '-webkit-color-swatch',
  205. '-webkit-color-swatch-wrapper',
  206. '-webkit-calendar-picker-indicator',
  207. '-webkit-clear-button',
  208. '-webkit-date-and-time-value',
  209. '-webkit-datetime-edit',
  210. '-webkit-datetime-edit-ampm-field',
  211. '-webkit-datetime-edit-day-field',
  212. '-webkit-datetime-edit-fields-wrapper',
  213. '-webkit-datetime-edit-hour-field',
  214. '-webkit-datetime-edit-millisecond-field',
  215. '-webkit-datetime-edit-minute-field',
  216. '-webkit-datetime-edit-month-field',
  217. '-webkit-datetime-edit-second-field',
  218. '-webkit-datetime-edit-text',
  219. '-webkit-datetime-edit-week-field',
  220. '-webkit-datetime-edit-year-field',
  221. '-webkit-details-marker',
  222. '-webkit-distributed',
  223. '-webkit-file-upload-button',
  224. '-webkit-input-placeholder',
  225. '-webkit-keygen-select',
  226. '-webkit-meter-bar',
  227. '-webkit-meter-even-less-good-value',
  228. '-webkit-meter-inner-element',
  229. '-webkit-meter-optimum-value',
  230. '-webkit-meter-suboptimum-value',
  231. '-webkit-progress-bar',
  232. '-webkit-progress-inner-element',
  233. '-webkit-progress-value',
  234. '-webkit-search-cancel-button',
  235. '-webkit-search-decoration',
  236. '-webkit-search-results-button',
  237. '-webkit-search-results-decoration',
  238. '-webkit-slider-runnable-track',
  239. '-webkit-slider-thumb',
  240. '-webkit-textfield-decoration-container',
  241. '-webkit-validation-bubble',
  242. '-webkit-validation-bubble-arrow',
  243. '-webkit-validation-bubble-arrow-clipper',
  244. '-webkit-validation-bubble-heading',
  245. '-webkit-validation-bubble-message',
  246. '-webkit-validation-bubble-text-block',
  247. ...keywordSets.webkitScrollbarPseudoElements,
  248. ]);
  249. keywordSets.pseudoElements = uniteSets(
  250. keywordSets.levelOneAndTwoPseudoElements,
  251. keywordSets.levelThreeAndUpPseudoElements,
  252. keywordSets.vendorSpecificPseudoElements,
  253. keywordSets.shadowTreePseudoElements,
  254. );
  255. keywordSets.aNPlusBNotationPseudoClasses = new Set([
  256. 'nth-column',
  257. 'nth-last-column',
  258. 'nth-last-of-type',
  259. 'nth-of-type',
  260. ]);
  261. keywordSets.linguisticPseudoClasses = new Set(['dir', 'lang']);
  262. keywordSets.atRulePagePseudoClasses = new Set(['first', 'right', 'left', 'blank']);
  263. keywordSets.logicalCombinationsPseudoClasses = new Set(['has', 'is', 'matches', 'not', 'where']);
  264. keywordSets.aNPlusBOfSNotationPseudoClasses = new Set(['nth-child', 'nth-last-child']);
  265. keywordSets.otherPseudoClasses = new Set([
  266. 'active',
  267. 'any-link',
  268. 'autofill',
  269. 'blank',
  270. 'checked',
  271. 'current',
  272. 'default',
  273. 'defined',
  274. 'disabled',
  275. 'empty',
  276. 'enabled',
  277. 'first-child',
  278. 'first-of-type',
  279. 'focus',
  280. 'focus-within',
  281. 'focus-visible',
  282. 'fullscreen',
  283. 'fullscreen-ancestor',
  284. 'future',
  285. 'host',
  286. 'host-context',
  287. 'hover',
  288. 'indeterminate',
  289. 'in-range',
  290. 'invalid',
  291. 'last-child',
  292. 'last-of-type',
  293. 'link',
  294. 'only-child',
  295. 'only-of-type',
  296. 'optional',
  297. 'out-of-range',
  298. 'past',
  299. 'placeholder-shown',
  300. 'playing',
  301. 'picture-in-picture',
  302. 'paused',
  303. 'read-only',
  304. 'read-write',
  305. 'required',
  306. 'root',
  307. 'scope',
  308. 'state',
  309. 'target',
  310. 'unresolved',
  311. 'user-invalid',
  312. 'user-valid',
  313. 'valid',
  314. 'visited',
  315. 'window-inactive', // for ::selection (chrome)
  316. ]);
  317. keywordSets.vendorSpecificPseudoClasses = new Set([
  318. '-khtml-drag',
  319. '-moz-any',
  320. '-moz-any-link',
  321. '-moz-broken',
  322. '-moz-drag-over',
  323. '-moz-first-node',
  324. '-moz-focusring',
  325. '-moz-full-screen',
  326. '-moz-full-screen-ancestor',
  327. '-moz-last-node',
  328. '-moz-loading',
  329. '-moz-meter-optimum',
  330. '-moz-meter-sub-optimum',
  331. '-moz-meter-sub-sub-optimum',
  332. '-moz-placeholder',
  333. '-moz-submit-invalid',
  334. '-moz-suppressed',
  335. '-moz-ui-invalid',
  336. '-moz-ui-valid',
  337. '-moz-user-disabled',
  338. '-moz-window-inactive',
  339. '-ms-fullscreen',
  340. '-ms-input-placeholder',
  341. '-webkit-drag',
  342. '-webkit-any',
  343. '-webkit-any-link',
  344. '-webkit-autofill',
  345. '-webkit-full-screen',
  346. '-webkit-full-screen-ancestor',
  347. ]);
  348. // https://webkit.org/blog/363/styling-scrollbars/
  349. keywordSets.webkitScrollbarPseudoClasses = new Set([
  350. 'horizontal',
  351. 'vertical',
  352. 'decrement',
  353. 'increment',
  354. 'start',
  355. 'end',
  356. 'double-button',
  357. 'single-button',
  358. 'no-button',
  359. 'corner-present',
  360. 'window-inactive',
  361. ]);
  362. keywordSets.pseudoClasses = uniteSets(
  363. keywordSets.aNPlusBNotationPseudoClasses,
  364. keywordSets.linguisticPseudoClasses,
  365. keywordSets.logicalCombinationsPseudoClasses,
  366. keywordSets.aNPlusBOfSNotationPseudoClasses,
  367. keywordSets.otherPseudoClasses,
  368. keywordSets.vendorSpecificPseudoClasses,
  369. );
  370. keywordSets.shorthandTimeProperties = new Set(['transition', 'animation']);
  371. keywordSets.longhandTimeProperties = new Set([
  372. 'transition-duration',
  373. 'transition-delay',
  374. 'animation-duration',
  375. 'animation-delay',
  376. ]);
  377. keywordSets.timeProperties = uniteSets(
  378. keywordSets.shorthandTimeProperties,
  379. keywordSets.longhandTimeProperties,
  380. );
  381. keywordSets.camelCaseKeywords = new Set([
  382. 'optimizeSpeed',
  383. 'optimizeQuality',
  384. 'optimizeLegibility',
  385. 'geometricPrecision',
  386. 'currentColor',
  387. 'crispEdges',
  388. 'visiblePainted',
  389. 'visibleFill',
  390. 'visibleStroke',
  391. 'sRGB',
  392. 'linearRGB',
  393. ]);
  394. // https://developer.mozilla.org/docs/Web/CSS/counter-increment
  395. keywordSets.counterIncrementKeywords = uniteSets(keywordSets.basicKeywords, ['none']);
  396. keywordSets.counterResetKeywords = uniteSets(keywordSets.basicKeywords, ['none']);
  397. keywordSets.gridRowKeywords = uniteSets(keywordSets.basicKeywords, ['auto', 'span']);
  398. keywordSets.gridColumnKeywords = uniteSets(keywordSets.basicKeywords, ['auto', 'span']);
  399. keywordSets.gridAreaKeywords = uniteSets(keywordSets.basicKeywords, ['auto', 'span']);
  400. // https://developer.mozilla.org/ru/docs/Web/CSS/list-style-type
  401. keywordSets.listStyleTypeKeywords = uniteSets(keywordSets.basicKeywords, [
  402. 'none',
  403. 'disc',
  404. 'circle',
  405. 'square',
  406. 'decimal',
  407. 'cjk-decimal',
  408. 'decimal-leading-zero',
  409. 'lower-roman',
  410. 'upper-roman',
  411. 'lower-greek',
  412. 'lower-alpha',
  413. 'lower-latin',
  414. 'upper-alpha',
  415. 'upper-latin',
  416. 'arabic-indic',
  417. 'armenian',
  418. 'bengali',
  419. 'cambodian',
  420. 'cjk-earthly-branch',
  421. 'cjk-ideographic',
  422. 'devanagari',
  423. 'ethiopic-numeric',
  424. 'georgian',
  425. 'gujarati',
  426. 'gurmukhi',
  427. 'hebrew',
  428. 'hiragana',
  429. 'hiragana-iroha',
  430. 'japanese-formal',
  431. 'japanese-informal',
  432. 'kannada',
  433. 'katakana',
  434. 'katakana-iroha',
  435. 'khmer',
  436. 'korean-hangul-formal',
  437. 'korean-hanja-formal',
  438. 'korean-hanja-informal',
  439. 'lao',
  440. 'lower-armenian',
  441. 'malayalam',
  442. 'mongolian',
  443. 'myanmar',
  444. 'oriya',
  445. 'persian',
  446. 'simp-chinese-formal',
  447. 'simp-chinese-informal',
  448. 'tamil',
  449. 'telugu',
  450. 'thai',
  451. 'tibetan',
  452. 'trad-chinese-formal',
  453. 'trad-chinese-informal',
  454. 'upper-armenian',
  455. 'disclosure-open',
  456. 'disclosure-closed',
  457. // Non-standard extensions (without prefixe)
  458. 'ethiopic-halehame',
  459. 'ethiopic-halehame-am',
  460. 'ethiopic-halehame-ti-er',
  461. 'ethiopic-halehame-ti-et',
  462. 'hangul',
  463. 'hangul-consonant',
  464. 'urdu',
  465. ]);
  466. keywordSets.listStylePositionKeywords = uniteSets(keywordSets.basicKeywords, ['inside', 'outside']);
  467. keywordSets.listStyleImageKeywords = uniteSets(keywordSets.basicKeywords, ['none']);
  468. keywordSets.listStyleShorthandKeywords = uniteSets(
  469. keywordSets.basicKeywords,
  470. keywordSets.listStyleTypeKeywords,
  471. keywordSets.listStylePositionKeywords,
  472. keywordSets.listStyleImageKeywords,
  473. );
  474. keywordSets.fontStyleKeywords = uniteSets(keywordSets.basicKeywords, [
  475. 'normal',
  476. 'italic',
  477. 'oblique',
  478. ]);
  479. keywordSets.fontVariantKeywords = uniteSets(keywordSets.basicKeywords, [
  480. 'normal',
  481. 'none',
  482. 'historical-forms',
  483. 'none',
  484. 'common-ligatures',
  485. 'no-common-ligatures',
  486. 'discretionary-ligatures',
  487. 'no-discretionary-ligatures',
  488. 'historical-ligatures',
  489. 'no-historical-ligatures',
  490. 'contextual',
  491. 'no-contextual',
  492. 'small-caps',
  493. 'small-caps',
  494. 'all-small-caps',
  495. 'petite-caps',
  496. 'all-petite-caps',
  497. 'unicase',
  498. 'titling-caps',
  499. 'lining-nums',
  500. 'oldstyle-nums',
  501. 'proportional-nums',
  502. 'tabular-nums',
  503. 'diagonal-fractions',
  504. 'stacked-fractions',
  505. 'ordinal',
  506. 'slashed-zero',
  507. 'jis78',
  508. 'jis83',
  509. 'jis90',
  510. 'jis04',
  511. 'simplified',
  512. 'traditional',
  513. 'full-width',
  514. 'proportional-width',
  515. 'ruby',
  516. ]);
  517. keywordSets.fontStretchKeywords = uniteSets(keywordSets.basicKeywords, [
  518. 'semi-condensed',
  519. 'condensed',
  520. 'extra-condensed',
  521. 'ultra-condensed',
  522. 'semi-expanded',
  523. 'expanded',
  524. 'extra-expanded',
  525. 'ultra-expanded',
  526. ]);
  527. keywordSets.fontSizeKeywords = uniteSets(keywordSets.basicKeywords, [
  528. 'xx-small',
  529. 'x-small',
  530. 'small',
  531. 'medium',
  532. 'large',
  533. 'x-large',
  534. 'xx-large',
  535. 'larger',
  536. 'smaller',
  537. ]);
  538. keywordSets.lineHeightKeywords = uniteSets(keywordSets.basicKeywords, ['normal']);
  539. keywordSets.fontShorthandKeywords = uniteSets(
  540. keywordSets.basicKeywords,
  541. keywordSets.fontStyleKeywords,
  542. keywordSets.fontVariantKeywords,
  543. keywordSets.fontWeightKeywords,
  544. keywordSets.fontStretchKeywords,
  545. keywordSets.fontSizeKeywords,
  546. keywordSets.lineHeightKeywords,
  547. keywordSets.fontFamilyKeywords,
  548. );
  549. keywordSets.keyframeSelectorKeywords = new Set(['from', 'to']);
  550. // https://www.w3.org/TR/css-page-3/#syntax-page-selector
  551. keywordSets.pageMarginAtRules = new Set([
  552. 'top-left-corner',
  553. 'top-left',
  554. 'top-center',
  555. 'top-right',
  556. 'top-right-corner',
  557. 'bottom-left-corner',
  558. 'bottom-left',
  559. 'bottom-center',
  560. 'bottom-right',
  561. 'bottom-right-corner',
  562. 'left-top',
  563. 'left-middle',
  564. 'left-bottom',
  565. 'right-top',
  566. 'right-middle',
  567. 'right-bottom',
  568. ]);
  569. // https://developer.mozilla.org/en/docs/Web/CSS/At-rule
  570. keywordSets.atRules = uniteSets(keywordSets.pageMarginAtRules, [
  571. 'annotation',
  572. 'apply',
  573. 'character-variant',
  574. 'charset',
  575. 'counter-style',
  576. 'custom-media',
  577. 'custom-selector',
  578. 'document',
  579. 'font-face',
  580. 'font-feature-values',
  581. 'import',
  582. 'keyframes',
  583. 'media',
  584. 'namespace',
  585. 'nest',
  586. 'ornaments',
  587. 'page',
  588. 'property',
  589. 'styleset',
  590. 'stylistic',
  591. 'supports',
  592. 'swash',
  593. 'viewport',
  594. ]);
  595. // https://drafts.csswg.org/mediaqueries/#descdef-media-update
  596. keywordSets.deprecatedMediaFeatureNames = new Set([
  597. 'device-aspect-ratio',
  598. 'device-height',
  599. 'device-width',
  600. 'max-device-aspect-ratio',
  601. 'max-device-height',
  602. 'max-device-width',
  603. 'min-device-aspect-ratio',
  604. 'min-device-height',
  605. 'min-device-width',
  606. ]);
  607. // https://drafts.csswg.org/mediaqueries/#descdef-media-update
  608. keywordSets.mediaFeatureNames = uniteSets(keywordSets.deprecatedMediaFeatureNames, [
  609. 'any-hover',
  610. 'any-pointer',
  611. 'aspect-ratio',
  612. 'color',
  613. 'color-gamut',
  614. 'color-index',
  615. 'dynamic-range',
  616. 'forced-colors',
  617. 'grid',
  618. 'height',
  619. 'hover',
  620. 'inverted-colors',
  621. 'light-level',
  622. 'max-aspect-ratio',
  623. 'max-color',
  624. 'max-color-index',
  625. 'max-height',
  626. 'max-monochrome',
  627. 'max-resolution',
  628. 'max-width',
  629. 'min-aspect-ratio',
  630. 'min-color',
  631. 'min-color-index',
  632. 'min-height',
  633. 'min-monochrome',
  634. 'min-resolution',
  635. 'min-width',
  636. 'monochrome',
  637. 'orientation',
  638. 'overflow-block',
  639. 'overflow-inline',
  640. 'pointer',
  641. 'prefers-color-scheme',
  642. 'prefers-contrast',
  643. 'prefers-reduced-motion',
  644. 'prefers-reduced-transparency',
  645. 'resolution',
  646. 'scan',
  647. 'scripting',
  648. 'update',
  649. 'video-dynamic-range',
  650. 'width',
  651. ]);
  652. // https://www.w3.org/TR/CSS22/ui.html#system-colors
  653. keywordSets.systemColors = new Set([
  654. 'activeborder',
  655. 'activecaption',
  656. 'appworkspace',
  657. 'background',
  658. 'buttonface',
  659. 'buttonhighlight',
  660. 'buttonshadow',
  661. 'buttontext',
  662. 'captiontext',
  663. 'graytext',
  664. 'highlight',
  665. 'highlighttext',
  666. 'inactiveborder',
  667. 'inactivecaption',
  668. 'inactivecaptiontext',
  669. 'infobackground',
  670. 'infotext',
  671. 'menu',
  672. 'menutext',
  673. 'scrollbar',
  674. 'threeddarkshadow',
  675. 'threedface',
  676. 'threedhighlight',
  677. 'threedlightshadow',
  678. 'threedshadow',
  679. 'window',
  680. 'windowframe',
  681. 'windowtext',
  682. ]);
  683. // htmlTags includes only "standard" tags. So we augment it with older tags etc.
  684. keywordSets.nonStandardHtmlTags = new Set([
  685. 'acronym',
  686. 'applet',
  687. 'basefont',
  688. 'big',
  689. 'blink',
  690. 'center',
  691. 'content',
  692. 'dir',
  693. 'font',
  694. 'frame',
  695. 'frameset',
  696. 'hgroup',
  697. 'isindex',
  698. 'keygen',
  699. 'listing',
  700. 'marquee',
  701. 'nobr',
  702. 'noembed',
  703. 'plaintext',
  704. 'spacer',
  705. 'strike',
  706. 'tt',
  707. 'xmp',
  708. ]);
  709. keywordSets.validMixedCaseSvgElements = new Set([
  710. 'altGlyph',
  711. 'altGlyphDef',
  712. 'altGlyphItem',
  713. 'animateColor',
  714. 'animateMotion',
  715. 'animateTransform',
  716. 'clipPath',
  717. 'feBlend',
  718. 'feColorMatrix',
  719. 'feComponentTransfer',
  720. 'feComposite',
  721. 'feConvolveMatrix',
  722. 'feDiffuseLighting',
  723. 'feDisplacementMap',
  724. 'feDistantLight',
  725. 'feDropShadow',
  726. 'feFlood',
  727. 'feFuncA',
  728. 'feFuncB',
  729. 'feFuncG',
  730. 'feFuncR',
  731. 'feGaussianBlur',
  732. 'feImage',
  733. 'feMerge',
  734. 'feMergeNode',
  735. 'feMorphology',
  736. 'feOffset',
  737. 'fePointLight',
  738. 'feSpecularLighting',
  739. 'feSpotLight',
  740. 'feTile',
  741. 'feTurbulence',
  742. 'foreignObject',
  743. 'glyphRef',
  744. 'linearGradient',
  745. 'radialGradient',
  746. 'textPath',
  747. ]);
  748. /**
  749. * @param {(string[] | Set<string>)[]} args
  750. */
  751. function uniteSets(...args) {
  752. return new Set([...args].reduce((result, set) => [...result, ...set], []));
  753. }
  754. module.exports = keywordSets;