- Notifications
You must be signed in to change notification settings - Fork0
Machine-readable references of terms defined in web browser specifications
License
djangoai/webref
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
This repository containsmachine-readable references of CSS properties, definitions, IDL, and other useful terms that can be automatically extracted from web browser specifications (see alist of projects known to use the data). The contents of the repository are updated automaticallyevery 6 hours (although note information about published/TR/ versions of specifications are updated only once per day).
Specifications covered by this repository are technical Web specifications that appear inbrowser-specs.
Themain branch of this repository containsautomatically-generated raw extracts from web browser specifications. These extracts come with no guarantee on validity or consistency. For instance, if a specification defines invalid IDL snippets or uses an unknown IDL type, the corresponding IDL extract in this repository will be invalid as well.
Thecurated branch containscurated extracts. Curated extracts are generated from raw extracts in theed folder by applying manually-maintained patches to fix invalid content and providevalidity and consistency guarantees. Thecurated branch is updated automatically whenever themain branch is updated, unless patches need to be modified (which requires manual intervention). Curated extracts are published underhttps://w3c.github.io/webref/ed/.
Additionally, subsets of the curated content get manually reviewed and published asNPMpackages on a weekly basis:
@webref/idlcontains acurated version of theed/idlfolder.@webref/csscontains acurated version of theed/cssfolder.@webref/elementscontains acurated version of theed/elementsfolder.@webref/eventscontains acurated version of theed/eventsfolder.
Important: The curated extracts only contain data for specifications that are ingood standing (to keep the number of manually-maintained patches minimal and manageable). The NPM packages only contain curated extracts of specifications that are in good standing and thattarget web browsers.
Important: Unless you are ready to deal with invalid content, we strongly recommend that you process contents of thecurated branch or NPM packages instead of raw content in themain branch.
This repository contains raw and curated information aboutnightly versions of Web specifications in theed folder, as well as raw information about thereleased version (for/TR/ specifications) in thetr folder.
Note: Thetr folder only contains information aboutreleased specifications. Specifications that have not been published as/TR/ documents (such as WHATWG specifications or Community Group reports) do not appear under thetr folder in particular.
More often than not, released versions of specifications are much older than their nightly version. Data in thetr folder is more invalid/inconsistent than data in theed folder as a result. Additionally, no attempt is being made at curating data in thetr folder,use thetr folder at your own risk!
The following subfolders in thecurated branch contain individual machine-readable JSON or text files generated from specifications:
ed/css: CSS terms (properties, descriptors, value spaces). One file per specificationseries.ed/dfns:<dfn>terms, along with metadata such as linking text, access level, namespace. One file per specification.ed/elements: Markup elements defined, along with the interface that they implement. One file per specification.ed/headings: Section headings. One file per specification.ed/idl: Raw WebIDL index. One file per specificationseries.ed/idlnames: WebIDL definitions per referenceable IDL name. One file per IDL name.ed/idlnamesparsed: Parsed WebIDL structure of definitions in theidlnamesfolder. One file per IDL name.ed/idlparsed: Parsed WebIDL structure of definitions in theidlfolder. One file per specification.ed/ids: Fragments defined in the specification. One file per specification.ed/links: Links to other documents, along with targeted fragments. One file per specification.ed/refs: Normative and informative references to other specifications. One file per specification.
Individual files are named after the shortname of the specification, or after the shortname of the specification series for CSS definitions and raw IDL files. Individual files are only created when needed, meaning when the specification actually includes relevant terms.
Theed/index.json file contains the index of specifications that have been crawled, and relative links to individual files that have been created.
This repository usesReffy, a Web spec exploration tool, to crawl the specifications and generate the data. In particular, the data it contains is the result of running Reffy. The repository does not contain any more data.
Raw WebIDL extracts are used inweb-platform-tests, please see theirinterfaces/README.md for details.
Data curation brings the following guarantees.
- All IDL files can be parsed by the version ofwebidl2.js referenced in
package.json. WebIDL2.validatepasses with the exception of the "no-nointerfaceobject" rule about[LegacyNoInterfaceObject], which is in wide use.- All types are defined by some specification.
- All extended attributes are defined by some specification.
- No duplicate top-level definitions or members.
- No missing or mismatched types in inheritance chains.
- No conflicts when applying mixins and partials.
- All values in CSS files can be parsed by the version ofCSSTree used in
peerDependenciesinpackage.json. - No duplicate definitions of CSS properties provided that CSS extracts ofdelta specs are not taken into account (such extracts end with
-n.json, wherenis a level number). - CSS extracts contain a base definition of all CSS properties that get extended by other CSS property definitions (those for which
newValuesis set). - All entries in CSS files that do not extend a base definition link back to their actual definition in the spec. In other words, all entries under
properties[],properties[].values[],selectors[],atrules[]andvalues[]have anhrefkey that contains an absolute URL with fragment, except properties that that have anewValueskey, at-rules that neither have aprosenor avaluekey, and definitions of adelta spec that completely override a definition in a previous level.
- All Web IDL interfaces referenced by elements exist in Web IDL extracts.
- All elements link back to their definition in the spec.
- All events have a
typeattribute that match the name of the event - All events have a
interfaceattribute to describe the interface used by the Event. The Web IDL interface exists in the latest version of the@webref/idlpackage at the time the@webref/eventspackage is released, and represents an actual interface (i.e. not a mixin). - All events have a
targetsattribute with a non-empty list of target interfaces on which the event may fire. All Web IDL interfaces in the list exist in the latest version of the@webref/idlpackage at the time the@webref/eventspackage is released, and represent an actual interface (i.e. not a mixin). - The
bubblesattribute is always set to a boolean value for target interfaces that belong to a bubbling tree (DOM, IndexedDB, Serial API, Web Bluetooth). - The
bubblesattribute is only set for target interfaces that belong to a bubbling tree. - The
bubblingPathattribute is only set for target interfaces on which the event bubbles. - The
targetsattribute contains the top most interfaces in an inheritance chain, unless bubbling conditions differ. For instance, the list may contain{ "target": "Element", "bubbles": true }but not also{ "target": "HTMLElement", "bubbles": true }sinceHTMLElementinherits fromElement. - For target interfaces that belong to a bubbling tree, the
targetsattribute only contains the deepest interface in the bubbling tree on which the event may fire and bubble. For instance, the list may contain{ "target": "HTMLElement", "bubbles": true }, but not also{ "target": "Document" }since event would de facto fire atDocumentthrough bubbling.
The following projects are known to use webref data:
- MDN content management system,yari
- Web Platform Tests
- Open Web Docs MDN Browser Compat Data collector
- bikeshed, a specification authoring tool
- ReSpec, a specification authoring tool
- "DOM" Bindings for TypeScript
- browser API bindings for Dart
- thePulsar text editor
- PostCSS preset env plugin
- strudy
- nodysseus
- WebIDLPedia
- Webdex
Using webref data in a project that is not yet in the list? Let us know!
This repository used to contain analyses of potential spec anomalies, such as missing references and invalid Web IDL definitions. These analyses are now published in the companionw3c/webref-analysis repository.
Feel free to raiseissues in this repository as needed. Note that most issues likely more directly apply to underlying tools:
- Errors in the data are most likely caused by bugs or missing features inReffy, which is the tool that crawls and parses specifications under the hoods. If you spot an error, please report it inReffy's issue tracker.
- If you believe that a spec is missing from the list, please checkbrowser-specs and report itthere.
GitHub Actions workflows are used to automate most of the tasks in this repo.
- Update ED report - crawls thenightly version of specifications and updates the contents of the
edfolder. Workflow runs every 6 hours. Specifications that have not been modified since last crawl are skipped, unless the version of Reffy changed in the meantime. A typical crawl takes afew minutes to complete. A full crawl takes up to12mn. - Update TR report - crawls thereleased version of specifications and updates the contents of the
trfolder. Workflow runs once per day. A typical crawl takes afew minutes to complete. A full crawl takes up to8mn. - Curate data & Prepare package PRs - runs whenever crawled data gets updated and updates the
curatedbranch accordingly (provided all tests pass). The job also creates pull requests to release new versions of NPM packages when needed. Each pull request details the diff that would be released, and bumps the package version in the relevantpackages/xxx/package.jsonfile. - Clean up abandoned files - checks the contents of repository to detect orphan crawl files that are no longer targeted by the latest crawl's result and creates a PR to delete these files from the repository. Runs once per week on Wednesday. The crawl workflows does not delete these files automatically because crawl sometimes fails on a spec due to transient network or spec errors.
- Test - runs tests on pull requests.
- Clean patches when issues/PR are closed - drops patches that no longer need to apply because underlying issues got fixed. Runs once per week.
- Publish
@webref/xxpackage if needed - publishes a new version of the@webref/css,@webref/elements,@webref/eventsor@webref/idlpackage to NPM, tags the corresponding commits on themainandcuratedbranches, and updates the relevant@webref/xxx@latesttag to point to the right commit on thecuratedbranch. Runs whenever a pre-release PR is merged. Note that the released version is the version that appeared inpackages/css/package.json,packages/elements/package.json,packages/events/package.jsonorpackages/idl/package.jsonbefore the pre-release PR is merged. @webref/xxrelease: Request review of pre-release PR - assigns reviewers to NPM package pull requests. Runs once per week.
About
Machine-readable references of terms defined in web browser specifications
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Languages
- JavaScript95.9%
- HTML4.1%