From 048c2672669eab69eaffac451fda77ac4de87edf Mon Sep 17 00:00:00 2001 From: tophf Date: Tue, 7 Sep 2021 12:36:36 +0300 Subject: [PATCH] parserlib: check `@font-face` + shorten grammar tokens --- js/csslint/parserlib.js | 292 ++++++++++++++++++++++------------------ 1 file changed, 161 insertions(+), 131 deletions(-) diff --git a/js/csslint/parserlib.js b/js/csslint/parserlib.js index a1c40df0..2d6fa3d5 100644 --- a/js/csslint/parserlib.js +++ b/js/csslint/parserlib.js @@ -44,7 +44,7 @@ self.parserlib = (() => { 'all': GlobalKeywords.join(' | '), 'alignment-adjust': 'auto | baseline | before-edge | text-before-edge | middle | central | ' + 'after-edge | text-after-edge | ideographic | alphabetic | hanging | ' + - 'mathematical | ', + 'mathematical | ', 'alignment-baseline': 'auto | baseline | use-script | before-edge | text-before-edge | ' + 'after-edge | text-after-edge | central | middle | ideographic | alphabetic | ' + 'hanging | mathematical', @@ -108,7 +108,7 @@ self.parserlib = (() => { 'push-button | hyperlink | radio | radio-button | checkbox | menu-item | tab | menu | ' + 'menubar | pull-down-menu | pop-up-menu | list-menu | radio-group | checkbox-group | ' + 'outline-tree | range | field | combo-box | signature | password | normal', - 'aspect-ratio': 'auto || [ / ]', + 'aspect-ratio': 'auto || [ / ]', 'azimuth': '', 'backdrop-filter': ' | none', @@ -121,11 +121,11 @@ self.parserlib = (() => { 'background-image': '#', 'background-origin': '#', 'background-position': '#', - 'background-position-x': '[ center | [ left | right ]? ? ]#', - 'background-position-y': '[ center | [ top | bottom ]? ? ]#', + 'background-position-x': '[ center | [ left | right ]? ? ]#', + 'background-position-y': '[ center | [ top | bottom ]? ? ]#', 'background-repeat': '#', 'background-size': '#', - 'baseline-shift': 'baseline | sub | super | ', + 'baseline-shift': 'baseline | sub | super | ', 'behavior': 1, 'binding': 1, 'bleed': '', @@ -146,15 +146,15 @@ self.parserlib = (() => { 'border-image-width': '', 'border-spacing': '{1,2}', - 'border-bottom-left-radius': '{1,2}', - 'border-bottom-right-radius': '{1,2}', - 'border-end-end-radius': '{1,2}', - 'border-end-start-radius': '{1,2}', + 'border-bottom-left-radius': '{1,2}', + 'border-bottom-right-radius': '{1,2}', + 'border-end-end-radius': '{1,2}', + 'border-end-start-radius': '{1,2}', 'border-radius': '', - 'border-start-end-radius': '{1,2}', - 'border-start-start-radius': '{1,2}', - 'border-top-left-radius': '{1,2}', - 'border-top-right-radius': '{1,2}', + 'border-start-end-radius': '{1,2}', + 'border-start-start-radius': '{1,2}', + 'border-top-left-radius': '{1,2}', + 'border-top-right-radius': '{1,2}', 'bottom': '', 'box-decoration-break': 'slice | clone', @@ -232,16 +232,16 @@ self.parserlib = (() => { 'dominant-baseline': 'auto | use-script | no-change | reset-size | ideographic | alphabetic | ' + 'hanging | mathematical | central | middle | text-after-edge | text-before-edge', 'drop-initial-after-adjust': 'central | middle | after-edge | text-after-edge | ideographic | ' + - 'alphabetic | mathematical | ', + 'alphabetic | mathematical | ', 'drop-initial-after-align': 'baseline | use-script | before-edge | text-before-edge | ' + 'after-edge | text-after-edge | central | middle | ideographic | alphabetic | hanging | ' + 'mathematical', 'drop-initial-before-adjust': 'before-edge | text-before-edge | central | middle | ' + - 'hanging | mathematical | ', + 'hanging | mathematical | ', 'drop-initial-before-align': 'caps-height | baseline | use-script | before-edge | ' + 'text-before-edge | after-edge | text-after-edge | central | middle | ideographic | ' + 'alphabetic | hanging | mathematical', - 'drop-initial-size': 'auto | line | ', + 'drop-initial-size': 'auto | line | ', 'drop-initial-value': '', 'elevation': ' | below | level | above | higher | lower', @@ -267,7 +267,7 @@ self.parserlib = (() => { 'flood-opacity': '', // matching no-pct first because Matcher doesn't retry for a longer match in nested definitions 'font': '? | ' + - '[ || ]? | ' + + '[ || ]? | ' + 'caption | icon | menu | message-box | small-caption | status-bar', 'font-family': '', 'font-feature-settings': '# | normal', @@ -283,7 +283,7 @@ self.parserlib = (() => { 'font-synthesis-style': 'auto | none', 'font-synthesis-weight': 'auto | none', 'font-synthesis-small-caps': 'auto | none', - 'font-variant': ' | normal | none', + 'font-variant': '', 'font-variant-alternates': ' | normal', 'font-variant-caps': ' | normal', 'font-variant-east-asian': ' | normal', @@ -401,10 +401,10 @@ self.parserlib = (() => { 'max-width': 'none | ', 'min-height': 'auto | ', 'min-width': 'auto | ', - 'max-block-size': ' | none', - 'max-inline-size': ' | none', - 'min-block-size': '', - 'min-inline-size': '', + 'max-block-size': ' | none', + 'max-inline-size': ' | none', + 'min-block-size': '', + 'min-inline-size': '', 'mix-blend-mode': '', 'move-to': 1, @@ -416,7 +416,7 @@ self.parserlib = (() => { 'object-fit': 'fill | contain | cover | none | scale-down', 'object-position': '', - 'opacity': ' | ', + 'opacity': ' | ', 'order': '', 'orphans': '', 'outline': '[ | invert ] || [ auto | ] || ', @@ -427,7 +427,7 @@ self.parserlib = (() => { 'overflow': '{1,2}', 'overflow-anchor': 'auto | none', 'overflow-block': '', - 'overflow-clip-margin': '', + 'overflow-clip-margin': '', 'overflow-inline': '', 'overflow-style': 1, 'overflow-wrap': 'normal | break-word | anywhere', @@ -439,17 +439,17 @@ self.parserlib = (() => { 'overscroll-behavior-x': '', 'overscroll-behavior-y': '', - 'padding': '{1,4}', - 'padding-block': '{1,2}', - 'padding-block-end': '', - 'padding-block-start': '', - 'padding-bottom': '', - 'padding-inline': '{1,2}', - 'padding-inline-end': '', - 'padding-inline-start': '', - 'padding-left': '', - 'padding-right': '', - 'padding-top': '', + 'padding': '{1,4}', + 'padding-block': '{1,2}', + 'padding-block-end': '', + 'padding-block-start': '', + 'padding-bottom': '', + 'padding-inline': '{1,2}', + 'padding-inline-end': '', + 'padding-inline-start': '', + 'padding-left': '', + 'padding-right': '', + 'padding-top': '', 'page': 1, 'page-break-after': 'auto | always | avoid | left | right | recto | verso', 'page-break-before': 'auto | always | avoid | left | right | recto | verso', @@ -531,19 +531,18 @@ self.parserlib = (() => { 'speak-numeral': 'digits | continuous', 'speak-punctuation': 'code | none', 'speech-rate': 1, - 'src': 1, 'stop-color': 1, 'stop-opacity': '', 'stress': 1, 'string-set': 1, 'stroke': '', 'stroke-dasharray': 'none | ', - 'stroke-dashoffset': ' | ', + 'stroke-dashoffset': ' | ', 'stroke-linecap': 'butt | round | square', 'stroke-linejoin': 'miter | miter-clip | round | bevel | arcs', - 'stroke-miterlimit': '', + 'stroke-miterlimit': '', 'stroke-opacity': '', - 'stroke-width': ' | ', + 'stroke-width': ' | ', 'table-layout': 'auto | fixed', 'tab-size': ' | ', @@ -565,7 +564,7 @@ self.parserlib = (() => { 'text-emphasis-style': '', 'text-emphasis-position': '[ over | under ] && [ right | left ]?', 'text-height': 1, - 'text-indent': ' && hanging? && each-line?', + 'text-indent': ' && hanging? && each-line?', 'text-justify': 'auto | none | inter-word | inter-character', 'text-outline': 1, 'text-overflow': 'clip | ellipsis', @@ -586,7 +585,7 @@ self.parserlib = (() => { 'transition-duration': '