Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion files/en-us/web/css/css_animations/tips/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ This looks weird, doesn't it? That's because the only way to play an animation a
Here's what happens when the `play()` function gets called:

1. The box's list of CSS classes is reset to `"box"`. This has the effect of removing any other classes currently applied to the box, including the `"changing"` class that handles animation. In other words, we're removing the animation effect from the box. However, changes to the class list don't take effect until the style recomputation is complete and a refresh has occurred to reflect the change.
2. To be sure that the styles are recalculated, we use {{domxref("window.requestAnimationFrame()")}}, specifying a callback. Our callback gets executed just before the next repaint of the document. The problem for us is that because it's before the repaint, the style recomputation hasn't actually happened yet! So...
2. To be sure that the styles are recalculated, we use {{domxref("window.requestAnimationFrame()")}}, specifying a callback. Our callback gets executed just before the next repaint of the document. The problem for us is that because it's before the repaint, the style recomputation hasn't actually happened yet! So
3. Our callback cleverly calls `requestAnimationFrame()` a second time! This time, the callback is run before the next repaint, which is after the style recomputation has occurred. This callback adds the `"changing"` class back onto the box, so that the repaint will start the animation once again.

Of course, we also need to add an event handler to our "Run" button so it'll actually do something:
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/css/css_colors/applying_color/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ The HTML here creates a box that contains a color picker control (with a label c

#### CSS

The CSS establishes a size for the box and some basic styling for appearances. The border is also established with a 2-pixel width and a border color that won't last, courtesy of the JavaScript below\...
The CSS establishes a size for the box and some basic styling for appearances. The border is also established with a 2-pixel width and a border color.

```css
#box {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ The first part of this article, [Stacking without the z-index property](/en-US/d
The `z-index` property can be specified with an integer value (positive, zero, or negative), which represents the position of the element along the z-axis. If you are not familiar with the z-axis, imagine the page as a stack of layers, each one having a number. Layers are rendered in numerical order, with larger numbers above smaller numbers.

- bottom layer _(farthest from the observer)_
- ...
-
- Layer -3
- Layer -2
- Layer -1
- Layer 0 _(default rendering layer)_
- Layer 1
- Layer 2
- Layer 3
- ...
-
- top layer _(closest to the observer)_

> **Note:**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ To better understand the situation, here is the stacking context hierarchy:
- LEVEL #2 (z-index: 1)

- LEVEL #3
- ...
-
- LEVEL #3

- LEVEL #2 (z-index: 1)
- ...
-
- LEVEL #2 (z-index: 1)

- LEVEL #1
- ...
-
- LEVEL #1

This problem can be avoided by removing overlapping between different level menus, or by using individual (and different) `z-index` values assigned through the id selector instead of class selector, or by flattening the HTML hierarchy.
Expand Down
4 changes: 2 additions & 2 deletions files/en-us/web/css/position/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,13 +254,13 @@ Fixed positioning is similar to absolute positioning, with the exception that th

### Sticky positioning

Sticky positioning can be thought of as a hybrid of relative and fixed positioning when it nearest scrolling ancestor is viewport. A stickily positioned element is treated as relatively positioned until it crosses a specified threshold, at which point it is treated as fixed until it reaches the boundary of its parent. For instance...
Sticky positioning can be thought of as a hybrid of relative and fixed positioning when it nearest scrolling ancestor is viewport. A stickily positioned element is treated as relatively positioned until it crosses a specified threshold, at which point it is treated as fixed until it reaches the boundary of its parent. For example,

```css
#one { position: sticky; top: 10px; }
```

...would position the element with id _one_ relatively until the viewport were scrolled such that the element would be less than 10 pixels from the top. Beyond that threshold, the element would be fixed to 10 pixels from the top.
Above CSS rule would position the element with id _one_ relatively until the viewport were scrolled such that the element would be less than 10 pixels from the top. Beyond that threshold, the element would be fixed to 10 pixels from the top.

A common use for sticky positioning is for the headings in an alphabetized list. The "B" heading will appear just below the items that begin with "A" until they are scrolled offscreen. Rather than sliding offscreen with the rest of the content, the "B" heading will then remain fixed to the top of the viewport until all the "B" items have scrolled offscreen, at which point it will be covered up by the "C" heading, and so on.

Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/html/attributes/readonly/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ The only way to modify dynamically the value of the readonly attribute is throug

### Usability

Browsers display the `readonly` attribute...
Browsers display the `readonly` attribute

### Constraint validation

Expand Down
6 changes: 2 additions & 4 deletions files/en-us/web/html/element/base/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,9 @@ If multiple `<base>` elements are used, only the first `href` and first `target`

### In-page anchors

Links pointing to a fragment in the document — e.g. `<a href="#some-id">` — are resolved with the `<base>`, triggering an HTTP request to the base URL with the fragment attached. For example:
Links pointing to a fragment in the document — e.g. `<a href="#some-id">` — are resolved with the `<base>`, triggering an HTTP request to the base URL with the fragment attached.

1. Given `<base href="https://example.com">`
2. ...and this link: `<a href="#anchor">To anchor</a>`
3. ...the link points to `https://example.com/#anchor`.
For example, given `<base href="https://example.com">` and this link: `<a href="#anchor">To anchor</a>`. The link points to `https://example.com/#anchor`.

### Open Graph

Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/html/element/picture/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ If the {{HTMLElement("source")}}'s media condition evaluates to `false`, the bro

The [{{htmlattrdef("srcset")}}](/en-US/docs/Web/HTML/Element/source#attr-srcset) attribute is used to offer list of possible images _based on size_.

It is composed of a comma-separated list of image descriptors. Each image descriptor is composed of a URL of the image, and _either..._
It is composed of a comma-separated list of image descriptors. Each image descriptor is composed of a URL of the image, and _either_

- a _width descriptor_, followed by a `w` (such as `300w`);
_OR_
Expand Down
9 changes: 0 additions & 9 deletions files/en-us/web/http/link_prefetching_faq/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,6 @@ Browsers based on Mozilla 1.2 (or later), as well as browsers based on Mozilla 1

Along with the referral and URL-following implications already mentioned above, prefetching will generally cause the cookies of the prefetched site to be accessed. (For example, if you google amazon, the Google results page will prefetch `www.amazon.com`, causing amazon cookies to be sent back and forth. You can block 3rd party cookies in Firefox, see [Disabling third party cookies](https://support.mozilla.org/en-US/kb/third-party-cookies-firefox-tracking-protection).)

### What about...?

If you have any questions or comments about link prefetching, please feel free to send them my way :-)

#### See also

[Prefetching Hints](https://www.edochan.com/programming/pf.htm)

## Original Document Information

- Author(s): Darin Fisher (darin at meer dot net)
- Last Updated Date: Updated: March 3, 2003
Comment on lines -125 to -128
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to keep this one (unfortunately).

4 changes: 2 additions & 2 deletions files/en-us/web/javascript/guide/functions/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ Within the function body, the following are all equivalent:

A function that calls itself is called a _recursive function_. In some ways, recursion is analogous to a loop. Both execute the same code multiple times, and both require a condition (to avoid an infinite loop, or rather, infinite recursion in this case).

For example, the following loop...
For example, the following loop:

```js
let x = 0;
Expand All @@ -281,7 +281,7 @@ while (x < 10) { // "x < 10" is the loop condition
}
```

...can be converted into a recursive function declaration, followed by a call to that function:
Can be converted into a recursive function declaration, followed by a call to that function:

```js
function loop(x) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ The `Number` prototype provides methods for retrieving information from `Number`

## Math object

The built-in {{jsxref("Math")}} object has properties and methods for mathematical constants and functions. For example, the `Math` object's `PI` property has the value of pi (3.141...), which you would use in an application as
The built-in {{jsxref("Math")}} object has properties and methods for mathematical constants and functions. For example, the `Math` object's `PI` property has the value of pi (3.141), which you would use in an application as

```js
Math.PI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -518,9 +518,9 @@ This page provides an overall cheat sheet of all the capabilities of `RegExp` sy
usually just the order of the capturing groups themselves. This
becomes important when capturing groups are nested. Matches are
accessed using the index of the result's elements (<code
>[1], ..., [n]</code
>[1], , [n]</code
>) or from the predefined <code>RegExp</code> object's properties
(<code>$1, ..., $9</code>).
(<code>$1, , $9</code>).
</p>
<p>
Capturing groups have a performance penalty. If you don't need the
Expand Down Expand Up @@ -567,8 +567,8 @@ This page provides an overall cheat sheet of all the capabilities of `RegExp` sy
<td>
<strong>Non-capturing group: </strong>Matches "x" but does not remember
the match. The matched substring cannot be recalled from the resulting
array's elements (<code>[1], ..., [n]</code>) or from the predefined
<code>RegExp</code> object's properties (<code>$1, ..., $9</code>).
array's elements (<code>[1], , [n]</code>) or from the predefined
<code>RegExp</code> object's properties (<code>$1, , $9</code>).
</td>
</tr>
<tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ Groups group multiple patterns as a whole, and capturing groups provide extra su
usually just the order of the capturing groups themselves. This
becomes important when capturing groups are nested. Matches are
accessed using the index of the result's elements (<code
>[1], ..., [n]</code
>[1], , [n]</code
>) or from the predefined <code>RegExp</code> object's properties
(<code>$1, ..., $9</code>).
(<code>$1, , $9</code>).
</p>
<p>
Capturing groups have a performance penalty. If you don't need the
Expand Down Expand Up @@ -91,8 +91,8 @@ Groups group multiple patterns as a whole, and capturing groups provide extra su
<td>
<strong>Non-capturing group: </strong>Matches "x" but does not remember
the match. The matched substring cannot be recalled from the resulting
array's elements (<code>[1], ..., [n]</code>) or from the predefined
<code>RegExp</code> object's properties (<code>$1, ..., $9</code>).
array's elements (<code>[1], , [n]</code>) or from the predefined
<code>RegExp</code> object's properties (<code>$1, , $9</code>).
</td>
</tr>
<tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,4 @@ Array.from(myEmptyIterable); // []
- {{jsxref("Object.entries")}}
- {{jsxref("Map")}}
- [generators](/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators#generators)
- [forof](/en-US/docs/Web/JavaScript/Guide/Loops_and_iteration#for...of_statement)
- [for...of](/en-US/docs/Web/JavaScript/Guide/Loops_and_iteration#for...of_statement)
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ The properties and elements returned from this match are as follows:
<td><code>"dbBd"</code></td>
</tr>
<tr>
<td><code>[1], ...[n]</code><br />{{ReadOnlyInline}}</td>
<td><code>[1], [n]</code><br />{{ReadOnlyInline}}</td>
<td>
Elements that specify the parenthesized substring matches (if included)
in the regular expression. The number of possible parenthesized
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ Where:

| Format String | Description |
| ------------- | ------------------------------------------------------------ |
| `Www` | Day of week, as three letters (e.g. Sun, Mon, ...) |
| `Www` | Day of week, as three letters (e.g. Sun, Mon, ) |
| `dd` | Day of month, as two digits with leading zero if required |
| `Mmm` | Month, as three letters (e.g. Jan, Feb, ...) |
| `Mmm` | Month, as three letters (e.g. Jan, Feb, ) |
| `yyyy` | Year, as four or more digits with leading zeroes if required |
| `hh` | Hour, as two digits with leading zero if required |
| `mm` | Minute, as two digits with leading zero if required |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ A locale identifier is a string that consists of:
5. (optionally) one or more BCP 47 extension sequences, and
6. (optionally) a private-use extension sequence

...with all present subtags and sequences separated by hyphens. Locale identifiers are case-insensitive ASCII. However, it's conventional to use title case (first letter capitalized, successive letters lower case) for script subtags, upper case for region subtags, and lower case for everything else. For example:
With all present subtags and sequences separated by hyphens. Locale identifiers are case-insensitive ASCII. However, it's conventional to use title case (first letter capitalized, successive letters lower case) for script subtags, upper case for region subtags, and lower case for everything else. For example:

- "`hi`": Hindi (language)
- "`de-AT`": German (language) as used in Austria (region)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,9 @@ JavaScript is _not_ JSON.
- **Numbers**
- : Leading zeros are prohibited. A decimal point must be followed by at least one
digit. `NaN` and `Infinity` are unsupported.
- **Any JSON text is a valid JavaScript expression...**
- : ...But only in JavaScript engines that have implemented
the [proposal to make all JSON text valid ECMA-262](https://github.com/tc39/proposal-json-superset).
In engines that haven't implemented the proposal, U+2028 LINE
SEPARATOR and U+2029 PARAGRAPH SEPARATOR are allowed in string literals and property
keys in JSON; but their use in these features in JavaScript string literals is a
{{jsxref("SyntaxError")}}.

Any JSON text is a valid JavaScript expression, but only in JavaScript engines that have implemented the [proposal to make all JSON text valid ECMA-262](https://github.com/tc39/proposal-json-superset).
In engines that haven't implemented the proposal, U+2028 LINE SEPARATOR and U+2029 PARAGRAPH SEPARATOR are allowed in string literals and property keys in JSON; but their use in these features in JavaScript string literals is a {{jsxref("SyntaxError")}}.

Consider this example where {{jsxref("JSON.parse()")}} parses the string as JSON and
{{jsxref("Global_Objects/eval", "eval")}} executes the string as JavaScript:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ The natural logarithm (base {{jsxref("Math.E", "e")}}) of `1` plus the given num

For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off.

When you calculate log(1 + x) where x is a small positive number, you should get an answer very close to x, because <math display="inline"><semantics><mrow><munder><mo movablelimits="true" form="prefix">lim</mo><mrow ><mi>x</mi><mo stretchy="false">→</mo><mn>0</mn></mrow></munder><mfrac><mrow><mi>log</mi><mo>⁡</mo><mo stretchy="false">(</mo><mn>1</mn><mo>+</mo><mi>x</mi><mo stretchy="false">)</mo></mrow><mi>x</mi></mfrac><mo>=</mo><mn>1</mn></mrow><annotation encoding="TeX">\lim_{x \to 0} \frac{\log(1+x)}{x} = 1</annotation></semantics></math>. If you calculate `Math.log(1 + 1.1111111111e-15)`, you should get an answer close to `1.1111111111e-15`. Instead, you will end up taking the logarithm of `1.00000000000000111022` (the roundoff is in binary, so sometimes it gets ugly), and get the answer 1.11022...e-15, with only 3 correct digits. If, instead, you calculate `Math.log1p(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111110999995e-15`, with 15 correct digits of precision (actually 16 in this case).
When you calculate log(1 + x) where x is a small positive number, you should get an answer very close to x, because <math display="inline"><semantics><mrow><munder><mo movablelimits="true" form="prefix">lim</mo><mrow ><mi>x</mi><mo stretchy="false">→</mo><mn>0</mn></mrow></munder><mfrac><mrow><mi>log</mi><mo>⁡</mo><mo stretchy="false">(</mo><mn>1</mn><mo>+</mo><mi>x</mi><mo stretchy="false">)</mo></mrow><mi>x</mi></mfrac><mo>=</mo><mn>1</mn></mrow><annotation encoding="TeX">\lim_{x \to 0} \frac{\log(1+x)}{x} = 1</annotation></semantics></math>. If you calculate `Math.log(1 + 1.1111111111e-15)`, you should get an answer close to `1.1111111111e-15`. Instead, you will end up taking the logarithm of `1.00000000000000111022` (the roundoff is in binary, so sometimes it gets ugly), and get the answer 1.11022…e-15, with only 3 correct digits. If, instead, you calculate `Math.log1p(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111110999995e-15`, with 15 correct digits of precision (actually 16 in this case).

If the value of `x` is less than -1, the return value is always {{jsxref("NaN")}}.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ A string representing the object.

## Description

An object's `toString()` method is most commonly invoked when that object undergoes...
An object's `toString()` method is most commonly invoked when that object undergoes

- explicit {{Glossary("type conversion")}} to a string (for example, `{{jsxref("String/String", "String")}}(myObject)`)
- implicit {{Glossary("type coercion")}} into a string (for example, `myObject + "hello world"`)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ The following table shows the state of `result` after running this script:
<td><code>"Quick Brown Fox Jumps"</code></td>
</tr>
<tr>
<td><code>[1], ...[<var>n</var>]</code></td>
<td><code>[1], [<var>n</var>]</code></td>
<td>
<p>The parenthesized substring matches, if any.</p>
<p>The number of possible parenthesized substrings is unlimited.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The legacy RegExp **$1, $2, $3, $4, $5, $6, $7, $8, $9** properties are static a

## Description

The $1, ..., $9 properties are static, they are not a property of an individual regular expression object. Instead, you always use them as `RegExp.$1`, ..., `RegExp.$9`.
The $1, , $9 properties are static, they are not a property of an individual regular expression object. Instead, you always use them as `RegExp.$1`, , `RegExp.$9`.

The values of these properties are read-only and modified whenever successful matches are made.

Expand Down
Loading