Skip to content

Commit 099f320

Browse files
committed
Upgrade dependencies
1 parent 5fa290c commit 099f320

File tree

10 files changed

+1549
-115
lines changed

10 files changed

+1549
-115
lines changed

__tests__/style.js

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,7 +1197,7 @@ describe('-webkit-line-clamp', () => {
11971197
style.blockEllipsis = initial('block-ellipsis')
11981198
style.continue = '-webkit-legacy'
11991199
expect(style.webkitLineClamp).toBe('')
1200-
expect(style.cssText).toBe('line-clamp: 1 none -webkit-legacy;')
1200+
expect(style.cssText).toBe('line-clamp: 1 no-ellipsis -webkit-legacy;')
12011201
})
12021202
})
12031203
describe('-webkit-text-stroke', () => {
@@ -2515,6 +2515,16 @@ describe('columns', () => {
25152515
longhands.forEach(longhand => expect(style[longhand]).toBe(initial(longhand)))
25162516
expect(style.columns).toBe('auto')
25172517
expect(style.cssText).toBe('columns: auto;')
2518+
style.columns = '1'
2519+
longhands.forEach(longhand =>
2520+
expect(style[longhand]).toBe(longhand === 'column-count' ? '1' : initial(longhand)))
2521+
expect(style.columns).toBe('1')
2522+
expect(style.cssText).toBe('columns: 1;')
2523+
style.columns = 'auto / 1px'
2524+
longhands.forEach(longhand =>
2525+
expect(style[longhand]).toBe(longhand === 'column-height' ? '1px' : initial(longhand)))
2526+
expect(style.columns).toBe('auto / 1px')
2527+
expect(style.cssText).toBe('columns: auto / 1px;')
25182528
})
25192529
test('shorthand reification', () => {
25202530

@@ -2524,11 +2534,6 @@ describe('columns', () => {
25242534
longhands.forEach(longhand => style[longhand] = initial(longhand))
25252535
expect(style.columns).toBe('auto')
25262536
expect(style.cssText).toBe('columns: auto;')
2527-
2528-
// Explicit initial column-count value
2529-
style.columnHeight = '1px'
2530-
expect(style.columns).toBe('auto auto / 1px')
2531-
expect(style.cssText).toBe('columns: auto auto / 1px;')
25322537
})
25332538
})
25342539
describe('contain-intrinsic-size', () => {
@@ -3389,12 +3394,12 @@ describe('line-clamp', () => {
33893394
expect(style.continue).toBe('-webkit-legacy')
33903395
expect(style.lineClamp).toBe('1 -webkit-legacy')
33913396
expect(style.cssText).toBe('line-clamp: 1 -webkit-legacy;')
3392-
style.lineClamp = 'none -webkit-legacy'
3397+
style.lineClamp = 'no-ellipsis -webkit-legacy'
33933398
expect(style.maxLines).toBe('none')
3394-
expect(style.blockEllipsis).toBe('none')
3399+
expect(style.blockEllipsis).toBe('no-ellipsis')
33953400
expect(style.continue).toBe('-webkit-legacy')
3396-
expect(style.lineClamp).toBe('none -webkit-legacy')
3397-
expect(style.cssText).toBe('line-clamp: none -webkit-legacy;')
3401+
expect(style.lineClamp).toBe('no-ellipsis -webkit-legacy')
3402+
expect(style.cssText).toBe('line-clamp: no-ellipsis -webkit-legacy;')
33983403
})
33993404
test('shorthand reification', () => {
34003405

@@ -3408,18 +3413,18 @@ describe('line-clamp', () => {
34083413
// All longhands cannot be represented
34093414
style.maxLines = '1'
34103415
expect(style.lineClamp).toBe('')
3411-
expect(style.cssText).toBe('max-lines: 1; block-ellipsis: none; continue: auto;')
3416+
expect(style.cssText).toBe('max-lines: 1; block-ellipsis: no-ellipsis; continue: auto;')
34123417
style.maxLines = initial('max-lines')
34133418
style.blockEllipsis = 'auto'
34143419
expect(style.lineClamp).toBe('')
34153420
expect(style.cssText).toBe('-webkit-line-clamp: none;')
34163421
style.blockEllipsis = initial('block-ellipsis')
34173422
style.continue = 'collapse'
34183423
expect(style.lineClamp).toBe('')
3419-
expect(style.cssText).toBe('max-lines: none; block-ellipsis: none; continue: collapse;')
3424+
expect(style.cssText).toBe('max-lines: none; block-ellipsis: no-ellipsis; continue: collapse;')
34203425
style.continue = 'discard'
34213426
expect(style.lineClamp).toBe('')
3422-
expect(style.cssText).toBe('max-lines: none; block-ellipsis: none; continue: discard;')
3427+
expect(style.cssText).toBe('max-lines: none; block-ellipsis: no-ellipsis; continue: discard;')
34233428
})
34243429
})
34253430
describe('list-style', () => {

__tests__/value.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3014,6 +3014,27 @@ describe('<color>', () => {
30143014
]
30153015
valid.forEach(([input, expected = input]) => expect(parse('<color>', input)).toBe(expected))
30163016
})
3017+
test('valid <alpha()>', () => {
3018+
const valid = [
3019+
// Relative component keyword
3020+
['alpha(from green / alpha)'],
3021+
['alpha(from green / calc(alpha + 1 + 1))', 'alpha(from green / calc(2 + alpha))'],
3022+
// Out of range arguments
3023+
['alpha(from green / -1)', 'alpha(from green / 0)'],
3024+
['alpha(from green / 2)', 'alpha(from green)'],
3025+
// Map <percentage> to <number>
3026+
['alpha(from green / -1%)', 'alpha(from green / 0)'],
3027+
['alpha(from green / 101%)', 'alpha(from green)'],
3028+
// Preserve `none`
3029+
['alpha(from green / none)', 'alpha(from green / none)'],
3030+
// Precision (at least 16 bits)
3031+
['alpha(from green / 0.499)', 'alpha(from green / 0.498)'],
3032+
['alpha(from green / 0.501)', 'alpha(from green / 0.5)'],
3033+
['alpha(from green / 49.9%)', 'alpha(from green / 0.498)'],
3034+
['alpha(from green / 50.1%)', 'alpha(from green / 0.5)'],
3035+
]
3036+
valid.forEach(([input, expected = input]) => expect(parse('<color>', input)).toBe(expected))
3037+
})
30173038
test('valid <color()>', () => {
30183039
const valid = [
30193040
// Explicit `xyz` color space

lib/properties/definitions.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -940,14 +940,14 @@ export default {
940940
'block-ellipsis': {
941941
initial: {
942942
parsed: {
943-
end: 4,
943+
end: 11,
944944
start: 0,
945945
types: ['<ident-token>', '<ident>', '<keyword>', 'block-ellipsis'],
946-
value: 'none',
946+
value: 'no-ellipsis',
947947
},
948-
serialized: 'none',
948+
serialized: 'no-ellipsis',
949949
},
950-
value: 'none | auto | <string>',
950+
value: 'no-ellipsis | auto | <string>',
951951
},
952952
'block-size': {
953953
group: 'size',
@@ -2272,7 +2272,7 @@ export default {
22722272
value: 'auto | nowrap | wrap',
22732273
},
22742274
'columns': {
2275-
value: "<'column-width'> || <'column-count'> [/ <'column-height'>]?",
2275+
value: "[<'column-width'> || <'column-count'>] [/ <'column-height'>]?",
22762276
},
22772277
'contain': {
22782278
animate: false,

lib/serialize.js

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ function serializeColor({ name, types, value }, specified) {
387387
return channels
388388
}
389389
if (types.includes('<color>')) {
390-
source = `from ${serializeColor(component, name)} `
390+
source = `from ${serializeColor(component, name)}`
391391
return channels
392392
}
393393
const isAlpha = (index + 1) === components.length
@@ -520,11 +520,14 @@ function serializeColor({ name, types, value }, specified) {
520520
if (name === 'rgba' || name === 'hsla') {
521521
name = name.slice(0, -1)
522522
}
523-
value = value.map(value => typeof value === 'number' ? serializeNumber({ value }) : value).join(' ')
523+
value = value.map(value => typeof value === 'number' ? serializeNumber({ value }) : value)
524+
if (source) {
525+
value.unshift(source)
526+
}
524527
if (alpha) {
525-
return `${name}(${source}${value} / ${alpha})`
528+
value.push(`/ ${alpha}`)
526529
}
527-
return `${name}(${source}${value})`
530+
return `${name}(${value.join(' ')})`
528531
}
529532

530533
if (name === 'hsl' || name === 'hsla') {
@@ -2241,12 +2244,21 @@ function representClipPath(path) {
22412244
*/
22422245
function representColumns(columns) {
22432246
const [width, count, height] = columns.map(serializeValue)
2244-
if (height === '' || height === 'auto') {
2245-
if (count === '' || count === 'auto') {
2247+
if (count === 'auto') {
2248+
if (height === 'auto') {
22462249
return [width]
22472250
}
2251+
return [width, '/', height]
2252+
}
2253+
if (height === 'auto') {
2254+
if (width === 'auto') {
2255+
return [count]
2256+
}
22482257
return [width, count]
22492258
}
2259+
if (width === 'auto') {
2260+
return [count, '/', height]
2261+
}
22502262
return [width, count, '/', height]
22512263
}
22522264

@@ -2634,12 +2646,12 @@ function representLineClamp(declarations, legacy) {
26342646
return [maxLines]
26352647
}
26362648
} else if (fragment === 'auto') {
2637-
if (maxLines === 'none' && blockEllipsis === 'none') {
2649+
if (maxLines === 'none' && blockEllipsis === 'no-ellipsis') {
26382650
return ['none']
26392651
}
26402652
} else if (fragment === 'collapse') {
26412653
if (maxLines === 'none') {
2642-
if (blockEllipsis !== 'none') {
2654+
if (blockEllipsis !== 'no-ellipsis') {
26432655
return [blockEllipsis]
26442656
}
26452657
} else if (blockEllipsis === 'auto') {

lib/values/colors.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

22
export const colorFunctionKeywords = {
3+
alpha: 'alpha',
34
hsl: 'h | s | l | alpha',
45
hsla: 'h | s | l | alpha',
56
hwb: 'h | w | b | alpha',

lib/values/definitions.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export default {
77
'<absolute-size>': 'xx-small | x-small | small | medium | large | x-large | xx-large',
88
'<acos()>': 'acos(<calc-sum>)',
99
'<age>': 'child | young | old',
10+
'<alpha()>': 'alpha(from <color> [/ [<alpha-value> | none]]?)',
1011
'<alpha-value>': '<number> | <percentage>',
1112
'<an+b>': "odd | even | <integer> | <n-dimension> | '+'? n | -n | <ndashdigit-dimension> | '+'? <ndashdigit-ident> | <dashndashdigit-ident> | <n-dimension> <signed-integer> | '+'? n <signed-integer> | -n <signed-integer> | <ndash-dimension> <signless-integer> | '+'? n- <signless-integer> | -n- <signless-integer> | <n-dimension> ['+' | '-'] <signless-integer> | '+'? n ['+' | '-'] <signless-integer> | -n ['+' | '-'] <signless-integer>",
1213
'<anchor()>': 'anchor(<anchor-name>? && <anchor-side> , <length-percentage>?)',
@@ -70,7 +71,7 @@ export default {
7071
'<color()>': 'color([from <color>]? <colorspace-params> [/ [<alpha-value> | none]]?)',
7172
'<color-base>': '<hex-color> | <color-function> | <named-color> | <color-mix()> | transparent',
7273
'<color-font-tech>': 'color-COLRv0 | color-COLRv1 | color-SVG | color-sbix | color-CBDT',
73-
'<color-function>': '<rgb()> | <rgba()> | <hsl()> | <hsla()> | <hwb()> | <lab()> | <lch()> | <oklab()> | <oklch()> | <ictcp()> | <jzazbz()> | <jzczhz()> | <color()>',
74+
'<color-function>': '<rgb()> | <rgba()> | <hsl()> | <hsla()> | <hwb()> | <lab()> | <lch()> | <oklab()> | <oklch()> | <ictcp()> | <jzazbz()> | <jzczhz()> | <alpha()> | <color()>',
7475
'<color-interpolate()>': 'color-interpolate([<progress-source> && [by <easing-function>]? && <easing-function>? && <color-interpolation-method>?] , <input-position>{1,2} : <color> , [[<easing-function> || <color-interpolation-method>]? , <input-position>{1,2} : <color>]#?)',
7576
'<color-interpolation-method>': 'in [<rectangular-color-space> | <polar-color-space> <hue-interpolation-method>? | <custom-color-space>]',
7677
'<color-mix()>': 'color-mix(<color-interpolation-method> , [<color> && <percentage [0,100]>?]#)',
@@ -122,7 +123,7 @@ export default {
122123
'<counter>': '<counter()> | <counters()>',
123124
'<counters()>': 'counters(<counter-name> , <string> , <counter-style>?)',
124125
'<cross-fade()>': 'cross-fade(<cf-image>#)',
125-
'<crossorigin-modifier>': 'crossorigin(anonymous | use-credentials)',
126+
'<cross-origin-modifier>': 'cross-origin(anonymous | use-credentials)',
126127
'<css-type>': '<syntax-component> | <type()>',
127128
'<cubic-bezier()>': 'cubic-bezier([<number [0,1]> , <number>]#{2})',
128129
'<cubic-bezier-easing-function>': 'ease | ease-in | ease-out | ease-in-out | <cubic-bezier()>',
@@ -357,7 +358,7 @@ export default {
357358
'<position>': '<position-one> | <position-two> | <position-four>',
358359
'<pow()>': 'pow(<calc-sum> , <calc-sum>)',
359360
'<predefined-rgb-params>': '<predefined-rgb> [<number> | <percentage> | none]{3}',
360-
'<predefined-rgb>': 'srgb | srgb-linear | display-p3 | a98-rgb | prophoto-rgb | rec2020 | rec2100-pq | rec2100-hlg | rec2100-linear',
361+
'<predefined-rgb>': 'srgb | srgb-linear | display-p3 | display-p3-linear | a98-rgb | prophoto-rgb | rec2020 | rec2100-pq | rec2100-hlg | rec2100-linear',
361362
'<progress()>': 'progress(<calc-sum> , <calc-sum> , <calc-sum>)',
362363
'<progress-source>': "<percentage> | <number> | <dimension> | <'animation-timeline'>",
363364
'<pseudo-class-selector>': ': <ident-token> | : <function-token> <any-value> )',
@@ -384,8 +385,8 @@ export default {
384385
'<ray()>': 'ray(<angle> && <ray-size>? && contain? && [at <position>]?)',
385386
'<ray-size>': 'closest-side | closest-corner | farthest-side | farthest-corner | sides',
386387
'<rect()>': "rect([<length-percentage> | auto]{4} [round <'border-radius'>]?)",
387-
'<rectangular-color-space>': 'srgb | srgb-linear | display-p3 | a98-rgb | prophoto-rgb | rec2020 | lab | oklab | <xyz-space>',
388-
'<referrerpolicy-modifier>': 'referrerpolicy(no-referrer | no-referrer-when-downgrade | same-origin | origin | strict-origin | origin-when-cross-origin | strict-origin-when-cross-origin | unsafe-url)',
388+
'<rectangular-color-space>': 'srgb | srgb-linear | display-p3 | display-p3-linear | a98-rgb | prophoto-rgb | rec2020 | lab | oklab | <xyz-space>',
389+
'<referrer-policy-modifier>': 'referrer-policy(no-referrer | no-referrer-when-downgrade | same-origin | origin | strict-origin | origin-when-cross-origin | strict-origin-when-cross-origin | unsafe-url)',
389390
'<relative-control-point>': '<coordinate-pair> [from [start | end | origin]]?',
390391
'<relative-real-selector-list>': '<relative-real-selector>#',
391392
'<relative-real-selector>': '<combinator>? <complex-real-selector>',
@@ -398,7 +399,7 @@ export default {
398399
'<repeating-linear-gradient()>': 'repeating-linear-gradient(<linear-gradient-syntax>)',
399400
'<repeating-radial-gradient()>': 'repeating-radial-gradient(<radial-gradient-syntax>)',
400401
'<repetition>': 'repeat | space | round | no-repeat',
401-
'<request-url-modifier>': '<crossorigin-modifier> | <integrity-modifier> | <referrerpolicy-modifier>',
402+
'<request-url-modifier>': '<cross-origin-modifier> | <integrity-modifier> | <referrer-policy-modifier>',
402403
'<resolution>': '<dimension>',
403404
'<reversed-counter-name>': 'reversed(<counter-name>)',
404405
'<rgb()>': '<legacy-rgb-syntax> | <modern-rgb-syntax>',

lib/values/pseudos.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@ const userActions = [
158158
'focus-visible',
159159
'focus-within',
160160
'hover',
161+
'interest-source',
162+
'interest-target',
161163
]
162164

163165
/**

0 commit comments

Comments
 (0)