Skip to content

Commit

Permalink
Merge branch 'main' into patch-2
Browse files Browse the repository at this point in the history
  • Loading branch information
arichiv authored May 13, 2024
2 parents 03be72c + 2d337c3 commit 2146126
Show file tree
Hide file tree
Showing 431 changed files with 2,037 additions and 720 deletions.
22 changes: 13 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,19 @@ If you've found a typo on the [JavaScript landing page][], for example, you can

1. Sign in to [GitHub](https://github.com/)
2. Navigate to [https://github.com/mdn/content](https://github.com/mdn/content)
3. Find the source file `files/en-us/web/javascript/index.md`
3. Find the source file, in this case `files/en-us/web/javascript/index.md`
4. Click the edit (pencil) button

From there, the GitHub UI will walk you through the rest by creating a [fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) and a branch to commit your changes to.
After you have made changes to your branch, the goal is to open a [pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests) for your changes to be incorporated.
After you have made changes to your branch, open a [pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests) with your changes to be incorporated.

A pull request represents the work you want to be reviewed, approved, and merged into the `main` branch of the MDN repository.
See the [Creating a pull request](#creating-a-pull-request) for more details on creating and handling pull requests successfully.

If you're not certain of the changes that you want to make, [get in touch with us][]!
If you're not certain of the changes that you want to make, [get in touch with us]!

> **Note:** You can click the **View the source on GitHub** link at the bottom of an MDN page to jump directly to the page source on GitHub.
> [!NOTE]
> You can click the **View the source on GitHub** link at the bottom of an MDN page to jump directly to the page source on GitHub.
### Forking and cloning the repository

Expand Down Expand Up @@ -191,7 +192,8 @@ To edit files and track your changes, you should use feature branches.
Feature branches are created from the `main` branch and should be named after the feature you're working on.
This will make it easier to submit a pull request for your changes.
> **Note:** Open a discussion if your changes will contain large, complex or structural changes. Ask for feedback before embarking on large tasks.
> [!NOTE]
> Open a discussion if your changes will contain large, complex or structural changes. Ask for feedback before embarking on large tasks.
1. When the server is running, make the changes you would like to make to one or more `index.md` files.
Expand Down Expand Up @@ -223,7 +225,9 @@ To ensure that all MDN documents follow the same formatting, we use both [Pretti
If you have a [local checkout](#forking-and-cloning-the-repository) of the repository and have [installed the dependencies](#preparing-the-project), or you are using [github.dev](https://github.dev), a pre-commit hook will be installed which automatically runs while making a commit. To save some headache and improve your work flow while authoring, you may wish to [configure your editor to automatically run Prettier](https://prettier.io/docs/en/editors.html). Alternatively, you may run `yarn fix:md` in the command line to manually format all Markdown files.
> **Note:** Automatically formatting changes does not work for pull requests opened using the GitHub Web UI as described in the ["Simple changes" section](#simple-changes). This may result in failed status checks on pull requests. If you're not sure about how to fix this, [get in touch with us][]! for help.
> [!NOTE]
> Automatically formatting changes does not work for pull requests opened using the GitHub Web UI as described in the ["Simple changes" section](#simple-changes).
> This may result in failed status checks on pull requests. If you're not sure about how to fix this, [get in touch with us][]! for help.
### Adding a new document
Expand All @@ -245,7 +249,7 @@ This command moves the file and fixes up redirects automatically. You can use th
yarn content move <from-slug> <to-slug> [locale]
```
> **Warning**
> [!WARNING]
> Don't edit the `_redirects.txt` file manually.
> See the [Redirecting a document](#redirecting-a-document) section for more information.
Expand Down Expand Up @@ -293,7 +297,7 @@ Let's say you want to move the entire `/en-US/Learn/Accessibility` tree to `/en-
Similar to moving files, you can delete documents or a tree of documents easily by using the `yarn content delete` command.
> **Warning:**
> [!WARNING]
> Don't delete files or directories from the repository manually; the `yarn content delete` command handles the necessary changes such as updating the `_wikihistory.json` file.
You can use this command as shown below:
Expand Down Expand Up @@ -330,7 +334,7 @@ Say you want to delete the entire `/en-US/Learn/Accessibility` tree and redirect
yarn content delete Learn/Accessibility --recursive --redirect Web/Accessibility
```
> **Warning:**
> [!WARNING]
> You should always add a redirect when deleting documents. If there is no obvious alternative, redirect to the nearest "parent" of the deleted topic.
> If you forget to redirect when deleting a file, you can do it afterwards. See the [Redirecting a document](#redirecting-a-document) section.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ for (let c = 0; c < brickInfo.count.col; c++) {
}
```

Here we're looping through the rows and columns to create the new bricks and place them on the screen. The newly created brick is enabled for the Arcade physics engine, it's body is set to be immovable (so it won't move when hit by the ball), and we're also setting the anchor to be in the middle and adding the brick to the group.
Here we're looping through the rows and columns to create the new bricks and place them on the screen. The newly created brick is enabled for the Arcade physics engine, its body is set to be immovable (so it won't move when hit by the ball), and we're also setting the anchor to be in the middle and adding the brick to the group.

The problem currently is that we're painting all the bricks in one place, at coordinates (0,0). What we need to do is draw each brick at its own x and y position. Update the `brickX` and `brickY` lines as follows:

Expand Down
1 change: 1 addition & 0 deletions files/en-us/glossary/aspect_ratio/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ myTrack.applyConstraints(constraints);
## See also

- CSS {{cssxref("aspect-ratio")}} property
- [Understanding aspect ratios](/en-US/docs/Web/CSS/CSS_box_sizing/Understanding_aspect-ratio) guide
- [CSS box sizing](/en-US/docs/Web/CSS/CSS_box_sizing) module
- {{glossary("intrinsic size")}} glossary term
- CSS {{cssxref("min-content")}}, {{cssxref("max-content")}}, and {{cssxref("fit-content")}} property values.
13 changes: 10 additions & 3 deletions files/en-us/glossary/baseline/compatibility/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,16 @@ Baseline tracks availability with the following browsers:

## Extra considerations

Baseline is a summary guide to support and doesn't cover every situation.
If your site needs to work with an older device or browser release, or a browser not covered by the Baseline status, then you may need to do your own research or testing.
If Baseline doesn't cover your situation, then consider reading browser compatibility tables on MDN or visiting [caniuse.com](https://caniuse.com/) before committing to a feature.
Baseline is a summary guide to browser support to help you make decisions before committing to use a feature in your projects.
Baseline is not a substitute for testing your application for accessibility, usability, performance, security, or other concerns.

Baseline may not tell you whether a feature works with:

- Older devices and browser releases
- Browsers not covered by the Baseline browser set, such as operating system web views
- Assistive technology, such as screen readers

If Baseline doesn't cover your situation, you can find more information in the browser compatibility tables on MDN, [caniuse.com](https://caniuse.com/), and [a11ysupport.io](https://a11ysupport.io/).

## Contributing

Expand Down
2 changes: 1 addition & 1 deletion files/en-us/glossary/developer_tools/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ page-type: glossary-definition

**Developer tools** (or "development tools" or short "DevTools") are programs that allow a developer to create, test and debug software.

Current browsers provide integrated developer tools, which allow to inspect a website. They let users inspect and debug the page's {{Glossary("HTML")}}, {{Glossary("CSS")}}, and {{Glossary("JavaScript")}}, allow to inspect the network traffic it causes, make it possible to measure it's performance, and much more.
Current browsers provide integrated developer tools, which allow to inspect a website. They let users inspect and debug the page's {{Glossary("HTML")}}, {{Glossary("CSS")}}, and {{Glossary("JavaScript")}}, allow to inspect the network traffic it causes, make it possible to measure its performance, and much more.

## See also

Expand Down
3 changes: 1 addition & 2 deletions files/en-us/glossary/tls/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ All modern browsers support the TLS protocol, requiring the server to provide a
- [RFC 8446](https://datatracker.ietf.org/doc/html/rfc8446) (The Transport Layer Security Protocol, Version 1.3)
- [RFC 5246](https://datatracker.ietf.org/doc/html/rfc5246) (The Transport Layer Security Protocol, Version 1.2)
- [Transport Layer Security](/en-US/docs/Web/Security/Transport_Layer_Security)
- [OWASP: Transport Layer Protection Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Transport_Layer_Protection_Cheat_Sheet.html)
- [Transport Layer Security Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Transport_Layer_Security_Cheat_Sheet.html) (OWASP)
- [Glossary](/en-US/docs/Glossary)

- {{Glossary("HTTPS")}}
- {{Glossary("SSL")}}
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ Or to make the top right corner have a horizontal radius of 1em, and a vertical
}
```

> **Note:** Like with the border properties above, these border-radius properties also have mapped [_logical_ border-radius properties]/en-US/docs/Web/CSS/CSS_logical_properties_and_values#properties_for_border_radius).
> **Note:** Like with the border properties above, these border-radius properties also have mapped [_logical_ border-radius properties](/en-US/docs/Web/CSS/CSS_logical_properties_and_values#properties_for_border_radius).
We have set all four corners in the example below and then changed the values for the top right corner to make it different. You can play with the values to change the corners. Take a look at the property page for {{cssxref("border-radius")}} to see the available syntax options. The [border-radius generator](/en-US/docs/Web/CSS/CSS_backgrounds_and_borders/Border-radius_generator) can be used to output rounded corner values for you.

Expand Down
2 changes: 1 addition & 1 deletion files/en-us/learn/javascript/first_steps/arrays/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Items in an array are numbered, starting from zero. This number is called the it
// shopping will now return [ "tahini", "milk", "cheese", "hummus", "noodles" ]
```

> **Note:** We've said it before, but just as a reminder — computers start counting from 0!
> **Note:** We've said it before, but just as a reminder — Javascript starts indexing arrays at zero!
3. Note that an array inside an array is called a multidimensional array. You can access an item inside an array that is itself inside another array by chaining two sets of square brackets together. For example, to access one of the items inside the array that is the third item inside the `random` array (see previous section), we could do something like this:
Expand Down
4 changes: 2 additions & 2 deletions files/en-us/learn/performance/multimedia/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ Secondly, with the adoption of Priority Hints, you can control the priority furt

### Rendering strategy: preventing jank when loading images

As images are loaded asynchronously and continue to load after the first paint, if their dimensions aren't defined before load, they can cause reflows to the page content. For example, when text gets pushed down the page by images loading. For this reason, it's critical that you set `width` and `height` attributes so that the browser can reserve space for them in the layout.
As images are loaded asynchronously and continue to load after the first paint, if their dimensions aren't defined before load, they can cause reflows to the page content. For example, when text gets pushed down the page by images loading. For this reason, it's important to set `width` and `height` attributes so that the browser can reserve space for them in the layout.

When the `width` and `height` attributes of an image are included on an HTML {{htmlelement("img")}} element, the aspect ratio of the image can be calculated by the browser prior to the image being loaded. This {{glossary("aspect ratio")}} is used to reserve the space needed to display the image, reducing or even preventing a layout shift when the image is downloaded and painted to the screen. Reducing layout shift is a major component of good user experience and web performance.
When the `width` and `height` attributes of an image are included on an HTML {{htmlelement("img")}} element, the [aspect ratio of the image](/en-US/docs/Web/CSS/CSS_box_sizing/Understanding_aspect-ratio#adjusting_aspect_ratios_of_replaced_elements) can be calculated by the browser prior to the image being loaded. This {{glossary("aspect ratio")}} is used to reserve the space needed to display the image, reducing or even preventing a layout shift when the image is downloaded and painted to the screen. Reducing layout shift is a major component of good user experience and web performance.

Browsers begin rendering content as HTML is parsed, often before all assets, including images, are downloaded. Including dimensions enable browsers to reserve a correctly-sized placeholder box for each image to appear in when the images are loaded when first rendering the page.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ exports.genre_create_post = [
} else {
// Data from form is valid.
// Check if Genre with same name already exists.
const genreExists = await Genre.findOne({ name: req.body.name }).exec();
const genreExists = await Genre.findOne({ name: req.body.name })
.collation({ locale: "en", strength: 2 })
.exec();
if (genreExists) {
// Genre exists, redirect to its detail page.
res.redirect(genreExists.url);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ const driver = new Builder().forBrowser("firefox").build();
})();
```
WebDriver will now wait for 2 seconds before filling in the form field. We then test whether its value got filled in (i.e. is not empty) by using `getAttribute()` to retrieve it's `value` attribute value, and print a message to the console if it is not empty.
WebDriver will now wait for 2 seconds before filling in the form field. We then test whether its value got filled in (i.e. is not empty) by using `getAttribute()` to retrieve its `value` attribute value, and print a message to the console if it is not empty.
> **Note:** There is also a method called [`wait()`](https://www.selenium.dev/selenium/docs/api/javascript/module/selenium-webdriver/lib/webdriver_exports_WebDriver.html#wait), which repeatedly tests a condition for a certain length of time, and then carries on executing the code. This also makes use of the [util library](https://www.selenium.dev/selenium/docs/api/javascript/module/selenium-webdriver/lib/until.html), which defines common conditions to use along with `wait()`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ browser-compat: webextensions.api.declarativeNetRequest.Rule

{{AddonSidebar}}

The object describing the actions to take for matching requests. These can be specified in the static rule resources linked by the [manifest.json's `declarative_net_request` key](Mozilla/Add-ons/WebExtensions/manifest.json/declarative_net_request), or more dynamically through the {{WebExtAPIRef("declarativeNetRequest.updateDynamicRules")}} or {{WebExtAPIRef("declarativeNetRequest.updateSessionRules")}} methods.
The object describing the actions to take for matching requests. These can be specified in the static rule resources linked by the [manifest.json's `declarative_net_request` key](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/declarative_net_request), or more dynamically through the {{WebExtAPIRef("declarativeNetRequest.updateDynamicRules")}} or {{WebExtAPIRef("declarativeNetRequest.updateSessionRules")}} methods.

See [Rules](/en-US/docs/Mozilla/Add-ons/WebExtensions/API/declarativeNetRequest#rules) on the API overview page for more information about rules.

Expand Down
8 changes: 5 additions & 3 deletions files/en-us/mozilla/firefox/releases/126/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,13 @@ This article provides information about the changes in Firefox 126 that affect d

### WebDriver conformance (WebDriver BiDi, Marionette)

#### General

#### WebDriver BiDi

#### Marionette
- Added the `contexts` argument to the `network.addIntercept` command to limit the interception of network requests to particular top-level browsing contexts ([Firefox bug 1884935](https://bugzil.la/1882260)).
- Both the commands `session.subscribe` and `session.unsubscribe` now raise an `invalid argument` error when the value of the arguments `events` or `contexts` are empty arrays ([Firefox bug 1884935](https://bugzil.la/1887871)).
- Updated the implementation of the `storage.getCookies` command to align with the Gecko default cookie behaviour. This allows the removal of the user value for the preference `network.cookie.cookieBehavior`, which was only expected to be set for our CDP implementation ([Firefox bug 1884935](https://bugzil.la/1879503)).
- Removed the `ownership` and `sandbox` arguments for the `browsingContext.locateNodes` command because they are no longer necessary ([Firefox bug 1884935](https://bugzil.la/1838152)).
- Improved error message for the `session.new` command when no capabilities are specified ([Firefox bug 1885495](https://bugzil.la/1838152)).

## Changes for add-on developers

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ Firefox 3.5 closes a security hole that made it possible to use remote chrome. T

Previously, it was possible to get a load context from a request by querying various docShell APIs. In particular, it was a common practice to use `notificationCallbacks.getInterface(nsIDOMWindow)` to get the window object associated with the load. While the older approach may work in some circumstances, it is not recommended to use it anymore ([details](https://bugzil.la/457153#c16)).

This correct and reliable way to do this is to use an `nsILoadContext` (see the [interface definition](https://mxr.mozilla.org/mozilla-central/source/docshell/base/nsILoadContext.idl) on mxr).
This correct and reliable way to do this is to use an `nsILoadContext` (see the [interface definition](https://hg.mozilla.org/mozilla-central/file/tip/docshell/base/nsILoadContext.idl)).

From JavaScript, you do it like this:

Expand Down
2 changes: 1 addition & 1 deletion files/en-us/mozilla/firefox/releases/65/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ _No changes._
### JavaScript

- {{jsxref("Intl/RelativeTimeFormat", "Intl.RelativeTimeFormat")}} is now supported ([Firefox bug 1504334](https://bugzil.la/1504334)).
- Strings now have a maximum {{jsxref("String/length","length","","1")}} of `2**30 - 2` (\~1GB) instead of `2**28 - 1` (\~256MB) ([Firefox bug 1509542](https://bugzil.la/1509542)).
- Strings now have a maximum {{jsxref("String/length","length","", 1)}} of `2**30 - 2` (\~1GB) instead of `2**28 - 1` (\~256MB) ([Firefox bug 1509542](https://bugzil.la/1509542)).
- The {{jsxref("globalThis")}} property, which always refers to the top-level global object, has been implemented ([Firefox bug 1317422](https://bugzil.la/1317422)).

### APIs
Expand Down
Loading

0 comments on commit 2146126

Please sign in to comment.