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
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const htmlCanvas = document.getElementById("htmlCanvas").getContext("bitmaprende
const offscreen = new OffscreenCanvas(256, 256);
const gl = offscreen.getContext("webgl");

// ... some drawing using the gl context ...
// Perform some drawing using the gl context

// Transfer the current frame to the visible canvas
const bitmap = offscreen.transferToImageBitmap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ The promise may be rejected with the following exceptions:
const offscreen = new OffscreenCanvas(256, 256);
const gl = offscreen.getContext("webgl");

// ... some drawing using the gl context ...
// Perform some drawing using the gl context

offscreen.convertToBlob().then( blob => console.log(blob));
// Blob { size: 334, type: "image/png" }
Expand Down
8 changes: 4 additions & 4 deletions files/en-us/web/api/offscreencanvas/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ const two = document.getElementById("two").getContext("bitmaprenderer");
const offscreen = new OffscreenCanvas(256, 256);
const gl = offscreen.getContext('webgl');

// ... some drawing for the first canvas using the gl context ...
// Perform some drawing for the first canvas using the gl context

// Commit rendering to the first canvas
const bitmapOne = offscreen.transferToImageBitmap();
one.transferFromImageBitmap(bitmapOne);

// ... some more drawing for the second canvas using the gl context ...
// Perform some more drawing for the second canvas

// Commit rendering to the second canvas
const bitmapTwo = offscreen.transferToImageBitmap();
Expand Down Expand Up @@ -99,7 +99,7 @@ onmessage = function(evt) {
const canvas = evt.data.canvas;
const gl = canvas.getContext("webgl");

// ... some drawing using the gl context ...
// Perform some drawing using the gl context
};
```

Expand All @@ -111,7 +111,7 @@ onmessage = function(evt) {
const gl = canvas.getContext("webgl");

function render(time) {
// ... some drawing using the gl context ...
// Perform some drawing using the gl context
requestAnimationFrame(render);
}
requestAnimationFrame(render);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ An {{domxref("ImageBitmap")}}.
const offscreen = new OffscreenCanvas(256, 256);
const gl = offscreen.getContext("webgl");

// ... some drawing using the gl context ...
// Perform some drawing using the gl context

offscreen.transferToImageBitmap();
// ImageBitmap { width: 256, height: 256 }
Expand Down
12 changes: 6 additions & 6 deletions files/en-us/web/api/performanceentry/duration/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ The following example shows the use of the `duration` property.

```js
function run_PerformanceEntry() {
log("PerformanceEntry support ...");
console.log("PerformanceEntry support");

if (performance.mark === undefined) {
log("... performance.mark Not supported");
console.log("The property performance.mark is not supported");
return;
}

Expand All @@ -85,18 +85,18 @@ function check_PerformanceEntry(obj) {
// check each property
const supported = properties[i] in obj;
if (supported)
log("..." + properties[i] + " = " + obj[properties[i]]);
console.log("" + properties[i] + " = " + obj[properties[i]]);
else
log("..." + properties[i] + " = Not supported");
console.log("" + properties[i] + " = Not supported");
}
for (let i=0; i < methods.length; i++) {
// check each method
const supported = typeof obj[methods[i]] == "function";
if (supported) {
const js = obj[methods[i]]();
log("..." + methods[i] + "() = " + JSON.stringify(js));
console.log("" + methods[i] + "() = " + JSON.stringify(js));
} else {
log("..." + methods[i] + " = Not supported");
console.log("" + methods[i] + " = Not supported");
}
}
}
Expand Down
12 changes: 6 additions & 6 deletions files/en-us/web/api/performanceentry/name/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ The following example shows the use of the `name` property.

```js
function run_PerformanceEntry() {
log("PerformanceEntry support ...");
console.log("PerformanceEntry support");

if (performance.mark === undefined) {
log("... performance.mark Not supported");
console.log("The property performance.mark is not supported");
return;
}

Expand All @@ -113,18 +113,18 @@ function check_PerformanceEntry(obj) {
// check each property
const supported = properties[i] in obj;
if (supported)
log("..." + properties[i] + " = " + obj[properties[i]]);
console.log("" + properties[i] + " = " + obj[properties[i]]);
else
log("..." + properties[i] + " = Not supported");
console.log("" + properties[i] + " = Not supported");
}
for (let i=0; i < methods.length; i++) {
// check each method
const supported = typeof obj[methods[i]] == "function";
if (supported) {
const js = obj[methods[i]]();
log("..." + methods[i] + "() = " + JSON.stringify(js));
console.log("" + methods[i] + "() = " + JSON.stringify(js));
} else {
log("..." + methods[i] + " = Not supported");
console.log("" + methods[i] + " = Not supported");
}
}
}
Expand Down
12 changes: 6 additions & 6 deletions files/en-us/web/api/performanceentry/starttime/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ The following example shows the use of the `startTime` property.

```js
function run_PerformanceEntry() {
log("PerformanceEntry support ...");
console.log("PerformanceEntry support");

if (performance.mark === undefined) {
log("... performance.mark Not supported");
console.log("The property performance.mark is not supported");
return;
}

Expand All @@ -80,18 +80,18 @@ function check_PerformanceEntry(obj) {
// check each property
const supported = properties[i] in obj;
if (supported)
log("..." + properties[i] + " = " + obj[properties[i]]);
console.log("" + properties[i] + " = " + obj[properties[i]]);
else
log("..." + properties[i] + " = Not supported");
console.log("" + properties[i] + " = Not supported");
}
for (let i=0; i < methods.length; i++) {
// check each method
const supported = typeof obj[methods[i]] == "function";
if (supported) {
const js = obj[methods[i]]();
log("..." + methods[i] + "() = " + JSON.stringify(js));
console.log("" + methods[i] + "() = " + JSON.stringify(js));
} else {
log("..." + methods[i] + " = Not supported");
console.log("" + methods[i] + " = Not supported");
}
}
}
Expand Down
12 changes: 6 additions & 6 deletions files/en-us/web/api/performanceentry/tojson/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ The following example shows the use of the `toJSON()` method.

```js
function run_PerformanceEntry() {
log("PerformanceEntry support ...");
console.log("PerformanceEntry support");

if (performance.mark === undefined) {
log("... performance.mark Not supported");
console.log("The roperty performance.mark is not supported");
return;
}

Expand All @@ -63,18 +63,18 @@ function check_PerformanceEntry(obj) {
// check each property
const supported = properties[i] in obj;
if (supported)
log("..." + properties[i] + " = " + obj[properties[i]]);
console.log("" + properties[i] + " = " + obj[properties[i]]);
else
log("..." + properties[i] + " = Not supported");
console.log("" + properties[i] + " = Not supported");
}
for (let i=0; i < methods.length; i++) {
// check each method
const supported = typeof obj[methods[i]] == "function";
if (supported) {
const js = obj[methods[i]]();
log("..." + methods[i] + "() = " + JSON.stringify(js));
console.log("" + methods[i] + "() = " + JSON.stringify(js));
} else {
log("..." + methods[i] + " = Not supported");
console.log("" + methods[i] + " = Not supported");
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/rtcdtlstransport/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ This example presents a function, `tallySenders()`, which iterates over an `RTCP
```js
let pc = new RTCPeerConnection({ bundlePolicy: "max-bundle" });

/* ... */
// …

function tallySenders(pc) {
let results = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ signalingChannel.onmessage = receivedString => {
if (message.ice) {
// A typical value of ice here might look something like this:
//
// {candidate: "candidate:0 1 UDP 2122154243 192.168.1.9 53421 typ host", sdpMid: "0", ...}
// {candidate: "candidate:0 1 UDP 2122154243 192.168.1.9 53421 typ host", sdpMid: "0", }
//
// Pass the whole thing to addIceCandidate:

Expand Down
6 changes: 3 additions & 3 deletions files/en-us/web/api/rtcpeerconnection/addtrack/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ which will be transmitted to the other peer.>
addTrack(track)
addTrack(track, stream0)
addTrack(track, stream0, stream1)
addTrack(track, stream0, stream1, /* ... ,*/ streamN)
addTrack(track, stream0, stream1, /* ,*/ streamN)
```

### Parameters

- `track`
- : A {{domxref("MediaStreamTrack")}} object representing the media track to add to the
peer connection.
- `stream0, ..., streamN` {{optional_inline}}
- `stream0, , streamN` {{optional_inline}}
- : One or more local {{domxref("MediaStream")}} objects to which the track should be
added.

Expand Down Expand Up @@ -237,7 +237,7 @@ is received from the remote peer.
```js
var mediaConstraints = {
audio: true, // We want an audio track
video: true, // ...and we want a video track
video: true, // And we want a video track
};

var desc = new RTCSessionDescription(sdp);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ A string representing the current state of the connection, that is one of the fo
```js
var pc = new RTCPeerConnection(configuration);

/* ... */
// …

var connectionState = pc.connectionState;
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ pc.onconnectionstatechange = ev => {
switch(pc.connectionState) {
case "new":
case "checking":
setOnlineStatus("Connecting...");
setOnlineStatus("Connecting");
break;
case "connected":
setOnlineStatus("Online");
break;
case "disconnected":
setOnlineStatus("Disconnecting...");
setOnlineStatus("Disconnecting");
break;
case "closed":
setOnlineStatus("Offline");
Expand All @@ -69,7 +69,7 @@ You can also create a handler for `connectionstatechange` by using {{domxref("Ev
```js
pc.addEventListener("connectionstatechange", ev => {
switch(pc.connectionState) {
/* ... */
// …
}
}, false);
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ the console and returns `null` to the caller.
```js
let pc = new RTCPeerConnection();

/* ... */
// …

async function getIdentityAssertion(pc) {
try {
Expand Down
4 changes: 2 additions & 2 deletions files/en-us/web/api/screen/orientation/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ var orientation = (screen.orientation || {}).type || screen.mozOrientation || sc
if (orientation === "landscape-primary") {
console.log("That looks good.");
} else if (orientation === "landscape-secondary") {
console.log("Mmmh... the screen is upside down!");
console.log("Mmmh the screen is upside down!");
} else if (orientation === "portrait-secondary" || orientation === "portrait-primary") {
console.log("Mmmh... you should rotate your device to landscape");
console.log("Mmmh you should rotate your device to landscape");
} else if (orientation === undefined) {
console.log("The orientation API isn't supported in this browser :(");
}
Expand Down
4 changes: 2 additions & 2 deletions files/en-us/web/api/sensor_apis/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ The examples below show three methods for detecting sensor APIs. Additionally yo

```js
if (typeof Gyroscope === "function") {
// run in circles...
// run in circles
}

if ("ProximitySensor" in window) {
// watch out!
}

if (window.AmbientLightSensor) {
// go dark...
// go dark
}
```

Expand Down
4 changes: 2 additions & 2 deletions files/en-us/web/api/serialport/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ while (port.readable) {
// |reader| has been canceled.
break;
}
// Do something with |value|...
// Do something with |value|
}
} catch (error) {
// Handle |error|...
// Handle |error|
} finally {
reader.releaseLock();
}
Expand Down
4 changes: 2 additions & 2 deletions files/en-us/web/api/serialport/readable/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ while (port.readable) {
// |reader| has been canceled.
break;
}
// Do something with |value|...
// Do something with |value|
}
} catch (error) {
// Handle |error|...
// Handle |error|
} finally {
reader.releaseLock();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const registerServiceWorker = async () => {
}
};

// ...
//

registerServiceWorker();
```
Expand Down Expand Up @@ -469,7 +469,7 @@ self.addEventListener('install', (event) => {

// ...

// include other new resources for the new version...
// include other new resources for the new version
]
));
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ async function messageClient(clientId) {
addEventListener('fetch', (event) => {
messageClient(event.clientId);
event.respondWith(() => {
// ...
//
});
});
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ if('serviceWorker' in navigator) {
.then(function() { console.log('Service Worker Registered'); });
}

// ...
//

navigator.serviceWorker.addEventListener('message', (e) => {
// ...
//
});

navigator.serviceWorker.startMessages();
Expand Down
Loading