Skip to content

Commit a8fc94d

Browse files
committed
Define <dashed-function> as element-dependent
1 parent 86bffe3 commit a8fc94d

File tree

3 files changed

+8
-15
lines changed

3 files changed

+8
-15
lines changed

__tests__/style.js

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4656,9 +4656,8 @@ describe('CSSFontFaceDescriptors', () => {
46564656
['initial'],
46574657
['inherit(--custom)'],
46584658
['var(--custom)'],
4659-
// Cascade dependent value
4660-
['--custom()'],
46614659
// Element-dependent value
4660+
['--custom()'],
46624661
['attr(name)'],
46634662
['random-item(--key, 1)', 'random-item(--key, 1%)'],
46644663
['interpolate(0, 0: 1)', 'interpolate(0, 0: 1%)'],
@@ -4776,11 +4775,9 @@ describe('CSSKeyframeProperties', () => {
47764775
style.fontWeight = 'var(--custom)'
47774776
expect(style.fontWeight).toBe('var(--custom)')
47784777

4779-
// Cascade-dependent value
4778+
// Element-dependent value
47804779
style.fontWeight = '--custom()'
47814780
expect(style.fontWeight).toBe('--custom()')
4782-
4783-
// Element-dependent value
47844781
style.fontWeight = 'attr(name)'
47854782
expect(style.fontWeight).toBe('attr(name)')
47864783
style.fontWeight = 'random-item(--key, 1)'
@@ -4855,7 +4852,7 @@ describe('CSSMarginDescriptors', () => {
48554852
style.fontWeight = 'var(--custom)'
48564853
expect(style.fontWeight).toBe('var(--custom)')
48574854

4858-
// Cascade-dependent value
4855+
// Element-dependent value
48594856
style.fontWeight = '--custom()'
48604857
expect(style.fontWeight).toBe('--custom()')
48614858
})
@@ -4934,7 +4931,7 @@ describe('CSSPageDescriptors', () => {
49344931
expect(style.fontWeight).toBe('var(--custom)')
49354932
expect(style.size).toBe('var(--custom)')
49364933

4937-
// Cascade-dependent value
4934+
// Element-dependent value
49384935
style.fontWeight = '--custom()'
49394936
style.size = '--custom()'
49404937
expect(style.fontWeight).toBe('--custom()')
@@ -4983,11 +4980,9 @@ describe('CSSPositionTryDescriptors', () => {
49834980
style.top = 'var(--custom)'
49844981
expect(style.top).toBe('var(--custom)')
49854982

4986-
// Cascade-dependent value
4983+
// Element-dependent value
49874984
style.top = '--custom()'
49884985
expect(style.top).toBe('--custom()')
4989-
4990-
// Element-dependent value
49914986
style.top = 'attr(name)'
49924987
expect(style.top).toBe('attr(name)')
49934988
style.top = 'random-item(--key, 1px)'

__tests__/value.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4029,9 +4029,8 @@ describe('<style-feature>', () => {
40294029
['width: initial'],
40304030
['width: inherit(--custom)'],
40314031
['width: var(--custom)'],
4032-
// Cascade-dependent substitution
4033-
['width: --custom()'],
40344032
// Element-dependent substitution
4033+
['width: --custom()'],
40354034
['width: attr(name)'],
40364035
['width: random-item(--key, 1px)'],
40374036
['width: interpolate(0, 0: 1px)'],
@@ -4094,9 +4093,8 @@ describe('<supports-decl>', () => {
40944093
['(width: initial)'],
40954094
['(width: inherit(--custom))'],
40964095
['(width: var(--custom))'],
4097-
// Cascade-dependent substitution
4098-
['(width: --custom())'],
40994096
// Element-dependent substitution
4097+
['(width: --custom())'],
41004098
['(width: attr(name))'],
41014099
['(width: random-item(--key, 1px))'],
41024100
['(width: interpolate(0, 0: 1px))'],

lib/values/substitutions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const properties = require('../properties/definitions.js')
1010
* @see {@link https://drafts.csswg.org/css-variables-2/#funcdef-var}
1111
*/
1212
const arbitrary = [
13-
{ name: '<dashed-ident>', cascade: true, type: '<dashed-function>' },
13+
{ name: '<dashed-ident>', element: true, type: '<dashed-function>' },
1414
{ name: 'attr', element: true },
1515
{ name: 'env' },
1616
{ name: 'inherit', cascade: true },

0 commit comments

Comments
 (0)