mirror of
https://github.com/servo/servo.git
synced 2025-08-30 17:48:20 +01:00
Update web-platform-tests to revision 7da6acfd668e66adae5ab4e2d389810d3b1460be
This commit is contained in:
parent
50db64a20e
commit
bae87d193d
307 changed files with 35826 additions and 209 deletions
|
@ -61,6 +61,22 @@ In the browser:
|
|||
var tree = WebIDL2.parse("string of WebIDL");
|
||||
</script>
|
||||
|
||||
Advanced Parsing
|
||||
----------------
|
||||
|
||||
`parse()` can optionally accept a second parameter, an options object, which can be used to
|
||||
modify parsing behavior.
|
||||
|
||||
The following options are recognized:
|
||||
```javascript
|
||||
{
|
||||
allowNestedTypedefs: false #
|
||||
}
|
||||
```
|
||||
And their meanings are as follows:
|
||||
|
||||
* `allowNestedTypedefs`: Boolean indicating whether the parser should accept `typedef`s as valid members of `interface`s. This is non-standard syntax and therefore the default is `false`.
|
||||
|
||||
Errors
|
||||
------
|
||||
When there is a syntax error in the WebIDL, it throws an exception object with the following
|
||||
|
@ -223,6 +239,7 @@ A dictionary looks like this:
|
|||
{
|
||||
"type": "field",
|
||||
"name": "fillPattern",
|
||||
"required": false,
|
||||
"idlType": {
|
||||
"sequence": false,
|
||||
"generic": null,
|
||||
|
@ -255,6 +272,7 @@ All the members are fields as follows:
|
|||
|
||||
* `type`: Always "field".
|
||||
* `name`: The name of the field.
|
||||
* `required`: Boolean indicating whether this is a [required](https://heycam.github.io/webidl/#required-dictionary-member) field.
|
||||
* `idlType`: An [IDL Type](#idl-type) describing what field's type.
|
||||
* `extAttrs`: A list of [extended attributes](#extended-attributes).
|
||||
* `default`: A [default value](#default-and-const-values), absent if there is none.
|
||||
|
@ -658,9 +676,8 @@ The fields are as follows:
|
|||
whereas the lack thereof will yield a `null`. If there is an `rhs` field then
|
||||
they are the right-hand side's arguments, otherwise they apply to the extended
|
||||
attribute directly.
|
||||
* `rhs`: If there is a right-hand side, this will capture its `type` (always
|
||||
"identifier" in practice, though it may be extended in the future) and its
|
||||
`value`.
|
||||
* `rhs`: If there is a right-hand side, this will capture its `type` (which can be
|
||||
"identifier" or "identifier-list") and its `value`.
|
||||
* `typePair`: If the extended attribute is a `MapClass` this will capture the
|
||||
map's key type and value type respectively.
|
||||
|
||||
|
@ -669,16 +686,34 @@ The fields are as follows:
|
|||
Dictionary fields and operation arguments can take default values, and constants take
|
||||
values, all of which have the following fields:
|
||||
|
||||
* `type`: One of string, number, boolean, null, Infinity, or NaN.
|
||||
* `type`: One of string, number, boolean, null, Infinity, NaN, or sequence.
|
||||
|
||||
For string, number, and boolean:
|
||||
For string, number, boolean, and sequence:
|
||||
|
||||
* `value`: The value of the given type.
|
||||
* `value`: The value of the given type. For sequence, the only possible value is `[]`.
|
||||
|
||||
For Infinity:
|
||||
|
||||
* `negative`: Boolean indicating whether this is negative Infinity or not.
|
||||
|
||||
### `iterable<>`, `legacyiterable<>`, `maplike<>`, `setlike<>` declarations
|
||||
|
||||
These appear as members of interfaces that look like this:
|
||||
|
||||
{
|
||||
"type": "maplike", // or "legacyiterable" / "iterable" / "setlike"
|
||||
"idlType": /* One or two types */,
|
||||
"readonly": false, // only for maplike and setlike
|
||||
"extAttrs": []
|
||||
}
|
||||
|
||||
The fields are as follows:
|
||||
|
||||
* `type`: Always one of "iterable", "legacyiterable", "maplike" or "setlike".
|
||||
* `idlType`: An [IDL Type](#idl-type) (or an array of two types) representing the declared type arguments.
|
||||
* `readonly`: Whether the maplike or setlike is declared as read only.
|
||||
* `extAttrs`: A list of [extended attributes](#extended-attributes).
|
||||
|
||||
|
||||
Testing
|
||||
=======
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue