Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to new schema #86

Closed
wants to merge 265 commits into from
Closed
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
265 commits
Select commit Hold shift + click to select a range
3b8fdb5
Fix sessions.Filter version (#101)
Jan 5, 2017
f860087
Bug 1308057 - Merge WebGLTimerQuery into WebGLQuery
Elchi3 Jan 5, 2017
e38302a
Bug 1308057 - EXT_disjoint_timer_query is no longer Draft
Elchi3 Jan 5, 2017
c1d84ef
Added topSites data (#102)
Jan 5, 2017
5d12bfb
Document Tab.cookieStoreId (#103)
Jan 6, 2017
c42ad5d
WebGL2 is supported in Chrome 56 and Opera 43 (#104)
Elchi3 Jan 9, 2017
685978e
Fix requestBody note for Firefox (#105)
Jan 10, 2017
cc1d810
Note cookieStoreId in tabs.query and tabs.create (#106)
Jan 11, 2017
b29712f
Note that Session objects don't contain Tab.url in Firefox (#108)
Jan 11, 2017
01db98b
Note that sessions Tab objects also don't contain title or favIconUrl…
Jan 11, 2017
1317abb
IE 8 supports ALLOW-FROM
errietta Jan 12, 2017
ef8d62e
Latest opera doesn't support allow_from
errietta Jan 12, 2017
4ccd3af
XTO was implemented in Firefox 50 (bug 471020)
Elchi3 Jan 26, 2017
2145c9e
Bug link for content cache immutable in Safari
daytonlowell Jan 27, 2017
707a417
Support for referrer directive was removed from Chrome.
jpmedley Jan 27, 2017
1f1f826
Add Large-Allocation header (bug 1304140)
Elchi3 Jan 30, 2017
34b8028
Note Firefox 53 support for browser_action ans page_action contexts (…
Jan 30, 2017
769a044
Note support for the 'password' context (#122)
Jan 30, 2017
20146c7
Noted support for 'tab' context (#123)
Jan 30, 2017
725f5d8
Add HTTP methods CONNECT, DELETE, PUT
Elchi3 Jan 31, 2017
a14effe
Correct compat info for runtime.onStartup (#124)
Rob--W Feb 1, 2017
85b674c
Add Android Webview to experimental schema (see PR #120)
Elchi3 Feb 2, 2017
c602697
Add HTTP Ranges related headers and statuses
Elchi3 Feb 2, 2017
c63dfbe
gl.lineWidth is not supported in WebGL
Elchi3 Feb 6, 2017
2472d5b
Update browser-compat-data.json (#127)
vitaliylag Feb 7, 2017
396d3d2
Added identity API data (#129)
Feb 8, 2017
9577f98
Noted Firefox support for windowId and tabId in webRequest filters (#…
Feb 8, 2017
eab3453
Added browsingData data (#131)
Feb 11, 2017
b64a8df
Added data for contextualIdentities (#132)
Feb 15, 2017
0c07e40
Fixes for browsingData compat data, based on review comments (#133)
Feb 15, 2017
7f805e7
Added notes about cssOrigin (#134)
Feb 16, 2017
de51413
Noted context menu inheritance (#135)
Feb 16, 2017
c7aa52a
Update support for requestBody in Firefox 53 (#136)
Feb 16, 2017
95f18e1
Noted Firefox support for changeInfo.title in tabs.onUpdated (#137)
Feb 16, 2017
8d83f02
Added data for omnibox API (#138)
Feb 18, 2017
6d679d3
Added note about SuggestResult.description (#139)
Feb 18, 2017
5b643e5
Added note for omnibox.setDefaultSuggestion (#140)
Feb 18, 2017
8c236d5
Add 401, 403, 407 status codes
Elchi3 Feb 20, 2017
e81bbe5
storage.sync is supported in Firefox 53 (#141)
Feb 21, 2017
5bb0571
Add WebGL2 support to readPixels() for Chrome 56. (#145)
jpmedley Mar 8, 2017
f511ac4
Add WEBGL_compressed_texture_astc WebGL extension data (#146)
Elchi3 Mar 9, 2017
c354fa3
HTTP header updates for Edge
erikadoyle Mar 14, 2017
e86320b
WebGL extension support in Edge
erikadoyle Mar 14, 2017
11760e1
Whitespace
erikadoyle Mar 14, 2017
f5b860c
Add data for sidebar API (#149)
Mar 28, 2017
15ef262
Fix sidebar -> sidebarAction (#150)
Mar 28, 2017
adfa4b7
updating large-allocation header support info, as it is turned on by …
chrisdavidmills Apr 3, 2017
18468c6
i have now been told this is released in 53, not 54
chrisdavidmills Apr 3, 2017
d4b807f
Bug 1336645 – WEBGL_debug_renderer_info available without pref in Fx53+
Elchi3 Apr 5, 2017
548687b
Add WebGL2 Compat Status to Certain Functions. (#151)
jpmedley Apr 6, 2017
67bc692
Document ClickData.modifiers (#153)
Apr 7, 2017
b20b442
Updated compat data for tab support in Firefox for Android (#154)
Apr 10, 2017
4f4f48e
Some fixes for Firefox for Android data (#155)
Apr 10, 2017
1e5ec93
Update onAuthRequired for Firefox 54 (#156)
Apr 11, 2017
e5806f1
Add compat info for Firefox for Android (#157)
Apr 11, 2017
7185d9e
Added data for devtools APIs (#158)
Apr 17, 2017
1406ddb
Add Firefox support for onCreatedNavigationTarget (#159)
Apr 17, 2017
ca77435
Support for onMessageExternal/onConnectExternal (#160)
Apr 18, 2017
47a68c3
Add notes for ignored events (#161)
Apr 18, 2017
004ec10
Add privacy API (#162)
Apr 20, 2017
d722129
Remove incognito-related compat notes for BrowserSetting (#164)
Apr 20, 2017
3ca0d70
Update schema to introduce the notion of identifier
teoli2003 Dec 4, 2016
a42e18a
Update background-attachment.json to new schema
teoli2003 Dec 4, 2016
95dff43
Update background-clip.json to new schema
teoli2003 Dec 4, 2016
df2f5ff
Update background-color.json to new schema
teoli2003 Dec 4, 2016
8b8d17b
Update background-image.json to new schema
teoli2003 Dec 4, 2016
e2020e3
Update background-origin.json to new schema
teoli2003 Dec 4, 2016
922ea40
Update background-position-x.json to new schema
teoli2003 Dec 4, 2016
a328eff
Update background-position-y.json to new schema
teoli2003 Dec 4, 2016
0cbd0ed
Update background-position.json to new schema
teoli2003 Dec 4, 2016
7ebb45d
Update background-repeat.json to new schema
teoli2003 Dec 4, 2016
73122bd
Update background-size.json to new schema
teoli2003 Dec 4, 2016
5acc0ca
Update background.json to new schema
teoli2003 Dec 4, 2016
5517f54
Update status.json to new schema
teoli2003 Dec 5, 2016
35604b2
Update methods.json to new schema
teoli2003 Dec 5, 2016
23703ee
Update x-xss-protection.json to new schema
teoli2003 Dec 5, 2016
55b86fd
Update x-frame-options.json to new schema
teoli2003 Dec 5, 2016
3e9bfee
Update x-content-type-options.json to new schema
teoli2003 Dec 5, 2016
89ad765
Update warning.json to new schema
teoli2003 Dec 5, 2016
639b5b2
Update via.json to new schema
teoli2003 Dec 5, 2016
b542bac
Update vary.json to new schema
teoli2003 Dec 5, 2016
28be392
Update user-agent.json to new schema
teoli2003 Dec 5, 2016
387ebe1
Update upgrade-insecure-requests.json to new schema
teoli2003 Dec 5, 2016
27a3287
Update transfer-encoding.json to new schema
teoli2003 Dec 5, 2016
549d4a9
Update trailer.json to new schema
teoli2003 Dec 5, 2016
d0ee326
Update te.json to new schema
teoli2003 Dec 5, 2016
590a0b9
Update strict-transport-security.json to new schema
teoli2003 Dec 5, 2016
1f058df
Update set-cookie2.json to new schema
teoli2003 Dec 5, 2016
89c8105
Update set-cookie.json to new schema
teoli2003 Dec 5, 2016
43f36a6
Update server.json to new schema
teoli2003 Dec 5, 2016
48cc7de
Update retry-after.json to new schema
teoli2003 Dec 5, 2016
e807b98
Update referrer-policy.json to new schema
teoli2003 Dec 5, 2016
606a0ce
Update referer.json to new schema
teoli2003 Dec 5, 2016
d26842a
Update public-key-pins.json to new schema
teoli2003 Dec 5, 2016
285361c
Update public-key-pins-report-only.json to new schema
teoli2003 Dec 5, 2016
6a56b48
Update pragma.json to new schema
teoli2003 Dec 5, 2016
f477c52
Update origin.json to new schema
teoli2003 Dec 5, 2016
719b5c6
Update location.json to new schema
teoli2003 Dec 5, 2016
371e475
Update last-modified.json to new schema
teoli2003 Dec 5, 2016
755c7af
Update keep-alive.json to new schema
teoli2003 Dec 5, 2016
c699e59
Update if-unmodified-since.json to new schema
teoli2003 Dec 5, 2016
b35f00b
Update if-modified-since.json to new schema
teoli2003 Dec 5, 2016
f4bfb12
Update if-none-match.json to new schema
teoli2003 Dec 5, 2016
4f779be
Update if-match.json to new schema
teoli2003 Dec 5, 2016
8a1829c
Update host.json to new schema
teoli2003 Dec 5, 2016
bec5612
Update from.json to new schema
teoli2003 Dec 5, 2016
f795ddd
Update expires.json to new schema
teoli2003 Dec 5, 2016
f62c6ed
Update etag.json to new schema
teoli2003 Dec 5, 2016
946d5db
Update dnt.json to new schema
teoli2003 Dec 5, 2016
e7ffee0
Update date.json to new schema
teoli2003 Dec 5, 2016
52df0ea
Update cookie2.json to new schema
teoli2003 Dec 5, 2016
104a4ee
Update cookie.json to new schema
teoli2003 Dec 5, 2016
c028916
Update content-type.json to new schema
teoli2003 Dec 5, 2016
afc7407
Update content-security-policy.json to new schema
teoli2003 Dec 5, 2016
7b76c50
Update content-security-policy-report-only.json to new schema
teoli2003 Dec 5, 2016
fbf3403
Update content-location.json to new schema
teoli2003 Dec 5, 2016
583cb30
Update content-length.json to new schema
teoli2003 Dec 6, 2016
38038a4
Update content-language.json to new schema
teoli2003 Dec 6, 2016
7e12b55
Update content-encoding.json to new schema
teoli2003 Dec 6, 2016
8b99064
Update content-disposition.json to new schema
teoli2003 Dec 6, 2016
e92a54e
Update connection.json to new schema
teoli2003 Dec 6, 2016
0c4deee
Update cache-control.json to new schema
teoli2003 Dec 6, 2016
86be332
Update age.json to new schema
teoli2003 Dec 6, 2016
6e87662
Update access-control-request-method.json to new schema
teoli2003 Dec 6, 2016
38c3be4
Update access-control-request-headers.json to new schema
teoli2003 Dec 6, 2016
85fb617
Update access-control-max-age.json to new schema
teoli2003 Dec 6, 2016
336763b
Update access-control-expose-headers.json to new schema
teoli2003 Dec 6, 2016
ede86e2
Update access-control-allow-origin.json to new schema
teoli2003 Dec 6, 2016
a083b51
Update access-control-allow-methods.json to new schema
teoli2003 Dec 6, 2016
fe99dcb
Update access-control-allow-headers.json to new schema
teoli2003 Dec 6, 2016
4426de7
Update access-control-allow-credentials.json to new schema
teoli2003 Dec 6, 2016
43c21d1
Update accept.json to new schema
teoli2003 Dec 6, 2016
d7cadeb
Update accept-language.json to new schema
teoli2003 Dec 6, 2016
b106970
Update accept-encoding.json to new schema
teoli2003 Dec 6, 2016
89038f4
Update accept-charset.json to new schema
teoli2003 Dec 6, 2016
7d9f035
#2462 Create a json example with a basic CSS property (background-pos…
teoli2003 Mar 9, 2017
c80be00
#2463 Create a json example with a complex CSS property (subfeatures)
teoli2003 Mar 9, 2017
8f07c46
#2466 Create a json example with a prefixed CSS properties
teoli2003 Mar 9, 2017
8224a05
#2467 Create a json example with a CSS property with some feature/sub…
teoli2003 Mar 9, 2017
00e0aba
#2468 Update schema with knowledge gathered from examples on CSS prop…
teoli2003 Mar 9, 2017
976fadf
Docs for new schema
teoli2003 Mar 10, 2017
f57f52f
Minor changes to schema
teoli2003 Mar 15, 2017
1931ccb
Changing browser ids
teoli2003 Mar 17, 2017
7efde21
Update after Toronto feedback
teoli2003 Mar 27, 2017
2585308
Update after Toronto feedback (second part)
teoli2003 Mar 28, 2017
eb3a004
Fix alignment
teoli2003 Mar 28, 2017
e6f1a51
More fixup
teoli2003 Mar 31, 2017
3d24bf7
Use cssxref macro
teoli2003 Apr 5, 2017
5940a08
flag
teoli2003 Apr 5, 2017
e73b16d
fixup
teoli2003 Apr 5, 2017
701eed1
Minor fixup of values
teoli2003 Apr 5, 2017
1d4b5f6
Minor fixup of values
teoli2003 Apr 5, 2017
4c64ed3
Minor fixup of values
teoli2003 Apr 5, 2017
145b54b
Fixup background-attachment
teoli2003 Apr 6, 2017
0b369fd
Fixup background-clip
teoli2003 Apr 6, 2017
e11db65
Fixup background-color
teoli2003 Apr 6, 2017
df9fe42
Fixup background-color
teoli2003 Apr 6, 2017
78c85c6
Fixup background-image
teoli2003 Apr 7, 2017
cbcde3b
Fixup background-origin
teoli2003 Apr 7, 2017
a6bdd84
Fixup background-position-x
teoli2003 Apr 7, 2017
40b0030
Fixup background-position
teoli2003 Apr 7, 2017
eb5fee6
Update background-repeat
teoli2003 Apr 8, 2017
6c06ead
Update background-size
teoli2003 Apr 8, 2017
e51a09f
Update background-size
teoli2003 Apr 8, 2017
c7ec7bc
Update accept-charset
teoli2003 Apr 9, 2017
692b6cb
Update accept-encoding
teoli2003 Apr 9, 2017
7db156b
Update accept-language
teoli2003 Apr 9, 2017
9a589b8
Update accept
teoli2003 Apr 9, 2017
cb89270
Update access-control-allow-credentials
teoli2003 Apr 9, 2017
516f19b
Update access-control-allow-headers
teoli2003 Apr 9, 2017
47638fc
Update access-control-allow-methods
teoli2003 Apr 9, 2017
6537825
Update access-control-allow-headers
teoli2003 Apr 9, 2017
5795df0
Update access-control-allow-origin
teoli2003 Apr 9, 2017
2d1227e
Update access-control-expose-headers
teoli2003 Apr 9, 2017
9fe482e
Update access-control-max-age
teoli2003 Apr 9, 2017
c3ddcda
Update access-control-request-headers
teoli2003 Apr 9, 2017
5a1130f
Update access-control-request-method
teoli2003 Apr 9, 2017
a88f1eb
Update age
teoli2003 Apr 9, 2017
9a86677
Update connection
teoli2003 Apr 9, 2017
684d16b
Update content-disposition
teoli2003 Apr 9, 2017
8aee506
Update content-encoding
teoli2003 Apr 9, 2017
a6c8392
Update content-language
teoli2003 Apr 9, 2017
26e9a6a
Update content-length
teoli2003 Apr 9, 2017
45fb3f0
Update content-location
teoli2003 Apr 9, 2017
06d12e1
Update content-security-policy-report-only
teoli2003 Apr 13, 2017
2f9358b
Update content-type
teoli2003 Apr 13, 2017
847c7c1
Update cookie
teoli2003 Apr 13, 2017
e161af7
Update cookie2
teoli2003 Apr 13, 2017
d281444
Update date
teoli2003 Apr 13, 2017
21172f0
Update dnt
teoli2003 Apr 13, 2017
d54dc71
Update etag
teoli2003 Apr 13, 2017
9a86c18
Update expires
teoli2003 Apr 13, 2017
3ebc4ac
Update from
teoli2003 Apr 13, 2017
b694175
Update host
teoli2003 Apr 13, 2017
057f297
Update if-match
teoli2003 Apr 13, 2017
2f22bce
Update if-modified-since
teoli2003 Apr 13, 2017
f1945f9
Update if-none-match
teoli2003 Apr 13, 2017
6178040
Update if-unmodified-since
teoli2003 Apr 13, 2017
6fd3c8e
Update keep-alive
teoli2003 Apr 13, 2017
77abd28
Update last-modified
teoli2003 Apr 13, 2017
45205e5
Update location
teoli2003 Apr 13, 2017
a3450d4
Update origin
teoli2003 Apr 13, 2017
172d4e6
Update pragma
teoli2003 Apr 13, 2017
7ea9ba6
Update if-match
teoli2003 Apr 13, 2017
a9527ad
Update referer
teoli2003 Apr 13, 2017
0b7d189
Update server
teoli2003 Apr 13, 2017
9b6d60a
Update set-cookie
teoli2003 Apr 13, 2017
5544c81
Update set-cookie2
teoli2003 Apr 13, 2017
886f501
Update strict-transport-security
teoli2003 Apr 13, 2017
a39a68c
Update te
teoli2003 Apr 13, 2017
281392d
Update trailer
teoli2003 Apr 13, 2017
6901fe9
Update transfer-encoding
teoli2003 Apr 13, 2017
8bce56b
Update user-agent
teoli2003 Apr 13, 2017
784e35a
Update vary
teoli2003 Apr 13, 2017
6c7c08f
Update via
teoli2003 Apr 13, 2017
54e4bf5
Update warning
teoli2003 Apr 13, 2017
b4ac9c3
Update x-xss-protection
teoli2003 Apr 13, 2017
98935ee
Update headers
teoli2003 Apr 13, 2017
352bb22
Update promise
teoli2003 Apr 13, 2017
ff0d1f5
Remove check on api so that I can commit divide the PR in smaller chunk
teoli2003 Apr 26, 2017
f12f69a
Merge branch 'master' into schema-with-identifier
teoli2003 Apr 27, 2017
d199dec
background-attachment
teoli2003 Apr 27, 2017
bb068af
Merge branch 'schema-with-identifier' of github.com:teoli2003/browser…
teoli2003 Apr 27, 2017
175c2e2
Test: go back to all travis file to see if travis is trigerred
teoli2003 Apr 27, 2017
0fb253a
Fix typo in set-cookie
teoli2003 Apr 27, 2017
862297a
Update to latest schema
teoli2003 Apr 27, 2017
ac009d2
Remove api from schema validation for the moment
teoli2003 Apr 27, 2017
3a2b970
Fix background-attachment entry
teoli2003 Apr 27, 2017
3aa348f
Add missing version number
teoli2003 Apr 27, 2017
0b7aa74
Set up basic_support object
teoli2003 Apr 27, 2017
7907172
accept-ranges
teoli2003 Apr 27, 2017
5aa7539
content-range
teoli2003 Apr 27, 2017
9542eb6
if-range
teoli2003 Apr 28, 2017
956fb63
if-range typo
teoli2003 Apr 28, 2017
af307d1
range
teoli2003 Apr 28, 2017
7f92648
large-allocation
teoli2003 Apr 28, 2017
803deb6
range typo
teoli2003 Apr 28, 2017
fac052e
large-allocation typo
teoli2003 Apr 28, 2017
b2b82f5
promise
teoli2003 Apr 28, 2017
f8c5388
promise typo
teoli2003 Apr 28, 2017
efd1dcd
Fix webextensions schema
teoli2003 Apr 28, 2017
2319685
Fix comment from PR
teoli2003 May 2, 2017
4c8ebe9
Make the schema a bit more strict (data, version but no additionalPro…
teoli2003 May 2, 2017
a73e7a3
Typo in schema
teoli2003 May 2, 2017
084ba1c
Update to schema with "data"
teoli2003 May 2, 2017
664e56d
Update to schema with "data"
teoli2003 May 2, 2017
f23c5eb
Update to schema with "data"
teoli2003 May 2, 2017
1730321
Update to schema with "data"
teoli2003 May 2, 2017
68f3d3c
Removed extra blank line
teoli2003 May 2, 2017
9862548
Update schema description to link to semver docs, as well to add info…
teoli2003 May 2, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -4,7 +4,7 @@ before_script:
- npm install ajv-cli -g
script:
- find . -name \*.json | xargs -I {} jsonlint -q {}
- ajv validate -s compat-data.schema.json -d "{api/**/*.json,css/**/*.json,http/**/*.json,javascript/**/*.json}"
- ajv validate -s compat-data.schema.json -d "{css/**/*.json,http/**/*.json,javascript/**/*.json}"
- ajv validate -s webextensions/browser-compat-data.schema.json -d webextensions/browser-compat-data.json
notifications:
email: false
374 changes: 374 additions & 0 deletions compat-data-schema.md
@@ -0,0 +1,374 @@
# The browser-compat-data JSON format

Maintained by the [MDN team at Mozilla](https://wiki.mozilla.org/MDN).

## Browser compatibility information
MDN needs the compatibility information for each feature of the Web platform. In
order to make it easier to maintain and easy to reuse by third-party tool, we
decided to store this data into a set of JSON files, stored in a git repository.

In order to ensure the coherence of the data, we define a JSON schema that
describes the content of the JSON files storing the info. Before accepting a
PR, we validate the changes against this schema with _travis-ci_.

This document describes the format in lay-man terms so that a human can create
a JSON browser-compat-data file without having to decrypt the schema from
scratch.

__Note:__ The schema tries to capture as many constraints and rules about the
browser-compat-data JSON format. Nevertheless there are constraints that cannot
be described inside a schema, and won't be checked by automated tests. We tried
to mark such cases in the following text with a __Not enforced by the
schema__ notice.

## The JSON format

### Division in files
The browser-compat-data schema has been designed so the division in files doesn't
convey any meaning. That means that browser compatibility information about features
can be stored in one single large files or being divided in smaller files.

The division in separate files, themselves in different directories is guided
by making it easy to maintain by humans.

### Schema versioning
There one single information that is tied to each file, and is mandatory. It is
the version of schema used inside the file.

{
"version": "1.0.0",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like "version" could easily be the name of an identifier. For example manifest.json has a version key that will appear as an identifier in the data (not at the top-level, but we could imagine this happening).

Should we call it __compat_version? Alternatively we could shift the data down a level, and have the top-level look like:

{
  "version": "1.2.3",
  "data": {...}
}

That seems less hacky, but introduces another level of nesting, and we already have a lot of that.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good point. I don't like "__*" even if we are using it once, so I like the "data" idea. It also allows to extend this in the feature (if needed). I will apply this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

}

We are using semantic versioning, so the version is a `string` containing three
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should link to http://semver.org/ - actually, IMO, we should link instead of including the three bullets below. Either we are semver, in which case the definitions must be the same, and by duplicating it we just allow for incompatibility to creep in. Or we are not, in which case we shouldn't say we are.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

integers separate by a dot (`.`). No whitespace or additional characters are
allowed.

* __1st digit change.__ We introduced a breaking change: some old values will no
longer validate.
* __2nd digit change.__ We introduced some novelty that are backward compatible:
Old values still validate but some new values are now allowed.
* __3rd digit change.__ Bug fix that still allows old values to validate,
without introducing new ones: We optimized our schema to make it simpler and/or
faster and/or more readable without introducing new values nor breaking existing
ones, …

This versioning allows to transition to new schema without breaking
third-parties. The new schema is introduced, with some test schemas, third-party
tools (like MDN macros) are updated to support both the old and new schemas,
browser compat data is updated to the new schema, and finally the third-party
support for the old schema is removed.

__Note:__ You cannot mix two schemas in the same file. `"version"` is unique in
a given file.

### Feature identifier
A _feature_ is a functionality of the platform. It is an entity that can be used
independently. A _sub-feature_ is a specific value or behavior of a feature. The
division is a bit arbitrary, but matches the way developers perceive features of
a platform

* For CSS, an entity like a property, a pseudo-class, a pseudo-element, an
at-rule, or a descriptor is a feature. A value, a new syntax change, or a
specific behavior, like if a property applies to a set of elements or another
are sub-features.

* For HTML, an element or an attribute are features, while specific values of an
attribute are sub-features.

* For Web APIs or JavaScript, an interface, a method, a property, a constructor
are features, while arguments or special values of an enumerated type are
sub-features.

Each feature is identified by a unique hierarchy of strings. E.g the
`text-align` property is identified by `css.properties.text-align`.

The strings of an identifier are not intended to be displayed and are therefore
not translatable.

In JSON, this gives:

{
"css": {
"properties": {
"text-align": {…},
},
},
}

That way, each feature is uniquely identifier, independently of the file it is
defined in.

The hierarchy of identifiers is not defined inside the schema. It is a
convention of the project using the schema.

In the MDN browser-compat case, it is:

_Note: this list will evolve as we migrate our data_

{
"css": {
"properties": {…}
"pseudo-classes": {…}
"pseudo-elements": {…}
"at-rules": {…}
},
"html": {
"elements": {
…,
"<element-name>": {
…,
"<attribute-name>": {…},
}
}
"global_attributes": {…}
}
}

### Feature description

A feature is represented by an identifier containing the `"__compat"` property.
In this compat property, you'll find the list of sub-features associated to the
feature.

A feature has at least one sub-feature, representing the basic support. It is
always named `"basic"`.

The basic support feature represents the minimal set of functionality included
when a feature is qualified of 'supported'. What this represents depends of the
evolution of the feature over time, both in term of specification and of browser
support. Another way of seeing it is to consider `"support"` as representing all
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think `"support"` here should be `"basic"`?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, also at line 139. Both fixed.

the functionality of the feature that doesn't have its own sub-feature(s).

### Sub-feature

A sub-feature is the basic entity having browser compatibility information. As
explained in the previous paragraph, any feature has at least one sub-feature
called `'support'`, but it may many more.
Copy link
Collaborator

@wbamberg wbamberg Apr 28, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, `"support"` -> `"basic_support"`?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct (we changed several time the naming ;-)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

… and fixed.


A sub-feature may have three properties.

* __Sub-feature description__ contained in the `"desc"` property. It is a
`string` that contains a human-readable description of the sub-feature. As it is
intended to be used as a kind of caption or title for the feature, keep it short.
the `<code>` and `<a>`, as well as the macros `{{cssxref}}`, `{{HTMLElement}}`,
`{{htmlattrxref}}`, and `{{domxref}}` can be used. See the localization section
below for an explanation about how this string will be localized.
* __Compat information__ contained in the `"support"` property. It contains an
object listing the compat information for each browser. (See the description
below.)
* __Status information__ contained in the `"status"` object. It contains the
information about the stability of the sub-feature: Is it a functionality that
is standard? Is it stable? Has it been deprecated and shouldn't be used anymore
(See the description below.)

### The `"support"` object
Each sub-feature has support information. For each browser identifier, it
contains a compat object with the information about versions, prefixes or
alternate names, as well as notes.

The currently accepted browser identifiers are:
* `"webview_android"`, Webview, the former stock browser on Android,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, it's the browser bundled with Android for use in native and hybrid apps. Since Android 4.4 (KitKat) it has been based on the Chromium open source project, the same project on which Chrome is built.

Copy link
Collaborator

@wbamberg wbamberg May 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @jpmedley. I suggested that we should validate version numbers, here: #86 (review), and Florian just filed an issue for it: #168. I'm sure it would be great to get your input into what the format should be for Chrome.

* `"chrome"`, Google Chrome (on desktops),
* `"chrome_android"`, Google Chrome (on Android),
* `"edge"`, MS Edge (on Windows),
* `"edge_mobile"`, MS Edge, the mobile version,
* `"firefox`", Mozilla Firefox (on desktops),
* `"firefox_android"`, Firefox for Android, sometimes nicknamed Fennec,
* `"ie_mobile"`, Microsoft Internet Explorer, the mobile version,
* `"ie"`, Microsoft Internet Explorer (discontinued)
* `"opera"`, the Opera browser (desktop), based on Blink since Opera 15,
* `"opera_android"`, the Opera browser (Android version)
* `"safari"`, Apple Safari, on Mac OS,
* `"safari_ios"`, Apple Safari, on iOS,
* `"servo"`, the experimental Mozilla engine.

No value is mandatory.

Each of these properties contains a `support-statement` object with the
practical compatibility information for this sub-feature and this browser.

### The `support-statement` object
This object is the key element of each browser compat information. It is a
support-statement object. It is an array of `support` objects, but if there
are only one of them, the array can be ommitted


Example of an `support` compat object (with 2 entries):

{
"support": [
{
"version_added": "6.0"
},
{
"prefix": "-moz-",
"version_added": "3.5",
"version_removed": "9.0"
}

]
}

Example of a `support` compat object (with 1 entry, array ommitted):

{
"support": { "version_added": "6.0" }
}

### Compat information in a `"support"` field.
Compatibility information is stored in a `"support"` field. It may consist of the
following properties:

#### `"version_added"`
Contains a string with the version number the sub-feature has
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an extra suggestion, but I think we should define and enforce, for each runtime, what the version syntax must be. I'm thinking here of something like: mdn/kumascript#131 - are Edge versions like "12.34567", or "34567" or "12"? If we don't define this, then we'll end up with a mix, and it will become really hard to work with the data.

Copy link
Member Author

@teoli2003 teoli2003 May 2, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is an interesting idea: I quite like it, though it may may be complex to define and maintain. I think we should do, or at least study, this in a follow-up. Could you open an issue so that this is tracked?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'd also need to have uniform data to begin with. When I started contributing to MDN, all the reference to Chrome version numbers were 3 digits ("39.0"). Chrome doesn't do it that way and as far as I can tell never did. I've been trying to correct to 2 digits ("39") wherever I can, but right now it's a mix.

been added (and is therefore supported), the Boolean values to indicate the
sub-feature is supported (`true`, with the additional meaning that the we don't
know in which version) or not (`false`). A value of `null` indicates that we
don't have support information for it.

* Support from version 3.5 (included)

{
"version_added": "3.5"
}

* Support, but version unknown

{
"version_added": true
}

* No support

{
"version_added": false
}

* Support unknown (default value)

{
"version_added" : null
}

#### `"version_removed"`
Contains a string with the version number the sub-feature
stopped to be supported. It may be a Boolean value of (`true` or `false`), or the
`null` value. If `"version_added"` is set to a Boolean or a `string`, `"version_removed"`
default value is `false`; if it is `null`, the default value of `"version_removed"`
is `null` too.

* Removed in version 10 (start in 3.5):

{
"version_added": "3.5",
"version_removed": "10"
}

* Not removed (default if `"version_added"` is not `null`):

{
"version_added": "3.5",
"version_removed": false
}


#### `"prefix"`
Contains the prefix to add to the sub-feature name (default to the empty
string). Note that leading and trailing `-` must be included.

* Prefixed sub-feature:

{
"prefix": "-moz-",
"version_added": "3.5"
}

#### `"alternative_name"`
For the cases when prefixing is not enough, contains the whole name of the sub-feature. ( A
sub-feature may have a completely different name in some older version.

* Prefixed version had a different capitalization

{
"alternative_name": "mozRequestFullScreen",
"version_added": "true",
"version_removed": "9.0"
}

#### `"flags"`
Is a specific object indicating what kind of flags must be set for this feature
to work. It consists of three values:
* `"type"`, an enum that indicates what kind of flag it is: `"preference"` represents
a flag that the user can set himself on its browser, like in `about:config` on Firefox;
or `"compile_flag"` that is a flag that has to be set before the compilation of the browser.
* `"name"`, a `string` representing the flag or preference to modify.
* `"value_to_set"` representing the actual to set the flag to. It is a string, that may be
converted to the right type (that is `true` or `false` for Boolean value, or `4` for an
integer valuie).

#### `partial_implementation`
Is a `boolean` value indicating if the implementation of the subfeature follows the current
spec close enough not to create major interoperability problem. It defaults to `false` (no
interoperability problem expected). If set `true`, it is recommended to add a note indicating
how it diverges from the standard (implement an old version of the standard, …)

#### `"notes"`
Is an `array` of zero or more translatable `string` containing
additional pertinent information. If there are only 1 entry in the array,
the array can be ommitted

* Indication of an experimental support behind a flag

{
"version_added" : false,
"notes": "Experimental implementation available when <code>layout.css.text-align</code> is set to <code>true</code>."
}

* Linking to a bug and indicating a restriction

{
"version_added": "3.5",
"notes": ["See <a href='https://bugzil.la/123456'>bug 123456</a>.",
"Do not work on {{cssxref('::first-letter)}} pseudo-elements."]
}

Each `string` that contains a human-readable description of the sub-feature. The
`<code>` and `<a>`, as well as the macros `{{cssxref}}`, `{{HTMLElement}}`,
`{{htmlattrxref}}`, and `{{domxref}}` can be used. See the localization section
below for an explanation about how this string will be localized.

### Status information
The status indicates the stability of the feature. It is an object named
`"status"` and has four mandatory properties:
* `"experimental"`, a `boolean` value that indicates this functionality is
intended to be an addition to the Web platform. Some features are added to
conduct tests. Set to `false`, it means the functionality is mature, and no
significant incompatible changes is expected in the future.
* `"standard_track"`, a `boolean` value indicating if the feature is in a
standard track.
* `"obsolete`", a `"boolean"` value that indicates if the functionality is only
kept for compatibility purpose and shouldn't be used anymore. It may be removed
from the Web platform in the future.

## Localization
There is no localization happening inside the .json files themselves; l10n is
handled separately in order to take advantage of existing toolchains.

In the case of MDN, .po files with the translated string will be created. We
will work on them once the prototype validating the structure of the json will
be done.

The plan is:

1. Define all source strings as English in the spec, as well as which data elements are plain text, HTML, etc. Avoiding HTML is a good idea, but being clear about it is necessary if you can't avoid it.
2. Create a script to extract strings into the standard gettext format
3. Manage translation using gettext conventions, like Kuma, perhaps even using Pontoon to translate the strings. With gettext, you get fuzzy translations, notifications of changed strings, etc. etc. for free.
4. Create a second script to export gettext-formatted files to a JSON data structure.
5. Implement a gettext-like translation in KumaScript (I'm pretty sure this is already done, and multiple times).

1. is done in this document.