Skip to content

Commit 334d538

Browse files
committed
Rename interface to global, as the former is too spec-ific (terrible pun intended)
1 parent 05054d7 commit 334d538

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+66
-66
lines changed

src/classes/Feature/InterfaceFeature.js renamed to src/classes/Feature/GlobalFeature.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Feature from '../Feature.js';
22
import testExtends from '../../supports/extends.js';
3-
import supportsInterface from '../../supports/interface.js';
3+
import supportsGlobal from '../../supports/global.js';
44
import supportsMember from '../../supports/member.js';
55

66
export class MemberFeature extends Feature {
@@ -12,7 +12,7 @@ export class MemberFeature extends Feature {
1212
static gatingTest = true;
1313

1414
get base () {
15-
return this.closest(f => f instanceof InterfaceFeature)?.base;
15+
return this.closest(f => f instanceof GlobalFeature)?.base;
1616
}
1717

1818
get memberType () {
@@ -48,16 +48,16 @@ export class MemberFeature extends Feature {
4848
}
4949
}
5050

51-
export default class InterfaceFeature extends Feature {
51+
export default class GlobalFeature extends Feature {
5252
static children = {
5353
/** @deprecated Alias of members */
5454
tests: { type: MemberFeature },
5555

5656
/** The object needs to be an instance of this class */
57-
instanceof: { type: InterfaceFeature },
57+
instanceof: { type: GlobalFeature },
5858

5959
/** The object should be a subclass of this class */
60-
extends: { type: InterfaceFeature },
60+
extends: { type: GlobalFeature },
6161

6262
/** Properties that should exist on this object */
6363
properties: { type: MemberFeature },
@@ -93,7 +93,7 @@ export default class InterfaceFeature extends Feature {
9393
}
9494

9595
/**
96-
* Get the InterfaceFeature that contains the actual interface these are testing stuff in
96+
* Get the GlobalFeature that contains the actual interface these are testing stuff in
9797
*/
9898
get base () {
9999
if (this.def.fromParent === 'extends') {
@@ -115,9 +115,9 @@ export default class InterfaceFeature extends Feature {
115115
let Class = this.id;
116116
let name = this.parent.id;
117117

118-
return supportsInterface(name, {instanceof: Class});
118+
return supportsGlobal(name, {instanceof: Class});
119119
}
120120

121-
return supportsInterface(this.id);
121+
return supportsGlobal(this.id);
122122
}
123123
}

src/classes/Feature/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
export { default as CSSValueFeature } from './CSSValueFeature.js';
22
export { default as CSSPropertyFeature } from './CSSPropertyFeature.js';
33
export { default as CSSAtruleFeature } from './CSSAtruleFeature.js';
4-
export { default as InterfaceFeature } from './InterfaceFeature.js';
4+
export { default as GlobalFeature } from './GlobalFeature.js';

src/data/types.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CSSPropertyFeature, CSSValueFeature, CSSAtruleFeature, InterfaceFeature } from '../classes/Feature/index.js';
1+
import { CSSPropertyFeature, CSSValueFeature, CSSAtruleFeature, GlobalFeature } from '../classes/Feature/index.js';
22

33
const meta = {
44
properties: {
@@ -17,9 +17,9 @@ const meta = {
1717
class: CSSAtruleFeature,
1818
title: '@Rules & Descriptors',
1919
},
20-
interfaces: {
21-
class: InterfaceFeature,
22-
title: 'Interfaces',
20+
globals: {
21+
class: GlobalFeature,
22+
title: 'Globals',
2323
},
2424
mediaqueries: {
2525
supports: 'mq',

src/supports.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import selector from './supports/selector.js';
1313
import atrule from './supports/atrule.js';
1414
import mq from './supports/mq.js';
1515
import variable from './supports/variable.js';
16-
import Interface from './supports/interface.js';
16+
import Global from './supports/global.js';
1717
import member from './supports/member.js';
1818
import testExtends from './supports/extends.js';
1919

@@ -28,7 +28,7 @@ const Supports = {
2828
atrule,
2929
mq,
3030
variable,
31-
interface: Interface,
31+
global: Global,
3232
member,
3333
extends: testExtends,
3434
};
@@ -38,5 +38,5 @@ if (IS_DEV) {
3838
}
3939

4040
export default Supports;
41-
export { property, value, descriptor, descriptorvalue, selector, atrule, mq, variable, Interface, member, testExtends };
41+
export { property, value, descriptor, descriptorvalue, selector, atrule, mq, variable, Global, member, testExtends };
4242

File renamed without changes.

src/supports/member.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { domPrefixes as prefixes, prefixCamelCase as prefixName } from './shared.js';
22

3-
import supportsInterface from './interface.js';
3+
import supportsGlobal from './global.js';
44

55
/**
66
* Check for the presence of a member or static property
@@ -29,7 +29,7 @@ export default function member (name, options) {
2929
let object = contextObject ?? callback?.() ?? globalThis[contextName];
3030

3131
if (!object) {
32-
let contextSupported = supportsInterface(contextName);
32+
let contextSupported = supportsGlobal(contextName);
3333

3434
if (!contextSupported.success) {
3535
return {success: false};

tests/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# CSS Test Data Schema
22

3-
This document describes the data schema used in the CSS test files located in the `tests/` directory. Each test file exports a JavaScript object that defines tests for various CSS features, properties, values, and interfaces.
3+
This document describes the data schema used in the CSS test files located in the `tests/` directory. Each test file exports a JavaScript object that defines tests for various CSS features, properties, values, and globals.
44

55
## Schema Summary
66

@@ -56,8 +56,8 @@ This document describes the data schema used in the CSS test files located in th
5656
}
5757
},
5858

59-
// Tests for JavaScript/DOM interfaces
60-
interfaces?: {
59+
// Tests for JavaScript/DOM globals
60+
globals?: {
6161
"InterfaceName": {
6262
links: { /* documentation links */ },
6363
tests: string[],
@@ -152,12 +152,12 @@ atrules: {
152152
153153
<a name="at-rules-tests"></a>
154154
155-
### 5. [Interfaces Tests](#interfaces-tests)
155+
### 5. [Globals Tests](#globals-tests)
156156
157-
Tests for JavaScript/DOM interfaces related to CSS.
157+
Tests for JavaScript/DOM globals related to CSS.
158158
159159
```javascript
160-
interfaces: {
160+
globals: {
161161
'InterfaceName': {
162162
links: { /* documentation links */ },
163163
tests: ['method1', 'method2', 'property1'],
@@ -166,7 +166,7 @@ interfaces: {
166166
}
167167
```
168168
169-
<a name="interfaces-tests"></a>
169+
<a name="globals-tests"></a>
170170
171171
## Test Value Types
172172
@@ -238,7 +238,7 @@ export default {
238238
}
239239
```
240240
241-
### Interface Test
241+
### Global Test
242242
```javascript
243243
export default {
244244
title: 'CSS Typed OM Level 1',
@@ -247,7 +247,7 @@ export default {
247247
dev: 'css-typed-om-1',
248248
devtype: 'houdini'
249249
},
250-
interfaces: {
250+
globals: {
251251
CSSStyleValue: {
252252
links: {
253253
dev: '#stylevalue-objects',

tests/css-anchor-position-1.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ export default {
405405
descriptors: ['top', 'left', 'bottom', 'right', 'position-area', 'margin'],
406406
},
407407
},
408-
interfaces: {
408+
globals: {
409409
CSSPositionTryRule: {
410410
links: {
411411
dev: '#om-position-try',

tests/css-animation-worklet-1.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
group: 'houdini',
55
link: 'css-animation-worklet-1',
66
status: 'experimental',
7-
interfaces: {
7+
globals: {
88
CSS: {
99
link: '#animation-worklet-desc',
1010
properties: {

tests/css-animations-1.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export default {
6060
// TODO from, to, <percentage>
6161
},
6262
},
63-
interfaces: {
63+
globals: {
6464
AnimationEvent: {
6565
link: '#interface-animationevent',
6666
mdnGroup: 'DOM',

0 commit comments

Comments
 (0)