Skip to content

Commit

Permalink
Remove "matches" object from schema (#15781)
Browse files Browse the repository at this point in the history
  • Loading branch information
queengooborg authored May 26, 2022
1 parent 6996406 commit 237a32a
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 161 deletions.
3 changes: 0 additions & 3 deletions css/properties/transform-origin.json
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,6 @@
"three_value_syntax": {
"__compat": {
"description": "Three-value syntax",
"matches": {
"regex_value": "^([\\d\\w%-]+|calc\\(.+\\))\\s+([\\d\\w%-]+|calc\\(.+\\))\\s+([\\d\\w-]+|calc\\(.+\\))$"
},
"support": {
"chrome": {
"version_added": "12"
Expand Down
14 changes: 0 additions & 14 deletions css/properties/transform.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,20 +152,6 @@
"3d": {
"__compat": {
"description": "3D support",
"matches": {
"keywords": [
"matrix3d",
"translate3d",
"translateZ",
"scale3d",
"scaleZ",
"rotate3d",
"rotateX",
"rotateY",
"rotateZ",
"perspective"
]
},
"support": {
"chrome": {
"version_added": "12"
Expand Down
5 changes: 0 additions & 5 deletions css/selectors/backdrop.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@
"backdrop": {
"__compat": {
"description": "<code>::backdrop</code>",
"matches": {
"keywords": [
"::backdrop"
]
},
"mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::backdrop",
"spec_url": "https://fullscreen.spec.whatwg.org/#::backdrop-pseudo-element",
"support": {
Expand Down
3 changes: 0 additions & 3 deletions css/types/color.json
Original file line number Diff line number Diff line change
Expand Up @@ -1036,9 +1036,6 @@
"alpha_hexadecimal_notation": {
"__compat": {
"description": "RGBA hexadecimal notation (<code>#RRGGBBAA</code>, <code>#RGBA</code>)",
"matches": {
"regex_token": "^#[0-9a-fA-F]{4}(?:[0-9a-fA-F]{4})?$"
},
"support": {
"chrome": {
"version_added": "62"
Expand Down
30 changes: 0 additions & 30 deletions schemas/compat-data-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,6 @@ The `__compat` object consists of the following:
It is intended to be used as a caption or title and should be kept short.
The `<code>`, `<kbd>`, `<em>`, and `<strong>` HTML elements may be used.

- An optional `matches` property to **help match the feature to source code** ([see below](#the-matches-object))
An object that contains a keyword list or regex that can match values or tokens which correspond to the feature.

- An optional `mdn_url` property which **points to an MDN reference page documenting the feature**.
It needs to be a valid URL, and should be the language-neutral URL (e.g. use `https://developer.mozilla.org/docs/Web/CSS/text-align` instead of `https://developer.mozilla.org/en-US/docs/Web/CSS/text-align`).

Expand Down Expand Up @@ -441,33 +438,6 @@ Example:

The `<code>`, `<kbd>`, `<em>`, and `<strong>` HTML elements may be used. In addition, `<a>` tags may be used, such as to link to a browser's bug report, or MDN documentation.

### The `matches` object

A `matches` object contains hints to help automatically detect whether source code corresponds to a feature, such as a list of keywords or a regular expression. A `matches` object may have one of the following properties (in order of preference):

- `keywords`: an array of one or more literal strings that correspond to the feature.

Examples:

- In CSS selector features, they can be literal selectors. See [`css.selectors.backdrop`](../css/selectors/backdrop.json)).
- In CSS property subfeatures, they can be data type keywords or function keywords. See [`css.properties.transform.3d`](../css/properties/transform.json)).

- `regex_token`: a string containing a regular expression that matches a single token (i.e., text delimited by characters that are excluded from the text to be matched) corresponding to the feature.

Tests are required for all regular expressions. See [`test-regexes.js`](../tests/test-regexes.js).

Examples:

- In CSS property subfeatures, they can be regular expressions that match component value types. See [`css.properties.color.alpha_hexadecimal_notation`](../css/properties/color.json) and corresponding tests.

- `regex_value`: a string containing a regular expression that matches a complete value corresponding to the feature.

Tests are required for all regular expressions. See [`test-regexes.js`](../tests/test-regexes.js).

Examples:

- In CSS property subfeatures, these can be regular expressions that match whole declaration values. See [`css.properties.transform-origin.three_value_syntax`](../css/properties/transform-origin.json) and corresponding tests.

### Status information

The mandatory status property contains information about stability of the feature. It is
Expand Down
24 changes: 0 additions & 24 deletions schemas/compat-data.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,29 +140,6 @@
]
},

"matches_block": {
"type": "object",
"maxProperties": 1,
"minProperties": 1,
"properties": {
"keywords": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {
"type": "string"
}
},
"regex_token": {
"type": "string"
},
"regex_value": {
"type": "string"
}
},
"additionalProperties": false
},

"status_block": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -249,7 +226,6 @@
],
"description": "An optional URL or array of URLs, each of which is for a specific part of a specification in which this feature is defined. Each URL must contain a fragment identifier."
},
"matches": { "$ref": "#/definitions/matches_block" },
"support": { "$ref": "#/definitions/support_block" },
"status": { "$ref": "#/definitions/status_block" }
},
Expand Down
74 changes: 0 additions & 74 deletions test/test-regexes.js

This file was deleted.

8 changes: 0 additions & 8 deletions types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,6 @@ export interface CompatStatement {
*/
mdn_url?: string;

matches?: MatchesBlock;

/**
* Each `__compat` object contains support information.
*
Expand All @@ -318,12 +316,6 @@ export interface SupportBlock
extends Partial<Record<BrowserNames, SupportStatement>>,
Partial<Record<string, SupportStatement>> {}

export interface MatchesBlock {
keywords?: string[];
regex_token?: string;
regex_value?: string;
}

/**
* The status property contains information about stability of the feature.
*/
Expand Down

0 comments on commit 237a32a

Please sign in to comment.