Skip to content

Commit

Permalink
Fix constructor parameter names (mdn#20656)
Browse files Browse the repository at this point in the history
* Fix URLSeachParams() parameter name

* Fix XRWebGLLayer() parameter name

* Fix VideocolorSpace() parameter name

* Fix constructor parameter names
  • Loading branch information
teoli2003 authored Sep 13, 2022
1 parent 6fb8052 commit 5c8416b
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ specified object.
## Syntax

```js-nolint
new RTCSessionDescription(rtcSessionDescriptionInit)
new RTCSessionDescription(options)
```

### Values

- `rtcSessionDescriptionInit` {{optional_inline}}
- `options` {{optional_inline}}

- : An object providing the default values for the session description; the object
conforms to the `RTCSessionDescriptionInit` dictionary. That dictionary has
Expand Down
4 changes: 2 additions & 2 deletions files/en-us/web/api/taskcontroller/taskcontroller/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ If no priority is set, the signal priority defaults to [`user-visible`](/en-US/d

```js-nolint
new TaskController()
new TaskController(init)
new TaskController(options)
```

### Parameters

- `init` {{optional_inline}}
- `options` {{optional_inline}}

- : An object with the following properties:

Expand Down
6 changes: 3 additions & 3 deletions files/en-us/web/api/text/text/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ with the optional string given in parameter as its textual content.

```js-nolint
new Text()
new Text(aString)
new Text(string)
```

### Parameters

- `aString` {{optional_inline}}
- `string` {{optional_inline}}

### Return value

A new {{domxref("Text")}} object containing `aString`, or the empty string if no parameter was given.
A new {{domxref("Text")}} object with the content of the `string` parameter, or the empty string if no parameter was given.

## Example

Expand Down
4 changes: 2 additions & 2 deletions files/en-us/web/api/urlsearchparams/urlsearchparams/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ new {{domxref("URLSearchParams")}} object.

```js-nolint
new URLSearchParams()
new URLSearchParams(init)
new URLSearchParams(options)
```

### Parameters

- `init` {{optional_inline}}
- `options` {{optional_inline}}
- : One of:
- A string, which will be parsed from `application/x-www-form-urlencoded` format. A leading `'?'` character is ignored.
- A literal sequence of name-value string pairs, or any object — such as a {{domxref("FormData")}} object — with an [iterator](/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators#iterators) that produces a sequence of string pairs. Note that {{domxref("File")}} entries will be serialized as `[object File]` rather than as their filename (as they would in an `application/x-www-form-urlencoded` form).
Expand Down
10 changes: 5 additions & 5 deletions files/en-us/web/api/videocolorspace/videocolorspace/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ The **`VideoColorSpace()`** constructor creates a new {{domxref("VideoColorSpace

```js-nolint
new VideoColorSpace()
new VideoColorSpace(init)
new VideoColorSpace(options)
```

### Parameters

All values default to `null` when they are not present.

- `init` {{optional_inline}}
- : A dictionary object containing the following:
- `options` {{optional_inline}}
- : An object containing the following:
- `primaries` {{optional_inline}}
- : One of the following strings:
- `"bt709"`
Expand All @@ -52,12 +52,12 @@ All values default to `null` when they are not present.
The following example creates a new `VideoColorSpace` object with {{domxref("VideoColorSpace.primaries")}} set to `"bt709"`, and {{domxref("VideoColorSpace.primaries")}} set to `true`.

```js
let options = {
const options = {
primaries: "bt709",
fullRange: true
}

let colorSpace = new VideoColorSpace(options);
const colorSpace = new VideoColorSpace(options);
console.log(colorSpace);
```

Expand Down
6 changes: 3 additions & 3 deletions files/en-us/web/api/videodecoder/videodecoder/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ The **`VideoDecoder()`** constructor creates a new {{domxref("VideoDecoder")}} o
## Syntax

```js-nolint
new VideoDecoder(init)
new VideoDecoder(options)
```

### Parameters

- `init`
- : A dictionary object containing two callbacks.
- `options`
- : An object containing two callbacks.
- `output`
- : A callback which takes a {{domxref("VideoFrame")}} object as its only argument.
- `error`
Expand Down
4 changes: 2 additions & 2 deletions files/en-us/web/api/videoencoder/videoencoder/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ The **`VideoEncoder()`** constructor creates a new {{domxref("VideoEncoder")}} o
## Syntax

```js-nolint
new VideoEncoder(init)
new VideoEncoder(options)
```

### Parameters

- `init`
- `options`
- : An object containing two required callbacks.
- `output`
- : A callback which takes an {{domxref("EncodedVideoChunk")}} object as the first argument, and an optional metadata object as the second. The metadata object has three members:
Expand Down
18 changes: 9 additions & 9 deletions files/en-us/web/api/videoframe/videoframe/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ The **`VideoFrame()`** constructor creates a new {{domxref("VideoFrame")}} objec

```js-nolint
new VideoFrame(image)
new VideoFrame(image, init)
new VideoFrame(data, init)
new VideoFrame(image, options)
new VideoFrame(data, options)
```

### Parameters
Expand All @@ -35,8 +35,8 @@ The first type of constructor (see above) creates a new {{domxref("VideoFrame")}
an {{domxref("ImageBitmap")}},
an {{domxref("OffscreenCanvas")}},
or another {{domxref("VideoFrame")}}.
- `init` {{Optional_Inline}}
- : A dictionary object containing the following:
- `options` {{Optional_Inline}}
- : An object containing the following:
- `duration` {{Optional_Inline}}
- : An integer representing the duration of the frame in microseconds.
- `timestamp`
Expand All @@ -46,7 +46,7 @@ The first type of constructor (see above) creates a new {{domxref("VideoFrame")}
- `"keep"`: Indicates that the user agent should preserve alpha channel data.
- `"discard"`: Indicates that the user agent should ignore or remove alpha channel data.
- `visibleRect` {{Optional_Inline}}
- : A dictionary representing the visible rectangle of the `VideoFrame`, containing the following:
- : An object representing the visible rectangle of the `VideoFrame`, containing the following:
- `x`
- : The x-coordinate.
- `y`
Expand All @@ -64,8 +64,8 @@ The second type of constructor (see above) creates a new {{domxref("VideoFrame")

- `data`
- : An {{jsxref("ArrayBuffer")}} containing the data for the new `VideoFrame`.
- `init`
- : A dictionary object containing the following:
- `options`
- : An object containing the following:
- `format`
- : A string representing the video pixel format. One of the following strings, which are fully described on the page for the {{domxref("VideoFrame.format","format")}} property:
- `"I420"`
Expand Down Expand Up @@ -93,7 +93,7 @@ The second type of constructor (see above) creates a new {{domxref("VideoFrame")
- : An integer representing the number of bytes, including padding, used by each row of the plane.
Planes may not overlap. If no `layout` is specified, the planes will be tightly packed.
- `visibleRect` {{Optional_Inline}}
- : A dictionary representing the visible rectangle of the `VideoFrame`, containing the following:
- : An object representing the visible rectangle of the `VideoFrame`, containing the following:
- `x`
- : The x-coordinate.
- `y`
Expand All @@ -107,7 +107,7 @@ The second type of constructor (see above) creates a new {{domxref("VideoFrame")
- `displayHeight` {{Optional_Inline}}
- : The height of the `VideoFrame` when displayed after applying aspect ratio adjustments.
- `colorSpace`
- : A dictionary representing the color space of the `VideoFrame`, containing the following:
- : An object representing the color space of the `VideoFrame`, containing the following:
- `primaries`
- : A string representing the video color primaries, described on the page for the {{domxref("VideoColorSpace.primaries")}} property.
- `transfer`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ The **`createEquirectLayer()`** method of the {{domxref("XRWebGLBinding")}} inte
## Syntax

```js-nolint
createEquirectLayer(init)
createEquirectLayer(options)
```

### Parameters

- `init`
- `options`
- : An object to configure the {{domxref("XREquirectLayer")}}. It must have the `space`, `viewPixelHeight`, and `viewPixelWidth` properties. `init` has the following properties:
- `centralHorizontalAngle` {{optional_inline}}
- : A number indicating the central horizontal angle in radians of the sphere. Default value: `6.28318` (2π).
Expand Down
12 changes: 6 additions & 6 deletions files/en-us/web/api/xrwebglbinding/createquadlayer/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ The **`createQuadLayer()`** method of the {{domxref("XRWebGLBinding")}} interfac
## Syntax

```js-nolint
createQuadLayer(init)
createQuadLayer(options)
```

### Parameters

- `init`
- `options`
- : An object to configure the {{domxref("XRQuadLayer")}}. It must have the `space`, `viewPixelHeight`, and `viewPixelWidth` properties. `init` has the following properties:
- `colorFormat` {{optional_inline}}
- : A {{domxref("GLenum")}} defining the data type of the color texture data. Possible values:
Expand Down Expand Up @@ -58,10 +58,10 @@ createQuadLayer(init)
- `gl.DEPTH_COMPONENT24`
- `gl.DEPTH24_STENCIL24`
The default value is `gl.DEPTH_COMPONENT`.
- `height`
- : Optional. A number specifying the height of the layer in meters. The default value is `1.0`.
- `isStatic`
- : Optional. A boolean that, if true, indicates you can only draw to this layer when {{domxref("XRCompositionLayer.needsRedraw", "needsRedraw")}} is `true`. The default value is `false`.
- `height` {{optional_inline}}
- : A number specifying the height of the layer in meters. The default value is `1.0`.
- `isStatic` {{optional_inline}}
- : A boolean that, if true, indicates you can only draw to this layer when {{domxref("XRCompositionLayer.needsRedraw", "needsRedraw")}} is `true`. The default value is `false`.
- `layout` {{optional_inline}}
- : A string indicating the layout of the layer. Possible values:
- `default`
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/xrwebglbinding/xrwebglbinding/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ new XRWebGLBinding(session, context)

### Return value

A newly-created {{domxref("XRWebGLBinding")}}.
A new {{domxref("XRWebGLBinding")}}.

### Exceptions

Expand Down
4 changes: 2 additions & 2 deletions files/en-us/web/api/xrwebgllayer/xrwebgllayer/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ WebXR device and the WebGL graphics layer used to render the 3D scene.

```js-nolint
new XRWebGLLayer(session, context)
new XRWebGLLayer(session, context, layerInit)
new XRWebGLLayer(session, context, options)
```

### Parameters
Expand All @@ -47,7 +47,7 @@ new XRWebGLLayer(session, context, layerInit)
- : A {{domxref("WebGLRenderingContext")}} or {{domxref("WebGL2RenderingContext")}}
identifying the WebGL drawing context to use for rendering the scene for the specified
WebXR session.
- `layerInit` {{optional_inline}}
- `options` {{optional_inline}}

- : An object providing configuration options for the new `XRWebGLLayer`. The available options
are:
Expand Down

0 comments on commit 5c8416b

Please sign in to comment.