parserlib: update props

This commit is contained in:
tophf 2021-01-01 19:43:28 +03:00
parent 6563aca141
commit 8807819f16

View File

@ -37,7 +37,7 @@ self.parserlib = (() => {
'all': 'initial | inherit | unset', 'all': 'initial | inherit | unset',
'alignment-adjust': 'auto | baseline | before-edge | text-before-edge | middle | central | ' + 'alignment-adjust': 'auto | baseline | before-edge | text-before-edge | middle | central | ' +
'after-edge | text-after-edge | ideographic | alphabetic | hanging | ' + 'after-edge | text-after-edge | ideographic | alphabetic | hanging | ' +
'mathematical | <percentage> | <length>', 'mathematical | <length-pct>',
'alignment-baseline': 'auto | baseline | use-script | before-edge | text-before-edge | ' + 'alignment-baseline': 'auto | baseline | use-script | before-edge | text-before-edge | ' +
'after-edge | text-after-edge | central | middle | ideographic | alphabetic | ' + 'after-edge | text-after-edge | central | middle | ideographic | alphabetic | ' +
'hanging | mathematical', 'hanging | mathematical',
@ -117,7 +117,7 @@ self.parserlib = (() => {
'background-position-y': '[ center | [ top | bottom ]? <length-pct>? ]#', 'background-position-y': '[ center | [ top | bottom ]? <length-pct>? ]#',
'background-repeat': '<repeat-style>#', 'background-repeat': '<repeat-style>#',
'background-size': '<bg-size>#', 'background-size': '<bg-size>#',
'baseline-shift': 'baseline | sub | super | <percentage> | <length>', 'baseline-shift': 'baseline | sub | super | <length-pct>',
'behavior': 1, 'behavior': 1,
'binding': 1, 'binding': 1,
'bleed': '<length>', 'bleed': '<length>',
@ -126,10 +126,6 @@ self.parserlib = (() => {
'bookmark-level': 'none | <integer>', 'bookmark-level': 'none | <integer>',
'bookmark-state': 'open | closed', 'bookmark-state': 'open | closed',
'bookmark-target': 'none | <uri>', 'bookmark-target': 'none | <uri>',
'border-bottom-left-radius': '<x-one-radius>',
'border-bottom-right-radius': '<x-one-radius>',
'border-top-left-radius': '<x-one-radius>',
'border-top-right-radius': '<x-one-radius>',
'border-boundary': 'none | parent | display', 'border-boundary': 'none | parent | display',
'border-collapse': 'collapse | separate', 'border-collapse': 'collapse | separate',
'border-image': '[ none | <image> ] || <border-image-slice> ' + 'border-image': '[ none | <image> ] || <border-image-slice> ' +
@ -140,8 +136,18 @@ self.parserlib = (() => {
'border-image-slice': '<border-image-slice>', 'border-image-slice': '<border-image-slice>',
'border-image-source': '<image> | none', 'border-image-source': '<image> | none',
'border-image-width': '<border-image-width>', 'border-image-width': '<border-image-width>',
'border-radius': '<border-radius>',
'border-spacing': '<length>{1,2}', 'border-spacing': '<length>{1,2}',
'border-bottom-left-radius': '<length-pct>{1,2}',
'border-bottom-right-radius': '<length-pct>{1,2}',
'border-end-end-radius': '<length-pct>{1,2}',
'border-end-start-radius': '<length-pct>{1,2}',
'border-radius': '<border-radius>',
'border-start-end-radius': '<length-pct>{1,2}',
'border-start-start-radius': '<length-pct>{1,2}',
'border-top-left-radius': '<length-pct>{1,2}',
'border-top-right-radius': '<length-pct>{1,2}',
'bottom': '<width>', 'bottom': '<width>',
'box-decoration-break': 'slice | clone', 'box-decoration-break': 'slice | clone',
'box-shadow': '<box-shadow>', 'box-shadow': '<box-shadow>',
@ -217,12 +223,12 @@ self.parserlib = (() => {
'dominant-baseline': 'auto | use-script | no-change | reset-size | ideographic | alphabetic | ' + 'dominant-baseline': 'auto | use-script | no-change | reset-size | ideographic | alphabetic | ' +
'hanging | mathematical | central | middle | text-after-edge | text-before-edge', 'hanging | mathematical | central | middle | text-after-edge | text-before-edge',
'drop-initial-after-adjust': 'central | middle | after-edge | text-after-edge | ideographic | ' + 'drop-initial-after-adjust': 'central | middle | after-edge | text-after-edge | ideographic | ' +
'alphabetic | mathematical | <percentage> | <length>', 'alphabetic | mathematical | <length-pct>',
'drop-initial-after-align': 'baseline | use-script | before-edge | text-before-edge | ' + 'drop-initial-after-align': 'baseline | use-script | before-edge | text-before-edge | ' +
'after-edge | text-after-edge | central | middle | ideographic | alphabetic | hanging | ' + 'after-edge | text-after-edge | central | middle | ideographic | alphabetic | hanging | ' +
'mathematical', 'mathematical',
'drop-initial-before-adjust': 'before-edge | text-before-edge | central | middle | ' + 'drop-initial-before-adjust': 'before-edge | text-before-edge | central | middle | ' +
'hanging | mathematical | <percentage> | <length>', 'hanging | mathematical | <length-pct>',
'drop-initial-before-align': 'caps-height | baseline | use-script | before-edge | ' + 'drop-initial-before-align': 'caps-height | baseline | use-script | before-edge | ' +
'text-before-edge | after-edge | text-after-edge | central | middle | ideographic | ' + 'text-before-edge | after-edge | text-after-edge | central | middle | ideographic | ' +
'alphabetic | hanging | mathematical', 'alphabetic | hanging | mathematical',
@ -411,6 +417,7 @@ self.parserlib = (() => {
'overflow': '<overflow>{1,2}', 'overflow': '<overflow>{1,2}',
'overflow-anchor': 'auto | none', 'overflow-anchor': 'auto | none',
'overflow-block': '<overflow>', 'overflow-block': '<overflow>',
'overflow-clip-margin': '<nonnegative-len>',
'overflow-inline': '<overflow>', 'overflow-inline': '<overflow>',
'overflow-style': 1, 'overflow-style': 1,
'overflow-wrap': 'normal | break-word | anywhere', 'overflow-wrap': 'normal | break-word | anywhere',
@ -521,12 +528,12 @@ self.parserlib = (() => {
'string-set': 1, 'string-set': 1,
'stroke': '<paint>', 'stroke': '<paint>',
'stroke-dasharray': 'none | <dasharray>', 'stroke-dasharray': 'none | <dasharray>',
'stroke-dashoffset': '<percentage> | <length>', 'stroke-dashoffset': '<length-pct> | <number>',
'stroke-linecap': 'butt | round | square', 'stroke-linecap': 'butt | round | square',
'stroke-linejoin': 'miter | round | bevel', 'stroke-linejoin': 'miter | miter-clip | round | bevel | arcs',
'stroke-miterlimit': '<miterlimit>', 'stroke-miterlimit': '<nonnegative-num>',
'stroke-opacity': '<opacity-value>', 'stroke-opacity': '<opacity-value>',
'stroke-width': '<percentage> | <length>', 'stroke-width': '<length-pct> | <number>',
'table-layout': 'auto | fixed', 'table-layout': 'auto | fixed',
'tab-size': '<number> | <length>', 'tab-size': '<number> | <length>',
@ -577,7 +584,7 @@ self.parserlib = (() => {
'user-select': 'auto | text | none | contain | all', 'user-select': 'auto | text | none | contain | all',
'vertical-align': 'auto | use-script | baseline | sub | super | top | text-top | ' + 'vertical-align': 'auto | use-script | baseline | sub | super | top | text-top | ' +
'central | middle | bottom | text-bottom | <percentage> | <length>', 'central | middle | bottom | text-bottom | <length-pct>',
'visibility': 'visible | hidden | collapse', 'visibility': 'visible | hidden | collapse',
'voice-balance': 1, 'voice-balance': 1,
'voice-duration': 1, 'voice-duration': 1,
@ -761,9 +768,12 @@ self.parserlib = (() => {
!p.expr.parts.length || !p.expr.parts.length ||
p.expr.parts.every(VTSimple['<ident-for-grid>'], VTSimple) p.expr.parts.every(VTSimple['<ident-for-grid>'], VTSimple)
), ),
'<miterlimit>': p => p.type === 'number' && p.value >= 1 || p.isCalc, '<nonnegative-len>': p =>
p.value >= 0 && vtIsLength(p) || p.isCalc,
'<nonnegative-len-pct>': p => '<nonnegative-len-pct>': p =>
p.value >= 0 && (p.type === 'percentage' || vtIsLength(p)) || p.isCalc, p.value >= 0 && (p.type === 'percentage' || vtIsLength(p)) || p.isCalc,
'<nonnegative-num>': p =>
p.value >= 0 && p.type === 'number' || p.isCalc,
'<nonnegative-num-pct>': p => '<nonnegative-num-pct>': p =>
p.value >= 0 && (p.type === 'number' || p.type === 'percentage') || p.isCalc, p.value >= 0 && (p.type === 'number' || p.type === 'percentage') || p.isCalc,
//eslint-disable-next-line no-use-before-define //eslint-disable-next-line no-use-before-define
@ -850,7 +860,7 @@ self.parserlib = (() => {
'<cubic-bezier-timing-function>': 'ease | ease-in | ease-out | ease-in-out | ' + '<cubic-bezier-timing-function>': 'ease | ease-in | ease-out | ease-in-out | ' +
'cubic-bezier( <number>#{4} )', 'cubic-bezier( <number>#{4} )',
'<dasharray>': Matcher => '<dasharray>': Matcher =>
Matcher.parse('<nonnegative-len-pct>') Matcher.parse('<nonnegative-len-pct> | <nonnegative-num>')
.braces(1, Infinity, '#', Matcher.parse(',').braces(0, 1, '?')), .braces(1, Infinity, '#', Matcher.parse(',').braces(0, 1, '?')),
'<display-listitem>': '<display-outside>? && [ flow | flow-root ]? && list-item', '<display-listitem>': '<display-outside>? && [ flow | flow-root ]? && list-item',
'<explicit-track-list>': '[ <line-names>? <track-size> ]+ <line-names>?', '<explicit-track-list>': '[ <line-names>? <track-size> ]+ <line-names>?',
@ -912,9 +922,7 @@ self.parserlib = (() => {
'<justify-self>': 'auto | normal | stretch | <baseline-position> | <overflow-position>? ' + '<justify-self>': 'auto | normal | stretch | <baseline-position> | <overflow-position>? ' +
'[ <self-position> | left | right ]', '[ <self-position> | left | right ]',
'<overscroll>': 'contain | none | auto', '<overscroll>': 'contain | none | auto',
'<paint>': 'none | child | child( <integer> ) | <color> | ' + '<paint>': 'none | <color> | <uri> [ none | <color> ]? | context-fill | context-stroke',
'<uri> [ none | currentColor | <color> ]? | ' +
'context-fill | context-stroke',
// Because our `alt` combinator is ordered, we need to test these // Because our `alt` combinator is ordered, we need to test these
// in order from longest possible match to shortest. // in order from longest possible match to shortest.
'<position>': '<position>':
@ -965,7 +973,6 @@ self.parserlib = (() => {
'<width-height>': '<length-pct> | min-content | max-content | ' + '<width-height>': '<length-pct> | min-content | max-content | ' +
'fit-content | fit-content( <length-pct> ) | -moz-available | -webkit-fill-available', 'fit-content | fit-content( <length-pct> ) | -moz-available | -webkit-fill-available',
'<will-change>': 'auto | <animateable-feature>#', '<will-change>': 'auto | <animateable-feature>#',
'<x-one-radius>': '<length-pct>{1,2}',
}; };
//#endregion //#endregion
@ -2346,7 +2353,7 @@ self.parserlib = (() => {
/** @param {PropertyValuePart} p */ /** @param {PropertyValuePart} p */
function vtIsLength(p) { function vtIsLength(p) {
return p.text === '0' || p.type === 'length' || p.type === 'number' || p.isCalc; return p.text === '0' || p.type === 'length' || p.isCalc;
} }
/** /**