Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: flaws in web/api/d* #2834

Merged
merged 1 commit into from
Mar 11, 2021
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/learn/css/css_layout/grids/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ <h3 id="The_minmax_function">The minmax() function</h3>

<p>Our 100-pixel tall tracks won’t be very useful if we add content into those tracks that is taller than 100 pixels, in which case it would cause an overflow. It might be better to have tracks that are <em>at least</em> 100 pixels tall and can still expand if more content gets into them. A fairly basic fact about the web is that you never really know how tall something is going to be; additional content or larger font sizes can cause problems with designs that attempt to be pixel perfect in every dimension.</p>

<p>The {{cssxref("minmax")}} function lets us set a minimum and maximum size for a track, for example <code>minmax(100px, auto)</code>. The minimum size is 100 pixels, but the maximum is <code>auto</code>, which will expand to fit the content. Try changing <code>grid-auto-rows</code> to use a minmax value:</p>
<p>The {{cssxref("minmax()")}} function lets us set a minimum and maximum size for a track, for example <code>minmax(100px, auto)</code>. The minimum size is 100 pixels, but the maximum is <code>auto</code>, which will expand to fit the content. Try changing <code>grid-auto-rows</code> to use a minmax value:</p>

<pre class="brush: css">.container {
display: grid;
Expand All @@ -309,7 +309,7 @@ <h3 id="The_minmax_function">The minmax() function</h3>

<h3 id="As_many_columns_as_will_fit">As many columns as will fit</h3>

<p>We can combine some of the things we have learned about track listing, repeat notation and {{cssxref("minmax")}} to create a useful pattern. Sometimes it is helpful to be able to ask grid to create as many columns as will fit into the container. We do this by setting the value of <code>grid-template-columns</code> using {{cssxref("repeat")}} notation, but instead of passing in a number, pass in the keyword <code>auto-fill</code>. For the second parameter of the function we use <code>minmax()</code>, with a minimum value equal to the minimum track size that we would like to have, and a maximum of <code>1fr</code>.</p>
<p>We can combine some of the things we have learned about track listing, repeat notation and {{cssxref("minmax()")}} to create a useful pattern. Sometimes it is helpful to be able to ask grid to create as many columns as will fit into the container. We do this by setting the value of <code>grid-template-columns</code> using {{cssxref("repeat()")}} notation, but instead of passing in a number, pass in the keyword <code>auto-fill</code>. For the second parameter of the function we use <code>minmax()</code>, with a minimum value equal to the minimum track size that we would like to have, and a maximum of <code>1fr</code>.</p>

<p>Try this in your file now, using the below CSS:</p>

Expand Down
22 changes: 11 additions & 11 deletions files/en-us/web/api/dedicatedworkerglobalscope/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
---
<p>{{APIRef("Web Workers API")}}</p>

<p>The <strong><code>DedicatedWorkerGlobalScope</code></strong> object (the {{domxref("Worker")}} global scope) is accessible through the {{domxref("window.self","self")}} keyword. Some additional global functions, namespaces objects, and constructors, not typically associated with the worker global scope, but available on it, are listed in the <a href="/en-US/docs/Web/JavaScript/Reference">JavaScript Reference</a>. See also: <a href="/en-US/docs/Web/Guide/Needs_categorization/Functions_available_to_workers">Functions available to workers</a>.</p>
<p>The <strong><code>DedicatedWorkerGlobalScope</code></strong> object (the {{domxref("Worker")}} global scope) is accessible through the {{domxref("window.self","self")}} keyword. Some additional global functions, namespaces objects, and constructors, not typically associated with the worker global scope, but available on it, are listed in the <a href="/en-US/docs/Web/JavaScript/Reference">JavaScript Reference</a>. See also: <a href="/en-US/docs/Web/API/Web_Workers_API/Functions_and_classes_available_to_workers">Functions available to workers</a>.</p>

<h2 id="Properties">Properties</h2>

Expand Down Expand Up @@ -71,17 +71,17 @@ <h3 id="Inherited_from_WorkerGlobalScope">Inherited from WorkerGlobalScope</h3>
<h3 id="Implemented_from_other_places">Implemented from other places</h3>

<dl>
<dt>{{domxref("WindowBase64.atob()")}}</dt>
<dt>{{domxref("WindowOrWorkerGlobalScope.atob")}}</dt>
<dd>Decodes a string of data which has been encoded using base-64 encoding.</dd>
<dt>{{domxref("WindowBase64.btoa()")}}</dt>
<dt>{{domxref("WindowOrWorkerGlobalScope.btoa")}}</dt>
<dd>Creates a base-64 encoded ASCII string from a string of binary data.</dd>
<dt>{{domxref("WindowTimers.clearInterval()")}}</dt>
<dd>Cancels the repeated execution set using {{domxref("WindowTimers.setInterval()")}}.</dd>
<dt>{{domxref("WindowTimers.clearTimeout()")}}</dt>
<dd>Cancels the repeated execution set using {{domxref("WindowTimers.setTimeout()")}}.</dd>
<dt>{{domxref("WindowTimers.setInterval()")}}</dt>
<dt>{{domxref("WindowOrWorkerGlobalScope.clearInterval")}}</dt>
<dd>Cancels the repeated execution set using {{domxref("WindowOrWorkerGlobalScope.setInterval")}}.</dd>
<dt>{{domxref("WindowOrWorkerGlobalScope.clearTimeout")}}</dt>
<dd>Cancels the repeated execution set using {{domxref("WindowOrWorkerGlobalScope.setTimeout")}}.</dd>
<dt>{{domxref("WindowOrWorkerGlobalScope.setInterval")}}</dt>
<dd>Schedules the execution of a function every X milliseconds.</dd>
<dt>{{domxref("WindowTimers.setTimeout()")}}</dt>
<dt>{{domxref("WindowOrWorkerGlobalScope.setTimeout")}}</dt>
<dd>Sets a delay for executing a function.</dd>
</dl>

Expand Down Expand Up @@ -122,6 +122,6 @@ <h2 id="See_also">See also</h2>
<ul>
<li>{{domxref("Worker")}}</li>
<li>{{domxref("WorkerGlobalScope")}}</li>
<li><a href="/en-US/docs/Web/Guide/Performance/Using_web_workers">Using web workers</a></li>
<li><a href="/en-US/docs/Web/Guide/Needs_categorization/Functions_available_to_workers">Functions available to workers</a></li>
<li><a href="/en-US/docs/Web/API/Web_Workers_API/Using_web_workers">Using web workers</a></li>
<li><a href="/en-US/docs/Web/API/Web_Workers_API/Functions_and_classes_available_to_workers">Functions available to workers</a></li>
</ul>
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,6 @@ <h2 id="Browser_compatibility">Browser compatibility</h2>
<h2 id="See_also">See also</h2>

<ul>
<li>Related events: <code><a href="/docs/Web/API/DedicatedWorkerGlobalScope/messageerror_event">messageerror</a></code>.</li>
<li>Related events: <code><a href="/en-US/docs/Web/API/DedicatedWorkerGlobalScope/messageerror_event">messageerror</a></code>.</li>
<li><code><a href="/en-US/docs/Web/API/Worker/postMessage">Worker.postMessage()</a></code>.</li>
</ul>
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,5 @@ <h2 id="See_also">See also</h2>

<ul>
<li><code><a href="/en-US/docs/Web/API/Worker/postMessage">Worker.postMessage()</a></code></li>
<li>Related events: <code><a href="/docs/Web/API/DedicatedWorkerGlobalScope/message_event">message</a></code>.</li>
<li>Related events: <code><a href="/en-US/docs/Web/API/DedicatedWorkerGlobalScope/message_event">message</a></code>.</li>
</ul>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
---
<p>{{APIRef("Web Workers API")}}</p>

<p>The <code><strong>postMessage()</strong></code> method of the {{domxref("DedicatedWorkerGlobalScope")}} interface sends a message to the main thread that spawned it. This accepts a single parameter, which is the data to send to the worker. The data may be any value or JavaScript object handled by the <a href="/en-US/docs/Web/Guide/DOM/The_structured_clone_algorithm">structured clone</a> algorithm, which includes cyclical references.</p>
<p>The <code><strong>postMessage()</strong></code> method of the {{domxref("DedicatedWorkerGlobalScope")}} interface sends a message to the main thread that spawned it. This accepts a single parameter, which is the data to send to the worker. The data may be any value or JavaScript object handled by the <a href="/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm">structured clone</a> algorithm, which includes cyclical references.</p>

<p>The main scope that spawned the worker can send back information to the thread that spawned it using the {{domxref("Worker.postMessage")}} method.</p>

Expand All @@ -24,7 +24,7 @@ <h3 id="Parameters">Parameters</h3>

<dl>
<dt><em>aMessage</em></dt>
<dd>The object to deliver to the main thread; this will be in the data field in the event delivered to the {{domxref("Worker.onmessage")}} handler. This may be any value or JavaScript object handled by the <a href="/en-US/docs/Web/Guide/DOM/The_structured_clone_algorithm">structured clone</a> algorithm, which includes cyclical references.</dd>
<dd>The object to deliver to the main thread; this will be in the data field in the event delivered to the {{domxref("Worker.onmessage")}} handler. This may be any value or JavaScript object handled by the <a href="/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm">structured clone</a> algorithm, which includes cyclical references.</dd>
<dt><em>transferList</em> {{optional_inline}}</dt>
<dd>An optional <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">array</a> of {{domxref("Transferable")}} objects to transfer ownership of. If the ownership of an object is transferred, it becomes unusable (<em>neutered</em>) in the context it was sent from and it becomes available only to the main thread it was sent to.</dd>
<dd>Only {{domxref("MessagePort")}} and {{domxref("ArrayBuffer")}} objects can be transferred.</dd>
Expand Down
4 changes: 2 additions & 2 deletions files/en-us/web/api/delaynode/delaytime/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<div>
<p>The <code>delayTime</code> property of the {{ domxref("DelayNode") }} interface is an <a href="/en-US/docs/Web/API/AudioParam#a-rate">a-rate</a> {{domxref("AudioParam")}} representing the amount of delay to apply.</p>

<p><code>delayTime</code> is expressed in seconds, its minimal value is <code>0</code>, and its maximum value is defined by the <code>maxDelayTime</code> argument of the {{domxref("AudioContext.createDelay()")}} method that created it.</p>
<p><code>delayTime</code> is expressed in seconds, its minimal value is <code>0</code>, and its maximum value is defined by the <code>maxDelayTime</code> argument of the {{domxref("BaseAudioContext.createDelay")}} method that created it.</p>
</div>

<h2 id="Syntax">Syntax</h2>
Expand Down Expand Up @@ -60,5 +60,5 @@ <h2 id="Browser_compatibility">Browser compatibility</h2>
<h2 id="See_also">See also</h2>

<ul>
<li><a href="/en-US/docs/Web_Audio_API/Using_Web_Audio_API">Using the Web Audio API</a></li>
<li><a href="/en-US/docs/Web/API/Web_Audio_API/Using_Web_Audio_API">Using the Web Audio API</a></li>
</ul>
10 changes: 5 additions & 5 deletions files/en-us/web/api/detecting_device_orientation/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ <h2 id="Processing_orientation_events">Processing orientation events</h2>

<h3 id="Orientation_values_explained">Orientation values explained</h3>

<p>The value reported for each axis indicates the amount of rotation around a given axis in reference to a standard coordinate frame. These are described in greater detail in the <a href="/en-US/docs/DOM/Orientation_and_motion_data_explained">Orientation and motion data explained</a> article which is summarized below.</p>
<p>The value reported for each axis indicates the amount of rotation around a given axis in reference to a standard coordinate frame. These are described in greater detail in the <a href="/en-US/docs/Web/Guide/Events/Orientation_and_motion_data_explained">Orientation and motion data explained</a> article which is summarized below.</p>

<ul>
<li>The {{domxref("DeviceOrientationEvent.alpha")}} value represents the motion of the device around the z axis, represented in degrees with values ranging from 0 (inclusive) to 360 (exclusive).</li>
Expand Down Expand Up @@ -154,7 +154,7 @@ <h2 id="Processing_motion_events">Processing motion events</h2>

<h3 id="Motion_values_explained">Motion values explained</h3>

<p>The {{domxref("DeviceMotionEvent")}} objects provide web developers with information about the speed of changes for the device's position and orientation. The changes are provided along three axis (see <a href="/en-US/docs/Web/Guide/DOM/Events/Orientation_and_motion_data_explained">Orientation and motion data explained</a> for details).</p>
<p>The {{domxref("DeviceMotionEvent")}} objects provide web developers with information about the speed of changes for the device's position and orientation. The changes are provided along three axis (see <a href="/en-US/docs/Web/Guide/Events/Orientation_and_motion_data_explained">Orientation and motion data explained</a> for details).</p>

<p>For {{domxref("DeviceMotionEvent.acceleration","acceleration")}} and {{domxref("DeviceMotionEvent.accelerationIncludingGravity","accelerationIncludingGravity")}}, those axes correspond to the following:</p>

Expand Down Expand Up @@ -211,7 +211,7 @@ <h2 id="See_also">See also</h2>
<li>{{domxref("DeviceOrientationEvent")}}</li>
<li>{{domxref("DeviceMotionEvent")}}</li>
<li>The legacy <code><a href="/en-US/docs/Web/Events/MozOrientation">MozOrientation</a></code> event.</li>
<li><a href="/en-US/docs/Web/Guide/DOM/Events/Orientation_and_motion_data_explained">Orientation and motion data explained</a></li>
<li><a href="/en-US/docs/Web/Guide/DOM/Events/Using_device_orientation_with_3D_transforms">Using deviceorientation in 3D Transforms</a></li>
<li><a href="/en-US/docs/Games/Workflows/HTML5_Gamedev_Phaser_Device_Orientation">Cyber Orb: 2D maze game with device orientation</a></li>
<li><a href="/en-US/docs/Web/Guide/Events/Orientation_and_motion_data_explained">Orientation and motion data explained</a></li>
<li><a href="/en-US/docs/Web/Guide/Events/Using_device_orientation_with_3D_transforms">Using deviceorientation in 3D Transforms</a></li>
<li><a href="/en-US/docs/Games/Tutorials/HTML5_Gamedev_Phaser_Device_Orientation">Cyber Orb: 2D maze game with device orientation</a></li>
</ul>
2 changes: 1 addition & 1 deletion files/en-us/web/api/devicelightevent/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ <h2 id="See_also">See also</h2>

<ul>
<li>{{event("devicelight")}}</li>
<li><a href="/en-US/docs/WebAPI/Using_Light_Events">Using Light Events</a></li>
<li><a href="/en-US/docs/Web/API/Ambient_Light_Events">Using Light Events</a></li>
</ul>
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ <h2 id="How_Does_it_Work"><span style="line-height: 1.572;">How Does it Work?</s
<p>&gt; 10000 lux : Bright</p>
</div>

<p>It uses the {{DOMxRef("Window.addEventListener", "addEventListener")}} method of the {{DOMxRef("window")}} object.</p>
<p>It uses the {{DOMxRef("EventTarget/addEventListener", "addEventListener")}} method of the {{DOMxRef("window")}} object.</p>

<pre class="brush: js">window.addEventListener("devicelight", function (event) {

Expand Down Expand Up @@ -88,5 +88,5 @@ <h2 id="References">References:</h2>

<ul>
<li><a href="https://hacks.mozilla.org/2013/04/ambient-light-events-and-javascript-detection/">Ambient Light Events and JavaScript detection : Robert Nyman</a></li>
<li><a href="/en-US/docs/WebAPI/Using_Light_Events">Using light events</a></li>
<li><a href="/en-US/docs/Web/API/Ambient_Light_Events">Using light events</a></li>
</ul>
14 changes: 7 additions & 7 deletions files/en-us/web/api/devicelightevent/value/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
title: DeviceLightEvent.value
slug: Web/API/DeviceLightEvent/value
tags:
- API
- Ambient Light Events
- Experimental
- NeedsBetterSpecLink
- NeedsMarkupWork
- Property
- API
- Ambient Light Events
- Experimental
- NeedsBetterSpecLink
- NeedsMarkupWork
- Property
---
<div>{{APIRef("Ambient Light Events")}}</div>

Expand Down Expand Up @@ -50,5 +50,5 @@ <h2 id="See_also">See also</h2>

<ul>
<li>{{domxref("DeviceLightEvent")}}</li>
<li><a href="/en-US/docs/WebAPI/Using_Light_Events">Using Light Events</a></li>
<li><a href="/en-US/docs/Web/API/Ambient_Light_Events">Using Light Events</a></li>
</ul>
22 changes: 11 additions & 11 deletions files/en-us/web/api/devicemotionevent/acceleration/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
title: DeviceMotionEvent.acceleration
slug: Web/API/DeviceMotionEvent/acceleration
tags:
- API
- Device Orientation
- Experimental
- Mobile
- Motion
- NeedsExample
- Orientation
- Property
- Reference
- API
- Device Orientation
- Experimental
- Mobile
- Motion
- NeedsExample
- Orientation
- Property
- Reference
---
<p>{{APIRef("Device Orientation Events")}}</p>

Expand Down Expand Up @@ -75,9 +75,9 @@ <h2 id="See_also">See also</h2>
<li>{{DOMxRef("window.ondevicemotion")}}</li>
<li>{{Event("deviceorientation")}}</li>
<li>{{DOMxRef("DeviceOrientationEvent")}}</li>
<li><a href="/en-US/docs/WebAPI/Detecting_device_orientation">Detecting device
<li><a href="/en-US/docs/Web/API/Detecting_device_orientation">Detecting device
orientation</a></li>
<li><a href="https://developer.mozilla.org/en/DOM/Orientation_and_motion_data_explained"
<li><a href="/en-US/docs/Web/Guide/Events/Orientation_and_motion_data_explained"
title="Orientation and motion data explained">Orientation and motion data
explained</a></li>
</ul>
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
title: DeviceMotionEvent.accelerationIncludingGravity
slug: Web/API/DeviceMotionEvent/accelerationIncludingGravity
tags:
- API
- Device Orientation
- Experimental
- Mobile
- Motion
- NeedsExample
- Orientation
- Property
- Reference
- API
- Device Orientation
- Experimental
- Mobile
- Motion
- NeedsExample
- Orientation
- Property
- Reference
---
<p>{{APIRef("Device Orientation Events")}}</p>

Expand Down Expand Up @@ -81,9 +81,9 @@ <h2 id="See_also">See also</h2>
<li>{{DOMxRef("window.ondevicemotion")}}</li>
<li>{{Event("deviceorientation")}}</li>
<li>{{DOMxRef("DeviceOrientationEvent")}}</li>
<li><a href="/en-US/docs/WebAPI/Detecting_device_orientation">Detecting device
<li><a href="/en-US/docs/Web/API/Detecting_device_orientation">Detecting device
orientation</a></li>
<li><a href="https://developer.mozilla.org/en/DOM/Orientation_and_motion_data_explained"
<li><a href="/en-US/docs/Web/Guide/Events/Orientation_and_motion_data_explained"
title="Orientation and motion data explained">Orientation and motion data
explained</a></li>
</ul>
4 changes: 2 additions & 2 deletions files/en-us/web/api/devicemotionevent/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,6 @@ <h2 id="See_also">See also</h2>
<li>{{Event("deviceorientation")}}</li>
<li>{{DOMxRef("DeviceOrientationEvent")}}</li>
<li>{{Event("devicemotion")}}</li>
<li><a href="/en-US/docs/WebAPI/Detecting_device_orientation">Detecting device orientation</a></li>
<li><a href="https://developer.mozilla.org/en/DOM/Orientation_and_motion_data_explained" title="Orientation and motion data explained">Orientation and motion data explained</a></li>
<li><a href="/en-US/docs/Web/API/Detecting_device_orientation">Detecting device orientation</a></li>
<li><a href="/en-US/docs/Web/Guide/Events/Orientation_and_motion_data_explained" title="Orientation and motion data explained">Orientation and motion data explained</a></li>
</ul>
22 changes: 11 additions & 11 deletions files/en-us/web/api/devicemotionevent/interval/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
title: DeviceMotionEvent.interval
slug: Web/API/DeviceMotionEvent/interval
tags:
- API
- Device Orientation
- Experimental
- Mobile
- Motion
- NeedsExample
- Orientation
- Property
- Reference
- API
- Device Orientation
- Experimental
- Mobile
- Motion
- NeedsExample
- Orientation
- Property
- Reference
---
<p>{{APIRef("Device Orientation Events")}}</p>

Expand Down Expand Up @@ -53,9 +53,9 @@ <h2 id="See_also">See also</h2>
<li>{{DOMxRef("window.ondevicemotion")}}</li>
<li>{{Event("deviceorientation")}}</li>
<li>{{DOMxRef("DeviceOrientationEvent")}}</li>
<li><a href="/en-US/docs/WebAPI/Detecting_device_orientation">Detecting device
<li><a href="/en-US/docs/Web/API/Detecting_device_orientation">Detecting device
orientation</a></li>
<li><a href="https://developer.mozilla.org/en/DOM/Orientation_and_motion_data_explained"
<li><a href="/en-US/docs/Web/Guide/Events/Orientation_and_motion_data_explained"
title="Orientation and motion data explained">Orientation and motion data
explained</a></li>
</ul>
Loading