Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions files/en-us/web/api/mediasession/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const actionHandlers = [
// set playback state
navigator.mediaSession.playbackState = "playing";
// update our status element
updateStatus(allMeta[index], 'Action: play | Track is playing...')
updateStatus(allMeta[index], 'Action: play | Track is playing')
}
],
[
Expand All @@ -89,7 +89,7 @@ const actionHandlers = [
// set playback state
navigator.mediaSession.playbackState = "paused";
// update our status element
updateStatus(allMeta[index], 'Action: pause | Track has been paused...');
updateStatus(allMeta[index], 'Action: pause | Track has been paused');
}
],
]
Expand Down
4 changes: 2 additions & 2 deletions files/en-us/web/api/mediasession/playbackstate/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const actionHandlers = [
// set playback state
navigator.mediaSession.playbackState = "playing";
// update our status element
updateStatus(allMeta[index], 'Action: play | Track is playing...')
updateStatus(allMeta[index], 'Action: play | Track is playing')
}
],
[
Expand All @@ -60,7 +60,7 @@ const actionHandlers = [
// set playback state
navigator.mediaSession.playbackState = "paused";
// update our status element
updateStatus(allMeta[index], 'Action: pause | Track has been paused...');
updateStatus(allMeta[index], 'Action: pause | Track has been paused');
}
],
]
Expand Down
4 changes: 2 additions & 2 deletions files/en-us/web/api/mediasession/setactionhandler/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ const actionHandlers = [
// set playback state
navigator.mediaSession.playbackState = "playing";
// update our status element
updateStatus(allMeta[index], 'Action: play | Track is playing...')
updateStatus(allMeta[index], 'Action: play | Track is playing')
}
],
[
Expand All @@ -136,7 +136,7 @@ const actionHandlers = [
// set playback state
navigator.mediaSession.playbackState = "paused";
// update our status element
updateStatus(allMeta[index], 'Action: pause | Track has been paused...');
updateStatus(allMeta[index], 'Action: pause | Track has been paused');
}
],
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function sourceOpen (_) {
});
};

// ...
//
```

## Specifications
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/mediasource/duration/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function sourceOpen (_) {
});
};

// ...
//
```

## Specifications
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/mediasource/mediasource/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ if ('MediaSource' in window && MediaSource.isTypeSupported(mimeCodec)) {
console.error('Unsupported MIME type or codec: ', mimeCodec);
}

// ...
//
```

## Browser compatibility
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/mediasource/sourcebuffers/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function sourceOpen (_) {
});
};

// ...
//
```

## Specifications
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/mediastream_recording_api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function handleDataAvailable(event) {
console.log(recordedChunks);
download();
} else {
// ...
//
}
}
function download() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ function startRecording(stream, lengthInMS) {

recorder.ondataavailable = event => data.push(event.data);
recorder.start();
log(recorder.state + " for " + (lengthInMS/1000) + " seconds...");
log(recorder.state + " for " + (lengthInMS/1000) + " seconds");

let stopped = new Promise((resolve, reject) => {
recorder.onstop = resolve;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ payRequest.onmerchantvalidation = event => {
}

function getValidationData(url) {
/* ...retrieve the validation data from the URL... */
// Retrieve the validation data from the URL
// …
}
```

Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/messageport/postmessage/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function handleMessage(e) {
para.innerHTML = e.data;
}

// in the iframe...
// in the iframe

window.addEventListener('message', function (event) {
const messagePort = event.ports?.[0];
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/mouseevent/button/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Others may have many buttons mapped to different functions and button values.
### HTML

```html
<button id="button" oncontextmenu="event.preventDefault();">Click here with your mouse...</button>
<button id="button" oncontextmenu="event.preventDefault();">Click here with your mouse</button>
<p id="log"></p>
```

Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/mutationevent/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ You can register a listener for mutation events using {{DOMxRef("EventTarget.add

```js
element.addEventListener("DOMNodeInserted", function (event) {
// ...
//
}, false);
```

Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/mutationobserver/disconnect/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const observerOptions = {
const observer = new MutationObserver(callback);
observer.observe(targetNode, observerOptions);

/* some time later... */
/* some time later */

observer.disconnect();
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const observerOptions = {
const observer = new MutationObserver(callback);
observer.observe(targetNode, observerOptions);

/* ...later, when it's time to stop observing... */
/* later, when it's time to stop observing */

/* handle any still-pending mutations */

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ var ext = gl.getExtension('OES_vertex_array_object');
var vao = ext.createVertexArrayOES();
ext.bindVertexArrayOES(vao);

// ...
//
// calls to bindBuffer or vertexAttribPointer
// which will be "recorded" in the VAO
// ...
//
```

## Specifications
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ var ext = gl.getExtension('OES_vertex_array_object');
var vao = ext.createVertexArrayOES();
ext.bindVertexArrayOES(vao);

// ...
//
// calls to bindBuffer or vertexAttribPointer
// which will be "recorded" in the VAO
// ...
//
```

## Specifications
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ var ext = gl.getExtension('OES_vertex_array_object');
var vao = ext.createVertexArrayOES();
ext.bindVertexArrayOES(vao);

// ...
//

ext.deleteVertexArrayOES(vao);
```
Expand Down
4 changes: 2 additions & 2 deletions files/en-us/web/api/oes_vertex_array_object/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ var oes_vao_ext = gl.getExtension('OES_vertex_array_object');
var vao = oes_vao_ext.createVertexArrayOES();
oes_vao_ext.bindVertexArrayOES(vao);

// ...
//
// calls to bindBuffer or vertexAttribPointer
// which will be "recorded" in the VAO
// ...
//
```

## Specifications
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var ext = gl.getExtension('OES_vertex_array_object');
var vao = ext.createVertexArrayOES();
ext.bindVertexArrayOES(vao);

// ...
//

ext.isVertexArrayOES(vao);
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const offlineCtx = new OfflineAudioContext({
sampleRate: 44100,
});
const source = offlineCtx.createBufferSource();
// etc...
//
```

For a full working example, see our [offline-audio-context-promise](https://mdn.github.io/webaudio-examples/offline-audio-context-promise/)
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/orientationsensor/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Promise.all([navigator.permissions.query({ name: "accelerometer" }),
.then(results => {
if (results.every(result => result.state === "granted")) {
sensor.start();
// ...
//
} else {
console.log("No permissions to use AbsoluteOrientationSensor.");
}
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/ovr_multiview2/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ gl.bindTexture(gl.TEXTURE_2D_ARRAY, depthStencilTex);
gl.texStorage3D(gl.TEXTURE_2D_ARRAY, 1, gl.DEPTH32F_STENCIL8, 512, 512, 2);

ext.framebufferTextureMultiviewOVR(gl.DRAW_FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, depthStencilTex, 0, 0, 2);
gl.drawElements(/* ... */); // draw will be broadcasted to the layers of colorTex and depthStencilTex.
gl.drawElements(/* */); // draw will be broadcasted to the layers of colorTex and depthStencilTex.
```

Shader code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ In the following snippet we do just this — depending on whether the user can m

```js
const checkoutButton = document.getElementById('checkout-button');
checkoutButton.innerText = "Loading...";
checkoutButton.innerText = "Loading";
if (window.PaymentRequest) {
let request = new PaymentRequest(buildSupportedPaymentMethodNames(),
buildShoppingCartDetails());
Expand Down Expand Up @@ -181,7 +181,8 @@ If the checkout flow needs to know whether {{domxref("PaymentRequest.canMakePaym
// The page has loaded. Should the page use PaymentRequest?
// If PaymentRequest fails, should the page fallback to manual
// web form checkout?
const supportedPaymentMethods = [ /* ... */ ];
const supportedPaymentMethods = [ /* supported methods */ ];

let shouldCallPaymentRequest = true;
let fallbackToLegacyOnPaymentRequestFailure = false;
(new PaymentRequest(supportedPaymentMethods,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ request.onpaymentmethodchange = function(ev) {
if (ev.methodName === "https://apple.com/apple-pay") {
switch (cardType) {
case "visa":
// do Apple Pay specific handling for Visa card...
// do Apple Pay specific handling for Visa card
// methodDetails contains the card information
const result = calculateDiscount(ev.methodDetails);
Object.assign(newStuff, result);
break;
}
}
// finally...
// finally
ev.updateWith(newStuff);
};
const response = await request.show();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ request.onpaymentmethodchange = function(ev) {
if (ev.methodName === "https://apple.com/apple-pay") {
switch (cardType) {
case "visa":
// do Apple Pay specific handling for Visa card...
// do Apple Pay specific handling for Visa card
// methodDetails contains the card information
const result = calculateDiscount(ev.methodDetails);
Object.assign(newStuff, result);
break;
}
}
// finally...
// finally
ev.updateWith(newStuff);
};
const response = await request.show();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ async function initPaymentRequest() {
return;
}

// Otherwise... let's see if we can use Example Pay
// Otherwise, let's see if we can use Example Pay
const supportsExamplePay = await new PaymentRequest(
[{ supportedMethods: "https://example.com/pay" }],
details
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/paymentrequest/show/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ async function requestPayment() {
},
};
const response = await request.show(updatedDetails);
// Check response, etc...
// Check response, etc.
}

document.getElementById("buyButton").onclick = requestPayment;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ You could also set up the event handler using the `addEventListener()` method:

```js
response.addEventListener("payerdetailchange", async ev => {
// ...
});
//
}
```

## Browser compatibility
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ function clear_performance_timings() {
// getEntries should now return zero
const p = performance.getEntriesByType("resource");
if (p.length == 0)
console.log("... Performance data buffer cleared");
console.log(" Performance data buffer cleared");
else
console.log("... Performance data buffer NOT cleared!");
console.log(" Performance data buffer NOT cleared!");
}
```

Expand Down