From 64e41e9df3b1c78a41e085f890514b138175e851 Mon Sep 17 00:00:00 2001 From: Estelle Weyl Date: Wed, 8 Nov 2023 22:43:14 -0800 Subject: [PATCH 01/52] Minor: remove fallback for grid: css cookbook (#30142) * Minor: remove fallback for grid: css cookbook * Minor: remove fallback for grid: css cookbook --- .../layout_cookbook/media_objects/index.md | 38 ++++--------------- 1 file changed, 8 insertions(+), 30 deletions(-) diff --git a/files/en-us/web/css/layout_cookbook/media_objects/index.md b/files/en-us/web/css/layout_cookbook/media_objects/index.md index c8c7d95637b44fc..e262f954cc1d600 100644 --- a/files/en-us/web/css/layout_cookbook/media_objects/index.md +++ b/files/en-us/web/css/layout_cookbook/media_objects/index.md @@ -2,14 +2,12 @@ title: "Recipe: Media objects" slug: Web/CSS/Layout_cookbook/Media_objects page-type: guide -browser-compat: - - css.properties.grid-template-areas - - css.properties.float +browser-compat: css.properties.grid --- {{CSSRef}} -The _Media Object_ is a pattern we see all over the web. [Named by Nicole Sullivan](http://www.stubbornella.org/content/2010/06/25/the-media-object-saves-hundreds-of-lines-of-code/) it refers to a two-column box with an image on one side and descriptive text on the other, e.g. a facebook post or tweet. +The _Media Object_ is a pattern we see all over the web. It refers to a two-column box with an image on one side and descriptive text on the other, e.g. a social media post. ![Example of a media object with profile image on the left side and lorem ipsum text to the right filling up 80% of the space](media-object.png) @@ -33,9 +31,9 @@ Media Object pattern needs some or all of the following characteristics: ## Choices made -I have chosen to use [Grid Layout](/en-US/docs/Web/CSS/CSS_grid_layout) for the media object as it allows me to control the layout in two dimensions when I need to. This means that when we have a footer, with short content above, the footer can be pushed down to the bottom of the media object. +I have chosen to use [grid layout](/en-US/docs/Web/CSS/CSS_grid_layout) for the media object as it allows me to control the layout in two dimensions when I need to. This means that when we have a footer, with short content above, the footer can be pushed down to the bottom of the media object. -Another reason to use Grid Layout is in order that I can use {{cssxref("fit-content")}} for the track sizing of the image. By using `fit-content` with a maximum size of 200 pixels, when we have a small image such as the icon, the track only gets as large as the size of that image — the `max-content` size. If the image is larger, the track stops growing at 200 pixels and as the image has a {{cssxref("max-width")}} of 100% applied, it scales down so that it continues to fit inside the column. +Another reason to use grid layout is in order that I can use {{cssxref("fit-content")}} for the track sizing of the image. By using `fit-content` with a maximum size of 200 pixels, when we have a small image such as the icon, the track only gets as large as the size of that image — the `max-content` size. If the image is larger, the track stops growing at 200 pixels and as the image has a {{cssxref("max-width")}} of 100% applied, it scales down so that it continues to fit inside the column. By using {{cssxref("grid-template-areas")}} to achieve the layout, I can see the pattern in the CSS. I define my grid once we have a max-width of 500 pixels, so on smaller devices the media object stacks. @@ -43,28 +41,8 @@ An option for the pattern is to flip it to switch the image to the other side When we nest one media object inside another we need to place it into the second track in the regular layout, and the first track when flipped. -## Fallbacks +## See also -There are a number of possible fallbacks for this pattern, depending on the browsers you wish to support. A good catch-all would be to float the image left, and to add a clearfix to the box to ensure that it contained the floats. - -{{EmbedGHLiveSample("css-examples/css-cookbook/media-objects-fallback.html", '100%', 3000)}} - -> **Callout:** -> -> [Download this example](https://github.com/mdn/css-examples/blob/main/css-cookbook/media-objects-fallback--download.html) - -Once floated elements become grid items the float no longer applies so you don't need to do anything special to clear the float. - -What you will need to do is remove any margins applied to the item, and any widths which we don't need in a grid context (we have the {{cssxref("gap")}} property to control it in grids, and the track takes control of the sizing). - -## Relevant resources on MDN - -- [CSS Grid Layout](/en-US/docs/Web/CSS/CSS_grid_layout) -- [Progressive Enhancement and Grid Layout](/en-US/docs/Web/CSS/CSS_grid_layout/Grid_layout_and_progressive_enhancement) -- [Using Grid Template Areas](/en-US/docs/Web/CSS/CSS_grid_layout/Grid_template_areas) -- [fit-content](/en-US/docs/Web/CSS/fit-content) -- [Grid-template-areas](/en-US/docs/Web/CSS/CSS_grid_layout/Grid_template_areas) - -## Browser compatibility - -{{Compat}} +- {{cssxref("fit-content")}} property +- [Using grid template areas](/en-US/docs/Web/CSS/CSS_grid_layout/Grid_template_areas) +- [CSS grid layout](/en-US/docs/Web/CSS/CSS_grid_layout) module From f352aa1f967cdecbbc1b145836a0f32009085ff0 Mon Sep 17 00:00:00 2001 From: Victor Ezekiel <43010620+ibkvictor@users.noreply.github.com> Date: Thu, 9 Nov 2023 07:47:45 +0100 Subject: [PATCH 02/52] Fix command line to run Prettier (#30141) Update index.md edited portion ``` prettier -v ``` changed to ``` npx prettier -v ``` --- .../introducing_complete_toolchain/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/en-us/learn/tools_and_testing/understanding_client-side_tools/introducing_complete_toolchain/index.md b/files/en-us/learn/tools_and_testing/understanding_client-side_tools/introducing_complete_toolchain/index.md index ac3187af4d23422..c2b027ad598514c 100644 --- a/files/en-us/learn/tools_and_testing/understanding_client-side_tools/introducing_complete_toolchain/index.md +++ b/files/en-us/learn/tools_and_testing/understanding_client-side_tools/introducing_complete_toolchain/index.md @@ -139,7 +139,7 @@ We'll be using Prettier, which we first met in Chapter 2, to tidy our code in th You can check whether you've already got it installed globally using the following command: ```bash -prettier -v +npx prettier -v ``` If installed, you'll get a version number returned like 2.0.2; if not, it'll return something along the lines of "command not found". If this is the case, install it using the following command: From e6f3d674aff436f22b7a4e5bb59a02161492d1ef Mon Sep 17 00:00:00 2001 From: Estelle Weyl Date: Wed, 8 Nov 2023 22:48:57 -0800 Subject: [PATCH 03/52] minor: edits to pagination cookbook (#30143) --- .../css/layout_cookbook/pagination/index.md | 26 ++++++------------- 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/files/en-us/web/css/layout_cookbook/pagination/index.md b/files/en-us/web/css/layout_cookbook/pagination/index.md index 4092a6cbeb9e6f9..c79fa0d4d629908 100644 --- a/files/en-us/web/css/layout_cookbook/pagination/index.md +++ b/files/en-us/web/css/layout_cookbook/pagination/index.md @@ -2,9 +2,7 @@ title: Pagination slug: Web/CSS/Layout_cookbook/Pagination page-type: guide -browser-compat: - - css.properties.justify-content - - css.properties.column-gap.flex_context +browser-compat: css.properties.flex --- {{CSSRef}} @@ -31,11 +29,7 @@ Typically, the pagination component will be centered horizontally underneath the This pattern is laid out using [flexbox](/en-US/docs/Web/CSS/CSS_flexible_box_layout) — one flex container nested inside another. The {{htmlelement("nav")}} element is designated a flex container in order that we can center the list inside using the {{cssxref("justify-content")}} property. -The list itself also becomes a flex container to lay the items out as a row. To space the items out we will use a {{cssxref("margin")}} on the flex items. - -## Alternative methods - -Once the {{cssxref("column-gap")}} property has implementation in browsers this could be used instead of margins to space out the items. +The list itself also becomes a flex container to lay the items out as a row. To space the items out we can either use a {{cssxref("margin")}} on the flex items or add a {{cssxref("gap")}} on the flex container. ```css .pagination { @@ -43,7 +37,7 @@ Once the {{cssxref("column-gap")}} property has implementation in browsers this margin: 0; padding: 0; display: flex; - column-gap: 2px; + gap: 2px; } ``` @@ -59,14 +53,10 @@ The "See Also" section at the end of this document has links to related accessib {{Specifications}} -## Browser compatibility - -{{Compat}} - ## See also -- {{Cssxref("justify-content")}}, {{Cssxref("column-gap")}} -- [Know your ARIA: 'Hidden' vs 'None'](https://www.scottohara.me/blog/2018/05/05/hidden-vs-none.html) -- [Invisible content just for screen reader users](https://webaim.org/techniques/css/invisiblecontent/#techniques) -- [Writing CSS With Accessibility in mind](https://medium.com/@matuzo/writing-css-with-accessibility-in-mind-8514a0007939) -- [a11y Style Guide: Pagination](https://a11y-style-guide.com/style-guide/section-navigation.html#kssref-navigation-pagination) +- {{Cssxref("justify-content")}}, {{Cssxref("gap")}} +- [Know your ARIA: 'hidden' vs 'none'](https://www.scottohara.me/blog/2018/05/05/hidden-vs-none.html) (2018) +- [Invisible content just for screen reader users](https://webaim.org/techniques/css/invisiblecontent/#techniques) via WebAIM.org (2020) +- [Writing CSS with accessibility in mind](https://medium.com/@matuzo/writing-css-with-accessibility-in-mind-8514a0007939) (2017) +- [a11y style guide: pagination](https://a11y-style-guide.com/style-guide/section-navigation.html#kssref-navigation-pagination) From 7e4769a3d501efb76e7cf92198b0589ab28f1864 Mon Sep 17 00:00:00 2001 From: wbamberg Date: Wed, 8 Nov 2023 23:03:33 -0800 Subject: [PATCH 04/52] De-XHR, part 1 (#30135) --- files/en-us/web/api/document/lastmodified/index.md | 7 ++----- .../how_to_create_a_dom_tree/index.md | 10 +++++----- .../web/api/eventtarget/addeventlistener/index.md | 2 +- files/en-us/web/api/eventtarget/index.md | 2 +- .../web/api/indexeddb_api/basic_terminology/index.md | 2 +- files/en-us/web/api/mediasource/endofstream/index.md | 4 ++-- files/en-us/web/api/pushmanager/index.md | 2 +- files/en-us/web/api/pushmanager/subscribe/index.md | 2 +- .../api/serviceworkerregistration/pushmanager/index.md | 2 +- files/en-us/web/api/streams_api/concepts/index.md | 2 +- files/en-us/web/api/web_workers_api/index.md | 4 +++- .../web/api/web_workers_api/using_web_workers/index.md | 8 +++++--- .../en-us/web/api/webrtc_api/session_lifetime/index.md | 2 +- .../webrtc_api/signaling_and_video_calling/index.md | 2 +- files/en-us/web/api/worker/index.md | 2 +- files/en-us/web/api/xmlserializer/index.md | 1 - 16 files changed, 27 insertions(+), 27 deletions(-) diff --git a/files/en-us/web/api/document/lastmodified/index.md b/files/en-us/web/api/document/lastmodified/index.md index 8256bbc055ecae2..0ac969169484862 100644 --- a/files/en-us/web/api/document/lastmodified/index.md +++ b/files/en-us/web/api/document/lastmodified/index.md @@ -9,7 +9,7 @@ browser-compat: api.Document.lastModified {{APIRef("DOM")}} The **`lastModified`** property of the {{domxref("Document")}} -interface returns a string containing the date and time on which the current document +interface returns a string containing the date and local time on which the current document was last modified. ## Value @@ -85,10 +85,7 @@ if (Number.isNaN(lastVisit) || lastModif > lastVisit) { } ``` -> **Note:** WebKit returns the time string in UTC; Gecko returns a time in the local timezone. (See: [Bug 4363 – document.lastModified returns date in UTC time, but should return it in local time](https://webkit.org/b/4363)) - -If you want to know **whether _an external page_ has changed**, -please read [this paragraph about the `XMLHttpRequest()` API](/en-US/docs/Web/API/XMLHttpRequest_API/Using_XMLHttpRequest#get_last_modified_date). +If you want to know whether an _external_ page has changed, you can make a {{HTTPMethod("HEAD")}} request using the {{domxref("fetch()")}} API, and examine the {{HTTPHeader("Last-Modified")}} response header. ## Specifications diff --git a/files/en-us/web/api/document_object_model/how_to_create_a_dom_tree/index.md b/files/en-us/web/api/document_object_model/how_to_create_a_dom_tree/index.md index 176578ed1635c18..d5a752d84ab26d7 100644 --- a/files/en-us/web/api/document_object_model/how_to_create_a_dom_tree/index.md +++ b/files/en-us/web/api/document_object_model/how_to_create_a_dom_tree/index.md @@ -83,14 +83,14 @@ doc.appendChild(peopleElem); DOM trees can be: -- [queried using XPath expressions](/en-US/docs/Web/XPath/Introduction_to_using_XPath_in_JavaScript) -- converted to strings using [XMLSerializer](/en-US/docs/Web/Guide/Parsing_and_serializing_XML) -- [posted to a web server](/en-US/docs/Web/API/XMLHttpRequest) using `XMLHttpRequest` -- transformed using [XSLT](/en-US/docs/Web/XSLT) or [XLink](/en-US/docs/Glossary/XLink). +- [Queried using XPath expressions](/en-US/docs/Web/XPath/Introduction_to_using_XPath_in_JavaScript). +- Converted to strings using [XMLSerializer](/en-US/docs/Web/Guide/Parsing_and_serializing_XML). +- [Posted to a web server](/en-US/docs/Web/API/Fetch_API) using the Fetch API. +- Transformed using [XSLT](/en-US/docs/Web/XSLT) or [XLink](/en-US/docs/Glossary/XLink). ## See also - [XML](/en-US/docs/Web/XML) - [XPath](/en-US/docs/Web/XPath) - [Parsing and serializing XML](/en-US/docs/Web/Guide/Parsing_and_serializing_XML) -- [XMLHttpRequest](/en-US/docs/Web/API/XMLHttpRequest) +- [Fetch API](/en-US/docs/Web/API/Fetch_API) diff --git a/files/en-us/web/api/eventtarget/addeventlistener/index.md b/files/en-us/web/api/eventtarget/addeventlistener/index.md index 6f517614f8366ca..d5e8bae59d55500 100644 --- a/files/en-us/web/api/eventtarget/addeventlistener/index.md +++ b/files/en-us/web/api/eventtarget/addeventlistener/index.md @@ -12,7 +12,7 @@ The **`addEventListener()`** method of the {{domxref("EventTarget")}} interface sets up a function that will be called whenever the specified event is delivered to the target. Common targets are {{domxref("Element")}}, or its children, {{domxref("Document")}}, and {{domxref("Window")}}, -but the target may be any object that supports events (such as {{domxref("XMLHttpRequest")}}). +but the target may be any object that supports events (such as {{domxref("IDBRequest")}}). > **Note:** The `addEventListener()` method is the _recommended_ way to register an event listener. The benefits are as follows: > diff --git a/files/en-us/web/api/eventtarget/index.md b/files/en-us/web/api/eventtarget/index.md index ae8d0f63449cd1f..b77ad3b583f8ebb 100644 --- a/files/en-us/web/api/eventtarget/index.md +++ b/files/en-us/web/api/eventtarget/index.md @@ -12,7 +12,7 @@ In other words, any target of events implements the three methods associated wit {{domxref("Element")}}, and its children, as well as {{domxref("Document")}} and {{domxref("Window")}}, are the most common event targets, but other objects can be event targets, too. -For example {{domxref("XMLHttpRequest")}}, {{domxref("AudioNode")}}, and {{domxref("AudioContext")}} are also event targets. +For example {{domxref("IDBRequest")}}, {{domxref("AudioNode")}}, and {{domxref("AudioContext")}} are also event targets. Many event targets (including elements, documents, and windows) also support setting [event handlers](/en-US/docs/Web/Events/Event_handlers) via `onevent` properties and attributes. diff --git a/files/en-us/web/api/indexeddb_api/basic_terminology/index.md b/files/en-us/web/api/indexeddb_api/basic_terminology/index.md index 6d9e4378b3a4d2b..ea95f63ece15969 100644 --- a/files/en-us/web/api/indexeddb_api/basic_terminology/index.md +++ b/files/en-us/web/api/indexeddb_api/basic_terminology/index.md @@ -27,7 +27,7 @@ If you have assumptions from working with other types of databases, you might ge This transaction model is really useful when you consider what might happen if a user opened two instances of your web app in two different tabs simultaneously. Without transactional operations, the two instances could interfere with each other's modifications. If you are not familiar with transactions in a database, read the [Wikipedia article on transactions](https://en.wikipedia.org/wiki/Database_transaction). Also see [transaction](#transaction) under the Definitions section. -- **The IndexedDB API is mostly asynchronous.** The API doesn't give you data by returning values; instead, you have to pass a callback function. You don't "store" a value into the database, or "retrieve" a value out of the database through synchronous means. Instead, you "request" that a database operation happens. You get notified by a DOM event when the operation finishes, and the type of event you get lets you know if the operation succeeded or failed. This sounds a little complicated at first, but there are sanity measures baked in. It's not that different from the way that [XMLHttpRequest](/en-US/docs/Web/API/XMLHttpRequest) works. +- **The IndexedDB API is mostly asynchronous.** The API doesn't give you data by returning values; instead, you have to pass a callback function. You don't "store" a value into the database, or "retrieve" a value out of the database through synchronous means. Instead, you "request" that a database operation happens. You get notified by a DOM event when the operation finishes, and the type of event you get lets you know if the operation succeeded or failed. - **IndexedDB uses a lot of requests.** Requests are objects that receive the success or failure DOM events that were mentioned previously. They have `onsuccess` and `onerror` properties, and you can call `addEventListener()` and `removeEventListener()` on them. They also have `readyState`, `result`, and `errorCode` properties that tell you the status of the request. The `result` property is particularly magical, as it can be many different things, depending on how the request was generated (for example, an `IDBCursor` instance, or the key for a value that you just inserted into the database). - **IndexedDB uses DOM events to notify you when results are available.** DOM events always have a `type` property (in IndexedDB, it is most commonly set to `"success"` or `"error"`). DOM events also have a `target` property that indicates where the event is headed. In most cases, the `target` of an event is the `IDBRequest` object that was generated as a result of doing some database operation. Success events don't bubble up and they can't be canceled. Error events, on the other hand, do bubble, and can be cancelled. This is quite important, as error events abort whatever transactions they're running in, unless they are cancelled. - **IndexedDB is object-oriented.** IndexedDB is not a relational database with tables representing collections of rows and columns. This important and fundamental difference affects the way you design and build your applications. diff --git a/files/en-us/web/api/mediasource/endofstream/index.md b/files/en-us/web/api/mediasource/endofstream/index.md index 3e8f6efd2e22714..990d61d84cc7ade 100644 --- a/files/en-us/web/api/mediasource/endofstream/index.md +++ b/files/en-us/web/api/mediasource/endofstream/index.md @@ -29,8 +29,8 @@ endOfStream(endOfStreamError) - : Terminates playback and signals that a network error has occurred. This can be used create a custom error handler related to media streams. For example, you might have a function that handles media chunk requests, separate - from other network requests. When you make an [XMLHttpRequest](/en-US/docs/Web/API/XMLHttpRequest) call for a media - chunk, and `onabort` or `onerror` triggers, you might want + from other network requests. When you make a {{domxref("fetch()")}} request for a media + chunk and receive a network error, you might want to call `endOfStream('network')`, display a descriptive message in the UI, and maybe retry the network request immediately or wait until the network is back up (via some kind of polling.) diff --git a/files/en-us/web/api/pushmanager/index.md b/files/en-us/web/api/pushmanager/index.md index 395fca0d379e55b..3ed7cfb6ec163de 100644 --- a/files/en-us/web/api/pushmanager/index.md +++ b/files/en-us/web/api/pushmanager/index.md @@ -53,7 +53,7 @@ navigator.serviceWorker console.log(pushSubscription.endpoint); // The push subscription details needed by the application // server are now available, and can be sent to it using, - // for example, an XMLHttpRequest. + // for example, the fetch() API. }, (error) => { console.error(error); diff --git a/files/en-us/web/api/pushmanager/subscribe/index.md b/files/en-us/web/api/pushmanager/subscribe/index.md index 8f06bdb4d96dfed..6446539282ccee6 100644 --- a/files/en-us/web/api/pushmanager/subscribe/index.md +++ b/files/en-us/web/api/pushmanager/subscribe/index.md @@ -70,7 +70,7 @@ navigator.serviceWorker.ready.then((serviceWorkerRegistration) => { console.log(pushSubscription.endpoint); // The push subscription details needed by the application // server are now available, and can be sent to it using, - // for example, an XMLHttpRequest. + // for example, the fetch() API. }, (error) => { // During development it often helps to log errors to the diff --git a/files/en-us/web/api/serviceworkerregistration/pushmanager/index.md b/files/en-us/web/api/serviceworkerregistration/pushmanager/index.md index d45030c8622c42b..e9b4ed60d43157a 100644 --- a/files/en-us/web/api/serviceworkerregistration/pushmanager/index.md +++ b/files/en-us/web/api/serviceworkerregistration/pushmanager/index.md @@ -36,7 +36,7 @@ navigator.serviceWorker console.log(pushSubscription.endpoint); // The push subscription details needed by the application // server are now available, and can be sent to it using, - // for example, an XMLHttpRequest. + // for example, the fetch() API. }, (error) => { // During development it often helps to log errors to the diff --git a/files/en-us/web/api/streams_api/concepts/index.md b/files/en-us/web/api/streams_api/concepts/index.md index 7eb935b6d59f6a7..7e9448b548e7a02 100644 --- a/files/en-us/web/api/streams_api/concepts/index.md +++ b/files/en-us/web/api/streams_api/concepts/index.md @@ -15,7 +15,7 @@ A readable stream is a data source represented in JavaScript by a {{domxref("Rea There are two types of underlying source: - **Push sources** constantly push data at you when you've accessed them, and it is up to you to start, pause, or cancel access to the stream. Examples include video streams and TCP/[Web sockets](/en-US/docs/Web/API/WebSockets_API). -- **Pull sources** require you to explicitly request data from them once connected to. Examples include a file access operation via a [Fetch](/en-US/docs/Web/API/Fetch_API) or [XHR](/en-US/docs/Web/API/XMLHttpRequest/XMLHttpRequest) call. +- **Pull sources** require you to explicitly request data from them once connected to. Examples include a file access operation via a {{domxref("fetch()")}} request. The data is read sequentially in small pieces called **chunks**. A chunk can be a single byte, or it can be something larger such as a [typed array](/en-US/docs/Web/JavaScript/Guide/Typed_arrays) of a certain size. A single stream can contain chunks of different sizes and types. diff --git a/files/en-us/web/api/web_workers_api/index.md b/files/en-us/web/api/web_workers_api/index.md index 72629ef2caf923c..426bb3c948565c8 100644 --- a/files/en-us/web/api/web_workers_api/index.md +++ b/files/en-us/web/api/web_workers_api/index.md @@ -17,7 +17,9 @@ In addition to the standard [JavaScript](/en-US/docs/Web/JavaScript) set of func Data is sent between workers and the main thread via a system of messages — both sides send their messages using the `postMessage()` method, and respond to messages via the `onmessage` event handler (the message is contained within the {{domxref("Worker/message_event", "message")}} event's `data` property). The data is copied rather than shared. -Workers may in turn spawn new workers, as long as those workers are hosted within the same {{glossary("origin")}} as the parent page. In addition, workers may use [`XMLHttpRequest`](/en-US/docs/Web/API/XMLHttpRequest) for network I/O, with the exception that the `responseXML` and `channel` attributes on `XMLHttpRequest` always return `null`. +Workers may in turn spawn new workers, as long as those workers are hosted within the same {{glossary("origin")}} as the parent page. + +In addition, workers can make network requests using the {{domxref("fetch()")}} or [`XMLHttpRequest`](/en-US/docs/Web/API/XMLHttpRequest) APIs (although note that the {{domxref("XMLHttpRequest.responseXML", "responseXML")}} attribute of `XMLHttpRequest` will always be `null`). ### Worker types diff --git a/files/en-us/web/api/web_workers_api/using_web_workers/index.md b/files/en-us/web/api/web_workers_api/using_web_workers/index.md index 68ba32e696d571c..bf268c292e44eda 100644 --- a/files/en-us/web/api/web_workers_api/using_web_workers/index.md +++ b/files/en-us/web/api/web_workers_api/using_web_workers/index.md @@ -7,7 +7,7 @@ spec-urls: https://html.spec.whatwg.org/multipage/#workers {{DefaultAPISidebar("Web Workers API")}} -Web Workers are a simple means for web content to run scripts in background threads. The worker thread can perform tasks without interfering with the user interface. In addition, they can perform I/O using [`XMLHttpRequest`](/en-US/docs/Web/API/XMLHttpRequest) (although the `responseXML` and `channel` attributes are always null) or [`fetch`](/en-US/docs/Web/API/Fetch_API) (with no such restrictions). Once created, a worker can send messages to the JavaScript code that created it by posting messages to an event handler specified by that code (and vice versa). +Web Workers are a simple means for web content to run scripts in background threads. The worker thread can perform tasks without interfering with the user interface. In addition, they can make network requests using the {{domxref("fetch()")}} or {{domxref("XMLHttpRequest")}} APIs. Once created, a worker can send messages to the JavaScript code that created it by posting messages to an event handler specified by that code (and vice versa). This article provides a detailed introduction to using web workers. @@ -23,7 +23,9 @@ You can run whatever code you like inside the worker thread, with some exception Data is sent between workers and the main thread via a system of messages — both sides send their messages using the `postMessage()` method, and respond to messages via the `onmessage` event handler (the message is contained within the {{domxref("Worker/message_event", "message")}} event's data attribute). The data is copied rather than shared. -Workers may, in turn, spawn new workers, as long as those workers are hosted within the same origin as the parent page. In addition, workers may use [`XMLHttpRequest`](/en-US/docs/Web/API/XMLHttpRequest) for network I/O, with the exception that the `responseXML` and `channel` attributes on `XMLHttpRequest` always return `null`. +Workers may in turn spawn new workers, as long as those workers are hosted within the same {{glossary("origin")}} as the parent page. + +In addition, workers can make network requests using the {{domxref("fetch()")}} or [`XMLHttpRequest`](/en-US/docs/Web/API/XMLHttpRequest) APIs (although note that the {{domxref("XMLHttpRequest.responseXML", "responseXML")}} attribute of `XMLHttpRequest` will always be `null`). ## Dedicated workers @@ -807,7 +809,7 @@ To learn how to debug web workers, see the documentation for each browser's Java You can use most standard JavaScript features inside a web worker, including: - {{domxref("Navigator")}} -- {{domxref("XMLHttpRequest")}} +- {{domxref("fetch()")}} - {{jsxref("Global_Objects/Array", "Array")}}, {{jsxref("Global_Objects/Date", "Date")}}, {{jsxref("Global_Objects/Math", "Math")}}, and {{jsxref("Global_Objects/String", "String")}} - {{domxref("setTimeout()")}} and {{domxref("setInterval()")}} diff --git a/files/en-us/web/api/webrtc_api/session_lifetime/index.md b/files/en-us/web/api/webrtc_api/session_lifetime/index.md index 4c88b8ae3a92a2f..aaf6172e8e34d23 100644 --- a/files/en-us/web/api/webrtc_api/session_lifetime/index.md +++ b/files/en-us/web/api/webrtc_api/session_lifetime/index.md @@ -30,7 +30,7 @@ Why, you may wonder, is something fundamental to the process of establishing a W In particular, if a developer already has a method in place for connecting two devices, it doesn't make sense for them to have to use another one, defined by the specification, just for WebRTC. Since WebRTC doesn't live in a vacuum, there is likely other connectivity in play, so it makes sense to avoid having to add additional connection channels for signaling if an existing one can be used. -In order to exchange signaling information, you can choose to send JSON objects back and forth over a WebSocket connection, or you could use XMPP or SIP over an appropriate channel, or you could use {{domxref("XMLHttpRequest")}} over {{Glossary("HTTPS")}} with polling, or any other combination of technologies you can come up with. You could even use email as the signaling channel. +In order to exchange signaling information, you can choose to send JSON objects back and forth over a WebSocket connection, or you could use XMPP or SIP over an appropriate channel, or you could use {{domxref("fetch()")}} over {{Glossary("HTTPS")}} with polling, or any other combination of technologies you can come up with. You could even use email as the signaling channel. It's also worth noting that the channel for performing signaling doesn't even need to be over the network. One peer can output a data object that can be printed out, physically carried (on foot or by carrier pigeon) to another device, entered into that device, and a response then output by that device to be returned on foot, and so forth, until the WebRTC peer connection is open. It'd be very high latency but it could be done. diff --git a/files/en-us/web/api/webrtc_api/signaling_and_video_calling/index.md b/files/en-us/web/api/webrtc_api/signaling_and_video_calling/index.md index d5d050cef003e09..ec35e84014deac3 100644 --- a/files/en-us/web/api/webrtc_api/signaling_and_video_calling/index.md +++ b/files/en-us/web/api/webrtc_api/signaling_and_video_calling/index.md @@ -18,7 +18,7 @@ In this article, we will further enhance the [WebSocket chat](https://webrtc-fro Establishing a WebRTC connection between two devices requires the use of a **signaling server** to resolve how to connect them over the internet. A signaling server's job is to serve as an intermediary to let two peers find and establish a connection while minimizing exposure of potentially private information as much as possible. How do we create this server and how does the signaling process actually work? -First we need the signaling server itself. WebRTC doesn't specify a transport mechanism for the signaling information. You can use anything you like, from [WebSocket](/en-US/docs/Web/API/WebSockets_API) to {{domxref("XMLHttpRequest")}} to carrier pigeons to exchange the signaling information between the two peers. +First we need the signaling server itself. WebRTC doesn't specify a transport mechanism for the signaling information. You can use anything you like, from [WebSocket](/en-US/docs/Web/API/WebSockets_API) to {{domxref("fetch()")}} to carrier pigeons to exchange the signaling information between the two peers. It's important to note that the server doesn't need to understand or interpret the signaling data content. Although it's {{Glossary("SDP")}}, even this doesn't matter so much: the content of the message going through the signaling server is, in effect, a black box. What does matter is when the {{Glossary("ICE")}} subsystem instructs you to send signaling data to the other peer, you do so, and the other peer knows how to receive this information and deliver it to its own ICE subsystem. All you have to do is channel the information back and forth. The contents don't matter at all to the signaling server. diff --git a/files/en-us/web/api/worker/index.md b/files/en-us/web/api/worker/index.md index c74db38af8bfcbe..11a0437935c165a 100644 --- a/files/en-us/web/api/worker/index.md +++ b/files/en-us/web/api/worker/index.md @@ -13,7 +13,7 @@ Creating a worker is done by calling the `Worker("path/to/worker/script")` const Workers may themselves spawn new workers, as long as those workers are hosted at the same [origin](/en-US/docs/Web/Security/Same-origin_policy) as the parent page. -[Not all interfaces and functions are available](/en-US/docs/Web/API/Web_Workers_API/Functions_and_classes_available_to_workers) to scripts inside a `Worker`. Workers may use {{domxref("XMLHttpRequest")}} for network communication, but its `responseXML` and `channel` attributes are always `null`. ([`fetch`](/en-US/docs/Web/API/Fetch_API) is also available, with no such restrictions.) +Note that not all interfaces and functions are available to web workers. See [Functions and classes available to Web Workers](/en-US/docs/Web/API/Web_Workers_API/Functions_and_classes_available_to_workers) for details. {{InheritanceDiagram}} diff --git a/files/en-us/web/api/xmlserializer/index.md b/files/en-us/web/api/xmlserializer/index.md index ecc629ec351e722..c15b2e6015a206c 100644 --- a/files/en-us/web/api/xmlserializer/index.md +++ b/files/en-us/web/api/xmlserializer/index.md @@ -69,5 +69,4 @@ Once that's done, `insertAdjacentHTML()` is used to insert the `` element ## See also - [Parsing and serializing XML](/en-US/docs/Web/Guide/Parsing_and_serializing_XML) -- {{domxref("XMLHttpRequest")}} - {{domxref("DOMParser")}} From 8bf3ac4abdad36a90c12691d9d5b97cf64ce6201 Mon Sep 17 00:00:00 2001 From: Estelle Weyl Date: Wed, 8 Nov 2023 23:38:50 -0800 Subject: [PATCH 05/52] CSS layout cookbook: card component (#29972) * CSS layout cookbook: card component * Apply suggestions from code review Co-authored-by: Chris Mills * errant comma!!! Co-authored-by: Chris Mills --------- Co-authored-by: Chris Mills --- .../web/css/layout_cookbook/card/index.md | 49 ++++++++++++------- 1 file changed, 30 insertions(+), 19 deletions(-) diff --git a/files/en-us/web/css/layout_cookbook/card/index.md b/files/en-us/web/css/layout_cookbook/card/index.md index 2cdcaced8d6fd76..e0d9fb5bed53e5e 100644 --- a/files/en-us/web/css/layout_cookbook/card/index.md +++ b/files/en-us/web/css/layout_cookbook/card/index.md @@ -2,24 +2,22 @@ title: Card slug: Web/CSS/Layout_cookbook/Card page-type: guide -browser-compat: - - css.properties.grid-template-columns - - css.properties.grid-template-rows +browser-compat: css.properties.grid --- {{CSSRef}} -This pattern is a list of "card" components with optional footers. +This pattern is a list of "card" components with optional footers. A card contains a title, an image, a description or other content, and an attribution or footer. Cards are generally displayed within a group or collection. ![Three card components in a row](cards.png) ## Requirements -The card component can contain a variety of content, including a heading, image, content and a footer. +Create a group of cards, with each card component containing a heading, image, content, and, optionally, a footer. -Each card should be the same height, and footers should stick to the bottom of the card. +Each card in the group of cards should be the same height. The optional card footer should stick to the bottom of the card. -When added to a collection of cards, the cards should line up in two dimensions. +The cards in the group should line up in two dimensions — both vertically and horizontally. ## Recipe @@ -31,7 +29,7 @@ When added to a collection of cards, the cards should line up in two dimensions. ## Choices made -The card is laid out using [CSS Grid Layout](/en-US/docs/Web/CSS/CSS_grid_layout) despite being a single dimensional layout, as it enables the use of content sizing for the grid tracks. When setting up the single column grid I use the following: +Each card is laid out using [CSS Grid Layout](/en-US/docs/Web/CSS/CSS_grid_layout) despite the layout being one-dimensional. This enables the use of content sizing for the grid tracks. To set up a single-column grid we can use the following: ```css .card { @@ -40,29 +38,42 @@ The card is laid out using [CSS Grid Layout](/en-US/docs/Web/CSS/CSS_grid_layout } ``` -The heading track is set to {{cssxref("max-content")}}, which prevents it from stretching. I have decided that I want my image to live within a track that is 200 pixels tall. I then set the next track — which is where the content lives — to `1fr`. This means it will take up any additional space. +{{cssxref("display", "display: grid")}} converts the element into a grid container. The three values of the {{cssxref("grid-template-rows")}} property divide the grid into a minimum of three rows, defining the height of the first three children of the card, in order. -If the track does have a footer it will be auto-sized, as rows created in the implicit grid are auto-sized by default. Therefore this will fit the content added to it. +Each `card` contains a {{HTMLElement("header")}}, {{HTMLElement("image")}}, and {{HTMLElement("div")}}, in that order, with some also containing a {{HTMLElement("footer")}}. -> **Note:** The various elements in separate cards do not align with each other, as each card is an independent grid. The proposed subgrid feature of Grid Level 2 would give a solution to this issue. +The heading row, or track, is set to {{cssxref("max-content")}}, which prevents it from stretching. The image track is set to 200 pixels tall. The third track — which is where the content lives — is set to `1fr`. This means it will fill any additional space. -## Useful fallbacks or alternative methods +Any children beyond the three with explicitly defined sizes create rows in the implicit grid, which fits the content added to it. These are auto-sized by default. If a card contains a footer, it is auto-sized. The footer, when present, sticks to the bottom of the grid. This is because the footer is auto-sized to fit its content; the content `
` then stretches take up any additional space. -[Flexbox](/en-US/docs/Web/CSS/CSS_flexible_box_layout) could be used to lay out the card, in which case you should make the content area grow, and other items not grow. This would be a reasonable way to lay out the card, although I have a slight preference for being able to control the tracks from the container rather than needing to add rules to the items. +The following ruleset creates the grid of cards: -For the overall layout you could use flexbox, however this will result in cards stretching over the final flex row where there are fewer than can fit in the rows above. Alternatively you could use [CSS multi-col](/en-US/docs/Web/CSS/CSS_multicol_layout) — this would cause the cards to lay out down the columns, which may or may not be a problem. +```css +.cards { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); + grid-gap: 20px; +} +``` -See the [columns recipe](/en-US/docs/Web/CSS/Layout_cookbook/Column_layouts) for demonstrations of each of these layout methods. +The {{cssxref("grid-template-columns")}} property defines the widths of the grid columns. In this case, we set the grid to auto-fill, with repeated columns that are minimally `230px` but allowed to grow to fill the available space. The {{cssxref("grid-gap")}} property sets a gap of `20px` between adjacent rows and adjacent columns. Alternatively, the {{cssxref("gap")}} property could have been used. -## Accessibility concerns +> **Note:** The various elements in separate cards do not align with each other, as each card is an independent grid. Lining up the components in each card with the same components in adjacent cards can be done with [subgrid](/en-US/docs/Web/CSS/CSS_grid_layout/Subgrid). -Depending on the content of your card there may be things you could, or should do to enhance accessibility. See [Inclusive Components: Card](https://inclusive-components.design/cards/) by Heydon Pickering, for a very detailed explanation of these issues. +## Alternative methods -## Browser compatibility +[Flexbox](/en-US/docs/Web/CSS/CSS_flexible_box_layout) can also be used to lay out each card. With flexbox, the dimensions of each card's rows are set with the {{cssxref("flex")}} property on each row, rather than on the card container. + +With flexbox, the dimensions of the flex items are defined on the children rather than the parent. Whether you choose to use grid or flexbox depends on your preference; whether you prefer controlling the tracks from the container or prefer adding rules to the items. + +We chose grid for the cards as, generally, you want cards to be lined up both vertically and horizontally. Additionally, lining up the components within each card to the components of adjacent cards can be done with subgrid. Flex has no hack-free equivalent to subgrid. + +## Accessibility concerns -{{Compat}} +Depending on the content of your card, there may be things you could or should do to enhance accessibility. See [Inclusive Components: Card](https://inclusive-components.design/cards/) by Heydon Pickering, for a very detailed explanation of these issues. ## See also - {{Cssxref("grid-template-columns")}}, {{Cssxref("grid-template-rows")}}, {{Cssxref("gap")}} - [Inclusive Components: Card](https://inclusive-components.design/cards/) +- [CSS Grid Layout](/en-US/docs/Web/CSS/CSS_grid_layout) module From 0573275b2354be5e6ba961c544b8e3a06103648b Mon Sep 17 00:00:00 2001 From: Himanshu Date: Thu, 9 Nov 2023 13:10:53 +0530 Subject: [PATCH 06/52] removes host and uses the page's existing terminology of server (#29868) * removes host and uses the page's existing terminology of server * Update files/en-us/web/http/cookies/index.md Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --------- Co-authored-by: Himanshu Garg Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- files/en-us/web/http/cookies/index.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/files/en-us/web/http/cookies/index.md b/files/en-us/web/http/cookies/index.md index 77422f9fa9f64b7..6cb490d48344d85 100644 --- a/files/en-us/web/http/cookies/index.md +++ b/files/en-us/web/http/cookies/index.md @@ -98,9 +98,11 @@ The `Domain` and `Path` attributes define the _scope_ of a cookie: what URLs the #### Domain attribute -The `Domain` attribute specifies which hosts can receive a cookie. If the server does not specify a `Domain`, the browser defaults the domain to the same {{Glossary("host")}} that set the cookie, _excluding subdomains_. If `Domain` _is_ specified, then subdomains are always included. Therefore, specifying `Domain` is less restrictive than omitting it. However, it can be helpful when subdomains need to share information about a user. +The `Domain` attribute specifies which server can receive a cookie. -For example, if you set `Domain=mozilla.org`, cookies are available on subdomains like `developer.mozilla.org`. +If specified, then cookies are available on the server and its subdomains. For example, if you set `Domain=mozilla.org`, cookies are available on mozilla.org and its subdomains like `developer.mozilla.org`. + +If the server does not specify a `Domain`, the cookies are available on the server _but not on its subdomains_. Therefore, specifying `Domain` is less restrictive than omitting it. However, it can be helpful when subdomains need to share information about a user. #### Path attribute From cb279e20569055b200f93802d1704846c28aa04f Mon Sep 17 00:00:00 2001 From: skyclouds2001 <95597335+skyclouds2001@users.noreply.github.com> Date: Thu, 9 Nov 2023 15:42:44 +0800 Subject: [PATCH 07/52] add {{AvailableInWorkers}} to global properties and functions (#30120) add {{AvailableInWorkers}} --- files/en-us/web/api/atob/index.md | 2 +- files/en-us/web/api/btoa/index.md | 2 +- files/en-us/web/api/caches/index.md | 2 +- files/en-us/web/api/clearinterval/index.md | 2 +- files/en-us/web/api/cleartimeout/index.md | 2 +- files/en-us/web/api/createimagebitmap/index.md | 2 +- files/en-us/web/api/crossoriginisolated/index.md | 2 +- files/en-us/web/api/crypto_property/index.md | 2 +- files/en-us/web/api/fetch/index.md | 2 +- files/en-us/web/api/indexeddb/index.md | 2 +- files/en-us/web/api/issecurecontext/index.md | 2 +- files/en-us/web/api/origin/index.md | 2 +- files/en-us/web/api/performance_property/index.md | 2 +- files/en-us/web/api/queuemicrotask/index.md | 2 +- files/en-us/web/api/setinterval/index.md | 2 +- files/en-us/web/api/settimeout/index.md | 2 +- files/en-us/web/api/structuredclone/index.md | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/files/en-us/web/api/atob/index.md b/files/en-us/web/api/atob/index.md index 054f9df9237ba32..dc001ec17e46f71 100644 --- a/files/en-us/web/api/atob/index.md +++ b/files/en-us/web/api/atob/index.md @@ -6,7 +6,7 @@ page-type: web-api-global-function browser-compat: api.atob --- -{{APIRef("HTML DOM")}} +{{APIRef("HTML DOM")}}{{AvailableInWorkers}} The **`atob()`** function decodes a string of data which has been encoded using {{glossary("Base64")}} encoding. You can use diff --git a/files/en-us/web/api/btoa/index.md b/files/en-us/web/api/btoa/index.md index ef3b9e0e2ac89a7..8d03ead934580c0 100644 --- a/files/en-us/web/api/btoa/index.md +++ b/files/en-us/web/api/btoa/index.md @@ -6,7 +6,7 @@ page-type: web-api-global-function browser-compat: api.btoa --- -{{APIRef("HTML DOM")}} +{{APIRef("HTML DOM")}}{{AvailableInWorkers}} The **`btoa()`** method creates a {{glossary("Base64")}}-encoded {{Glossary("ASCII")}} string from a _binary string_ (i.e., a diff --git a/files/en-us/web/api/caches/index.md b/files/en-us/web/api/caches/index.md index 735e01456fc319d..091c6993043e382 100644 --- a/files/en-us/web/api/caches/index.md +++ b/files/en-us/web/api/caches/index.md @@ -6,7 +6,7 @@ page-type: web-api-global-property browser-compat: api.caches --- -{{APIRef("Service Workers API")}} +{{APIRef("Service Workers API")}}{{AvailableInWorkers}} The global **`caches`** read-only property returns the {{domxref("CacheStorage")}} object associated with the current context. This object enables functionality such as storing assets for offline use, and generating custom responses to requests. diff --git a/files/en-us/web/api/clearinterval/index.md b/files/en-us/web/api/clearinterval/index.md index 2e8f8a59fd0e442..41b05e0ede7b639 100644 --- a/files/en-us/web/api/clearinterval/index.md +++ b/files/en-us/web/api/clearinterval/index.md @@ -6,7 +6,7 @@ page-type: web-api-global-function browser-compat: api.clearInterval --- -{{APIRef("HTML DOM")}} +{{APIRef("HTML DOM")}}{{AvailableInWorkers}} The global **`clearInterval()`** method cancels a timed, repeating action which was previously established by a call to {{domxref("setInterval", "setInterval()")}}. diff --git a/files/en-us/web/api/cleartimeout/index.md b/files/en-us/web/api/cleartimeout/index.md index a03ef4f2103e695..342b6ba232bc56a 100644 --- a/files/en-us/web/api/cleartimeout/index.md +++ b/files/en-us/web/api/cleartimeout/index.md @@ -6,7 +6,7 @@ page-type: web-api-global-function browser-compat: api.clearTimeout --- -{{APIRef("HTML DOM")}} +{{APIRef("HTML DOM")}}{{AvailableInWorkers}} The global **`clearTimeout()`** method cancels a timeout previously established by calling {{domxref("setTimeout()")}}. diff --git a/files/en-us/web/api/createimagebitmap/index.md b/files/en-us/web/api/createimagebitmap/index.md index 1dc99d9d5c4583e..1463a1321f02cc7 100644 --- a/files/en-us/web/api/createimagebitmap/index.md +++ b/files/en-us/web/api/createimagebitmap/index.md @@ -6,7 +6,7 @@ page-type: web-api-global-function browser-compat: api.createImageBitmap --- -{{APIRef("Canvas API")}} +{{APIRef("Canvas API")}}{{AvailableInWorkers}} The **`createImageBitmap()`** method creates a bitmap from a given source, optionally cropped to contain only a portion of that source. The method diff --git a/files/en-us/web/api/crossoriginisolated/index.md b/files/en-us/web/api/crossoriginisolated/index.md index d0ac6ba2ff23fc5..b54eb8d745a9815 100644 --- a/files/en-us/web/api/crossoriginisolated/index.md +++ b/files/en-us/web/api/crossoriginisolated/index.md @@ -6,7 +6,7 @@ page-type: web-api-global-property browser-compat: api.crossOriginIsolated --- -{{APIRef()}} +{{APIRef}}{{AvailableInWorkers}} The global **`crossOriginIsolated`** read-only property returns a boolean value that indicates whether the website is in a cross-origin isolation state. That state mitigates the risk of side-channel attacks and unlocks a few capabilities: diff --git a/files/en-us/web/api/crypto_property/index.md b/files/en-us/web/api/crypto_property/index.md index 19edd625ae457e5..acc390b7180ed7f 100644 --- a/files/en-us/web/api/crypto_property/index.md +++ b/files/en-us/web/api/crypto_property/index.md @@ -6,7 +6,7 @@ page-type: web-api-global-property browser-compat: api.crypto --- -{{APIRef}} +{{APIRef("Web Crypto API")}}{{AvailableInWorkers}} The global read-only **`crypto`** property returns the {{domxref("Crypto")}} object associated to the global object. This object allows web pages access to certain cryptographic related services. diff --git a/files/en-us/web/api/fetch/index.md b/files/en-us/web/api/fetch/index.md index db96ff28b87b0f4..3eeeabfc441f796 100644 --- a/files/en-us/web/api/fetch/index.md +++ b/files/en-us/web/api/fetch/index.md @@ -6,7 +6,7 @@ page-type: web-api-global-function browser-compat: api.fetch --- -{{APIRef("Fetch API")}} +{{APIRef("Fetch API")}}{{AvailableInWorkers}} The global **`fetch()`** method starts the process of fetching a resource from the network, returning a promise which is fulfilled once the response is available. diff --git a/files/en-us/web/api/indexeddb/index.md b/files/en-us/web/api/indexeddb/index.md index e32adcff3f077cb..f7bac71fef7d813 100644 --- a/files/en-us/web/api/indexeddb/index.md +++ b/files/en-us/web/api/indexeddb/index.md @@ -6,7 +6,7 @@ page-type: web-api-global-property browser-compat: api.indexedDB --- -{{ APIRef() }} +{{APIRef("IndexedDB")}}{{AvailableInWorkers}} The global **`indexedDB`** read-only property provides a mechanism for applications to asynchronously access the capabilities of indexed databases. diff --git a/files/en-us/web/api/issecurecontext/index.md b/files/en-us/web/api/issecurecontext/index.md index 2092df6df3e41cc..dc410d62e6580cf 100644 --- a/files/en-us/web/api/issecurecontext/index.md +++ b/files/en-us/web/api/issecurecontext/index.md @@ -6,7 +6,7 @@ page-type: web-api-global-property browser-compat: api.isSecureContext --- -{{APIRef}} +{{APIRef}}{{AvailableInWorkers}} The global **`isSecureContext`** read-only property returns a boolean indicating whether the current [context is secure](/en-US/docs/Web/Security/Secure_Contexts) diff --git a/files/en-us/web/api/origin/index.md b/files/en-us/web/api/origin/index.md index aa8aeeb7fcb7c9d..9c0c5a332a41e21 100644 --- a/files/en-us/web/api/origin/index.md +++ b/files/en-us/web/api/origin/index.md @@ -6,7 +6,7 @@ page-type: web-api-global-property browser-compat: api.origin --- -{{APIRef()}} +{{APIRef}}{{AvailableInWorkers}} The global **`origin`** read-only property returns the origin of the global scope, serialized as a string. diff --git a/files/en-us/web/api/performance_property/index.md b/files/en-us/web/api/performance_property/index.md index 5c16bf67f319f31..0687011d3542374 100644 --- a/files/en-us/web/api/performance_property/index.md +++ b/files/en-us/web/api/performance_property/index.md @@ -6,7 +6,7 @@ page-type: web-api-global-property browser-compat: api.performance --- -{{APIRef("Performance API")}} +{{APIRef("Performance API")}}{{AvailableInWorkers}} The global **`performance`** property returns a {{domxref("Performance")}} object, which can be used to gather performance information about the context it is called in (window or worker). diff --git a/files/en-us/web/api/queuemicrotask/index.md b/files/en-us/web/api/queuemicrotask/index.md index 17c12b976b7fa0b..0d05abbf5e36c18 100644 --- a/files/en-us/web/api/queuemicrotask/index.md +++ b/files/en-us/web/api/queuemicrotask/index.md @@ -6,7 +6,7 @@ page-type: web-api-global-function browser-compat: api.queueMicrotask --- -{{APIRef("HTML DOM")}} +{{APIRef("HTML DOM")}}{{AvailableInWorkers}} The **`queueMicrotask()`** method, which is exposed on the {{domxref("Window")}} or {{domxref("Worker")}} interface, diff --git a/files/en-us/web/api/setinterval/index.md b/files/en-us/web/api/setinterval/index.md index 3e672ddbf8a497a..e38ac25e19dc05a 100644 --- a/files/en-us/web/api/setinterval/index.md +++ b/files/en-us/web/api/setinterval/index.md @@ -6,7 +6,7 @@ page-type: web-api-global-function browser-compat: api.setInterval --- -{{APIRef("HTML DOM")}} +{{APIRef("HTML DOM")}}{{AvailableInWorkers}} The **`setInterval()`** method, offered on the {{domxref("Window")}} and {{domxref("Worker")}} interfaces, repeatedly calls a function or executes a code snippet, with a fixed time delay between each call. diff --git a/files/en-us/web/api/settimeout/index.md b/files/en-us/web/api/settimeout/index.md index c2000b32d37872a..65732eb3bccb375 100644 --- a/files/en-us/web/api/settimeout/index.md +++ b/files/en-us/web/api/settimeout/index.md @@ -6,7 +6,7 @@ page-type: web-api-global-function browser-compat: api.setTimeout --- -{{APIRef("HTML DOM")}} +{{APIRef("HTML DOM")}}{{AvailableInWorkers}} The global **`setTimeout()`** method sets a timer which executes a function or specified piece of code once the timer expires. diff --git a/files/en-us/web/api/structuredclone/index.md b/files/en-us/web/api/structuredclone/index.md index 82166aaa9118be5..54b5b926188bae9 100644 --- a/files/en-us/web/api/structuredclone/index.md +++ b/files/en-us/web/api/structuredclone/index.md @@ -6,7 +6,7 @@ page-type: web-api-global-function browser-compat: api.structuredClone --- -{{APIRef("HTML DOM")}} +{{APIRef("HTML DOM")}}{{AvailableInWorkers}} The global **`structuredClone()`** method creates a [deep clone](/en-US/docs/Glossary/Deep_copy) of a given value using the [structured clone algorithm](/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm). From 6754a50ec57c8c9758a65a42691878e5fd1f910a Mon Sep 17 00:00:00 2001 From: SphinxKnight Date: Thu, 9 Nov 2023 08:46:01 +0100 Subject: [PATCH 08/52] fix: Various minor fixes for Device Orientation Events pages (#30111) Various minor fixes --- .../detecting_device_orientation/index.md | 34 +++++++++++-------- .../api/device_orientation_events/index.md | 2 +- .../index.md | 28 +++++++-------- 3 files changed, 35 insertions(+), 29 deletions(-) diff --git a/files/en-us/web/api/device_orientation_events/detecting_device_orientation/index.md b/files/en-us/web/api/device_orientation_events/detecting_device_orientation/index.md index 28282d697aa485d..7eff6657d449d2b 100644 --- a/files/en-us/web/api/device_orientation_events/detecting_device_orientation/index.md +++ b/files/en-us/web/api/device_orientation_events/detecting_device_orientation/index.md @@ -19,13 +19,11 @@ The second event is the {{domxref("DeviceMotionEvent")}}, which is sent when a c All you need to do in order to begin receiving orientation change is to listen to the {{domxref("Window.deviceorientation_event", "deviceorientation")}} event: -> **Note:** [parallax](https://github.com/wagerfield/parallax) is a polyfill for normalizing the accelerometer and gyroscope data on mobile devices. This is useful for overcoming some of the differences in device support for device orientation. - ```js window.addEventListener("deviceorientation", handleOrientation, true); ``` -After registering your event listener (in this case, a JavaScript function called handleOrientation()), your listener function periodically gets called with updated orientation data. +After registering your event listener (in this case, a JavaScript function called `handleOrientation()`), your listener function periodically gets called with updated orientation data. The orientation event contains four values: @@ -47,6 +45,8 @@ function handleOrientation(event) { } ``` +> **Note:** [parallax](https://github.com/wagerfield/parallax) is a polyfill for normalizing the accelerometer and gyroscope data on mobile devices. This is useful for overcoming some of the differences in device support for device orientation. + ### Orientation values explained 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 [Orientation and motion data explained](/en-US/docs/Web/API/Device_orientation_events/Orientation_and_motion_data_explained) article which is summarized below. @@ -106,7 +106,7 @@ function handleOrientation(event) { let x = event.beta; // In degree in the range [-180,180) let y = event.gamma; // In degree in the range [-90,90) - output.textContent = `beta : ${x}\n`; + output.textContent = `beta: ${x}\n`; output.textContent += `gamma: ${y}\n`; // Because we don't want to have the device upside down @@ -124,9 +124,9 @@ function handleOrientation(event) { y += 90; // 10 is half the size of the ball - // It center the positioning point to the center of the ball - ball.style.left = `${(maxY * y) / 180 - 10}px`; // rotating device about Y axis moves the ball along X - ball.style.top = `${(maxX * x) / 180 - 10}px`; // rotating device about X axis moves the ball along Y + // It centers the positioning point to the center of the ball + ball.style.left = `${(maxY * y) / 180 - 10}px`; // rotating device around the y axis moves the ball horizontally + ball.style.top = `${(maxX * x) / 180 - 10}px`; // rotating device around the x axis moves the ball vertically } window.addEventListener("deviceorientation", handleOrientation); @@ -144,7 +144,7 @@ Motion events are handled the same way as the orientation events except that the window.addEventListener("devicemotion", handleMotion, true); ``` -What's really changed are the information provided within the {{domxref("DeviceMotionEvent")}} object passed as a parameter of the _HandleMotion_ function. +What's really changed are the information provided within the {{domxref("DeviceMotionEvent")}} object passed as a parameter of the event listener (`handleMotion()` in our example). The motion event contains four properties: @@ -159,15 +159,21 @@ The {{domxref("DeviceMotionEvent")}} objects provide web developers with informa For {{domxref("DeviceMotionEvent.acceleration","acceleration")}} and {{domxref("DeviceMotionEvent.accelerationIncludingGravity","accelerationIncludingGravity")}}, those axes correspond to the following: -- `x`: Represents the axis from West to East -- `y`: Represents the axis from South to North -- `z`: Represents the axis perpendicular to the ground +- `x` + - : Represents the axis from West to East +- `y` + - : Represents the axis from South to North +- `z` + - : Represents the axis perpendicular to the ground For {{domxref("DeviceMotionEvent.rotationRate","rotationRate")}}, the situation is a bit different; the information corresponds to the following in each case: -- `alpha`: Represents a rotation rate along the axis perpendicular to the screen (or keyboard for desktop). -- `beta`: Represents a rotation rate along the axis going from left to right of the plane of the screen (or keyboard for desktop). -- `gamma`: Represents a rotation rate along the axis going from bottom to top of the plane of the screen (or keyboard for desktop). +- `alpha` + - : Represents a rotation rate along the axis perpendicular to the screen (or keyboard for desktop). +- `beta` + - : Represents a rotation rate along the axis going from left to right of the plane of the screen (or keyboard for desktop). +- `gamma` + - : Represents a rotation rate along the axis going from bottom to top of the plane of the screen (or keyboard for desktop). Finally, {{domxref("DeviceMotionEvent.interval","interval")}} represents the interval of time, in milliseconds, at which data are obtained from the device. diff --git a/files/en-us/web/api/device_orientation_events/index.md b/files/en-us/web/api/device_orientation_events/index.md index 331772c52005e98..e5d66348b67baa8 100644 --- a/files/en-us/web/api/device_orientation_events/index.md +++ b/files/en-us/web/api/device_orientation_events/index.md @@ -14,7 +14,7 @@ browser-compat: {{DefaultAPISidebar("Device Orientation Events")}} -Device orientation events are events that allow you to [detect a device's physical orientation](/en-US/docs/Web/API/Device_orientation_events/Detecting_device_orientation#processing_motion_events), as well as allowing you to [detect the device's motion](/en-US/docs/Web/API/Device_orientation_events/Detecting_device_orientation#processing_motion_events). +Device orientation events are events that allow you to [detect a device's physical orientation](/en-US/docs/Web/API/Device_orientation_events/Detecting_device_orientation#processing_orientation_events), as well as allowing you to [detect the device's motion](/en-US/docs/Web/API/Device_orientation_events/Detecting_device_orientation#processing_motion_events). ## Concepts and usage diff --git a/files/en-us/web/api/device_orientation_events/using_device_orientation_with_3d_transforms/index.md b/files/en-us/web/api/device_orientation_events/using_device_orientation_with_3d_transforms/index.md index 35a8cedc2fe89a9..20d420745421249 100644 --- a/files/en-us/web/api/device_orientation_events/using_device_orientation_with_3d_transforms/index.md +++ b/files/en-us/web/api/device_orientation_events/using_device_orientation_with_3d_transforms/index.md @@ -9,29 +9,29 @@ This article provides tips on how to use device orientation information in tande ## Using orientation to rotate an element -The easiest way to convert [orientation data](/en-US/docs/Web/API/Window/deviceorientation_event) to a [3D transform](/en-US/docs/Web/CSS/transform) is basically to use the alpha, gamma, and beta values as `rotateZ`, `rotateX` and `rotateY` values. +The easiest way to convert [orientation data](/en-US/docs/Web/API/Window/deviceorientation_event) to a [3D transform](/en-US/docs/Web/CSS/transform) is basically to use the `alpha`, `gamma`, and `beta` values as `rotateZ`, `rotateX` and `rotateY` values. It is important to keep in mind, however, that the [Device Orientation coordinate system](/en-US/docs/Web/API/Device_orientation_events/Orientation_and_motion_data_explained) is different from the [CSS coordinate system](/en-US/docs/Web/CSS/CSSOM_view/Coordinate_systems). Namely, the former is [right-handed](https://en.wikipedia.org/wiki/Right-hand_rule) and its Y axis is positive upwards, while the latter is a left-handed coordinate system whose Y axis is positive to the bottom. Furthermore, the Device Orientation angle rotations should always be done in a Z - X' - Y'' order that does not match the order of some [CSS Transforms](/en-US/docs/Web/CSS/CSS_transforms). These are some of the practical consequences of these differences: - The order of angle rotations matters, so make sure the alpha, beta and gamma rotations are applied in this order. -- The [rotate3d()](/en-US/docs/Web/CSS/transform-function/rotate3d) CSS transformation, and the [DOMMatrixReadOnly.rotate()](/en-US/docs/Web/API/DOMMatrixReadOnly/rotate) and [DOMMatrix.rotateSelf()](/en-US/docs/Web/API/DOMMatrix/rotateSelf) functions apply angle rotations in a Z - Y' - X'' order, so it is not possible to apply the alpha, beta and gamma rotations in the right order with a single call to any of them. Instead, you should rotate each axis individually in the correct order. -- Due to the differences in coordinate systems outlined above, when looking towards the origin rotations are applied clockwise around in CSS and counter-clockwise in the Device Orientation spec. This means alpha and beta need to be inverted (the rotations around Z and X), but gamma (the rotation around Y) does not because they point to different directions in the two coordinate systems. +- The [`rotate3d()`](/en-US/docs/Web/CSS/transform-function/rotate3d) CSS transformation, and the [`DOMMatrixReadOnly.rotate()`](/en-US/docs/Web/API/DOMMatrixReadOnly/rotate) and [`DOMMatrix.rotateSelf()`](/en-US/docs/Web/API/DOMMatrix/rotateSelf) functions apply angle rotations in a Z - Y' - X'' order, so it is not possible to apply the alpha, beta and gamma rotations in the right order with a single call to any of them. Instead, you should rotate each axis individually in the correct order. +- Due to the differences in coordinate systems outlined above, when looking towards the origin rotations are applied clockwise around in CSS and counter-clockwise in the Device Orientation spec. This means alpha and beta need to be inverted (the rotations around Z and X), because they point to different directions in the two coordinate systems. However, gamma (the rotation around Y) should be kept as is. -Here's a simple code snippet to sum it up: + Here is a code snippet to sum it up: -```js -const elem = document.getElementById("view3d"); + ```js + const elem = document.getElementById("view3d"); -window.addEventListener("deviceorientation", (e) => { - elem.style.transform = `rotateZ(${-e.alpha}deg) rotateX(${-e.beta}deg) rotateY(${ - e.gamma - }deg)`; -}); -``` + window.addEventListener("deviceorientation", (e) => { + elem.style.transform = `rotateZ(${-e.alpha}deg) rotateX(${-e.beta}deg) rotateY(${ + e.gamma + }deg)`; + }); + ``` -## rotate3d to orientation +## Convert from `rotate3d()` angles to `deviceorientation` angles -Should you ever need to convert a rotate3d axis-angle to orientation Euler angles, you can use the following algorithm: +Should you ever need to convert a rotate3d axis-angle to orientation [Euler angles](https://en.wikipedia.org/wiki/Euler_angles), used by `deviceorientation`, you can use the following algorithm: ```js // convert a rotate3d axis-angle to deviceorientation angles From 4083bc433bf76a295e76f6ab3b4a57e8ff0fcbf9 Mon Sep 17 00:00:00 2001 From: skyclouds2001 <95597335+skyclouds2001@users.noreply.github.com> Date: Thu, 9 Nov 2023 16:13:12 +0800 Subject: [PATCH 09/52] update Beacon API group data (#30149) update beacon api group data --- files/jsondata/GroupData.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/files/jsondata/GroupData.json b/files/jsondata/GroupData.json index 75e19dd3402e5e2..fd15dd659dbf8a6 100644 --- a/files/jsondata/GroupData.json +++ b/files/jsondata/GroupData.json @@ -62,9 +62,9 @@ }, "Beacon": { "overview": ["Beacon API"], - "guides": ["/docs/Web/API/Beacon_API/Using_the_Beacon_API"], - "interfaces": ["Navigator", "WorkerNavigator"], - "methods": [], + "guides": [], + "interfaces": [], + "methods": ["Navigator.sendBeacon()"], "properties": [], "events": [] }, From 43c3f6dd0d20cc8064252904a8bf9c3389cdb052 Mon Sep 17 00:00:00 2001 From: Fina <42113148+BSPR0002@users.noreply.github.com> Date: Thu, 9 Nov 2023 18:05:36 +0800 Subject: [PATCH 10/52] Improve document of `FileSystemWritableFileStream.truncate()` (#30109) * Update index.md * Update files/en-us/web/api/filesystemwritablefilestream/truncate/index.md --- .../web/api/filesystemwritablefilestream/truncate/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/en-us/web/api/filesystemwritablefilestream/truncate/index.md b/files/en-us/web/api/filesystemwritablefilestream/truncate/index.md index d364355da88bfc8..e5b6e3198e746a4 100644 --- a/files/en-us/web/api/filesystemwritablefilestream/truncate/index.md +++ b/files/en-us/web/api/filesystemwritablefilestream/truncate/index.md @@ -10,7 +10,7 @@ browser-compat: api.FileSystemWritableFileStream.truncate The **`truncate()`** method of the {{domxref("FileSystemWritableFileStream")}} interface resizes the file associated with the stream to the specified size in bytes. -If the size specified is larger than the current file size the file is padded with `null` bytes. +If the size specified is larger than the current file size the file is padded with `0x00` bytes. The file cursor is also updated when `truncate()` is called. If the offset is smaller than the size, it remains unchanged. @@ -28,7 +28,7 @@ truncate(size) ### Parameters -- size +- `size` - : A number specifying the number of bytes to resize the stream to. ### Return value From 6fb7a20b8fa1f41766e498ca52e1c0573789e95d Mon Sep 17 00:00:00 2001 From: skyclouds2001 <95597335+skyclouds2001@users.noreply.github.com> Date: Thu, 9 Nov 2023 18:06:49 +0800 Subject: [PATCH 11/52] update Storage API exception section (#30092) * add {{AvailableInWorkers}} * update exception section * fix word --- files/en-us/web/api/storagemanager/estimate/index.md | 7 ++++++- files/en-us/web/api/storagemanager/getdirectory/index.md | 2 +- files/en-us/web/api/storagemanager/index.md | 2 +- files/en-us/web/api/storagemanager/persist/index.md | 5 +++++ files/en-us/web/api/storagemanager/persisted/index.md | 7 ++++++- 5 files changed, 19 insertions(+), 4 deletions(-) diff --git a/files/en-us/web/api/storagemanager/estimate/index.md b/files/en-us/web/api/storagemanager/estimate/index.md index ee29c881e7d7ad4..d4298d1e040c32c 100644 --- a/files/en-us/web/api/storagemanager/estimate/index.md +++ b/files/en-us/web/api/storagemanager/estimate/index.md @@ -6,7 +6,7 @@ page-type: web-api-instance-method browser-compat: api.StorageManager.estimate --- -{{securecontext_header}}{{APIRef("Storage")}} +{{securecontext_header}}{{APIRef("Storage")}}{{AvailableInWorkers}} The **`estimate()`** method of the {{domxref("StorageManager")}} interface asks the Storage Manager for how much storage the current [origin](/en-US/docs/Glossary/Same-origin_policy) takes up (`usage`), and how much space is available (`quota`). @@ -41,6 +41,11 @@ You may find that the `quota` varies from origin to origin. This variance is bas - Public site popularity data - User engagement signals like bookmarking, adding to homescreen, or accepting push notifications +### Exceptions + +- `TypeError` + - : Thrown if obtaining a local storage shelf failed. For example, if the current origin is an opaque origin or if the user has disabled storage. + ## Examples In this example, we obtain the usage estimates and present the percentage of storage capacity currently used to the user. diff --git a/files/en-us/web/api/storagemanager/getdirectory/index.md b/files/en-us/web/api/storagemanager/getdirectory/index.md index c6baab1dee28e35..ae400bb76ccad20 100644 --- a/files/en-us/web/api/storagemanager/getdirectory/index.md +++ b/files/en-us/web/api/storagemanager/getdirectory/index.md @@ -6,7 +6,7 @@ page-type: web-api-instance-method browser-compat: api.StorageManager.getDirectory --- -{{securecontext_header}}{{APIRef("File System API")}} +{{securecontext_header}}{{APIRef("File System API")}}{{AvailableInWorkers}} The **`getDirectory()`** method of the {{domxref("StorageManager")}} interface is used to obtain a reference to a {{domxref("FileSystemDirectoryHandle")}} object allowing access to a directory and its contents, stored in the [origin private file system](/en-US/docs/Web/API/File_System_API/Origin_private_file_system) (OPFS). diff --git a/files/en-us/web/api/storagemanager/index.md b/files/en-us/web/api/storagemanager/index.md index b4a4d6559ecb864..2367627537becc4 100644 --- a/files/en-us/web/api/storagemanager/index.md +++ b/files/en-us/web/api/storagemanager/index.md @@ -5,7 +5,7 @@ page-type: web-api-interface browser-compat: api.StorageManager --- -{{securecontext_header}}{{APIRef("Storage")}} +{{securecontext_header}}{{APIRef("Storage")}}{{AvailableInWorkers}} The **`StorageManager`** interface of the [Storage API](/en-US/docs/Web/API/Storage_API) provides an interface for managing persistence permissions and estimating available storage. You can get a reference to this interface using either {{domxref("navigator.storage")}} or {{domxref("WorkerNavigator.storage")}}. diff --git a/files/en-us/web/api/storagemanager/persist/index.md b/files/en-us/web/api/storagemanager/persist/index.md index 8d68964453f81b2..17285edc2b6af23 100644 --- a/files/en-us/web/api/storagemanager/persist/index.md +++ b/files/en-us/web/api/storagemanager/persist/index.md @@ -24,6 +24,11 @@ None. A {{jsxref('Promise')}} that resolves to a {{jsxref('Boolean')}}. +### Exceptions + +- `TypeError` + - : Thrown if obtaining a local storage shelf failed. For example, if the current origin is an opaque origin or if the user has disabled storage. + ## Example ```js diff --git a/files/en-us/web/api/storagemanager/persisted/index.md b/files/en-us/web/api/storagemanager/persisted/index.md index 3c504dab187b0fb..da6a9ae41bb7399 100644 --- a/files/en-us/web/api/storagemanager/persisted/index.md +++ b/files/en-us/web/api/storagemanager/persisted/index.md @@ -6,7 +6,7 @@ page-type: web-api-instance-method browser-compat: api.StorageManager.persisted --- -{{securecontext_header}}{{APIRef("Storage")}} +{{securecontext_header}}{{APIRef("Storage")}}{{AvailableInWorkers}} The **`persisted()`** method of the {{domxref("StorageManager")}} interface returns a {{jsxref('Promise')}} that resolves to `true` if your site's storage bucket is persistent. @@ -24,6 +24,11 @@ None. A {{jsxref('Promise')}} that resolves to a {{jsxref('Boolean')}}. +### Exceptions + +- `TypeError` + - : Thrown if obtaining a local storage shelf failed. For example, if the current origin is an opaque origin or if the user has disabled storage. + ## Example ```js From 85ceac6cab16f46ba87007f5d60a920b26d105b1 Mon Sep 17 00:00:00 2001 From: skyclouds2001 <95597335+skyclouds2001@users.noreply.github.com> Date: Thu, 9 Nov 2023 18:08:38 +0800 Subject: [PATCH 12/52] update Screen-Orientation exception (#30113) * update exception section * small style update * style update * update text * move the order --- files/en-us/web/api/screenorientation/index.md | 16 ++++++++-------- .../web/api/screenorientation/lock/index.md | 17 ++++++++++------- .../web/api/screenorientation/type/index.md | 4 ++-- .../web/api/screenorientation/unlock/index.md | 16 ++++++++++++++++ 4 files changed, 36 insertions(+), 17 deletions(-) diff --git a/files/en-us/web/api/screenorientation/index.md b/files/en-us/web/api/screenorientation/index.md index 8ef83b89a289f93..0b10cb7ca9a9d61 100644 --- a/files/en-us/web/api/screenorientation/index.md +++ b/files/en-us/web/api/screenorientation/index.md @@ -16,17 +16,10 @@ A **`ScreenOrientation`** instance object can be retrieved using the {{domxref(" ## Instance properties - {{DOMxRef("ScreenOrientation.type")}} {{ReadOnlyInline}} - - : Returns the document's current orientation type, one of "portrait-primary", "portrait-secondary", "landscape-primary", or "landscape-secondary". + - : Returns the document's current orientation type, one of `portrait-primary`, `portrait-secondary`, `landscape-primary`, or `landscape-secondary`. - {{DOMxRef("ScreenOrientation.angle")}} {{ReadOnlyInline}} - : Returns the document's current orientation angle. -## Events - -Listen to these events using `addEventListener()` or by assigning an event listener to the `oneventname` property of this interface. - -- {{DOMxRef("ScreenOrientation.change_event", "change")}} - - : Fired whenever the screen changes orientation. - ## Instance methods - {{DOMxRef("ScreenOrientation.lock()")}} @@ -34,6 +27,13 @@ Listen to these events using `addEventListener()` or by assigning an event liste - {{DOMxRef("ScreenOrientation.unlock()")}} - : Unlocks the orientation of the containing document from its default orientation. +## Events + +Listen to these events using `addEventListener()` or by assigning an event listener to the `oneventname` property of this interface. + +- {{DOMxRef("ScreenOrientation.change_event", "change")}} + - : Fired whenever the screen changes orientation. + ## Example In the following example, we listen for an orientation {{DOMxRef("ScreenOrientation.change_event", "change")}} event and log the new {{DOMxRef("ScreenOrientation.type", "screen orientation type", "", "nocode")}} and {{DOMxRef("ScreenOrientation.angle", "angle", "", "nocode")}}. diff --git a/files/en-us/web/api/screenorientation/lock/index.md b/files/en-us/web/api/screenorientation/lock/index.md index 6f734587b8e5edb..f64c356d250c682 100644 --- a/files/en-us/web/api/screenorientation/lock/index.md +++ b/files/en-us/web/api/screenorientation/lock/index.md @@ -60,18 +60,21 @@ A {{jsxref("Promise")}} that resolves after locking succeeds. The promise may be rejected with the following exceptions: -- `NotSupportedError` {{domxref("DOMException")}} +- `InvalidStateError` {{domxref("DOMException")}} - - : The user agent does not support locking the screen orientation. + - : Thrown if the document is not fully active. - `SecurityError` {{domxref("DOMException")}} - - : The user-agent's pre-lock conditions are not met. - For example, a browser may require that the top-level browsing context's `Document` is full screen. - The promise may also be rejected with this error if the document has the sandboxed orientation lock browsing context flag set. + - : Thrown if the document's visibility state is hidden or if the document is forbidden to use the feature (for example, by omitting the keyword `allow-orientation-lock` of the `sandbox` attribute of the `iframe` element). + +- `NotSupportedError` {{domxref("DOMException")}} + + - : Thrown if the user agent does not support locking the screen orientation of the specific orientation. + +- `AbortError` {{domxref("DOMException")}} -- {{jsxref("TypeError")}} - - : The `orientation` argument was not supplied. + - : Thrown if there is any other `lock()` method invoking. ## Examples diff --git a/files/en-us/web/api/screenorientation/type/index.md b/files/en-us/web/api/screenorientation/type/index.md index 0d03aa6043ee292..32416f09fbfe4fe 100644 --- a/files/en-us/web/api/screenorientation/type/index.md +++ b/files/en-us/web/api/screenorientation/type/index.md @@ -10,8 +10,8 @@ browser-compat: api.ScreenOrientation.type The **`type`** read-only property of the {{domxref("ScreenOrientation")}} interface returns the document's current orientation -type, one of "portrait-primary", "portrait-secondary", "landscape-primary", or -"landscape-secondary". +type, one of `portrait-primary`, `portrait-secondary`, `landscape-primary`, or +`landscape-secondary`. ## Value diff --git a/files/en-us/web/api/screenorientation/unlock/index.md b/files/en-us/web/api/screenorientation/unlock/index.md index 0ac35fd54a86a28..315f5aa6ebbd7e8 100644 --- a/files/en-us/web/api/screenorientation/unlock/index.md +++ b/files/en-us/web/api/screenorientation/unlock/index.md @@ -26,6 +26,22 @@ None. None ({{jsxref("undefined")}}). +### Exceptions + +The promise may be rejected with the following exceptions: + +- `InvalidStateError` {{domxref("DOMException")}} + + - : Thrown if the document is not fully active. + +- `SecurityError` {{domxref("DOMException")}} + + - : Thrown if the document's visibility state is hidden or if the document is forbidden to use the feature (for example, by omitting the keyword `allow-orientation-lock` of the `sandbox` attribute of the `iframe` element). + +- `AbortError` {{domxref("DOMException")}} + + - : Thrown if there is any other `lock()` method invoking. + ## Specifications {{Specifications}} From ea68d8f5b27af9c11247dc7d8115c0cfa6bffd1b Mon Sep 17 00:00:00 2001 From: skyclouds2001 <95597335+skyclouds2001@users.noreply.github.com> Date: Thu, 9 Nov 2023 18:10:18 +0800 Subject: [PATCH 13/52] User-Agent-Client-Hints-API (#30147) * fix and update group data * update macros * update --- .../web/api/navigatoruadata/brands/index.md | 2 +- .../gethighentropyvalues/index.md | 22 +++++++++++++------ files/en-us/web/api/navigatoruadata/index.md | 2 +- .../web/api/navigatoruadata/mobile/index.md | 2 +- .../web/api/navigatoruadata/platform/index.md | 2 +- .../web/api/navigatoruadata/tojson/index.md | 2 +- .../workernavigator/useragentdata/index.md | 2 +- files/jsondata/GroupData.json | 7 ++++-- 8 files changed, 26 insertions(+), 15 deletions(-) diff --git a/files/en-us/web/api/navigatoruadata/brands/index.md b/files/en-us/web/api/navigatoruadata/brands/index.md index 7e8032efec43226..e4d5cef57d6afa6 100644 --- a/files/en-us/web/api/navigatoruadata/brands/index.md +++ b/files/en-us/web/api/navigatoruadata/brands/index.md @@ -8,7 +8,7 @@ status: browser-compat: api.NavigatorUAData.brands --- -{{APIRef("User-Agent Client Hints API")}}{{SeeCompatTable}} +{{APIRef("User-Agent Client Hints API")}}{{SeeCompatTable}}{{AvailableInWorkers}} The **`brands`** read-only property of the {{domxref("NavigatorUAData")}} interface returns an array of brand information. diff --git a/files/en-us/web/api/navigatoruadata/gethighentropyvalues/index.md b/files/en-us/web/api/navigatoruadata/gethighentropyvalues/index.md index db31e1ff664c555..fd51671a2f22a30 100644 --- a/files/en-us/web/api/navigatoruadata/gethighentropyvalues/index.md +++ b/files/en-us/web/api/navigatoruadata/gethighentropyvalues/index.md @@ -8,7 +8,7 @@ status: browser-compat: api.NavigatorUAData.getHighEntropyValues --- -{{APIRef("User-Agent Client Hints API")}}{{SeeCompatTable}} +{{APIRef("User-Agent Client Hints API")}}{{SeeCompatTable}}{{AvailableInWorkers}} The **`getHighEntropyValues()`** method of the {{domxref("NavigatorUAData")}} interface is a {{jsxref("Promise")}} that resolves with a dictionary object containing the _high entropy_ values the user-agent returns. @@ -31,10 +31,12 @@ getHighEntropyValues(hints) - `"architecture"` - `"bitness"` + - `"formFactor"` + - `"fullVersionList"` - `"model"` - `"platformVersion"` - `"uaFullVersion"` {{Deprecated_Inline}} - - `"fullVersionList"` + - `"wow64"` ### Return value @@ -55,6 +57,14 @@ A {{jsxref("Promise")}} that resolves to an object containing some or all of the - `bitness` - : A string containing the architecture bitness. For example, `"32"` or `"64"`. Note that this information can be sent to a server in the {{HTTPHeader("Sec-CH-UA-Bitness")}} header if the server explicitly requests it in the {{HTTPHeader("Accept-CH")}} header. +- `formFactor` + - : A string containing the form-factor of a device. For example, `"Tablet"` or `"VR"`. + Note that this information can be sent to a server in the {{HTTPHeader("Sec-CH-UA-Form-Factor")}} header if the server explicitly requests it in the {{HTTPHeader("Accept-CH")}} header. +- `fullVersionList` + - : An array of objects with properties `"brand"` and `"version"` representing the browser name and full version respectively. + For example, `{"brand": "Google Chrome", "version": "103.0.5060.134"}, {"brand": "Chromium", "version": "103.0.5060.134"}`. + Please note that one object may intentionally contain invalid information to prevent sites from relying on a fixed list of browsers. + Note that this information can be sent to a server in the {{HTTPHeader("Sec-CH-UA-Full-Version-List")}} header if the server explicitly requests it in the {{HTTPHeader("Accept-CH")}} header. - `model` - : A string containing the model of mobile device. For example, `"Pixel 2XL"`. If device is not a mobile device or if device model is not known, `model` will be `""`. Note that this information can be sent to a server in the {{HTTPHeader("Sec-CH-UA-Model")}} header if the server explicitly requests it in the {{HTTPHeader("Accept-CH")}} header. @@ -64,11 +74,9 @@ A {{jsxref("Promise")}} that resolves to an object containing some or all of the - `uaFullVersion` {{Deprecated_Inline}} - : A string containing the full browser version. For example, `"103.0.5060.134"`. Deprecated in favor of `fullVersionList`. Note that this information can be sent to a server in the {{HTTPHeader("Sec-CH-UA-Full-Version")}} header if the server explicitly requests it in the {{HTTPHeader("Accept-CH")}} header. -- `fullVersionList` - - : An array of objects with properties `"brand"` and `"version"` representing the browser name and full version respectively. - For example, `{"brand": "Google Chrome", "version": "103.0.5060.134"}, {"brand": "Chromium", "version": "103.0.5060.134"}`. - Please note that one object may intentionally contain invalid information to prevent sites from relying on a fixed list of browsers. - Note that this information can be sent to a server in the {{HTTPHeader("Sec-CH-UA-Full-Version-List")}} header if the server explicitly requests it in the {{HTTPHeader("Accept-CH")}} header. +- `wow64` + - : A boolean indicating if the user agent's binary is running in 32-bit mode on 64-bit Windows. + Note that this information can be sent to a server in the {{HTTPHeader("Sec-CH-UA-WoW64")}} header if the server explicitly requests it in the {{HTTPHeader("Accept-CH")}} header. ### Exceptions diff --git a/files/en-us/web/api/navigatoruadata/index.md b/files/en-us/web/api/navigatoruadata/index.md index f3137b475134a56..ecc0b796427e57a 100644 --- a/files/en-us/web/api/navigatoruadata/index.md +++ b/files/en-us/web/api/navigatoruadata/index.md @@ -7,7 +7,7 @@ status: browser-compat: api.NavigatorUAData --- -{{APIRef("User-Agent Client Hints API")}}{{SeeCompatTable}} +{{APIRef("User-Agent Client Hints API")}}{{SeeCompatTable}}{{AvailableInWorkers}} The **`NavigatorUAData`** interface of the {{domxref('User-Agent Client Hints API')}} returns information about the browser and operating system of a user. diff --git a/files/en-us/web/api/navigatoruadata/mobile/index.md b/files/en-us/web/api/navigatoruadata/mobile/index.md index 779738733750695..9cfae83b5dd65de 100644 --- a/files/en-us/web/api/navigatoruadata/mobile/index.md +++ b/files/en-us/web/api/navigatoruadata/mobile/index.md @@ -8,7 +8,7 @@ status: browser-compat: api.NavigatorUAData.mobile --- -{{APIRef("User-Agent Client Hints API")}}{{SeeCompatTable}} +{{APIRef("User-Agent Client Hints API")}}{{SeeCompatTable}}{{AvailableInWorkers}} The **`mobile`** read-only property of the {{domxref("NavigatorUAData")}} interface returns a value indicating whether the device is a mobile device. diff --git a/files/en-us/web/api/navigatoruadata/platform/index.md b/files/en-us/web/api/navigatoruadata/platform/index.md index a57ee1195b59a27..5ed3e28e6118e20 100644 --- a/files/en-us/web/api/navigatoruadata/platform/index.md +++ b/files/en-us/web/api/navigatoruadata/platform/index.md @@ -8,7 +8,7 @@ status: browser-compat: api.NavigatorUAData.platform --- -{{APIRef("User-Agent Client Hints API")}}{{SeeCompatTable}} +{{APIRef("User-Agent Client Hints API")}}{{SeeCompatTable}}{{AvailableInWorkers}} The **`platform`** read-only property of the {{domxref("NavigatorUAData")}} interface returns the platform brand information. diff --git a/files/en-us/web/api/navigatoruadata/tojson/index.md b/files/en-us/web/api/navigatoruadata/tojson/index.md index f13eca5e250c9fd..de7a1b9aa7cd65a 100644 --- a/files/en-us/web/api/navigatoruadata/tojson/index.md +++ b/files/en-us/web/api/navigatoruadata/tojson/index.md @@ -8,7 +8,7 @@ status: browser-compat: api.NavigatorUAData.toJSON --- -{{APIRef("User-Agent Client Hints API")}}{{SeeCompatTable}} +{{APIRef("User-Agent Client Hints API")}}{{SeeCompatTable}}{{AvailableInWorkers}} The **`toJSON()`** method of the {{domxref("NavigatorUAData")}} interface is a _serializer_ that returns a JSON representation of the _low entropy_ properties of the `NavigatorUAData` object. diff --git a/files/en-us/web/api/workernavigator/useragentdata/index.md b/files/en-us/web/api/workernavigator/useragentdata/index.md index e8b26f86b73d213..7d7f760fa7ed300 100644 --- a/files/en-us/web/api/workernavigator/useragentdata/index.md +++ b/files/en-us/web/api/workernavigator/useragentdata/index.md @@ -8,7 +8,7 @@ status: browser-compat: api.WorkerNavigator.userAgentData --- -{{APIRef("User-Agent Client Hints API")}}{{SeeCompatTable}} +{{APIRef("User-Agent Client Hints API")}}{{SeeCompatTable}}{{securecontext_header}} The **`userAgentData`** read-only property of the {{domxref("WorkerNavigator")}} interface returns an {{domxref("NavigatorUAData")}} object which can be used to access the {{domxref("User-Agent Client Hints API")}}. diff --git a/files/jsondata/GroupData.json b/files/jsondata/GroupData.json index fd15dd659dbf8a6..c94ccf2408152b3 100644 --- a/files/jsondata/GroupData.json +++ b/files/jsondata/GroupData.json @@ -1558,8 +1558,11 @@ "User-Agent Client Hints API": { "overview": ["User-Agent Client Hints API"], "interfaces": ["NavigatorUAData"], - "methods": ["Navigator.userAgentData"], - "properties": [], + "methods": [], + "properties": [ + "Navigator.userAgentData", + "WorkerNavigator.userAgentData" + ], "events": [] }, "Vibration API": { From a3385f7188db4260f82d03684cd0bfcd51ece497 Mon Sep 17 00:00:00 2001 From: skyclouds2001 <95597335+skyclouds2001@users.noreply.github.com> Date: Thu, 9 Nov 2023 18:11:50 +0800 Subject: [PATCH 14/52] Fix to `setInterval()` (#30126) Update index.md --- files/en-us/web/api/setinterval/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/en-us/web/api/setinterval/index.md b/files/en-us/web/api/setinterval/index.md index e38ac25e19dc05a..b0ffc1c6c838988 100644 --- a/files/en-us/web/api/setinterval/index.md +++ b/files/en-us/web/api/setinterval/index.md @@ -8,7 +8,7 @@ browser-compat: api.setInterval {{APIRef("HTML DOM")}}{{AvailableInWorkers}} -The **`setInterval()`** method, offered on the {{domxref("Window")}} and {{domxref("Worker")}} interfaces, repeatedly calls a function or executes a code snippet, with a fixed time delay between each call. +The **`setInterval()`** method, offered on the {{domxref("Window")}} and {{domxref("WorkerGlobalScope")}} interfaces, repeatedly calls a function or executes a code snippet, with a fixed time delay between each call. This method returns an interval ID which uniquely identifies the interval, so you can remove it later by calling {{domxref("clearInterval", "clearInterval()")}}. From 9716100b38b40f0f2ee8b3bfa2c692958868c5a6 Mon Sep 17 00:00:00 2001 From: Hamish Willee Date: Thu, 9 Nov 2023 22:01:38 +1100 Subject: [PATCH 15/52] Remove RTCRtpContributingSource dictionary (#30079) * Move RTCRtpContributingSource info into RTCRtpReceiver.getContributingSources() * Delete RTCRtpContributingSource, redirecting to RTCRtpReceiver.getContributingSources * Remove RTCRtpContributingSource from API top level dictionary list * Minor typo * RTCRtpReceiver.getSynchronizationSources() - add info about returned object --- files/en-us/_redirects.txt | 5 ++ files/en-us/_wikihistory.json | 20 -------- .../mozilla/firefox/releases/72/index.md | 2 +- .../audiolevel/index.md | 46 ------------------- .../web/api/rtcrtpcontributingsource/index.md | 31 ------------- .../rtptimestamp/index.md | 29 ------------ .../rtcrtpcontributingsource/source/index.md | 33 ------------- .../timestamp/index.md | 27 ----------- .../getcontributingsources/index.md | 35 ++++++++++---- .../getsynchronizationsources/index.md | 40 ++++++++++------ files/en-us/web/api/rtcrtpreceiver/index.md | 4 +- files/en-us/web/api/webrtc_api/index.md | 5 -- 12 files changed, 61 insertions(+), 216 deletions(-) delete mode 100644 files/en-us/web/api/rtcrtpcontributingsource/audiolevel/index.md delete mode 100644 files/en-us/web/api/rtcrtpcontributingsource/index.md delete mode 100644 files/en-us/web/api/rtcrtpcontributingsource/rtptimestamp/index.md delete mode 100644 files/en-us/web/api/rtcrtpcontributingsource/source/index.md delete mode 100644 files/en-us/web/api/rtcrtpcontributingsource/timestamp/index.md diff --git a/files/en-us/_redirects.txt b/files/en-us/_redirects.txt index d5029239a8f2f46..e645bf661f75338 100644 --- a/files/en-us/_redirects.txt +++ b/files/en-us/_redirects.txt @@ -9525,6 +9525,11 @@ /en-US/docs/Web/API/RTCPeerConnectionIceEvent.candidate /en-US/docs/Web/API/RTCPeerConnectionIceEvent/candidate /en-US/docs/Web/API/RTCRtpCapabilities /en-US/docs/Web/API/RTCRtpSender/getCapabilities_static /en-US/docs/Web/API/RTCRtpCodecCapability /en-US/docs/Web/API/RTCRtpSender/getCapabilities_static +/en-US/docs/Web/API/RTCRtpContributingSource /en-US/docs/Web/API/RTCRtpReceiver/getContributingSources +/en-US/docs/Web/API/RTCRtpContributingSource/audioLevel /en-US/docs/Web/API/RTCRtpReceiver/getContributingSources +/en-US/docs/Web/API/RTCRtpContributingSource/rtpTimestamp /en-US/docs/Web/API/RTCRtpReceiver/getContributingSources +/en-US/docs/Web/API/RTCRtpContributingSource/source /en-US/docs/Web/API/RTCRtpReceiver/getContributingSources +/en-US/docs/Web/API/RTCRtpContributingSource/timestamp /en-US/docs/Web/API/RTCRtpReceiver/getContributingSources /en-US/docs/Web/API/RTCRtpParameters /en-US/docs/Web/API/RTCRtpSender/setParameters /en-US/docs/Web/API/RTCRtpReceiveParameters /en-US/docs/Web/API/RTCRtpReceiver/getParameters /en-US/docs/Web/API/RTCRtpReceiver/getCapabilities /en-US/docs/Web/API/RTCRtpReceiver/getCapabilities_static diff --git a/files/en-us/_wikihistory.json b/files/en-us/_wikihistory.json index 3f2bdfcc364c564..b34a5012b968377 100644 --- a/files/en-us/_wikihistory.json +++ b/files/en-us/_wikihistory.json @@ -55024,26 +55024,6 @@ "modified": "2019-05-20T18:28:16.993Z", "contributors": ["Sheppy"] }, - "Web/API/RTCRtpContributingSource": { - "modified": "2020-10-15T21:55:35.352Z", - "contributors": ["Sheppy", "fscholz", "Onkar316", "jpmedley"] - }, - "Web/API/RTCRtpContributingSource/audioLevel": { - "modified": "2020-10-15T21:55:34.869Z", - "contributors": ["fscholz", "Sheppy", "jpmedley"] - }, - "Web/API/RTCRtpContributingSource/rtpTimestamp": { - "modified": "2020-10-15T22:25:34.965Z", - "contributors": ["Sheppy"] - }, - "Web/API/RTCRtpContributingSource/source": { - "modified": "2020-10-15T21:55:40.516Z", - "contributors": ["fscholz", "Sheppy", "jpmedley"] - }, - "Web/API/RTCRtpContributingSource/timestamp": { - "modified": "2020-10-15T21:55:38.833Z", - "contributors": ["sideshowbarker", "fscholz", "Sheppy", "jpmedley"] - }, "Web/API/RTCRtpEncodingParameters": { "modified": "2020-10-15T22:01:53.269Z", "contributors": ["Sheppy"] diff --git a/files/en-us/mozilla/firefox/releases/72/index.md b/files/en-us/mozilla/firefox/releases/72/index.md index 99bc555e51edb95..26a94a728cc9eb5 100644 --- a/files/en-us/mozilla/firefox/releases/72/index.md +++ b/files/en-us/mozilla/firefox/releases/72/index.md @@ -91,7 +91,7 @@ _No changes._ #### Media, Web Audio, and WebRTC - The {{domxref("MediaDevices.getDisplayMedia()")}} method can now only be called in response to a user gesture such as a [`click`](/en-US/docs/Web/API/Element/click_event) event ([Firefox bug 1580944](https://bugzil.la/1580944)). -- The {{domxref("RTCRtpContributingSource")}} dictionary can now include the {{domxref("RTCRtpContributingSource.rtpTimestamp", "rtpTimestamp")}} property, which is a source-generated time at which the packet's media was generated or sampled ([Firefox bug 1583867](https://bugzil.la/1583867)). +- The `RTCRtpContributingSource` dictionary can now include the `rtpTimestamp` property, which is a source-generated time at which the packet's media was generated or sampled ([Firefox bug 1583867](https://bugzil.la/1583867)). #### Removals diff --git a/files/en-us/web/api/rtcrtpcontributingsource/audiolevel/index.md b/files/en-us/web/api/rtcrtpcontributingsource/audiolevel/index.md deleted file mode 100644 index 4dab42fc4565c47..000000000000000 --- a/files/en-us/web/api/rtcrtpcontributingsource/audiolevel/index.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -title: "RTCRtpContributingSource: audioLevel property" -short-title: audioLevel -slug: Web/API/RTCRtpContributingSource/audioLevel -page-type: web-api-instance-property -browser-compat: api.RTCRtpContributingSource.audioLevel ---- - -{{APIRef("WebRTC API")}} - -The read-only **`audioLevel`** -property of the {{domxref("RTCRtpContributingSource")}} dictionary contains the audio -level contained in the last RTP packet played from the described source. - -`audioLevel` will be the level value defined in \[RFC6465] if the RFC 6465 header extension -is present, and otherwise null. - -## Value - -A double-precision floating-point number which indicates the volume level of the audio -in the most recently received RTP packet from the source described by the -`RTCRtpContributingSource`. - -This value, which is in the range 0.0 to 1.0, is on a linear scale and its value is -defined in dBov, or decibels (overload). This is the amplitude relative to the point at -which clipping of the audio begins to occur. A value of 1.0 represents 0 dBov (maximum -volume), a value of 0.0 represents silence, and a value of 0.5 represents approximately -6 dB SPL (decibels of sound pressure level) change in the sound pressure level from 0 -dBov. - -For both `RTCRtpContributingSource` and -`RTCRtpSynchronizationSource`, the audio level is converted to this form -from the values defined in the specifications corresponding to each type of source. - -> **Note:** `audioLevel` may be absent from `RTCRtpContributingSource` -> objects, which indicates that no volume level was provided by the source; however, it -> is _required_ and always available on all -> `RTCRtpSynchronizationSource` objects. - -## Specifications - -{{Specifications}} - -## Browser compatibility - -{{Compat}} diff --git a/files/en-us/web/api/rtcrtpcontributingsource/index.md b/files/en-us/web/api/rtcrtpcontributingsource/index.md deleted file mode 100644 index b9186e1ef0f144d..000000000000000 --- a/files/en-us/web/api/rtcrtpcontributingsource/index.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -title: RTCRtpContributingSource -slug: Web/API/RTCRtpContributingSource -page-type: web-api-interface -browser-compat: api.RTCRtpContributingSource ---- - -{{APIRef("WebRTC API")}} - -The **`RTCRtpContributingSource`** dictionary of the [WebRTC API](/en-US/docs/Web/API/WebRTC_API) is used by {{domxref("RTCRtpReceiver.getContributingSources", "getContributingSources()")}} to provide information about a given contributing source (CSRC), including the most recent time a packet that the source contributed was played out. - -The information provided is based on the last ten seconds of media received. - -## Instance properties - -- {{domxref("RTCRtpContributingSource.audioLevel", "audioLevel")}} {{optional_inline}} - - : A double-precision floating-point value between 0 and 1 specifying the audio level contained in the last RTP packet played from this source. -- {{domxref("RTCRtpContributingSource.rtpTimestamp", "rtpTimestamp")}} {{optional_inline}} - - : The RTP timestamp of the media played out at the time indicated by `timestamp`. This value is a source-generated time value which can be used to help with sequencing and synchronization. -- {{domxref("RTCRtpContributingSource.source", "source")}} {{optional_inline}} - - : A 32-bit unsigned integer value specifying the CSRC identifier of the contributing source. -- {{domxref("RTCRtpContributingSource.timestamp", "timestamp")}} {{optional_inline}} - - : A {{domxref("DOMHighResTimeStamp")}} indicating the most recent time at which a frame originating from this source was delivered to the receiver's {{domxref("MediaStreamTrack")}} - -## Specifications - -{{Specifications}} - -## Browser compatibility - -{{Compat}} diff --git a/files/en-us/web/api/rtcrtpcontributingsource/rtptimestamp/index.md b/files/en-us/web/api/rtcrtpcontributingsource/rtptimestamp/index.md deleted file mode 100644 index 500b14956380baf..000000000000000 --- a/files/en-us/web/api/rtcrtpcontributingsource/rtptimestamp/index.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: "RTCRtpContributingSource: rtpTimestamp property" -short-title: rtpTimestamp -slug: Web/API/RTCRtpContributingSource/rtpTimestamp -page-type: web-api-instance-property -browser-compat: api.RTCRtpContributingSource.rtpTimestamp ---- - -{{APIRef("WebRTC API")}} - -The read-only **`rtpTimestamp`** -property of the {{domxref("RTCRtpContributingSource")}} dictionary contains a -{{domxref("DOMHighResTimeStamp")}} indicating the source-generated time at which the -media contained int he packet was first sampled or obtained. - -## Value - -An integer value specifying a source-generated timestamp indicating the time at which -the media in this packet, scheduled for play out at the time indicated by -{{domxref("RTCRtpContributingSource.timestamp", "timestamp")}}, was initially sampled or -generated. This value may be useful for sequencing and synchronization purposes. - -## Specifications - -{{Specifications}} - -## Browser compatibility - -{{Compat}} diff --git a/files/en-us/web/api/rtcrtpcontributingsource/source/index.md b/files/en-us/web/api/rtcrtpcontributingsource/source/index.md deleted file mode 100644 index 18edde3094710a3..000000000000000 --- a/files/en-us/web/api/rtcrtpcontributingsource/source/index.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -title: "RTCRtpContributingSource: source property" -short-title: source -slug: Web/API/RTCRtpContributingSource/source -page-type: web-api-instance-property -browser-compat: api.RTCRtpContributingSource.source ---- - -{{APIRef("WebRTC API")}} - -The read-only **`source`** property of -the {{domxref("RTCRtpContributingSource")}} dictionary contains the source identifier of -a particular stream of RTP packets. - -The value is the contributing source (CSRC) -or synchronization source (SSRC) identifier, depending on whether the object is an -`RTCRtpContributingSource` or `RTCRtpSynchronizationSource`, -which is based on the former. - -## Value - -An unsigned, 32-bit integer value which uniquely identifies the source of RTP packets -described by this `RTCRtpContributingSource` (in which case the value is a -CSRC identifier) or `RTCRtpSynchronizationSource` (the value is an SSRC -identifier). - -## Specifications - -{{Specifications}} - -## Browser compatibility - -{{Compat}} diff --git a/files/en-us/web/api/rtcrtpcontributingsource/timestamp/index.md b/files/en-us/web/api/rtcrtpcontributingsource/timestamp/index.md deleted file mode 100644 index 67c0baaea255115..000000000000000 --- a/files/en-us/web/api/rtcrtpcontributingsource/timestamp/index.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: "RTCRtpContributingSource: timestamp property" -short-title: timestamp -slug: Web/API/RTCRtpContributingSource/timestamp -page-type: web-api-instance-property -browser-compat: api.RTCRtpContributingSource.timestamp ---- - -{{APIRef("WebRTC API")}} - -The read-only **`timestamp`** property -of the {{domxref("RTCRtpContributingSource")}} dictionary contains a -{{domxref("DOMHighResTimeStamp")}} indicating the most recent time of playout of an -RTP packet from the source. - -## Value - -A {{domxref("DOMHighResTimeStamp")}} which indicates the time at which the most recent -RTP packet from the corresponding source was played out. - -## Specifications - -{{Specifications}} - -## Browser compatibility - -{{Compat}} diff --git a/files/en-us/web/api/rtcrtpreceiver/getcontributingsources/index.md b/files/en-us/web/api/rtcrtpreceiver/getcontributingsources/index.md index 3c0e9b6066ce44d..df0ecaebb4db128 100644 --- a/files/en-us/web/api/rtcrtpreceiver/getcontributingsources/index.md +++ b/files/en-us/web/api/rtcrtpreceiver/getcontributingsources/index.md @@ -8,11 +8,7 @@ browser-compat: api.RTCRtpReceiver.getContributingSources {{APIRef("WebRTC API")}} -The **`getContributingSources()`** -method of the {{domxref("RTCRtpReceiver")}} interface returns an array of -{{domxref("RTCRtpContributingSource")}} instances, each corresponding to one CSRC -(contributing source) identifier received by the current `RTCRtpReceiver` -in the last ten seconds. +The **`getContributingSources()`** method of the {{domxref("RTCRtpReceiver")}} interface returns an array of objects, each corresponding to one CSRC (contributing source) identifier received by the current `RTCRtpReceiver` in the last ten seconds. ## Syntax @@ -26,9 +22,32 @@ None. ### Return value -An array of {{domxref("RTCRtpContributingSource")}} instances. Each instance describes -one of the contributing sources that provided data to the incoming stream in the past -ten seconds. +An array of objects, each describing one of the contributing sources that provided data to the incoming stream in the past ten seconds. +These objects contain the following properties: + +- `audioLevel` {{optional_inline}} + + - : A floating-point value between 0.0 and 1.0 specifying the audio level contained in the last RTP packet played from the contributing source. + + The value is on a linear scale and is defined in units of dBov, or decibels (overload). + This is the amplitude relative to the point at which clipping of the audio begins to occur. + A value of 1.0 represents 0 dBov (maximum volume), a value of 0.0 represents silence, and a value of 0.5 represents approximately 6 dB SPL (decibels of sound pressure level) change in the sound pressure level from 0 dBov. + + If this property is not present then no volume level was provided by the source. + +- `rtpTimestamp` {{optional_inline}} + + - : The RTP timestamp (an integer {{domxref("DOMHighResTimeStamp")}}) of the media. + This source-generated timestamp indicates the time at which the media in this packet, scheduled for play out at the time indicated by `timestamp`, was initially sampled or generated. + It may be useful for sequencing and synchronization purposes. + +- `source` {{optional_inline}} + + - : A positive integer value specifying the CSRC identifier of the contributing source. + This uniquely identifies the source of the particular stream RTP packets. + +- `timestamp` {{optional_inline}} + - : A {{domxref("DOMHighResTimeStamp")}} indicating the most recent time at which a frame originating from this source was delivered to the receiver's {{domxref("MediaStreamTrack")}} ## Specifications diff --git a/files/en-us/web/api/rtcrtpreceiver/getsynchronizationsources/index.md b/files/en-us/web/api/rtcrtpreceiver/getsynchronizationsources/index.md index 4b74a8fc21e7111..b7e771d91de9187 100644 --- a/files/en-us/web/api/rtcrtpreceiver/getsynchronizationsources/index.md +++ b/files/en-us/web/api/rtcrtpreceiver/getsynchronizationsources/index.md @@ -8,11 +8,7 @@ browser-compat: api.RTCRtpReceiver.getSynchronizationSources {{APIRef("WebRTC API")}} -The **`getSynchronizationSources()`** -method of the {{domxref("RTCRtpReceiver")}} interface returns an array of -{{domxref("RTCRtpContributingSource")}} instances, each corresponding to one SSRC -(synchronization source) identifier received by the current -`RTCRtpReceiver` in the last ten seconds. +The **`getSynchronizationSources()`** method of the {{domxref("RTCRtpReceiver")}} interface returns an array of objects, each corresponding to one SSRC (synchronization source) identifier received by the current `RTCRtpReceiver` in the last ten seconds. ## Syntax @@ -26,16 +22,32 @@ None. ### Return value -An array of object describing one of the synchronization sources that provided data to the incoming stream in the past ten seconds. These objects contain the following properties: +An array of objects, each describing one of the synchronization sources that provided data to the incoming stream in the past ten seconds. +These objects contain the following properties: -- {{domxref("RTCRtpContributingSource.audioLevel", "audioLevel")}} {{optional_inline}} - - : A double-precision floating-point value between 0.0 and 1.0 specifying the audio level (in dBov) contained in the last RTP packet played from this source. -- {{domxref("RTCRtpContributingSource.rtpTimestamp", "rtpTimestamp")}} {{optional_inline}} - - : The RTP timestamp of the media played out at the time indicated by `timestamp`. This value is a source-generated time value which can be used to help with sequencing and synchronization. -- {{domxref("RTCRtpContributingSource.source", "source")}} {{optional_inline}} - - : A 32-bit unsigned integer value specifying the CSRC identifier of the contributing source. -- {{domxref("RTCRtpContributingSource.timestamp", "timestamp")}} {{optional_inline}} - - : A {{domxref("DOMHighResTimeStamp")}} indicating the most recent time at which a frame originating from this source was delivered to the receiver's {{domxref("MediaStreamTrack")}}. +- `audioLevel` + + - : A floating-point value between 0.0 and 1.0 specifying the audio level contained in the last RTP packet played from the synchronization source. + + The value is on a linear scale and is defined in units of dBov, or decibels (overload). + This is the amplitude relative to the point at which clipping of the audio begins to occur. + A value of 1.0 represents 0 dBov (maximum volume), a value of 0.0 represents silence, and a value of 0.5 represents approximately 6 dB SPL (decibels of sound pressure level) change in the sound pressure level from 0 dBov. + + This value is required and always present. + +- `rtpTimestamp` {{optional_inline}} + + - : The RTP timestamp (an integer {{domxref("DOMHighResTimeStamp")}}) of the media. + This source-generated timestamp indicates the time at which the media in this packet, scheduled for play out at the time indicated by `timestamp`, was initially sampled or generated. + It may be useful for sequencing and synchronization purposes. + +- `source` {{optional_inline}} + + - : A positive integer value specifying the SSRC identifier of the synchronization source. + This uniquely identifies the source of the particular stream RTP packets. + +- `timestamp` {{optional_inline}} + - : A {{domxref("DOMHighResTimeStamp")}} indicating the most recent time at which a frame originating from this source was delivered to the receiver's {{domxref("MediaStreamTrack")}} ## Specifications diff --git a/files/en-us/web/api/rtcrtpreceiver/index.md b/files/en-us/web/api/rtcrtpreceiver/index.md index 952b6a39b0893ed..686c60b2562b3a0 100644 --- a/files/en-us/web/api/rtcrtpreceiver/index.md +++ b/files/en-us/web/api/rtcrtpreceiver/index.md @@ -31,13 +31,13 @@ The **`RTCRtpReceiver`** interface of the [WebRTC API](/en-US/docs/Web/API/WebRT ## Instance methods - {{domxref("RTCRtpReceiver.getContributingSources()")}} - - : Returns an array of {{domxref("RTCRtpContributingSource")}} instances for each unique CSRC (contributing source) identifier received by the current `RTCRtpReceiver` in the last ten seconds. + - : Returns an array that contains an object for each unique CSRC (contributing source) identifier received by the current `RTCRtpReceiver` in the last ten seconds. - {{domxref("RTCRtpReceiver.getParameters()")}} - : Returns an object that contains information about how the RTC data is to be decoded. - {{domxref("RTCRtpReceiver.getStats()")}} - : Returns a {{jsxref("Promise")}} whose fulfillment handler receives a {{domxref("RTCStatsReport")}} which contains statistics about the incoming streams and their dependencies. - {{domxref("RTCRtpReceiver.getSynchronizationSources()")}} - - : Returns an array including one `RTCRtpSynchronizationSource` instance for each unique SSRC (synchronization source) identifier received by the current `RTCRtpReceiver` in the last ten seconds. + - : Returns an array that contains an object for each unique SSRC (synchronization source) identifier received by the current `RTCRtpReceiver` in the last ten seconds. ## Specifications diff --git a/files/en-us/web/api/webrtc_api/index.md b/files/en-us/web/api/webrtc_api/index.md index 944dd721dbe6fd0..25b4d23ce4e144b 100644 --- a/files/en-us/web/api/webrtc_api/index.md +++ b/files/en-us/web/api/webrtc_api/index.md @@ -63,11 +63,6 @@ These interfaces, dictionaries, and types are used to set up, open, and manage W - {{DOMxRef("RTCSctpTransport")}} - : Provides information which describes a Stream Control Transmission Protocol (**{{Glossary("SCTP")}}**) transport and also provides a way to access the underlying Datagram Transport Layer Security (**{{Glossary("DTLS")}}**) transport over which SCTP packets for all of an [`RTCPeerConnection`](/en-US/docs/Web/API/RTCPeerConnection)'s data channels are sent and received. -#### Dictionaries - -- {{DOMxRef("RTCRtpContributingSource")}} - - : Contains information about a given contributing source (CSRC) including the most recent time a packet that the source contributed was played out. - #### Events - {{domxref("RTCDataChannel.bufferedamountlow_event", "bufferedamountlow")}} From 2024a508694208f0316c484fb41e2c5823deae88 Mon Sep 17 00:00:00 2001 From: Tomer Chachamu Date: Thu, 9 Nov 2023 11:42:35 +0000 Subject: [PATCH 16/52] Delete reference to discontinued Google product (#30154) --- files/en-us/web/http/headers/cache-control/index.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/files/en-us/web/http/headers/cache-control/index.md b/files/en-us/web/http/headers/cache-control/index.md index ee54f89d26a86ec..7607c0dd932ecef 100644 --- a/files/en-us/web/http/headers/cache-control/index.md +++ b/files/en-us/web/http/headers/cache-control/index.md @@ -207,8 +207,6 @@ Some intermediaries transform content for various reasons. For example, some con `no-transform` indicates that any intermediary (regardless of whether it implements a cache) shouldn't transform the response contents. -Note: [Google's Web Light](https://developers.google.com/search/docs/advanced/mobile/web-light?visit_id=637855965115455923-776951611&rd=1) is one kind of such an intermediary. It converts images to minimize data for a cache store or slow connection and supports `no-transform` as an opt-out option. - #### `immutable` The `immutable` response directive indicates that the response will not be updated while it's [fresh](/en-US/docs/Web/HTTP/Caching#fresh_and_stale_based_on_age). From 992a2f675076732500620bf9d2c1aeb064920f3c Mon Sep 17 00:00:00 2001 From: Sriparno Roy <89148144+Sriparno08@users.noreply.github.com> Date: Thu, 9 Nov 2023 17:22:02 +0530 Subject: [PATCH 17/52] Move `window.scheduler` to `scheduler` global property (#30148) * Move window.scheduler to scheduler global property * Fix broken link * Fix broken link * Change uppercase to lowercase * Revert move * Update data related to scheduler property * Update files/en-us/web/api/prioritized_task_scheduling_api/index.md --------- Co-authored-by: Jean-Yves Perrier --- files/en-us/_redirects.txt | 1 + .../en-us/web/api/prioritized_task_scheduling_api/index.md | 4 ++-- .../api/{window/scheduler => scheduler_property}/index.md | 6 +++--- files/jsondata/GroupData.json | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) rename files/en-us/web/api/{window/scheduler => scheduler_property}/index.md (94%) diff --git a/files/en-us/_redirects.txt b/files/en-us/_redirects.txt index e645bf661f75338..3dbf1a3fe628611 100644 --- a/files/en-us/_redirects.txt +++ b/files/en-us/_redirects.txt @@ -10190,6 +10190,7 @@ /en-US/docs/Web/API/Window/removeEventListener /en-US/docs/Web/API/EventTarget/removeEventListener /en-US/docs/Web/API/Window/resolveLocalFileSystemURL /en-US/docs/Web/API/File_and_Directory_Entries_API#resolvelocalfilesystemurl() /en-US/docs/Web/API/Window/restore /en-US/docs/Web/API/Window/moveTo +/en-US/docs/Web/API/Window/scheduler /en-US/docs/Web/API/scheduler_property /en-US/docs/Web/API/Window/setInterval /en-US/docs/Web/API/setInterval /en-US/docs/Web/API/Window/setTimeout /en-US/docs/Web/API/setTimeout /en-US/docs/Web/API/Window/sidebar/Adding_search_engines_from_Web_pages /en-US/docs/Web/OpenSearch diff --git a/files/en-us/web/api/prioritized_task_scheduling_api/index.md b/files/en-us/web/api/prioritized_task_scheduling_api/index.md index 20fa34297b19129..5454164562124de 100644 --- a/files/en-us/web/api/prioritized_task_scheduling_api/index.md +++ b/files/en-us/web/api/prioritized_task_scheduling_api/index.md @@ -210,7 +210,7 @@ This allows you to avoid blocking the main thread when the user is actively inte - [`Navigator.scheduling`](/en-US/docs/Web/API/Navigator/scheduling) - : This property is the entry point for using the `Scheduling.isInputPending()` method. -- [`Window.scheduler`](/en-US/docs/Web/API/Window/scheduler) +- [`scheduler`](/en-US/docs/Web/API/scheduler_property) - : This property is the entry point for using the `Scheduler.postTask()` method. It is implemented on [`Window`](/en-US/docs/Web/API/Window#scheduler) and [`WorkerGlobalScope`](/en-US/docs/Web/API/WorkerGlobalScope#scheduler), making an instance of {{domxref("Scheduler")}} available through `this` in most scopes. @@ -233,7 +233,7 @@ function mylog(text) { ### Feature checking -Check whether prioritized task scheduling is supported by testing for the [`scheduler`](/en-US/docs/Web/API/Window/scheduler) property in the global "`this`" exposed to the current scope. +Check whether prioritized task scheduling is supported by testing for the [`scheduler`](/en-US/docs/Web/API/scheduler_property) property in the global "`this`" exposed to the current scope. The code below prints "Feature: Supported" if the API is supported on this browser. diff --git a/files/en-us/web/api/window/scheduler/index.md b/files/en-us/web/api/scheduler_property/index.md similarity index 94% rename from files/en-us/web/api/window/scheduler/index.md rename to files/en-us/web/api/scheduler_property/index.md index 9f94f1abd694d96..e8e0f31bb1c0260 100644 --- a/files/en-us/web/api/window/scheduler/index.md +++ b/files/en-us/web/api/scheduler_property/index.md @@ -1,8 +1,8 @@ --- -title: "Window: scheduler property" +title: scheduler global property short-title: scheduler -slug: Web/API/Window/scheduler -page-type: web-api-instance-property +slug: Web/API/scheduler_property +page-type: web-api-global-property browser-compat: api.scheduler --- diff --git a/files/jsondata/GroupData.json b/files/jsondata/GroupData.json index c94ccf2408152b3..4aa7c9a66abd1a2 100644 --- a/files/jsondata/GroupData.json +++ b/files/jsondata/GroupData.json @@ -1133,7 +1133,7 @@ "TaskPriorityChangeEvent" ], "methods": [], - "properties": ["Navigator.scheduling", "Window.scheduler"], + "properties": ["Navigator.scheduling", "scheduler_property"], "events": [] }, "Push API": { From a534297e92046c4b9b46773d8a5e79c809bb4c76 Mon Sep 17 00:00:00 2001 From: skyclouds2001 <95597335+skyclouds2001@users.noreply.github.com> Date: Thu, 9 Nov 2023 20:06:41 +0800 Subject: [PATCH 18/52] Add Navigator.bluetooth (#30150) * add Navigator.bluetooth * update navigator description * update group data * Update index.md * Apply suggestions from code review Co-authored-by: Jean-Yves Perrier --------- Co-authored-by: Jean-Yves Perrier --- .../web/api/navigator/bluetooth/index.md | 29 +++++++++++++++++++ files/en-us/web/api/navigator/index.md | 2 ++ files/jsondata/GroupData.json | 5 +++- 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 files/en-us/web/api/navigator/bluetooth/index.md diff --git a/files/en-us/web/api/navigator/bluetooth/index.md b/files/en-us/web/api/navigator/bluetooth/index.md new file mode 100644 index 000000000000000..ac90de2e54e1070 --- /dev/null +++ b/files/en-us/web/api/navigator/bluetooth/index.md @@ -0,0 +1,29 @@ +--- +title: "Navigator: bluetooth property" +short-title: bluetooth +slug: Web/API/Navigator/bluetooth +page-type: web-api-instance-property +status: + - experimental +browser-compat: api.Navigator.bluetooth +--- + +{{APIRef("Web Bluetooth API")}}{{SeeCompatTable}}{{secureContext_header}} + +The **`bluetooth`** read-only property of the {{domxref("Navigator")}} interface returns a {{domxref("Bluetooth")}} object for the current document, providing access to [Web Bluetooth API](/en-US/docs/Web/API/Web_Bluetooth_API) functionality. + +## Value + +A {{domxref("Bluetooth")}} object. + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## See also + +- [Web Bluetooth API](/en-US/docs/Web/API/Web_Bluetooth_API) diff --git a/files/en-us/web/api/navigator/index.md b/files/en-us/web/api/navigator/index.md index ad56a5711c24b98..74ef922cd089c01 100644 --- a/files/en-us/web/api/navigator/index.md +++ b/files/en-us/web/api/navigator/index.md @@ -17,6 +17,8 @@ _Doesn't inherit any properties._ ### Standard properties +- {{domxref("Navigator.bluetooth")}} {{ReadOnlyInline}} {{Experimental_Inline}} + - : Returns a {{domxref("Bluetooth")}} object for the current document, providing access to [Web Bluetooth API](/en-US/docs/Web/API/Web_Bluetooth_API) functionality. - {{domxref("Navigator.clipboard")}} {{ReadOnlyInline}} - : Returns a {{domxref("Clipboard")}} object that provides read and write access to the system clipboard. - {{domxref("Navigator.connection")}} {{ReadOnlyInline}} {{Experimental_Inline}} diff --git a/files/jsondata/GroupData.json b/files/jsondata/GroupData.json index 4aa7c9a66abd1a2..634e5cce61fa3c6 100644 --- a/files/jsondata/GroupData.json +++ b/files/jsondata/GroupData.json @@ -78,14 +78,17 @@ "Bluetooth API": { "overview": ["Web Bluetooth API"], "interfaces": [ + "Bluetooth", + "BluetoothCharacteristicProperties", "BluetoothDevice", "BluetoothRemoteGATTCharacteristic", + "BluetoothRemoteGATTDescriptor", "BluetoothRemoteGATTServer", "BluetoothRemoteGATTService", "BluetoothUUID" ], "methods": [], - "properties": [], + "properties": ["Navigator.bluetooth"], "events": [] }, "Canvas API": { From 679372b4126add5bdff01a9b99e2a8d86eefcecb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 9 Nov 2023 14:34:14 +0000 Subject: [PATCH 19/52] Bump @mdn/yari from 2.34.1 to 2.34.2 (#30156) --- package.json | 2 +- yarn.lock | 830 ++++++++++++++++++++++++++++++--------------------- 2 files changed, 485 insertions(+), 347 deletions(-) diff --git a/package.json b/package.json index 46e505ae62c0844..3ebd7ede982c1c7 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "dependencies": { "@apideck/better-ajv-errors": "^0.3.6", "@caporal/core": "^2.0.7", - "@mdn/yari": "2.34.1", + "@mdn/yari": "2.34.2", "ajv": "^8.12.0", "ajv-formats": "^2.1.1", "async": "^3.2.5", diff --git a/yarn.lock b/yarn.lock index b689aef59eca0e9..eca69b4ddf35072 100644 --- a/yarn.lock +++ b/yarn.lock @@ -837,25 +837,27 @@ dependencies: "@lezer/common" "^1.0.0" -"@ljharb/through@^2.3.9": - version "2.3.9" - resolved "https://registry.yarnpkg.com/@ljharb/through/-/through-2.3.9.tgz#85f221eb82f9d555e180e87d6e50fb154af85408" - integrity sha512-yN599ZBuMPPK4tdoToLlvgJB4CLK8fGl7ntfy0Wn7U6ttNvHYurd81bfUiK/6sMkiIwm65R6ck4L6+Y3DfVbNQ== +"@ljharb/through@^2.3.11": + version "2.3.11" + resolved "https://registry.yarnpkg.com/@ljharb/through/-/through-2.3.11.tgz#783600ff12c06f21a76cc26e33abd0b1595092f9" + integrity sha512-ccfcIDlogiXNq5KcbAwbaO7lMh3Tm1i3khMPYpxlK8hH/W53zN81KM9coerRLOnTGu3nfXIniAmQbRI9OxbC0w== + dependencies: + call-bind "^1.0.2" "@mdn/bcd-utils-api@^0.0.4": version "0.0.4" resolved "https://registry.npmjs.org/@mdn/bcd-utils-api/-/bcd-utils-api-0.0.4.tgz" integrity sha512-X9Qs+Um1EyFiQVZ8wEGPMEwN53VePTpZGMt2S0glKjVxwpF1kMQfKtPoaTcWmRl7kmNpCVYjvB5c3MdMTyxrxQ== -"@mdn/browser-compat-data@^5.3.28": - version "5.3.28" - resolved "https://registry.yarnpkg.com/@mdn/browser-compat-data/-/browser-compat-data-5.3.28.tgz#e00791109777b9cf8f85563f531a8c192f497c07" - integrity sha512-vC+UDAsQti7Cv2oBahPfgnTXT7n0XZk8e7UFucNMmkauszdiiEsNFI0elmMMrh2u+IaMOvAAHo3DDzMx7y80Cw== +"@mdn/browser-compat-data@^5.3.29": + version "5.3.29" + resolved "https://registry.yarnpkg.com/@mdn/browser-compat-data/-/browser-compat-data-5.3.29.tgz#4e2620a36fea61de464a8b59461c6d3bbd064a5b" + integrity sha512-ipYCpMxejriKEC5OMHHN+cTTWpTQhaSg9+RGHl/Vly2LhGNml2eiGdx+LCU4XcCsi4YVVVPGcirNI/dF1xj70w== -"@mdn/yari@2.34.1": - version "2.34.1" - resolved "https://registry.yarnpkg.com/@mdn/yari/-/yari-2.34.1.tgz#6858a42a0549afbbe8b53ab0cc11f6dd00644b64" - integrity sha512-Y9CrWhOhs7Ss5noCm+ROQ1R5NuLRujgFdjmV0sEBxsYrG2JiSpF5oLeImvCMWCuKz64WHRJ+IYu+D5BM4/RTGw== +"@mdn/yari@2.34.2": + version "2.34.2" + resolved "https://registry.yarnpkg.com/@mdn/yari/-/yari-2.34.2.tgz#e8c70afb416ebfde8bcf2b7503079d7dc47fb6d6" + integrity sha512-t0J9nswHNk+zl45U47xr5VG9peg0HRktihil8FSJojvv8ZW4mT8jeeXmnZs19TC5d8oaFfT6HqAUqe/xIn0Grw== dependencies: "@caporal/core" "^2.0.7" "@codemirror/lang-css" "^6.2.1" @@ -865,10 +867,10 @@ "@codemirror/theme-one-dark" "^6.1.2" "@fast-csv/parse" "^4.3.6" "@mdn/bcd-utils-api" "^0.0.4" - "@mdn/browser-compat-data" "^5.3.28" + "@mdn/browser-compat-data" "^5.3.29" "@mozilla/glean" "2.0.5" - "@sentry/integrations" "^7.77.0" - "@sentry/node" "^7.77.0" + "@sentry/integrations" "^7.78.0" + "@sentry/node" "^7.78.0" "@stripe/stripe-js" "^2.1.11" "@use-it/interval" "^1.0.0" "@vscode/ripgrep" "^1.15.6" @@ -880,7 +882,7 @@ cli-progress "^3.12.0" codemirror "^6.0.1" compression "^1.7.4" - cookie "^0.5.0" + cookie "^0.6.0" cookie-parser "^1.4.6" css-tree "^2.3.1" dayjs "^1.11.10" @@ -902,7 +904,7 @@ imagemin-mozjpeg "^10.0.0" imagemin-pngquant "^9.0.2" imagemin-svgo "^10.0.1" - inquirer "^9.2.11" + inquirer "^9.2.12" is-svg "^5.0.0" js-yaml "^4.1.0" loglevel "^1.8.1" @@ -913,29 +915,29 @@ mdn-data "^2.2.0" open "^9.1.0" open-editor "^4.1.1" - openai "^4.15.4" + openai "^4.16.1" prism-svelte "^0.5.0" prismjs "^1.29.0" react-markdown "^8.0.7" react-modal "^3.16.1" read-chunk "^4.0.3" - rehype-format "^5.0.0" + rehype-format "^4.0.1" rehype-raw "^7.0.0" rehype-sanitize "^6.0.0" - rehype-stringify "^10.0.0" - remark-gfm "^4.0.0" - remark-parse "^11.0.0" - remark-rehype "^11.0.0" + rehype-stringify "^9.0.4" + remark-gfm "^3.0.1" + remark-parse "^10.0.2" + remark-rehype "^10.1.0" sanitize-filename "^1.6.3" send "^0.18.0" source-map-support "^0.5.21" sse.js "^1.0.0" tempy "^3.1.0" - unified "^11.0.4" + unified "^10.1.2" unist-builder "^4.0.0" unist-util-visit "^5.0.0" web-features "^0.4.1" - web-specs "^2.71.0" + web-specs "^2.72.0" "@mozilla/glean@2.0.5": version "2.0.5" @@ -968,55 +970,55 @@ "@nodelib/fs.scandir" "2.1.3" fastq "^1.6.0" -"@sentry-internal/tracing@7.77.0": - version "7.77.0" - resolved "https://registry.yarnpkg.com/@sentry-internal/tracing/-/tracing-7.77.0.tgz#f3d82486f8934a955b3dd2aa54c8d29586e42a37" - integrity sha512-8HRF1rdqWwtINqGEdx8Iqs9UOP/n8E0vXUu3Nmbqj4p5sQPA7vvCfq+4Y4rTqZFc7sNdFpDsRION5iQEh8zfZw== +"@sentry-internal/tracing@7.79.0": + version "7.79.0" + resolved "https://registry.yarnpkg.com/@sentry-internal/tracing/-/tracing-7.79.0.tgz#db99820e93e15bf4d990f1b270a1d1c2a69fd564" + integrity sha512-Mf9Bd0OrZ24h1qZpvmz9IRnfORMGYNYC1xWBBFpIR1AauEDX89x+mJwIOrUc4KKAAAwt73shrJv1QA8QOm4E3g== dependencies: - "@sentry/core" "7.77.0" - "@sentry/types" "7.77.0" - "@sentry/utils" "7.77.0" + "@sentry/core" "7.79.0" + "@sentry/types" "7.79.0" + "@sentry/utils" "7.79.0" -"@sentry/core@7.77.0": - version "7.77.0" - resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.77.0.tgz#21100843132beeeff42296c8370cdcc7aa1d8510" - integrity sha512-Tj8oTYFZ/ZD+xW8IGIsU6gcFXD/gfE+FUxUaeSosd9KHwBQNOLhZSsYo/tTVf/rnQI/dQnsd4onPZLiL+27aTg== +"@sentry/core@7.79.0": + version "7.79.0" + resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.79.0.tgz#08871bd686afd58125f43421d3dcb65a3b9208b0" + integrity sha512-9vG7SfOcJNJNiqlqg4MuHDUCaSf2ZXpv3eZYRPbBkgPGr8X1ekrSABpOK+6kBNvbtKxfWVTWbLpAA6xU+cwnVw== dependencies: - "@sentry/types" "7.77.0" - "@sentry/utils" "7.77.0" + "@sentry/types" "7.79.0" + "@sentry/utils" "7.79.0" -"@sentry/integrations@^7.77.0": - version "7.77.0" - resolved "https://registry.yarnpkg.com/@sentry/integrations/-/integrations-7.77.0.tgz#f2717e05cb7c69363316ccd34096b2ea07ae4c59" - integrity sha512-P055qXgBHeZNKnnVEs5eZYLdy6P49Zr77A1aWJuNih/EenzMy922GOeGy2mF6XYrn1YJSjEwsNMNsQkcvMTK8Q== +"@sentry/integrations@^7.78.0": + version "7.79.0" + resolved "https://registry.yarnpkg.com/@sentry/integrations/-/integrations-7.79.0.tgz#8ee7df9e036a8b59a72aa5151f02cb62e2b593cc" + integrity sha512-BcD9KDgvFFoVkWGTZXu4jZ/zitXYJr39B0CQuJUfO/QquoKdAGvzcNXOKrq/sT9yMu1kl3e9MVqNxxrbXUkWWQ== dependencies: - "@sentry/core" "7.77.0" - "@sentry/types" "7.77.0" - "@sentry/utils" "7.77.0" + "@sentry/core" "7.79.0" + "@sentry/types" "7.79.0" + "@sentry/utils" "7.79.0" localforage "^1.8.1" -"@sentry/node@^7.77.0": - version "7.77.0" - resolved "https://registry.yarnpkg.com/@sentry/node/-/node-7.77.0.tgz#a247452779a5bcb55724457707286e3e4a29dbbe" - integrity sha512-Ob5tgaJOj0OYMwnocc6G/CDLWC7hXfVvKX/ofkF98+BbN/tQa5poL+OwgFn9BA8ud8xKzyGPxGU6LdZ8Oh3z/g== +"@sentry/node@^7.78.0": + version "7.79.0" + resolved "https://registry.yarnpkg.com/@sentry/node/-/node-7.79.0.tgz#8921037fa5af805d35597d210725b730b31df33e" + integrity sha512-7kZpYG5hGyt3JhEfo9YtEhbUMwFOzNRQqL/weKgHSyFXU20VcScorceKG2Hynn0rhdAZR6GfdKHsM4kFQvgmtg== dependencies: - "@sentry-internal/tracing" "7.77.0" - "@sentry/core" "7.77.0" - "@sentry/types" "7.77.0" - "@sentry/utils" "7.77.0" + "@sentry-internal/tracing" "7.79.0" + "@sentry/core" "7.79.0" + "@sentry/types" "7.79.0" + "@sentry/utils" "7.79.0" https-proxy-agent "^5.0.0" -"@sentry/types@7.77.0": - version "7.77.0" - resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.77.0.tgz#c5d00fe547b89ccde59cdea59143bf145cee3144" - integrity sha512-nfb00XRJVi0QpDHg+JkqrmEBHsqBnxJu191Ded+Cs1OJ5oPXEW6F59LVcBScGvMqe+WEk1a73eH8XezwfgrTsA== +"@sentry/types@7.79.0": + version "7.79.0" + resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.79.0.tgz#b47c53a3f8b9057aac820fe99e1154949aac934d" + integrity sha512-3tV32+v/DF8w7kD0p3kLWtgVTVdFL39oGY02+vz//rjWg/vzeqSE95mCYKm5pUfd6cPETX/8dunCiuTBQIkTHQ== -"@sentry/utils@7.77.0": - version "7.77.0" - resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.77.0.tgz#1f88501f0b8777de31b371cf859d13c82ebe1379" - integrity sha512-NmM2kDOqVchrey3N5WSzdQoCsyDkQkiRxExPaNI2oKQ/jMWHs9yt0tSy7otPBcXs0AP59ihl75Bvm1tDRcsp5g== +"@sentry/utils@7.79.0": + version "7.79.0" + resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.79.0.tgz#c410b6c0e3032dbc9e708177555c70bdb8d1f63b" + integrity sha512-tUTlb6PvfZawqBmBK9CPXflqrZDXHKWoX3fve2zLK6W0FSpIMOO4TH8PBqkHBFs0ZgF/bnv/bsM4z7uEAlAtzg== dependencies: - "@sentry/types" "7.77.0" + "@sentry/types" "7.79.0" "@sinclair/typebox@^0.27.8": version "0.27.8" @@ -1228,6 +1230,11 @@ dependencies: undici-types "~5.26.4" +"@types/parse5@^6.0.0": + version "6.0.3" + resolved "https://registry.yarnpkg.com/@types/parse5/-/parse5-6.0.3.tgz#705bb349e789efa06f43f128cef51240753424cb" + integrity sha512-SuT16Q1K51EAVPz1K29DJ/sXjhSQ0zjvsypYJ6tlwVsRV9jwW5Adq2ch8Dq8kDBCkYnELS7N7VNCSB5nC56t/g== + "@types/prop-types@^15.0.0": version "15.7.5" resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.5.tgz#5f19d2b85a98e9558036f6a3cacc8819420f05cf" @@ -1889,6 +1896,15 @@ call-bind@^1.0.0: function-bind "^1.1.1" get-intrinsic "^1.0.2" +call-bind@^1.0.2: + version "1.0.5" + resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.5.tgz#6fa2b7845ce0ea49bf4d8b9ef64727a2c2e2e513" + integrity sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ== + dependencies: + function-bind "^1.1.2" + get-intrinsic "^1.2.1" + set-function-length "^1.1.1" + callsites@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" @@ -2370,11 +2386,16 @@ cookie@0.4.1: resolved "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz" integrity sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA== -cookie@0.5.0, cookie@^0.5.0: +cookie@0.5.0: version "0.5.0" resolved "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz" integrity sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw== +cookie@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.6.0.tgz#2798b04b071b0ecbff0dbb62a505a8efa4e19051" + integrity sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw== + core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz" @@ -2651,6 +2672,15 @@ defer-to-connect@^2.0.1: resolved "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz" integrity sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg== +define-data-property@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/define-data-property/-/define-data-property-1.1.1.tgz#c35f7cd0ab09883480d12ac5cb213715587800b3" + integrity sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ== + dependencies: + get-intrinsic "^1.2.1" + gopd "^1.0.1" + has-property-descriptors "^1.0.0" + define-lazy-prop@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz" @@ -2691,7 +2721,7 @@ detect-newline@^3.0.0: resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== -devlop@^1.0.0, devlop@^1.1.0: +devlop@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/devlop/-/devlop-1.1.0.tgz#4db7c2ca4dc6e0e834c30be70c94bbc976dc7018" integrity sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA== @@ -3535,6 +3565,11 @@ function-bind@^1.1.1: resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz" integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== +function-bind@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c" + integrity sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA== + gauge@~1.2.5: version "1.2.7" resolved "https://registry.npmjs.org/gauge/-/gauge-1.2.7.tgz" @@ -3565,6 +3600,16 @@ get-intrinsic@^1.0.2: has "^1.0.3" has-symbols "^1.0.1" +get-intrinsic@^1.1.3, get-intrinsic@^1.2.1, get-intrinsic@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.2.tgz#281b7622971123e1ef4b3c90fd7539306da93f3b" + integrity sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA== + dependencies: + function-bind "^1.1.2" + has-proto "^1.0.1" + has-symbols "^1.0.3" + hasown "^2.0.0" + get-package-type@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a" @@ -3681,6 +3726,13 @@ globby@^12.0.0: merge2 "^1.4.1" slash "^4.0.0" +gopd@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.0.1.tgz#29ff76de69dac7489b7c0918a5788e56477c332c" + integrity sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA== + dependencies: + get-intrinsic "^1.1.3" + got@^13.0.0: version "13.0.0" resolved "https://registry.yarnpkg.com/got/-/got-13.0.0.tgz#a2402862cef27a5d0d1b07c0fb25d12b58175422" @@ -3783,12 +3835,24 @@ has-flag@^4.0.0: resolved "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== +has-property-descriptors@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has-property-descriptors/-/has-property-descriptors-1.0.1.tgz#52ba30b6c5ec87fd89fa574bc1c39125c6f65340" + integrity sha512-VsX8eaIewvas0xnvinAe9bw4WfIeODpGYikiWYLH+dma0Jw6KHYqWiWfhQlgOVK8D6PvjubK5Uc4P0iIhIcNVg== + dependencies: + get-intrinsic "^1.2.2" + +has-proto@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has-proto/-/has-proto-1.0.1.tgz#1885c1305538958aff469fef37937c22795408e0" + integrity sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg== + has-symbol-support-x@^1.4.1: version "1.4.2" resolved "https://registry.npmjs.org/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz" integrity sha512-3ToOva++HaW+eCpgqZrCfN51IPB+7bJNVT6CUATzueB5Heb8o6Nam0V3HG5dlDvZU1Gn5QLcbahiKw/XVk5JJw== -has-symbols@^1.0.1: +has-symbols@^1.0.1, has-symbols@^1.0.3: version "1.0.3" resolved "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz" integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== @@ -3812,13 +3876,32 @@ has@^1.0.3: dependencies: function-bind "^1.1.1" -hast-util-embedded@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/hast-util-embedded/-/hast-util-embedded-3.0.0.tgz#be4477780fbbe079cdba22982e357a0de4ba853e" - integrity sha512-naH8sld4Pe2ep03qqULEtvYr7EjrLK2QHY8KJR6RJkTUjPGObe1vnx585uzem2hGra+s1q08DZZpfgDVYRbaXA== +hasown@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.0.tgz#f4c513d454a57b7c7e1650778de226b11700546c" + integrity sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA== dependencies: - "@types/hast" "^3.0.0" - hast-util-is-element "^3.0.0" + function-bind "^1.1.2" + +hast-util-embedded@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/hast-util-embedded/-/hast-util-embedded-2.0.1.tgz#979e07ecc6bc42b560ccac755cab926c354f24c7" + integrity sha512-QUdSOP1/o+/TxXtpPFXR2mUg2P+ySrmlX7QjwHZCXqMFyYk7YmcGSvqRW+4XgXAoHifdE1t2PwFaQK33TqVjSw== + dependencies: + hast-util-is-element "^2.0.0" + +hast-util-from-parse5@^7.0.0: + version "7.1.2" + resolved "https://registry.yarnpkg.com/hast-util-from-parse5/-/hast-util-from-parse5-7.1.2.tgz#aecfef73e3ceafdfa4550716443e4eb7b02e22b0" + integrity sha512-Nz7FfPBuljzsN3tCQ4kCBKqdNhQE2l0Tn+X1ubgKBPRoiDIu1mL08Cfw4k7q71+Duyaw7DXDN+VTAp4Vh3oCOw== + dependencies: + "@types/hast" "^2.0.0" + "@types/unist" "^2.0.0" + hastscript "^7.0.0" + property-information "^6.0.0" + vfile "^5.0.0" + vfile-location "^4.0.0" + web-namespaces "^2.0.0" hast-util-from-parse5@^8.0.0: version "8.0.1" @@ -3834,26 +3917,34 @@ hast-util-from-parse5@^8.0.0: vfile-location "^5.0.0" web-namespaces "^2.0.0" -hast-util-has-property@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/hast-util-has-property/-/hast-util-has-property-3.0.0.tgz#4e595e3cddb8ce530ea92f6fc4111a818d8e7f93" - integrity sha512-MNilsvEKLFpV604hwfhVStK0usFY/QmM5zX16bo7EjnAEGofr5YyI37kzopBlZJkHD4t887i+q/C8/tr5Q94cA== +hast-util-has-property@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/hast-util-has-property/-/hast-util-has-property-2.0.1.tgz#8ec99c3e8f02626304ee438cdb9f0528b017e083" + integrity sha512-X2+RwZIMTMKpXUzlotatPzWj8bspCymtXH3cfG3iQKV+wPF53Vgaqxi/eLqGck0wKq1kS9nvoB1wchbCPEL8sg== + +hast-util-is-body-ok-link@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/hast-util-is-body-ok-link/-/hast-util-is-body-ok-link-2.0.0.tgz#e0df6947b2676d2acac55c611755d359f264958e" + integrity sha512-S58hCexyKdD31vMsErvgLfflW6vYWo/ixRLPJTtkOvLld24vyI8vmYmkgLA5LG3la2ME7nm7dLGdm48gfLRBfw== dependencies: - "@types/hast" "^3.0.0" + "@types/hast" "^2.0.0" + hast-util-has-property "^2.0.0" + hast-util-is-element "^2.0.0" -hast-util-is-body-ok-link@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/hast-util-is-body-ok-link/-/hast-util-is-body-ok-link-3.0.0.tgz#6b2d808813a6f73eb20e61bdd2b203591af85eb4" - integrity sha512-VFHY5bo2nY8HiV6nir2ynmEB1XkxzuUffhEGeVx7orbu/B1KaGyeGgMZldvMVx5xWrDlLLG/kQ6YkJAMkBEx0w== +hast-util-is-element@^2.0.0: + version "2.1.3" + resolved "https://registry.yarnpkg.com/hast-util-is-element/-/hast-util-is-element-2.1.3.tgz#cd3279cfefb70da6d45496068f020742256fc471" + integrity sha512-O1bKah6mhgEq2WtVMk+Ta5K7pPMqsBBlmzysLdcwKVrqzZQ0CHqUPiIVspNhAG1rvxpvJjtGee17XfauZYKqVA== dependencies: - "@types/hast" "^3.0.0" + "@types/hast" "^2.0.0" + "@types/unist" "^2.0.0" -hast-util-is-element@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/hast-util-is-element/-/hast-util-is-element-3.0.0.tgz#6e31a6532c217e5b533848c7e52c9d9369ca0932" - integrity sha512-Val9mnv2IWpLbNPqc/pUem+a7Ipj2aHacCwgNfTiK0vJKl0LF+4Ba4+v1oPHFpf3bLYmreq0/l3Gud9S5OH42g== +hast-util-parse-selector@^3.0.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/hast-util-parse-selector/-/hast-util-parse-selector-3.1.1.tgz#25ab00ae9e75cbc62cf7a901f68a247eade659e2" + integrity sha512-jdlwBjEexy1oGz0aJ2f4GKMaVKkA9jwjr4MjAAI22E5fM/TXVZHuS5OpONtdeIkRKqAaryQ2E9xNQxijoThSZA== dependencies: - "@types/hast" "^3.0.0" + "@types/hast" "^2.0.0" hast-util-parse-selector@^4.0.0: version "4.0.0" @@ -3862,16 +3953,33 @@ hast-util-parse-selector@^4.0.0: dependencies: "@types/hast" "^3.0.0" -hast-util-phrasing@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/hast-util-phrasing/-/hast-util-phrasing-3.0.1.tgz#fa284c0cd4a82a0dd6020de8300a7b1ebffa1690" - integrity sha512-6h60VfI3uBQUxHqTyMymMZnEbNl1XmEGtOxxKYL7stY2o601COo62AWAYBQR9lZbYXYSBoxag8UpPRXK+9fqSQ== +hast-util-phrasing@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/hast-util-phrasing/-/hast-util-phrasing-2.0.2.tgz#0747ba8000a8d5598bef4000819d92fda8f8843c" + integrity sha512-yGkCfPkkfCyiLfK6KEl/orMDr/zgCnq/NaO9HfULx6/Zga5fso5eqQA5Ov/JZVqACygvw9shRYWgXNcG2ilo7w== dependencies: - "@types/hast" "^3.0.0" - hast-util-embedded "^3.0.0" - hast-util-has-property "^3.0.0" - hast-util-is-body-ok-link "^3.0.0" - hast-util-is-element "^3.0.0" + "@types/hast" "^2.0.0" + hast-util-embedded "^2.0.0" + hast-util-has-property "^2.0.0" + hast-util-is-body-ok-link "^2.0.0" + hast-util-is-element "^2.0.0" + +hast-util-raw@^7.0.0: + version "7.2.3" + resolved "https://registry.yarnpkg.com/hast-util-raw/-/hast-util-raw-7.2.3.tgz#dcb5b22a22073436dbdc4aa09660a644f4991d99" + integrity sha512-RujVQfVsOrxzPOPSzZFiwofMArbQke6DJjnFfceiEbFh7S05CbPt0cYN+A5YeD3pso0JQk6O1aHBnx9+Pm2uqg== + dependencies: + "@types/hast" "^2.0.0" + "@types/parse5" "^6.0.0" + hast-util-from-parse5 "^7.0.0" + hast-util-to-parse5 "^7.0.0" + html-void-elements "^2.0.0" + parse5 "^6.0.0" + unist-util-position "^4.0.0" + unist-util-visit "^4.0.0" + vfile "^5.0.0" + web-namespaces "^2.0.0" + zwitch "^2.0.0" hast-util-raw@^9.0.0: version "9.0.1" @@ -3901,24 +4009,35 @@ hast-util-sanitize@^5.0.0: "@ungap/structured-clone" "^1.2.0" unist-util-position "^5.0.0" -hast-util-to-html@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/hast-util-to-html/-/hast-util-to-html-9.0.0.tgz#51c0ae2a3550b9aa988c094c4fc4e327af0dddd1" - integrity sha512-IVGhNgg7vANuUA2XKrT6sOIIPgaYZnmLx3l/CCOAK0PtgfoHrZwX7jCSYyFxHTrGmC6S9q8aQQekjp4JPZF+cw== +hast-util-to-html@^8.0.0: + version "8.0.4" + resolved "https://registry.yarnpkg.com/hast-util-to-html/-/hast-util-to-html-8.0.4.tgz#0269ef33fa3f6599b260a8dc94f733b8e39e41fc" + integrity sha512-4tpQTUOr9BMjtYyNlt0P50mH7xj0Ks2xpo8M943Vykljf99HW6EzulIoJP1N3eKOSScEHzyzi9dm7/cn0RfGwA== dependencies: - "@types/hast" "^3.0.0" - "@types/unist" "^3.0.0" + "@types/hast" "^2.0.0" + "@types/unist" "^2.0.0" ccount "^2.0.0" comma-separated-tokens "^2.0.0" - hast-util-raw "^9.0.0" - hast-util-whitespace "^3.0.0" - html-void-elements "^3.0.0" - mdast-util-to-hast "^13.0.0" + hast-util-raw "^7.0.0" + hast-util-whitespace "^2.0.0" + html-void-elements "^2.0.0" property-information "^6.0.0" space-separated-tokens "^2.0.0" stringify-entities "^4.0.0" zwitch "^2.0.4" +hast-util-to-parse5@^7.0.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/hast-util-to-parse5/-/hast-util-to-parse5-7.1.0.tgz#c49391bf8f151973e0c9adcd116b561e8daf29f3" + integrity sha512-YNRgAJkH2Jky5ySkIqFXTQiaqcAtJyVE+D5lkN6CdtOqrnkLfGYYrEcKuHOJZlp+MwjSwuD3fZuawI+sic/RBw== + dependencies: + "@types/hast" "^2.0.0" + comma-separated-tokens "^2.0.0" + property-information "^6.0.0" + space-separated-tokens "^2.0.0" + web-namespaces "^2.0.0" + zwitch "^2.0.0" + hast-util-to-parse5@^8.0.0: version "8.0.0" resolved "https://registry.yarnpkg.com/hast-util-to-parse5/-/hast-util-to-parse5-8.0.0.tgz#477cd42d278d4f036bc2ea58586130f6f39ee6ed" @@ -3937,12 +4056,16 @@ hast-util-whitespace@^2.0.0: resolved "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-2.0.1.tgz" integrity sha512-nAxA0v8+vXSBDt3AnRUNjyRIQ0rD+ntpbAp4LnPkumc5M9yUbSMa4XDU9Q6etY4f1Wp4bNgvc1yjiZtsTTrSng== -hast-util-whitespace@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/hast-util-whitespace/-/hast-util-whitespace-3.0.0.tgz#7778ed9d3c92dd9e8c5c8f648a49c21fc51cb621" - integrity sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw== +hastscript@^7.0.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/hastscript/-/hastscript-7.2.0.tgz#0eafb7afb153d047077fa2a833dc9b7ec604d10b" + integrity sha512-TtYPq24IldU8iKoJQqvZOuhi5CyCQRAbvDOX0x1eW6rsHSxa/1i2CCiptNTotGHJ3VoHRGmqiv6/D3q113ikkw== dependencies: - "@types/hast" "^3.0.0" + "@types/hast" "^2.0.0" + comma-separated-tokens "^2.0.0" + hast-util-parse-selector "^3.0.0" + property-information "^6.0.0" + space-separated-tokens "^2.0.0" hastscript@^8.0.0: version "8.0.0" @@ -3965,15 +4088,20 @@ html-escaper@^2.0.0: resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== +html-void-elements@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/html-void-elements/-/html-void-elements-2.0.1.tgz#29459b8b05c200b6c5ee98743c41b979d577549f" + integrity sha512-0quDb7s97CfemeJAnW9wC0hw78MtW7NU3hqtCD75g2vFlDLt36llsYD7uB7SUzojLMP24N5IatXf7ylGXiGG9A== + html-void-elements@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/html-void-elements/-/html-void-elements-3.0.0.tgz#fc9dbd84af9e747249034d4d62602def6517f1d7" integrity sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg== -html-whitespace-sensitive-tag-names@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/html-whitespace-sensitive-tag-names/-/html-whitespace-sensitive-tag-names-3.0.0.tgz#c7c8c11d93c014fba642e240d7f3da39656ab301" - integrity sha512-KlClZ3/Qy5UgvpvVvDomGhnQhNWH5INE8GwvSIQ9CWt1K0zbbXrl7eN5bWaafOZgtmO3jMPwUqmrmEwinhPq1w== +html-whitespace-sensitive-tag-names@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/html-whitespace-sensitive-tag-names/-/html-whitespace-sensitive-tag-names-2.0.0.tgz#80c7512c969de90c94279641068fafb5fa6da468" + integrity sha512-SQdIvTTtnHAx72xGUIUudvVOCjeWvV1U7rvSFnNGxTGRw3ZC7RES4Gw6dm1nMYD60TXvm6zjk/bWqgNc5pjQaw== htmlparser2@^8.0.1: version "8.0.1" @@ -4265,12 +4393,12 @@ inquirer@^6.0.0: strip-ansi "^5.1.0" through "^2.3.6" -inquirer@^9.2.11: - version "9.2.11" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-9.2.11.tgz#e9003755c233a414fceda1891c23bd622cad4a95" - integrity sha512-B2LafrnnhbRzCWfAdOXisUzL89Kg8cVJlYmhqoi3flSiV/TveO+nsXwgKr9h9PIo+J1hz7nBSk6gegRIMBBf7g== +inquirer@^9.2.12: + version "9.2.12" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-9.2.12.tgz#0348e9311765b7c93fce143bb1c0ef1ae879b1d7" + integrity sha512-mg3Fh9g2zfuVWJn6lhST0O7x4n03k7G8Tx5nvikJkbq8/CK47WDVm+UznF0G6s5Zi0KcyUisr6DU8T67N5U+1Q== dependencies: - "@ljharb/through" "^2.3.9" + "@ljharb/through" "^2.3.11" ansi-escapes "^4.3.2" chalk "^5.3.0" cli-cursor "^3.1.0" @@ -5446,15 +5574,15 @@ mdast-util-definitions@^5.0.0: "@types/unist" "^2.0.0" unist-util-visit "^4.0.0" -mdast-util-find-and-replace@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/mdast-util-find-and-replace/-/mdast-util-find-and-replace-3.0.1.tgz#a6fc7b62f0994e973490e45262e4bc07607b04e0" - integrity sha512-SG21kZHGC3XRTSUhtofZkBzZTJNM5ecCi0SK2IMKmSXR8vO3peL+kb1O0z7Zl83jKtutG4k5Wv/W7V3/YHvzPA== +mdast-util-find-and-replace@^2.0.0: + version "2.2.2" + resolved "https://registry.yarnpkg.com/mdast-util-find-and-replace/-/mdast-util-find-and-replace-2.2.2.tgz#cc2b774f7f3630da4bd592f61966fecade8b99b1" + integrity sha512-MTtdFRz/eMDHXzeK6W3dO7mXUlF82Gom4y0oOgvHhh/HXZAGvIQDUvQ0SuUx+j2tv44b8xTHOm8K/9OoRFnXKw== dependencies: - "@types/mdast" "^4.0.0" + "@types/mdast" "^3.0.0" escape-string-regexp "^5.0.0" - unist-util-is "^6.0.0" - unist-util-visit-parents "^6.0.0" + unist-util-is "^5.0.0" + unist-util-visit-parents "^5.0.0" mdast-util-from-markdown@^1.0.0: version "1.3.1" @@ -5492,70 +5620,71 @@ mdast-util-from-markdown@^2.0.0: micromark-util-types "^2.0.0" unist-util-stringify-position "^4.0.0" -mdast-util-gfm-autolink-literal@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-2.0.0.tgz#5baf35407421310a08e68c15e5d8821e8898ba2a" - integrity sha512-FyzMsduZZHSc3i0Px3PQcBT4WJY/X/RCtEJKuybiC6sjPqLv7h1yqAkmILZtuxMSsUyaLUWNp71+vQH2zqp5cg== +mdast-util-gfm-autolink-literal@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-1.0.3.tgz#67a13abe813d7eba350453a5333ae1bc0ec05c06" + integrity sha512-My8KJ57FYEy2W2LyNom4n3E7hKTuQk/0SES0u16tjA9Z3oFkF4RrC/hPAPgjlSpezsOvI8ObcXcElo92wn5IGA== dependencies: - "@types/mdast" "^4.0.0" + "@types/mdast" "^3.0.0" ccount "^2.0.0" - devlop "^1.0.0" - mdast-util-find-and-replace "^3.0.0" - micromark-util-character "^2.0.0" + mdast-util-find-and-replace "^2.0.0" + micromark-util-character "^1.0.0" -mdast-util-gfm-footnote@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/mdast-util-gfm-footnote/-/mdast-util-gfm-footnote-2.0.0.tgz#25a1753c7d16db8bfd53cd84fe50562bd1e6d6a9" - integrity sha512-5jOT2boTSVkMnQ7LTrd6n/18kqwjmuYqo7JUPe+tRCY6O7dAuTFMtTPauYYrMPpox9hlN0uOx/FL8XvEfG9/mQ== +mdast-util-gfm-footnote@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/mdast-util-gfm-footnote/-/mdast-util-gfm-footnote-1.0.2.tgz#ce5e49b639c44de68d5bf5399877a14d5020424e" + integrity sha512-56D19KOGbE00uKVj3sgIykpwKL179QsVFwx/DCW0u/0+URsryacI4MAdNJl0dh+u2PSsD9FtxPFbHCzJ78qJFQ== dependencies: - "@types/mdast" "^4.0.0" - devlop "^1.1.0" - mdast-util-from-markdown "^2.0.0" - mdast-util-to-markdown "^2.0.0" - micromark-util-normalize-identifier "^2.0.0" + "@types/mdast" "^3.0.0" + mdast-util-to-markdown "^1.3.0" + micromark-util-normalize-identifier "^1.0.0" -mdast-util-gfm-strikethrough@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-2.0.0.tgz#d44ef9e8ed283ac8c1165ab0d0dfd058c2764c16" - integrity sha512-mKKb915TF+OC5ptj5bJ7WFRPdYtuHv0yTRxK2tJvi+BDqbkiG7h7u/9SI89nRAYcmap2xHQL9D+QG/6wSrTtXg== +mdast-util-gfm-strikethrough@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-1.0.3.tgz#5470eb105b483f7746b8805b9b989342085795b7" + integrity sha512-DAPhYzTYrRcXdMjUtUjKvW9z/FNAMTdU0ORyMcbmkwYNbKocDpdk+PX1L1dQgOID/+vVs1uBQ7ElrBQfZ0cuiQ== dependencies: - "@types/mdast" "^4.0.0" - mdast-util-from-markdown "^2.0.0" - mdast-util-to-markdown "^2.0.0" + "@types/mdast" "^3.0.0" + mdast-util-to-markdown "^1.3.0" -mdast-util-gfm-table@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/mdast-util-gfm-table/-/mdast-util-gfm-table-2.0.0.tgz#7a435fb6223a72b0862b33afbd712b6dae878d38" - integrity sha512-78UEvebzz/rJIxLvE7ZtDd/vIQ0RHv+3Mh5DR96p7cS7HsBhYIICDBCu8csTNWNO6tBWfqXPWekRuj2FNOGOZg== +mdast-util-gfm-table@^1.0.0: + version "1.0.7" + resolved "https://registry.yarnpkg.com/mdast-util-gfm-table/-/mdast-util-gfm-table-1.0.7.tgz#3552153a146379f0f9c4c1101b071d70bbed1a46" + integrity sha512-jjcpmNnQvrmN5Vx7y7lEc2iIOEytYv7rTvu+MeyAsSHTASGCCRA79Igg2uKssgOs1i1po8s3plW0sTu1wkkLGg== dependencies: - "@types/mdast" "^4.0.0" - devlop "^1.0.0" + "@types/mdast" "^3.0.0" markdown-table "^3.0.0" - mdast-util-from-markdown "^2.0.0" - mdast-util-to-markdown "^2.0.0" + mdast-util-from-markdown "^1.0.0" + mdast-util-to-markdown "^1.3.0" -mdast-util-gfm-task-list-item@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-2.0.0.tgz#e68095d2f8a4303ef24094ab642e1047b991a936" - integrity sha512-IrtvNvjxC1o06taBAVJznEnkiHxLFTzgonUdy8hzFVeDun0uTjxxrRGVaNFqkU1wJR3RBPEfsxmU6jDWPofrTQ== +mdast-util-gfm-task-list-item@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-1.0.2.tgz#b280fcf3b7be6fd0cc012bbe67a59831eb34097b" + integrity sha512-PFTA1gzfp1B1UaiJVyhJZA1rm0+Tzn690frc/L8vNX1Jop4STZgOE6bxUhnzdVSB+vm2GU1tIsuQcA9bxTQpMQ== dependencies: - "@types/mdast" "^4.0.0" - devlop "^1.0.0" - mdast-util-from-markdown "^2.0.0" - mdast-util-to-markdown "^2.0.0" + "@types/mdast" "^3.0.0" + mdast-util-to-markdown "^1.3.0" -mdast-util-gfm@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/mdast-util-gfm/-/mdast-util-gfm-3.0.0.tgz#3f2aecc879785c3cb6a81ff3a243dc11eca61095" - integrity sha512-dgQEX5Amaq+DuUqf26jJqSK9qgixgd6rYDHAv4aTBuA92cTknZlKpPfa86Z/s8Dj8xsAQpFfBmPUHWJBWqS4Bw== +mdast-util-gfm@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/mdast-util-gfm/-/mdast-util-gfm-2.0.2.tgz#e92f4d8717d74bdba6de57ed21cc8b9552e2d0b6" + integrity sha512-qvZ608nBppZ4icQlhQQIAdc6S3Ffj9RGmzwUKUWuEICFnd1LVkN3EktF7ZHAgfcEdvZB5owU9tQgt99e2TlLjg== dependencies: - mdast-util-from-markdown "^2.0.0" - mdast-util-gfm-autolink-literal "^2.0.0" - mdast-util-gfm-footnote "^2.0.0" - mdast-util-gfm-strikethrough "^2.0.0" - mdast-util-gfm-table "^2.0.0" - mdast-util-gfm-task-list-item "^2.0.0" - mdast-util-to-markdown "^2.0.0" + mdast-util-from-markdown "^1.0.0" + mdast-util-gfm-autolink-literal "^1.0.0" + mdast-util-gfm-footnote "^1.0.0" + mdast-util-gfm-strikethrough "^1.0.0" + mdast-util-gfm-table "^1.0.0" + mdast-util-gfm-task-list-item "^1.0.0" + mdast-util-to-markdown "^1.0.0" + +mdast-util-phrasing@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/mdast-util-phrasing/-/mdast-util-phrasing-3.0.1.tgz#c7c21d0d435d7fb90956038f02e8702781f95463" + integrity sha512-WmI1gTXUBJo4/ZmSk79Wcb2HcjPJBzM1nlI/OUWA8yk2X9ik3ffNbBGsU+09BFmXaL1IBb9fiuvq6/KMiNycSg== + dependencies: + "@types/mdast" "^3.0.0" + unist-util-is "^5.0.0" mdast-util-phrasing@^4.0.0: version "4.0.0" @@ -5593,20 +5722,27 @@ mdast-util-to-hast@^13.0.0: unist-util-position "^5.0.0" unist-util-visit "^5.0.0" -mdast-util-to-markdown@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/mdast-util-to-markdown/-/mdast-util-to-markdown-2.1.0.tgz#9813f1d6e0cdaac7c244ec8c6dabfdb2102ea2b4" - integrity sha512-SR2VnIEdVNCJbP6y7kVTJgPLifdr8WEU440fQec7qHoHOUz/oJ2jmNRqdDQ3rbiStOXb2mCDGTuwsK5OPUgYlQ== +mdast-util-to-markdown@^1.0.0, mdast-util-to-markdown@^1.3.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/mdast-util-to-markdown/-/mdast-util-to-markdown-1.5.0.tgz#c13343cb3fc98621911d33b5cd42e7d0731171c6" + integrity sha512-bbv7TPv/WC49thZPg3jXuqzuvI45IL2EVAr/KxF0BSdHsU0ceFHOmwQn6evxAh1GaoK/6GQ1wp4R4oW2+LFL/A== dependencies: - "@types/mdast" "^4.0.0" - "@types/unist" "^3.0.0" + "@types/mdast" "^3.0.0" + "@types/unist" "^2.0.0" longest-streak "^3.0.0" - mdast-util-phrasing "^4.0.0" - mdast-util-to-string "^4.0.0" - micromark-util-decode-string "^2.0.0" - unist-util-visit "^5.0.0" + mdast-util-phrasing "^3.0.0" + mdast-util-to-string "^3.0.0" + micromark-util-decode-string "^1.0.0" + unist-util-visit "^4.0.0" zwitch "^2.0.0" +mdast-util-to-string@^3.0.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/mdast-util-to-string/-/mdast-util-to-string-3.2.0.tgz#66f7bb6324756741c5f47a53557f0cbf16b6f789" + integrity sha512-V4Zn/ncyN1QNSqSBxTrMOLpjr+IKdHl2v3KVLoWmDPscP4r9GcCi71gjgvUV1SFSKh92AjAG4peFuBl2/YgCJg== + dependencies: + "@types/mdast" "^3.0.0" + mdast-util-to-string@^3.1.0: version "3.1.1" resolved "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-3.1.1.tgz" @@ -5682,6 +5818,28 @@ methods@~1.1.2: resolved "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz" integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= +micromark-core-commonmark@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/micromark-core-commonmark/-/micromark-core-commonmark-1.1.0.tgz#1386628df59946b2d39fb2edfd10f3e8e0a75bb8" + integrity sha512-BgHO1aRbolh2hcrzL2d1La37V0Aoz73ymF8rAcKnohLy93titmv62E0gP8Hrx9PKcKrqCZ1BbLGbP3bEhoXYlw== + dependencies: + decode-named-character-reference "^1.0.0" + micromark-factory-destination "^1.0.0" + micromark-factory-label "^1.0.0" + micromark-factory-space "^1.0.0" + micromark-factory-title "^1.0.0" + micromark-factory-whitespace "^1.0.0" + micromark-util-character "^1.0.0" + micromark-util-chunked "^1.0.0" + micromark-util-classify-character "^1.0.0" + micromark-util-html-tag-name "^1.0.0" + micromark-util-normalize-identifier "^1.0.0" + micromark-util-resolve-all "^1.0.0" + micromark-util-subtokenize "^1.0.0" + micromark-util-symbol "^1.0.0" + micromark-util-types "^1.0.1" + uvu "^0.5.0" + micromark-core-commonmark@^1.0.1: version "1.0.6" resolved "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-1.0.6.tgz" @@ -5726,84 +5884,84 @@ micromark-core-commonmark@^2.0.0: micromark-util-symbol "^2.0.0" micromark-util-types "^2.0.0" -micromark-extension-gfm-autolink-literal@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-2.0.0.tgz#f1e50b42e67d441528f39a67133eddde2bbabfd9" - integrity sha512-rTHfnpt/Q7dEAK1Y5ii0W8bhfJlVJFnJMHIPisfPK3gpVNuOP0VnRl96+YJ3RYWV/P4gFeQoGKNlT3RhuvpqAg== +micromark-extension-gfm-autolink-literal@^1.0.0: + version "1.0.5" + resolved "https://registry.yarnpkg.com/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-1.0.5.tgz#5853f0e579bbd8ef9e39a7c0f0f27c5a063a66e7" + integrity sha512-z3wJSLrDf8kRDOh2qBtoTRD53vJ+CWIyo7uyZuxf/JAbNJjiHsOpG1y5wxk8drtv3ETAHutCu6N3thkOOgueWg== dependencies: - micromark-util-character "^2.0.0" - micromark-util-sanitize-uri "^2.0.0" - micromark-util-symbol "^2.0.0" - micromark-util-types "^2.0.0" + micromark-util-character "^1.0.0" + micromark-util-sanitize-uri "^1.0.0" + micromark-util-symbol "^1.0.0" + micromark-util-types "^1.0.0" -micromark-extension-gfm-footnote@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/micromark-extension-gfm-footnote/-/micromark-extension-gfm-footnote-2.0.0.tgz#91afad310065a94b636ab1e9dab2c60d1aab953c" - integrity sha512-6Rzu0CYRKDv3BfLAUnZsSlzx3ak6HAoI85KTiijuKIz5UxZxbUI+pD6oHgw+6UtQuiRwnGRhzMmPRv4smcz0fg== +micromark-extension-gfm-footnote@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/micromark-extension-gfm-footnote/-/micromark-extension-gfm-footnote-1.1.2.tgz#05e13034d68f95ca53c99679040bc88a6f92fe2e" + integrity sha512-Yxn7z7SxgyGWRNa4wzf8AhYYWNrwl5q1Z8ii+CSTTIqVkmGZF1CElX2JI8g5yGoM3GAman9/PVCUFUSJ0kB/8Q== dependencies: - devlop "^1.0.0" - micromark-core-commonmark "^2.0.0" - micromark-factory-space "^2.0.0" - micromark-util-character "^2.0.0" - micromark-util-normalize-identifier "^2.0.0" - micromark-util-sanitize-uri "^2.0.0" - micromark-util-symbol "^2.0.0" - micromark-util-types "^2.0.0" + micromark-core-commonmark "^1.0.0" + micromark-factory-space "^1.0.0" + micromark-util-character "^1.0.0" + micromark-util-normalize-identifier "^1.0.0" + micromark-util-sanitize-uri "^1.0.0" + micromark-util-symbol "^1.0.0" + micromark-util-types "^1.0.0" + uvu "^0.5.0" -micromark-extension-gfm-strikethrough@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-2.0.0.tgz#6917db8e320da70e39ffbf97abdbff83e6783e61" - integrity sha512-c3BR1ClMp5fxxmwP6AoOY2fXO9U8uFMKs4ADD66ahLTNcwzSCyRVU4k7LPV5Nxo/VJiR4TdzxRQY2v3qIUceCw== +micromark-extension-gfm-strikethrough@^1.0.0: + version "1.0.7" + resolved "https://registry.yarnpkg.com/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-1.0.7.tgz#c8212c9a616fa3bf47cb5c711da77f4fdc2f80af" + integrity sha512-sX0FawVE1o3abGk3vRjOH50L5TTLr3b5XMqnP9YDRb34M0v5OoZhG+OHFz1OffZ9dlwgpTBKaT4XW/AsUVnSDw== dependencies: - devlop "^1.0.0" - micromark-util-chunked "^2.0.0" - micromark-util-classify-character "^2.0.0" - micromark-util-resolve-all "^2.0.0" - micromark-util-symbol "^2.0.0" - micromark-util-types "^2.0.0" + micromark-util-chunked "^1.0.0" + micromark-util-classify-character "^1.0.0" + micromark-util-resolve-all "^1.0.0" + micromark-util-symbol "^1.0.0" + micromark-util-types "^1.0.0" + uvu "^0.5.0" -micromark-extension-gfm-table@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/micromark-extension-gfm-table/-/micromark-extension-gfm-table-2.0.0.tgz#2cf3fe352d9e089b7ef5fff003bdfe0da29649b7" - integrity sha512-PoHlhypg1ItIucOaHmKE8fbin3vTLpDOUg8KAr8gRCF1MOZI9Nquq2i/44wFvviM4WuxJzc3demT8Y3dkfvYrw== +micromark-extension-gfm-table@^1.0.0: + version "1.0.7" + resolved "https://registry.yarnpkg.com/micromark-extension-gfm-table/-/micromark-extension-gfm-table-1.0.7.tgz#dcb46074b0c6254c3fc9cc1f6f5002c162968008" + integrity sha512-3ZORTHtcSnMQEKtAOsBQ9/oHp9096pI/UvdPtN7ehKvrmZZ2+bbWhi0ln+I9drmwXMt5boocn6OlwQzNXeVeqw== dependencies: - devlop "^1.0.0" - micromark-factory-space "^2.0.0" - micromark-util-character "^2.0.0" - micromark-util-symbol "^2.0.0" - micromark-util-types "^2.0.0" + micromark-factory-space "^1.0.0" + micromark-util-character "^1.0.0" + micromark-util-symbol "^1.0.0" + micromark-util-types "^1.0.0" + uvu "^0.5.0" -micromark-extension-gfm-tagfilter@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/micromark-extension-gfm-tagfilter/-/micromark-extension-gfm-tagfilter-2.0.0.tgz#f26d8a7807b5985fba13cf61465b58ca5ff7dc57" - integrity sha512-xHlTOmuCSotIA8TW1mDIM6X2O1SiX5P9IuDtqGonFhEK0qgRI4yeC6vMxEV2dgyr2TiD+2PQ10o+cOhdVAcwfg== +micromark-extension-gfm-tagfilter@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/micromark-extension-gfm-tagfilter/-/micromark-extension-gfm-tagfilter-1.0.2.tgz#aa7c4dd92dabbcb80f313ebaaa8eb3dac05f13a7" + integrity sha512-5XWB9GbAUSHTn8VPU8/1DBXMuKYT5uOgEjJb8gN3mW0PNW5OPHpSdojoqf+iq1xo7vWzw/P8bAHY0n6ijpXF7g== dependencies: - micromark-util-types "^2.0.0" + micromark-util-types "^1.0.0" -micromark-extension-gfm-task-list-item@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-2.0.1.tgz#ee8b208f1ced1eb9fb11c19a23666e59d86d4838" - integrity sha512-cY5PzGcnULaN5O7T+cOzfMoHjBW7j+T9D2sucA5d/KbsBTPcYdebm9zUd9zzdgJGCwahV+/W78Z3nbulBYVbTw== +micromark-extension-gfm-task-list-item@^1.0.0: + version "1.0.5" + resolved "https://registry.yarnpkg.com/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-1.0.5.tgz#b52ce498dc4c69b6a9975abafc18f275b9dde9f4" + integrity sha512-RMFXl2uQ0pNQy6Lun2YBYT9g9INXtWJULgbt01D/x8/6yJ2qpKyzdZD3pi6UIkzF++Da49xAelVKUeUMqd5eIQ== dependencies: - devlop "^1.0.0" - micromark-factory-space "^2.0.0" - micromark-util-character "^2.0.0" - micromark-util-symbol "^2.0.0" - micromark-util-types "^2.0.0" + micromark-factory-space "^1.0.0" + micromark-util-character "^1.0.0" + micromark-util-symbol "^1.0.0" + micromark-util-types "^1.0.0" + uvu "^0.5.0" -micromark-extension-gfm@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/micromark-extension-gfm/-/micromark-extension-gfm-3.0.0.tgz#3e13376ab95dd7a5cfd0e29560dfe999657b3c5b" - integrity sha512-vsKArQsicm7t0z2GugkCKtZehqUm31oeGBV/KVSorWSy8ZlNAv7ytjFhvaryUiCUJYqs+NoE6AFhpQvBTM6Q4w== - dependencies: - micromark-extension-gfm-autolink-literal "^2.0.0" - micromark-extension-gfm-footnote "^2.0.0" - micromark-extension-gfm-strikethrough "^2.0.0" - micromark-extension-gfm-table "^2.0.0" - micromark-extension-gfm-tagfilter "^2.0.0" - micromark-extension-gfm-task-list-item "^2.0.0" - micromark-util-combine-extensions "^2.0.0" - micromark-util-types "^2.0.0" +micromark-extension-gfm@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/micromark-extension-gfm/-/micromark-extension-gfm-2.0.3.tgz#e517e8579949a5024a493e49204e884aa74f5acf" + integrity sha512-vb9OoHqrhCmbRidQv/2+Bc6pkP0FrtlhurxZofvOEy5o8RtuuvTq+RQ1Vw5ZDNrVraQZu3HixESqbG+0iKk/MQ== + dependencies: + micromark-extension-gfm-autolink-literal "^1.0.0" + micromark-extension-gfm-footnote "^1.0.0" + micromark-extension-gfm-strikethrough "^1.0.0" + micromark-extension-gfm-table "^1.0.0" + micromark-extension-gfm-tagfilter "^1.0.0" + micromark-extension-gfm-task-list-item "^1.0.0" + micromark-util-combine-extensions "^1.0.0" + micromark-util-types "^1.0.0" micromark-factory-destination@^1.0.0: version "1.0.0" @@ -6515,10 +6673,10 @@ open@^9.1.0: is-inside-container "^1.0.0" is-wsl "^2.2.0" -openai@^4.15.4: - version "4.16.1" - resolved "https://registry.yarnpkg.com/openai/-/openai-4.16.1.tgz#6377682ad2af805affd1b401958fb6eb92a87d61" - integrity sha512-Gr+uqUN1ICSk6VhrX64E+zL7skjI1TgPr/XUN+ZQuNLLOvx15+XZulx/lSW4wFEAQzgjBDlMBbBeikguGIjiMg== +openai@^4.16.1: + version "4.17.0" + resolved "https://registry.yarnpkg.com/openai/-/openai-4.17.0.tgz#92e2397032e95c39bb1f25caece44060eb5218f3" + integrity sha512-fJUdfOzKE49L2oitQ+L8oCYcTDI2oLOYmQvnPjklFrmH7M+8w65/8Ag9120ky1A3Xr3lCivALs2oBmNaZIvTgg== dependencies: "@types/node" "^18.11.18" "@types/node-fetch" "^2.6.4" @@ -6690,6 +6848,11 @@ parse5-htmlparser2-tree-adapter@^7.0.0: domhandler "^5.0.2" parse5 "^7.0.0" +parse5@^6.0.0: + version "6.0.1" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b" + integrity sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw== + parse5@^7.0.0: version "7.0.0" resolved "https://registry.npmjs.org/parse5/-/parse5-7.0.0.tgz" @@ -7132,30 +7295,32 @@ redent@^1.0.0: indent-string "^2.1.0" strip-indent "^1.0.1" -rehype-format@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/rehype-format/-/rehype-format-5.0.0.tgz#e51cc8edece2aee0e88e1efdd0625bc0cbef387b" - integrity sha512-kM4II8krCHmUhxrlvzFSptvaWh280Fr7UGNJU5DCMuvmAwGCNmGfi9CvFAQK6JDjsNoRMWQStglK3zKJH685Wg== +rehype-format@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/rehype-format/-/rehype-format-4.0.1.tgz#0d4ad47733699dd8e3fcd9f73d04f210246b39e1" + integrity sha512-HA92WeqFri00yiClrz54IIpM9no2DH9Mgy5aFmInNODoAYn+hN42a6oqJTIie2nj0HwFyV7JvOYx5YHBphN8mw== dependencies: - "@types/hast" "^3.0.0" - hast-util-embedded "^3.0.0" - hast-util-is-element "^3.0.0" - hast-util-phrasing "^3.0.0" - hast-util-whitespace "^3.0.0" - html-whitespace-sensitive-tag-names "^3.0.0" - rehype-minify-whitespace "^6.0.0" - unist-util-visit-parents "^6.0.0" + "@types/hast" "^2.0.0" + hast-util-embedded "^2.0.0" + hast-util-is-element "^2.0.0" + hast-util-phrasing "^2.0.0" + hast-util-whitespace "^2.0.0" + html-whitespace-sensitive-tag-names "^2.0.0" + rehype-minify-whitespace "^5.0.0" + unified "^10.0.0" + unist-util-visit-parents "^5.0.0" -rehype-minify-whitespace@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/rehype-minify-whitespace/-/rehype-minify-whitespace-6.0.0.tgz#fe97c5e9e48c5629458166753f2249afaa2e1fd1" - integrity sha512-i9It4YHR0Sf3GsnlR5jFUKXRr9oayvEk9GKQUkwZv6hs70OH9q3OCZrq9PpLvIGKt3W+JxBOxCidNVpH/6rWdA== +rehype-minify-whitespace@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/rehype-minify-whitespace/-/rehype-minify-whitespace-5.0.1.tgz#79729a0146aa97a9d43e1eb4b5884974e2f37e77" + integrity sha512-PPp4lWJiBPlePI/dv1BeYktbwkfgXkrK59MUa+tYbMPgleod+4DvFK2PLU0O0O60/xuhHfiR9GUIUlXTU8sRIQ== dependencies: - "@types/hast" "^3.0.0" - hast-util-embedded "^3.0.0" - hast-util-is-element "^3.0.0" - hast-util-whitespace "^3.0.0" - unist-util-is "^6.0.0" + "@types/hast" "^2.0.0" + hast-util-embedded "^2.0.0" + hast-util-is-element "^2.0.0" + hast-util-whitespace "^2.0.0" + unified "^10.0.0" + unist-util-is "^5.0.0" rehype-raw@^7.0.0: version "7.0.0" @@ -7174,28 +7339,26 @@ rehype-sanitize@^6.0.0: "@types/hast" "^3.0.0" hast-util-sanitize "^5.0.0" -rehype-stringify@^10.0.0: - version "10.0.0" - resolved "https://registry.yarnpkg.com/rehype-stringify/-/rehype-stringify-10.0.0.tgz#2031cf6fdd0355393706f0474ec794c75e5492f2" - integrity sha512-1TX1i048LooI9QoecrXy7nGFFbFSufxVRAfc6Y9YMRAi56l+oB0zP51mLSV312uRuvVLPV1opSlJmslozR1XHQ== +rehype-stringify@^9.0.4: + version "9.0.4" + resolved "https://registry.yarnpkg.com/rehype-stringify/-/rehype-stringify-9.0.4.tgz#31dbb9de6f5034c6964760a1b1083218059c4343" + integrity sha512-Uk5xu1YKdqobe5XpSskwPvo1XeHUUucWEQSl8hTrXt5selvca1e8K1EZ37E6YoZ4BT8BCqCdVfQW7OfHfthtVQ== dependencies: - "@types/hast" "^3.0.0" - hast-util-to-html "^9.0.0" - unified "^11.0.0" + "@types/hast" "^2.0.0" + hast-util-to-html "^8.0.0" + unified "^10.0.0" -remark-gfm@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/remark-gfm/-/remark-gfm-4.0.0.tgz#aea777f0744701aa288b67d28c43565c7e8c35de" - integrity sha512-U92vJgBPkbw4Zfu/IiW2oTZLSL3Zpv+uI7My2eq8JxKgqraFdU8YUGicEJCEgSbeaG+QDFqIcwwfMTOEelPxuA== +remark-gfm@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/remark-gfm/-/remark-gfm-3.0.1.tgz#0b180f095e3036545e9dddac0e8df3fa5cfee54f" + integrity sha512-lEFDoi2PICJyNrACFOfDD3JlLkuSbOa5Wd8EPt06HUdptv8Gn0bxYTdbU/XXQ3swAPkEaGxxPN9cbnMHvVu1Ig== dependencies: - "@types/mdast" "^4.0.0" - mdast-util-gfm "^3.0.0" - micromark-extension-gfm "^3.0.0" - remark-parse "^11.0.0" - remark-stringify "^11.0.0" - unified "^11.0.0" + "@types/mdast" "^3.0.0" + mdast-util-gfm "^2.0.0" + micromark-extension-gfm "^2.0.0" + unified "^10.0.0" -remark-parse@^10.0.0: +remark-parse@^10.0.0, remark-parse@^10.0.2: version "10.0.2" resolved "https://registry.yarnpkg.com/remark-parse/-/remark-parse-10.0.2.tgz#ca241fde8751c2158933f031a4e3efbaeb8bc262" integrity sha512-3ydxgHa/ZQzG8LvC7jTXccARYDcRld3VfcgIIFs7bI6vbRSxJJmzgLEIIoYKyrfhaY+ujuWaf/PJiMZXoiCXgw== @@ -7204,17 +7367,7 @@ remark-parse@^10.0.0: mdast-util-from-markdown "^1.0.0" unified "^10.0.0" -remark-parse@^11.0.0: - version "11.0.0" - resolved "https://registry.yarnpkg.com/remark-parse/-/remark-parse-11.0.0.tgz#aa60743fcb37ebf6b069204eb4da304e40db45a1" - integrity sha512-FCxlKLNGknS5ba/1lmpYijMUzX2esxW5xQqjWxw2eHFfS2MSdaHVINFmhjo+qN1WhZhNimq0dZATN9pH0IDrpA== - dependencies: - "@types/mdast" "^4.0.0" - mdast-util-from-markdown "^2.0.0" - micromark-util-types "^2.0.0" - unified "^11.0.0" - -remark-rehype@^10.0.0: +remark-rehype@^10.0.0, remark-rehype@^10.1.0: version "10.1.0" resolved "https://registry.npmjs.org/remark-rehype/-/remark-rehype-10.1.0.tgz" integrity sha512-EFmR5zppdBp0WQeDVZ/b66CWJipB2q2VLNFMabzDSGR66Z2fQii83G5gTBbgGEnEEA0QRussvrFHxk1HWGJskw== @@ -7224,26 +7377,6 @@ remark-rehype@^10.0.0: mdast-util-to-hast "^12.1.0" unified "^10.0.0" -remark-rehype@^11.0.0: - version "11.0.0" - resolved "https://registry.yarnpkg.com/remark-rehype/-/remark-rehype-11.0.0.tgz#7f21c08738bde024be5f16e4a8b13e5d7a04cf6b" - integrity sha512-vx8x2MDMcxuE4lBmQ46zYUDfcFMmvg80WYX+UNLeG6ixjdCCLcw1lrgAukwBTuOFsS78eoAedHGn9sNM0w7TPw== - dependencies: - "@types/hast" "^3.0.0" - "@types/mdast" "^4.0.0" - mdast-util-to-hast "^13.0.0" - unified "^11.0.0" - vfile "^6.0.0" - -remark-stringify@^11.0.0: - version "11.0.0" - resolved "https://registry.yarnpkg.com/remark-stringify/-/remark-stringify-11.0.0.tgz#4c5b01dd711c269df1aaae11743eb7e2e7636fd3" - integrity sha512-1OSmLd3awB/t8qdoEOMazZkNsfVTeY4fTsgzcQFdXNq8ToTN4ZGwrMnlda4K6smTFKD+GRV6O48i6Z4iKgPPpw== - dependencies: - "@types/mdast" "^4.0.0" - mdast-util-to-markdown "^2.0.0" - unified "^11.0.0" - repeating@^2.0.0: version "2.0.1" resolved "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz" @@ -7518,6 +7651,16 @@ serve-static@1.15.0: parseurl "~1.3.3" send "0.18.0" +set-function-length@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/set-function-length/-/set-function-length-1.1.1.tgz#4bc39fafb0307224a33e106a7d35ca1218d659ed" + integrity sha512-VoaqjbBJKiWtg4yRcKBQ7g7wnGnLV3M8oLvVWwOk2PdYY6PEFegR1vezXR0tw6fZGF9csVakIRjrJiy2veSBFQ== + dependencies: + define-data-property "^1.1.1" + get-intrinsic "^1.2.1" + gopd "^1.0.1" + has-property-descriptors "^1.0.0" + setprototypeof@1.2.0: version "1.2.0" resolved "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz" @@ -8297,7 +8440,7 @@ undici-types@~5.26.4: resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== -unified@^10.0.0: +unified@^10.0.0, unified@^10.1.2: version "10.1.2" resolved "https://registry.npmjs.org/unified/-/unified-10.1.2.tgz" integrity sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q== @@ -8310,19 +8453,6 @@ unified@^10.0.0: trough "^2.0.0" vfile "^5.0.0" -unified@^11.0.0, unified@^11.0.4: - version "11.0.4" - resolved "https://registry.yarnpkg.com/unified/-/unified-11.0.4.tgz#f4be0ac0fe4c88cb873687c07c64c49ed5969015" - integrity sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ== - dependencies: - "@types/unist" "^3.0.0" - bail "^2.0.0" - devlop "^1.0.0" - extend "^3.0.0" - is-plain-obj "^4.0.0" - trough "^2.0.0" - vfile "^6.0.0" - unique-string@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/unique-string/-/unique-string-3.0.0.tgz" @@ -8382,7 +8512,7 @@ unist-util-stringify-position@^4.0.0: dependencies: "@types/unist" "^3.0.0" -unist-util-visit-parents@^5.1.1: +unist-util-visit-parents@^5.0.0, unist-util-visit-parents@^5.1.1: version "5.1.3" resolved "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.1.3.tgz" integrity sha512-x6+y8g7wWMyQhL1iZfhIPhDAs7Xwbn9nRosDXl7qoPTSCy0yNxnKc+hWokFifWQIDGi154rdUqKvbCa4+1kLhg== @@ -8532,6 +8662,14 @@ vary@~1.1.2: resolved "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz" integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= +vfile-location@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/vfile-location/-/vfile-location-4.1.0.tgz#69df82fb9ef0a38d0d02b90dd84620e120050dd0" + integrity sha512-YF23YMyASIIJXpktBa4vIGLJ5Gs88UB/XePgqPmTa7cDA+JeO3yclbpheQYCHjVHBn/yePzrXuygIL+xbvRYHw== + dependencies: + "@types/unist" "^2.0.0" + vfile "^5.0.0" + vfile-location@^5.0.0: version "5.0.2" resolved "https://registry.yarnpkg.com/vfile-location/-/vfile-location-5.0.2.tgz#220d9ca1ab6f8b2504a4db398f7ebc149f9cb464" @@ -8611,10 +8749,10 @@ web-namespaces@^2.0.0: resolved "https://registry.npmjs.org/web-namespaces/-/web-namespaces-2.0.1.tgz" integrity sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ== -web-specs@^2.71.0: - version "2.71.0" - resolved "https://registry.yarnpkg.com/web-specs/-/web-specs-2.71.0.tgz#f7e497873f10fff0c3303042085bc6817256c765" - integrity sha512-j0RwRhBe0nmc7t2d2BI4ycQNOVJJRN7XKFIHXOBcdolDao/bvlyYZ7QFJeSPuHFCP5QtlgOjO/K130QpYYctuA== +web-specs@^2.72.0: + version "2.72.0" + resolved "https://registry.yarnpkg.com/web-specs/-/web-specs-2.72.0.tgz#42429d75ef870908d0103258f9abaa24d83e63cc" + integrity sha512-fjBCxCf7p4pNumIQJbguKpydl2SEixi3hSHPtL5/jC2bVMRdYjYhacZa/Cp/n3AK7khR0WoMaFyx1+xvPZu6Kg== web-streams-polyfill@4.0.0-beta.3: version "4.0.0-beta.3" From a1a721a19508ccfea49effc7e64a7a9e282ca870 Mon Sep 17 00:00:00 2001 From: Jordane Quincy <50746914+jquinc30@users.noreply.github.com> Date: Thu, 9 Nov 2023 16:15:47 +0100 Subject: [PATCH 20/52] fix(typo): replace `for for ` by `for ` (#30157) --- files/en-us/web/api/speculation_rules_api/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/en-us/web/api/speculation_rules_api/index.md b/files/en-us/web/api/speculation_rules_api/index.md index 685f513313a8f5f..7085cb40dc0cc75 100644 --- a/files/en-us/web/api/speculation_rules_api/index.md +++ b/files/en-us/web/api/speculation_rules_api/index.md @@ -229,7 +229,7 @@ If the functionality only occurs under normal circumstances when JavaScript runs It is also potentially risky to prefetch a document whose server-rendered contents will change due to actions the user can take on the current page. This could include, for example, flash sale pages or movie theater seat maps. Test such cases carefully, and mitigate such issues by updating content once the page is loaded. See [Server-rendered varying state](#server-rendered_varying_state) for more details about these cases. -> **Note:** Browsers will cache prefetched pages for a short time (Chrome for example caches them for for 5 minutes) before discarding them, so in any case, your users might see content that is up to 5 minutes out of date. +> **Note:** Browsers will cache prefetched pages for a short time (Chrome for example caches them for 5 minutes) before discarding them, so in any case, your users might see content that is up to 5 minutes out of date. One final tip is to audit the URLs listed as disallowed in your [`Robots.txt`](/en-US/docs/Glossary/Robots.txt) file — normally these URLs point to pages that can only be accessed by authenticated users, and therefore should not be included in search engine results. Many of these will be fine, but it can be a good place to find URLs unsafe for prefetching (i.e. they exhibit the conditions described above). From 0aeda8104dc3630ff3b08376fd11b4b99bf17720 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 9 Nov 2023 15:36:45 +0000 Subject: [PATCH 21/52] Bump github/issue-labeler from 3.2 to 3.3 (#30155) --- .github/workflows/issue-regex-labeler.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/issue-regex-labeler.yml b/.github/workflows/issue-regex-labeler.yml index c81d3dffa4662fc..dd777a5c65711ea 100644 --- a/.github/workflows/issue-regex-labeler.yml +++ b/.github/workflows/issue-regex-labeler.yml @@ -7,7 +7,7 @@ jobs: issue-labeler: runs-on: ubuntu-latest steps: - - uses: github/issue-labeler@v3.2 + - uses: github/issue-labeler@v3.3 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" configuration-path: .github/issue-regex-labeler.yml From 1da25452f3e4f5b4458804691a1d1a4c991f4321 Mon Sep 17 00:00:00 2001 From: Estelle Weyl Date: Thu, 9 Nov 2023 07:39:13 -0800 Subject: [PATCH 22/52] Minor: remove browser compat from css cookbook split nav (#30145) * Minor: css cookbook split nav * Apply suggestions from code review Co-authored-by: Jean-Yves Perrier --------- Co-authored-by: Jean-Yves Perrier --- .../css/layout_cookbook/split_navigation/index.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/files/en-us/web/css/layout_cookbook/split_navigation/index.md b/files/en-us/web/css/layout_cookbook/split_navigation/index.md index 52a4257cdefb29a..70b6a4a6483fe15 100644 --- a/files/en-us/web/css/layout_cookbook/split_navigation/index.md +++ b/files/en-us/web/css/layout_cookbook/split_navigation/index.md @@ -7,13 +7,13 @@ browser-compat: css.properties.flex {{CSSRef}} -A navigation pattern where one or more elements are separated from the rest of the navigation items. +The **split navigation** is a navigation pattern where one or more elements are separated from the rest of the navigation items. ![Items separated into two groups.](split-navigation.png) ## Requirements -A common navigation pattern is to have one element pushed away from the others. We can use Flexbox to achieve this, without needing to make the two sets of items into two separate flex containers. +A common navigation pattern is to have one element pushed away from the others. We can use flexbox to achieve this, without needing to make the two sets of items into two separate flex containers. ## Recipe @@ -25,16 +25,14 @@ A common navigation pattern is to have one element pushed away from the others. ## Choices made -This pattern combines auto margins with Flexbox to split the items. +This pattern combines auto margins with flexbox to split the items. An auto margin absorbs all available space in the direction it is applied. This is how centering a block with auto margins works — you have a margin on each side of the block trying to take up all of the space, thus pushing the block into the middle. In this case the left auto margin takes up any available space and pushes the item over to the right. You could apply the class `push` to any item in the list. -## Browser compatibility - -{{Compat}} - ## See also -- [CSS Flexible Box Layout](/en-US/docs/Web/CSS/CSS_flexible_box_layout) +- [CSS flexible box layout](/en-US/docs/Web/CSS/CSS_flexible_box_layout) module +- {{cssxref("display")}} property +- {{cssxref("margin")}} property From 1345f6dc327dae61ebdb124b67077aeb36f8c5e1 Mon Sep 17 00:00:00 2001 From: jimmonte <33158815+jimmonte@users.noreply.github.com> Date: Thu, 9 Nov 2023 11:08:22 -0500 Subject: [PATCH 23/52] Clarified sorting order that is used (#30158) * Clarified sorting order that is used Explained that items not given an order value receive the default value of 0. * Update files/en-us/web/css/order/index.md --------- Co-authored-by: Estelle Weyl --- files/en-us/web/css/order/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/en-us/web/css/order/index.md b/files/en-us/web/css/order/index.md index c242866723d8e29..8644d3b6f556575 100644 --- a/files/en-us/web/css/order/index.md +++ b/files/en-us/web/css/order/index.md @@ -7,7 +7,7 @@ browser-compat: css.properties.order {{CSSRef}} -The **`order`** [CSS](/en-US/docs/Web/CSS) property sets the order to lay out an item in a flex or grid container. Items in a container are sorted by ascending `order` value and then by their source code order. +The **`order`** [CSS](/en-US/docs/Web/CSS) property sets the order to lay out an item in a flex or grid container. Items in a container are sorted by ascending `order` value and then by their source code order. Items not given an explicit `order` value are assigned the default value of `0`. {{EmbedInteractiveExample("pages/css/order.html")}} From a5ed9ba50a810d22557671f96e0aae6ac310cb1d Mon Sep 17 00:00:00 2001 From: Mike West Date: Thu, 9 Nov 2023 18:25:40 +0100 Subject: [PATCH 24/52] Describe two new `rel` link types. (#29801) * Describe two new link types. This PR adds descriptions for the `privacy-policy` and `terms-of-service` link types, as defined in https://github.com/whatwg/html/pull/9860 and https://github.com/whatwg/html/pull/9877 respectively. * Apply suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * trying to fix CI failure * typo * fixup Apply suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Estelle Weyl * Update files/en-us/web/html/attributes/rel/index.md Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Estelle Weyl Co-authored-by: Estelle Weyl --- files/en-us/web/html/attributes/rel/index.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/files/en-us/web/html/attributes/rel/index.md b/files/en-us/web/html/attributes/rel/index.md index 095645b0cf92b9e..ba60161e5568443 100644 --- a/files/en-us/web/html/attributes/rel/index.md +++ b/files/en-us/web/html/attributes/rel/index.md @@ -26,7 +26,7 @@ The following table lists some of the most important existing keywords. Every ke | [`external`](#external) | The referenced document is not part of the same site as the current document. | Not allowed | Annotation | Annotation | | [`help`](#help) | Link to context-sensitive help. | Link | Link | Link | | [`icon`](#icon) | An icon representing the current document. | External Resource | Not allowed | Not allowed | -| [`license`](#license) | Indicates that the main content of the current document is covered by the copyright license. described by the referenced document. | Link | Link | Link | +| [`license`](#license) | Indicates that the main content of the current document is covered by the copyright license described by the referenced document. | Link | Link | Link | | [`manifest`](/en-US/docs/Web/HTML/Attributes/rel/manifest) | Web app manifest. | Link | Not allowed | Not allowed | | [`me`](/en-US/docs/Web/HTML/Attributes/rel/me) | Indicates that the current document represents the person who owns the linked content. | Link | Link | Not allowed | | [`modulepreload`](/en-US/docs/Web/HTML/Attributes/rel/modulepreload) | Tells to browser to preemptively fetch the script and store it in the document's module map for later evaluation. Optionally, the module's dependencies can be fetched as well. | External Resource | Not allowed | Not allowed | @@ -41,9 +41,11 @@ The following table lists some of the most important existing keywords. Every ke | [`preload`](/en-US/docs/Web/HTML/Attributes/rel/preload) | Specifies that the user agent must preemptively fetch and cache the target resource for current navigation according to the potential destination given by the [`as`](/en-US/docs/Web/HTML/Element/link#as) attribute (and the priority associated with the corresponding destination). | External Resource | Not allowed | Not allowed | | [`prerender`](/en-US/docs/Web/HTML/Attributes/rel/prerender) | Specifies that the user agent should preemptively fetch the target resource and process it in a way that helps deliver a faster response in the future. | External Resource | Not allowed | Not allowed | | [`prev`](#prev) | Indicates that the current document is a part of a series and that the previous document in the series is the referenced document. | Link | Link | Link | +| [`privacy-policy`](#privacy-policy) | Gives a link to a information about the data collection and usage practices that apply to the current document. | Link | Link | Not allowed | | [`search`](#search) | Gives a link to a resource that can be used to search through the current document and its related pages. | Link | Link | Link | | [`stylesheet`](#stylesheet) | Imports a style sheet. | External Resource | Not allowed | Not allowed | | [`tag`](#tag) | Gives a tag (identified by the given address) that applies to the current document. | Not allowed | Link | Not allowed | +| [`terms-of-service`](#terms-of-service) | Link to the agreement, or terms of service, between the document's provider and users who wish to use the document. | Link | Link | Not allowed | The `rel` attribute is relevant to the {{htmlelement('link')}}, {{htmlelement('a')}}, {{htmlelement('area')}}, and {{htmlelement('form')}} elements, but some values only relevant to a subset of those elements. Like all HTML keyword attribute values, these values are case-insensitive. @@ -184,6 +186,10 @@ The `rel` attribute has no default value. If the attribute is omitted or if none Note: The synonym `previous` is incorrect and should not be used. +- `privacy-policy` + + - : Valid for {{htmlelement('a')}}, {{htmlelement('area')}}, and {{htmlelement('link')}} elements, the `privacy-policy` value indicates that the referenced document is the Privacy Policy which describes the data collection and usage practices of the current document. + - `search` - : Relevant to {{htmlelement('form')}}, {{htmlelement('link')}}, {{htmlelement('a')}}, and {{htmlelement('area')}} elements, the `search` keywords indicates that the hyperlink references a document whose interface is specially designed for searching in the current document, site, and related resources, providing a link to a resource that can be used to search. @@ -203,8 +209,13 @@ The `rel` attribute has no default value. If the attribute is omitted or if none Requires the use of the CORS protocol for cross-origin fetching. - `tag` + - : Valid for the {{htmlelement('a')}}, and {{htmlelement('area')}} elements, it gives a tag (identified by the given address) that applies to the current document. The tag value denotes that the link refers to a document describing a tag applying to the document on which it is located. This link type is not meant for tags within a tag cloud, as those tags apply to a group of pages, whereas the `tag` value of the `rel` attribute is for a single document. +- `terms-of-service` + + - : Valid for {{htmlelement('a')}}, {{htmlelement('area')}}, and {{htmlelement('link')}} elements, the `terms-of-service` value indicates that the referenced document is the Terms of Service that describes the agreements between the current document's provider and users who wish to use the document provided. + ### Non-standard values - `apple-touch-icon` From 759e0b7f07e4124a7659114016bf5b347127eebf Mon Sep 17 00:00:00 2001 From: wbamberg Date: Thu, 9 Nov 2023 10:22:33 -0800 Subject: [PATCH 25/52] [XHR] XSLTProcessor (#30163) De-XHR: XSLTProcessor --- files/en-us/web/api/xsltprocessor/index.md | 74 +++++++++++----------- 1 file changed, 36 insertions(+), 38 deletions(-) diff --git a/files/en-us/web/api/xsltprocessor/index.md b/files/en-us/web/api/xsltprocessor/index.md index fa15874a96b7f63..e7bc2716a744e8a 100644 --- a/files/en-us/web/api/xsltprocessor/index.md +++ b/files/en-us/web/api/xsltprocessor/index.md @@ -50,23 +50,27 @@ _This are no properties for this interface._ ### Instantiating an `XSLTProcessor` ```js -const xsltProcessor = new XSLTProcessor(); - -// Load the xsl file using synchronous (third param is set to false) XMLHttpRequest -const myXMLHTTPRequest = new XMLHttpRequest(); -myXMLHTTPRequest.open("GET", "example.xsl", false); -myXMLHTTPRequest.send(null); - -const xslRef = myXMLHTTPRequest.responseXML; +async function init() { + const parser = new DOMParser(); + const xsltProcessor = new XSLTProcessor(); + + // Load the XSLT file, example1.xsl + const xslResponse = await fetch("example1.xsl"); + const xslText = await xslResponse.text(); + const xslStylesheet = parser.parseFromString(xslText, "application/xml"); + xsltProcessor.importStylesheet(xslStylesheet); -// Finally import the .xsl -xsltProcessor.importStylesheet(xslRef); + // process the file + // ... +} ``` -For the actual transformation, `XSLTProcessor` requires an XML document, which is used in conjunction with the imported XSL file to produce the final result. The XML document can be a separate XML file loaded as shown in figure 1, or it can be part of the existing page. To process part of a page's DOM, it is necessary to first create an XML document in memory. Assuming that the DOM to be processed is contained by an element with the id `example`, that DOM can be "cloned" using the in-memory XML document's {{domxref('Document.importNode()')}} method. {{domxref('Document.importNode()')}} allows transferring a DOM fragment between documents, in this case from an HTML document to an XML document. The first parameter references the DOM node to clone. By making the second parameter "true", it will clone all descendants as well (a deep clone). The cloned DOM can then be easily inserted into the XML document using {{domxref('Node.appendChild()')}}, as shown in figure 2. - ### Creating an XML document based on part of a document's DOM +For the actual transformation, `XSLTProcessor` requires an XML document, which is used in conjunction with the imported XSL file to produce the final result. The XML document can be a separate XML file loaded using {{domxref("fetch()")}}, or it can be part of the existing page. + +To process part of a page's DOM, it is necessary to first create an XML document in memory. Assuming that the DOM to be processed is contained by an element with the id `example`, that DOM can be "cloned" using the in-memory XML document's {{domxref('Document.importNode()')}} method. {{domxref('Document.importNode()')}} allows transferring a DOM fragment between documents, in this case from an HTML document to an XML document. The first parameter references the DOM node to clone. By making the second parameter "true", it will clone all descendants as well (a deep clone). The cloned DOM can then be inserted into the XML document using {{domxref('Node.appendChild()')}}, as shown below. + ```js // Create a new XML document in memory const xmlRef = document.implementation.createDocument("", "", null); @@ -185,38 +189,33 @@ The basic example will load an XML file and apply a XSL transformation on it. Th ``` -The example loads using synchronous {{domxref("XMLHTTPRequest")}} both the .xsl (`xslStylesheet`) and the .xml (`xmlDoc`) files into memory. The .xsl file is then imported (`xsltProcessor.importStylesheet(xslStylesheet)`) and the transformation run (`xsltProcessor.transformToFragment(xmlDoc, document)`). This allows fetching of data after the page has been loaded, without initiating a fresh page load. +The example loads both the .xsl (`xslStylesheet`) and the .xml (`xmlDoc`) files into memory. The .xsl file is then imported (`xsltProcessor.importStylesheet(xslStylesheet)`) and the transformation run (`xsltProcessor.transformToFragment(xmlDoc, document)`). This allows fetching of data after the page has been loaded, without initiating a fresh page load. #### JavaScript ```js -let xslStylesheet; -const xsltProcessor = new XSLTProcessor(); -let myDOM; - -let xmlDoc; - -function Init() { - // Load the xslt file, example1.xsl - let myXMLHTTPRequest = new XMLHttpRequest(); - myXMLHTTPRequest.open("GET", "example1.xsl", false); - myXMLHTTPRequest.send(null); - - xslStylesheet = myXMLHTTPRequest.responseXML; +async function init() { + const parser = new DOMParser(); + const xsltProcessor = new XSLTProcessor(); + + // Load the XSLT file, example1.xsl + const xslResponse = await fetch("example1.xsl"); + const xslText = await xslResponse.text(); + const xslStylesheet = parser.parseFromString(xslText, "application/xml"); xsltProcessor.importStylesheet(xslStylesheet); // Load the XML file, example1.xml - myXMLHTTPRequest = new XMLHttpRequest(); - myXMLHTTPRequest.open("GET", "example1.xml", false); - myXMLHTTPRequest.send(null); - - xmlDoc = myXMLHTTPRequest.responseXML; + const xmlResponse = await fetch("example1.xml"); + const xmlText = await xmlResponse.text(); + const xmlDoc = parser.parseFromString(xmlText, "application/xml"); const fragment = xsltProcessor.transformToFragment(xmlDoc, document); - myDOM = fragment; + document.getElementById("example").textContent = ""; document.getElementById("example").appendChild(fragment); } + +init(); ``` ### Advanced example @@ -249,18 +248,17 @@ Once the transformation is complete, the result is appended to the document, as ```js let xslRef; let xslloaded = false; +const parser = new DOMParser(); const xsltProcessor = new XSLTProcessor(); let myDOM; let xmlRef = document.implementation.createDocument("", "", null); -function sort() { +async function sort() { if (!xslloaded) { - const p = new XMLHttpRequest(); - p.open("GET", "example2.xsl", false); - p.send(null); - - xslRef = p.responseXML; + const response = await fetch("example2.xsl"); + const xslText = await response.text(); + xslRef = parser.parseFromString(xslText, "application/xml"); xsltProcessor.importStylesheet(xslRef); xslloaded = true; } From 51d5a70ecc2a95af77376f37f1e6fc87e5cb3b2d Mon Sep 17 00:00:00 2001 From: SphinxKnight Date: Thu, 9 Nov 2023 21:31:32 +0100 Subject: [PATCH 26/52] fix: Minor improvements for Using XHR API subpages (#30166) Minor improvements --- .../using_formdata_objects/index.md | 32 ++-- .../using_xmlhttprequest/index.md | 179 +++++------------- 2 files changed, 61 insertions(+), 150 deletions(-) diff --git a/files/en-us/web/api/xmlhttprequest_api/using_formdata_objects/index.md b/files/en-us/web/api/xmlhttprequest_api/using_formdata_objects/index.md index 8ec1d785a01c746..248662e17ec489e 100644 --- a/files/en-us/web/api/xmlhttprequest_api/using_formdata_objects/index.md +++ b/files/en-us/web/api/xmlhttprequest_api/using_formdata_objects/index.md @@ -8,7 +8,7 @@ page-type: guide The [`FormData`](/en-US/docs/Web/API/FormData) object lets you compile a set of key/value pairs to send using [`XMLHttpRequest`](/en-US/docs/Web/API/XMLHttpRequest). It is primarily intended for use in sending form data, but can be used independently from forms in order to transmit keyed data. The transmitted data is in the same format that the form's {{domxref("HTMLFormElement.submit","submit()")}} method would use to send the data if the form's encoding type were set to `multipart/form-data`. -## Creating a FormData object from scratch +## Creating a `FormData` object from scratch You can build a `FormData` object yourself, instantiating it then appending fields to it by calling its {{domxref("FormData.append","append()")}} method, like this: @@ -28,19 +28,19 @@ const blob = new Blob([content], { type: "text/xml" }); formData.append("webmasterfile", blob); const request = new XMLHttpRequest(); -request.open("POST", "http://foo.com/submitform.php"); +request.open("POST", "https://example.com/submitform.php"); request.send(formData); ``` -> **Note:** The fields "userfile" and "webmasterfile" both contain a file. The number assigned to the field "accountnum" is immediately converted into a string by the [`FormData.append()`](/en-US/docs/Web/API/FormData/append) method (the field's value can be a {{ domxref("Blob") }}, {{ domxref("File") }}, or a string: **if the value is neither a Blob nor a File, the value is converted to a string**). +> **Note:** The fields "userfile" and "webmasterfile" both contain a file. The number assigned to the field "accountnum" is immediately converted into a string by the [`FormData.append()`](/en-US/docs/Web/API/FormData/append) method (the field's value can be a {{ domxref("Blob") }}, {{ domxref("File") }}, or a string: **if the value is neither a `Blob` nor a `File`, the value is converted to a string**). -This example builds a `FormData` instance containing values for fields named "username", "accountnum", "userfile" and "webmasterfile", then uses the `XMLHttpRequest` method [`send()`](/en-US/docs/Web/API/XMLHttpRequest/send) to send the form's data. The field "webmasterfile" is a {{domxref("Blob")}}. A `Blob` object represents a file-like object of immutable, raw data. Blobs represent data that isn't necessarily in a JavaScript-native format. The {{ domxref("File") }} interface is based on `Blob`, inheriting blob functionality and expanding it to support files on the user's system. In order to build a `Blob` you can invoke the {{domxref("Blob.Blob","Blob() constructor")}}. +This example builds a `FormData` instance containing values for fields named "username", "accountnum", "userfile" and "webmasterfile", then uses the `XMLHttpRequest` method [`send()`](/en-US/docs/Web/API/XMLHttpRequest/send) to send the form's data. The field "webmasterfile" is a {{domxref("Blob")}}. A `Blob` object represents a file-like object of immutable, raw data. Blobs represent data that isn't necessarily in a JavaScript-native format. The {{ domxref("File") }} interface is based on `Blob`, inheriting blob functionality and expanding it to support files on the user's system. In order to build a `Blob` you can invoke [the `Blob()` constructor](/en-US/docs/Web/API/Blob/Blob). -## Retrieving a FormData object from an HTML form +## Retrieving a `FormData` object from an HTML form To construct a `FormData` object that contains the data from an existing {{ HTMLElement("form") }}, specify that form element when creating the `FormData` object: -> **Note:** FormData will only use input fields that use the name attribute. +> **Note:** `FormData` will only use input fields that use the name attribute. ```js const formData = new FormData(someFormElement); @@ -68,7 +68,7 @@ request.send(formData); This lets you augment the form's data before sending it along, to include additional information that's not necessarily user-editable. -## Sending files using a FormData object +## Sending files using a `FormData` object You can also send files using `FormData`. Include an {{ HTMLElement("input") }} element of type `file` in your {{htmlelement("form")}}: @@ -134,9 +134,9 @@ form.addEventListener( ); ``` -> **Note:** If you pass in a reference to the form, the [request method](/en-US/docs/Web/HTTP/Methods) specified in the form will be used over the method specified in the open() call. +> **Note:** If you pass in a reference to the form, the [request HTTP method](/en-US/docs/Web/HTTP/Methods) specified in the form will be used over the method specified in the `open()` call. -> **Warning:** When using FormData to submit POST requests using {{ domxref("XMLHttpRequest") }} or the {{ domxref("Fetch_API") }} with the `multipart/form-data` Content-Type (e.g. when uploading Files and Blobs to the server), _do not_ explicitly set the [`Content-Type`](/en-US/docs/Web/HTTP/Headers/Content-Type) header on the request. Doing so will prevent the browser from being able to set the Content-Type header with the boundary expression it will use to delimit form fields in the request body. +> **Warning:** When using `FormData` to submit POST requests using {{ domxref("XMLHttpRequest") }} or the [Fetch API](/en-US/docs/Web/API/Fetch_API) with the `multipart/form-data` content type (e.g. when uploading files and blobs to the server), _do not_ explicitly set the [`Content-Type`](/en-US/docs/Web/HTTP/Headers/Content-Type) header on the request. Doing so will prevent the browser from being able to set the `Content-Type` header with the boundary expression it will use to delimit form fields in the request body. You can also append a {{ domxref("File") }} or {{ domxref("Blob") }} directly to the {{ domxref("FormData") }} object, like this: @@ -146,19 +146,19 @@ data.append("myfile", myBlob, "filename.txt"); When using the {{domxref("FormData.append","append()")}} method it is possible to use the third optional parameter to pass a filename inside the `Content-Disposition` header that is sent to the server. When no filename is specified (or the parameter isn't supported), the name "blob" is used. -## Using a formdata event +## Using a `formdata` event -A more recent addition to the platform than the {{domxref("FormData")}} object is the [`formdata` event](/en-US/docs/Web/API/HTMLFormElement/formdata_event) — this is fired on an {{domxref("HTMLFormElement")}} object after the entry list representing the form's data is constructed. This happens when the form is submitted, but can also be triggered by the invocation of a {{domxref("FormData.FormData", "FormData()")}} constructor. +The [`formdata` event](/en-US/docs/Web/API/HTMLFormElement/formdata_event), more recent than the {{domxref("FormData")}} object, is fired on an {{domxref("HTMLFormElement")}} object after the entry list representing the form's data is constructed. This happens when the form is submitted, but can also be triggered by the invocation of a {{domxref("FormData.FormData", "FormData()")}} constructor. This allows a {{domxref("FormData")}} object to be quickly obtained in response to a `formdata` event firing, rather than needing to put it together yourself. -Typically this is used as shown in our [simple formdata event demo](https://long-impatiens.glitch.me/) — in the JavaScript we reference a form: +Typically this is used as shown in our [`formdata` event demo](https://long-impatiens.glitch.me/) — in the JavaScript we reference a form: ```js const formElem = document.querySelector("form"); ``` -In our [`submit` event](/en-US/docs/Web/API/HTMLFormElement/submit_event) handler we use [`preventDefault`](/en-US/docs/Web/API/Event/preventDefault) to stop the default form submission, then invoke a {{domxref("FormData")}} constructor to trigger the `formdata` event: +In our [`submit` event](/en-US/docs/Web/API/HTMLFormElement/submit_event) handler we use [`preventDefault`](/en-US/docs/Web/API/Event/preventDefault) to stop the default form submission, then invoke a {{domxref("FormData.FormData", "FormData()")}} constructor to trigger the `formdata` event: ```js formElem.addEventListener("submit", (e) => { @@ -189,12 +189,6 @@ formElem.addEventListener("formdata", (e) => { }); ``` -> **Note:** The `formdata` event and {{domxref("FormDataEvent")}} object are available in Chrome from version 77 (and other equivalent Chromiums), and Firefox 72 (first available behind the `dom.formdata.event.enabled` pref in Firefox 71). - -## Submitting forms and uploading files via AJAX without `FormData` objects - -If you want to know how to serialize and submit a form via [AJAX](/en-US/docs/Web/Guide/AJAX) _without_ using FormData objects, please read [this paragraph](https://github.com/mdn/content/blob/92435b5f26c680a2314d392ef06f479216f0b4dd/files/en-us/web/api/xmlhttprequest/using_xmlhttprequest/index.md#submitting-forms-and-uploading-files). - ## Gotchas The `FormData` object doesn't include data from the fields that are disabled or the fieldsets that are disabled. diff --git a/files/en-us/web/api/xmlhttprequest_api/using_xmlhttprequest/index.md b/files/en-us/web/api/xmlhttprequest_api/using_xmlhttprequest/index.md index c9f3d43b0736c70..59088c4d3347465 100644 --- a/files/en-us/web/api/xmlhttprequest_api/using_xmlhttprequest/index.md +++ b/files/en-us/web/api/xmlhttprequest_api/using_xmlhttprequest/index.md @@ -7,15 +7,17 @@ browser-compat: api.XMLHttpRequest {{DefaultAPISidebar("XMLHttpRequest API")}} -In this guide, we'll take a look at how to use -{{domxref("XMLHttpRequest")}} to issue [HTTP](/en-US/docs/Web/HTTP) -requests in order to exchange data between the website and a server. +In this guide, we'll take a look at how to use {{domxref("XMLHttpRequest")}} to issue [HTTP](/en-US/docs/Web/HTTP) requests in order to exchange data between the website and a server. Examples of both common and more obscure use cases for `XMLHttpRequest` are included. -To send an HTTP request, create an `XMLHttpRequest` object, open a URL, and -send the request. After the transaction completes, the object will contain useful -information such as the response body and the [HTTP status](/en-US/docs/Web/HTTP/Status) of the result. +To send an HTTP request: + +1. Create an `XMLHttpRequest` object +2. Open a URL +3. Send the request. + +After the transaction completes, the `XMLHttpRequest` object will contain useful information such as the response body and the [HTTP status](/en-US/docs/Web/HTTP/Status) of the result. ```js function reqListener() { @@ -30,96 +32,55 @@ req.send(); ## Types of requests -A request made via `XMLHttpRequest` can fetch the data in one of two ways, -asynchronously or synchronously. The type of request is dictated by the optional -`async` argument (the third argument) that is set on the -{{domxref("XMLHttpRequest.open()")}} method. If this argument is `true` or -not specified, the `XMLHttpRequest` is processed asynchronously, otherwise -the process is handled synchronously. A detailed discussion and demonstrations of these -two types of requests can be found on the [synchronous and asynchronous requests](/en-US/docs/Web/API/XMLHttpRequest_API/Synchronous_and_Asynchronous_Requests) page. You can't use synchronous requests outside web -workers as it freezes the main interface. +A request made via `XMLHttpRequest` can fetch the data in one of two ways, asynchronously or synchronously. The type of request is dictated by the optional `async` argument (the third argument) that is set on the {{domxref("XMLHttpRequest.open()")}} method. If this argument is `true` or not specified, the `XMLHttpRequest` is processed asynchronously, otherwise the process is handled synchronously. A detailed discussion and demonstrations of these two types of requests can be found on the [synchronous and asynchronous requests](/en-US/docs/Web/API/XMLHttpRequest_API/Synchronous_and_Asynchronous_Requests) page. You can't use synchronous requests outside web workers as it freezes the main interface. -> **Note:** The constructor `XMLHttpRequest` isn't limited to only XML documents. -> It starts with **"XML"** because when it was created the main format -> that was originally used for asynchronous data exchange was XML. +> **Note:** The constructor `XMLHttpRequest` isn't limited to only XML documents. It starts with **"XML"** because when it was created the main format that was originally used for asynchronous data exchange was XML. ## Handling responses -There are several types of [response attributes](https://xhr.spec.whatwg.org/) defined for the -{{domxref("XMLHttpRequest.XMLHttpRequest", "XMLHttpRequest()")}} constructor. These tell -the client making the `XMLHttpRequest` important information about the status -of the response. Some cases where dealing with non-text response types may involve some -manipulation and analysis are outlined in the following sections. +There are several types of [response attributes](https://xhr.spec.whatwg.org/) defined for the {{domxref("XMLHttpRequest.XMLHttpRequest", "XMLHttpRequest()")}} constructor. These tell the client making the `XMLHttpRequest` important information about the status of the response. Some cases where dealing with non-text response types may involve some manipulation and analysis are outlined in the following sections. ### Analyzing and manipulating the responseXML property -If you use `XMLHttpRequest` to get the content of a remote XML document, the -{{domxref("XMLHttpRequest.responseXML", "responseXML")}} property will be a DOM object -containing a parsed XML document. This could prove difficult to manipulate and analyze. -There are four primary ways of analyzing this XML document: +If you use `XMLHttpRequest` to get the content of a remote XML document, the {{domxref("XMLHttpRequest.responseXML", "responseXML")}} property will be a DOM object containing a parsed XML document. This could prove difficult to manipulate and analyze. There are four primary ways of analyzing this XML document: -1. Using [XPath](/en-US/docs/Web/XPath) to address (or point to) parts of - it. +1. Using [XPath](/en-US/docs/Web/XPath) to address (or point to) parts of it. 2. Manually [Parsing and serializing XML](/en-US/docs/Web/Guide/Parsing_and_serializing_XML) to strings or objects. -3. Using {{domxref("XMLSerializer")}} to serialize **DOM trees to strings or to - files**. -4. {{jsxref("RegExp")}} can be used if you always know the content of the XML document - beforehand. You might want to remove line breaks, if you use `RegExp` to - scan with regard to line breaks. However, this method is a "last resort" since if the - XML code changes slightly, the method will likely fail. - -> **Note:** `XMLHttpRequest` can now interpret HTML for you -> using the {{domxref("XMLHttpRequest.responseXML", "responseXML")}} property. Read the -> article about [HTML in XMLHttpRequest](/en-US/docs/Web/API/XMLHttpRequest_API/HTML_in_XMLHttpRequest) to learn how to do this. - -### Processing a responseText property containing an HTML document - -If you use `XMLHttpRequest` to get the content of a remote HTML webpage, the -{{domxref("XMLHttpRequest.responseText", "responseText")}} property is a string -containing the raw HTML. This could prove difficult to manipulate and analyze. There are -three primary ways to analyze and parse this raw HTML string: - -1. Use the `XMLHttpRequest.responseXML` property as covered in the article - [HTML in XMLHttpRequest](/en-US/docs/Web/API/XMLHttpRequest_API/HTML_in_XMLHttpRequest). -2. Inject the content into the body of a [document fragment](/en-US/docs/Web/API/DocumentFragment) via - `fragment.body.innerHTML` and traverse the DOM of the fragment. -3. {{jsxref("RegExp")}} can be used if you always know the content of the HTML - `responseText` beforehand. You might want to remove line breaks, if you use - `RegExp` to scan with regard to line breaks. However, this method is a "last resort" - since if the HTML code changes slightly, the method will likely fail. +3. Using {{domxref("XMLSerializer")}} to serialize **DOM trees to strings or to files**. +4. {{jsxref("RegExp")}} can be used if you always know the content of the XML document beforehand. You might want to remove line breaks, if you use `RegExp` to scan with regard to line breaks. However, this method is a "last resort" since if the XML code changes slightly, the method will likely fail. + +> **Note:** `XMLHttpRequest` can now interpret HTML for you, using the {{domxref("XMLHttpRequest.responseXML", "responseXML")}} property. Read the article about [HTML in XMLHttpRequest](/en-US/docs/Web/API/XMLHttpRequest_API/HTML_in_XMLHttpRequest) to learn how to do this. + +### Processing a `responseText` property containing an HTML document + +If you use `XMLHttpRequest` to get the content of a remote HTML webpage, the {{domxref("XMLHttpRequest.responseText", "responseText")}} property is a string containing the raw HTML. This could prove difficult to manipulate and analyze. There are three primary ways to analyze and parse this raw HTML string: + +1. Use the `XMLHttpRequest.responseXML` property as covered in the article [HTML in XMLHttpRequest](/en-US/docs/Web/API/XMLHttpRequest_API/HTML_in_XMLHttpRequest). +2. Inject the content into the body of a [document fragment](/en-US/docs/Web/API/DocumentFragment) via `fragment.body.innerHTML` and traverse the DOM of the fragment. +3. {{jsxref("RegExp")}} can be used if you always know the content of the HTML `responseText` beforehand. You might want to remove line breaks, if you use `RegExp` to scan with regard to line breaks. However, this method is a "last resort" since if the HTML code changes slightly, the method will likely fail. ## Handling binary data -Although {{domxref("XMLHttpRequest")}} is most commonly used to send and receive -textual data, it can be used to send and receive binary content. There are several well -tested methods for coercing the response of an `XMLHttpRequest` into sending -binary data. These involve utilizing the {{domxref("XMLHttpRequest.overrideMimeType", - "overrideMimeType()")}} method on the `XMLHttpRequest` object and is a -workable solution. +Although {{domxref("XMLHttpRequest")}} is most commonly used to send and receive textual data, it can be used to send and receive binary content. There are several well tested methods for coercing the response of an `XMLHttpRequest` into sending binary data. These involve utilizing the {{domxref("XMLHttpRequest.overrideMimeType", "overrideMimeType()")}} method on the `XMLHttpRequest` object and is a workable solution. ```js const req = new XMLHttpRequest(); req.open("GET", url); // retrieve data unprocessed as a binary string req.overrideMimeType("text/plain; charset=x-user-defined"); -/* ... */ +/* … */ ``` -However, more modern techniques are available, since the -{{domxref("XMLHttpRequest.responseType", "responseType")}} attribute now supports a -number of additional content types, which makes sending and receiving binary data much -easier. +However, more modern techniques are available, since the {{domxref("XMLHttpRequest.responseType", "responseType")}} attribute now supports a number of additional content types, which makes sending and receiving binary data much easier. -For example, consider this snippet, which uses the `responseType` of -"`arraybuffer`" to fetch the remote content into a {{jsxref("ArrayBuffer")}} -object, which stores the raw binary data. +For example, consider this snippet, which uses the `responseType` of "`arraybuffer`" to fetch the remote content into a {{jsxref("ArrayBuffer")}} object, which stores the raw binary data. ```js const req = new XMLHttpRequest(); req.onload = (e) => { const arraybuffer = req.response; // not responseText - /* ... */ + /* … */ }; req.open("GET", url); req.responseType = "arraybuffer"; @@ -130,13 +91,9 @@ For more examples check out the [Sending and Receiving Binary Data](/en-US/docs/ ## Monitoring progress -`XMLHttpRequest` provides the ability to listen to various events that can -occur while the request is being processed. This includes periodic progress -notifications, error notifications, and so forth. +`XMLHttpRequest` provides the ability to listen to various events that can occur while the request is being processed. This includes periodic progress notifications, error notifications, and so forth. -Support for DOM {{domxref("XMLHttpRequest/progress_event", "progress")}} event monitoring of `XMLHttpRequest` -transfers follows the [specification for progress events](https://xhr.spec.whatwg.org/#interface-progressevent): these events implement the {{domxref("ProgressEvent")}} interface. The -actual events you can monitor to determine the state of an ongoing transfer are: +Support for DOM {{domxref("XMLHttpRequest/progress_event", "progress")}} event monitoring of `XMLHttpRequest` transfers follows the [specification for progress events](https://xhr.spec.whatwg.org/#interface-progressevent): these events implement the {{domxref("ProgressEvent")}} interface. The actual events you can monitor to determine the state of an ongoing transfer are: - {{domxref("XMLHttpRequest/progress_event", "progress")}} - : The amount of data that has been retrieved has changed. @@ -153,13 +110,13 @@ req.addEventListener("abort", transferCanceled); req.open(); -// ... +// … // progress on transfers from the server to the client (downloads) function updateProgress(event) { if (event.lengthComputable) { const percentComplete = (event.loaded / event.total) * 100; - // ... + // … } else { // Unable to compute progress information since the total size is unknown } @@ -178,23 +135,13 @@ function transferCanceled(evt) { } ``` -Lines 3-6 add event listeners for the various events that are sent while performing a -data transfer using `XMLHttpRequest`. +Lines 3-6 add event listeners for the various events that are sent while performing a data transfer using `XMLHttpRequest`. -> **Note:** You need to add the event listeners before -> calling `open()` on the request. Otherwise the `progress` events -> will not fire. +> **Note:** You need to add the event listeners before calling `open()` on the request. Otherwise the `progress` events will not fire. -The progress event handler, specified by the `updateProgress()` function in -this example, receives the total number of bytes to transfer as well as the number of -bytes transferred so far in the event's `total` and `loaded` -fields. However, if the `lengthComputable` field is false, the total length -is not known and will be zero. +The progress event handler, specified by the `updateProgress()` function in this example, receives the total number of bytes to transfer as well as the number of bytes transferred so far in the event's `total` and `loaded` fields. However, if the `lengthComputable` field is false, the total length is not known and will be zero. -Progress events exist for both download and upload transfers. The download events are -fired on the `XMLHttpRequest` object itself, as shown in the above sample. -The upload events are fired on the `XMLHttpRequest.upload` object, as shown -below: +Progress events exist for both download and upload transfers. The download events are fired on the `XMLHttpRequest` object itself, as shown in the above sample. The upload events are fired on the `XMLHttpRequest.upload` object, as shown below: ```js const req = new XMLHttpRequest(); @@ -210,11 +157,7 @@ req.open(); > **Note:** Progress events are not available for the > `file:` protocol. -Progress events come in for every chunk of data received, including the last chunk in -cases in which the last packet is received and the connection closed before the -progress event is fired. In this case, the progress event is automatically fired when -the load event occurs for that packet. This lets you now reliably monitor progress by -only watching the "progress" event. +Progress events come in for every chunk of data received, including the last chunk in cases in which the last packet is received and the connection closed before the progress event is fired. In this case, the progress event is automatically fired when the load event occurs for that packet. This lets you now reliably monitor progress by only watching the "progress" event. One can also detect all three load-ending conditions (`abort`, `load`, or `error`) using the `loadend` event: @@ -229,10 +172,7 @@ function loadEnd(e) { } ``` -Note there is no way to be certain, from the information received by the -`loadend` event, as to which condition caused the operation to terminate; -however, you can use this to handle tasks that need to be performed in all -end-of-transfer scenarios. +Note there is no way to be certain, from the information received by the `loadend` event, as to which condition caused the operation to terminate; however, you can use this to handle tasks that need to be performed in all end-of-transfer scenarios. ## Get last modified date @@ -294,23 +234,18 @@ If you want to know if the current page has changed, refer to the article about ## Cross-site XMLHttpRequest -Modern browsers support cross-site requests by implementing the [Cross-Origin Resource Sharing](/en-US/docs/Web/HTTP/CORS) (CORS) standard. As -long as the server is configured to allow requests from your web application's origin, -`XMLHttpRequest` will work. Otherwise, an `INVALID_ACCESS_ERR` -exception is thrown. +Modern browsers support cross-site requests by implementing the [Cross-Origin Resource Sharing](/en-US/docs/Web/HTTP/CORS) (CORS) standard. As long as the server is configured to allow requests from your web application's origin, `XMLHttpRequest` will work. Otherwise, an `INVALID_ACCESS_ERR` exception is thrown. ## Bypassing the cache -A cross-browser compatible approach to bypassing the cache is appending a timestamp to -the URL, being sure to include a "?" or "&" as appropriate. For example: +A cross-browser compatible approach to bypassing the cache is appending a timestamp to the URL, being sure to include a "?" or "&" as appropriate. For example: ```plain -http://foo.com/bar.html -> http://foo.com/bar.html?12345 -http://foo.com/bar.html?foobar=baz -> http://foo.com/bar.html?foobar=baz&12345 +http://example.com/bar.html -> http://example.com/bar.html?12345 +http://example.com/bar.html?foobar=baz -> http://example.com/bar.html?foobar=baz&12345 ``` -As the local cache is indexed by URL, this causes every request to be unique, thereby -bypassing the cache. +As the local cache is indexed by URL, this causes every request to be unique, thereby bypassing the cache. You can automatically adjust URLs using the following code: @@ -323,29 +258,11 @@ req.send(null); ## Security -The recommended way to enable cross-site scripting is to use the -`Access-Control-Allow-Origin` HTTP header in the response to the -XMLHttpRequest. +The recommended way to enable cross-site scripting is to use the `Access-Control-Allow-Origin` HTTP header in the response to the XMLHttpRequest. ### XMLHttpRequests being stopped -If you conclude with an XMLHttpRequest receiving `status=0` and -`statusText=null`, this means the request was not allowed to be performed. It -was -[`UNSENT`](https://xhr.spec.whatwg.org/#dom-xmlhttprequest-unsent). -A likely cause for this is when the [`XMLHttpRequest` origin](https://www.w3.org/TR/2010/CR-XMLHttpRequest-20100803/#xmlhttprequest-origin) (at the creation of the XMLHttpRequest) has changed when the XMLHttpRequest -is subsequently `open()`. This case can happen, for example, when one has an -XMLHttpRequest that gets fired on an onunload event for a window, the expected -XMLHttpRequest is created when the window to be closed is still there, and finally -sending the request (in other words, `open()`) when this window has lost its -focus and another window gains focus. The most effective way to avoid this problem is to -set a listener on the new window's {{domxref("Element/DOMActivate_event", "DOMActivate")}} event which is set once the -terminated window has its {{domxref("Window/unload_event", "unload")}} event triggered. - -## Workers - -Setting `overrideMimeType` does not work from a {{domxref("Worker")}}. See -[Firefox bug 678057](https://bugzil.la/678057) for more details. Other browsers may handle this differently. +If you conclude with an XMLHttpRequest receiving `status=0` and `statusText=null`, this means the request was not allowed to be performed. It was [`UNSENT`](https://xhr.spec.whatwg.org/#dom-xmlhttprequest-unsent). A likely cause for this is when the [`XMLHttpRequest` origin](https://www.w3.org/TR/2010/CR-XMLHttpRequest-20100803/#xmlhttprequest-origin) (at the creation of the XMLHttpRequest) has changed when the XMLHttpRequest is subsequently `open()`. This case can happen, for example, when one has an XMLHttpRequest that gets fired on an onunload event for a window, the expected XMLHttpRequest is created when the window to be closed is still there, and finally sending the request (in other words, `open()`) when this window has lost its focus and another window gains focus. The most effective way to avoid this problem is to set a listener on the new window's {{domxref("Element/DOMActivate_event", "DOMActivate")}} event which is set once the terminated window has its {{domxref("Window/unload_event", "unload")}} event triggered. ## Specifications @@ -357,8 +274,8 @@ Setting `overrideMimeType` does not work from a {{domxref("Worker")}}. See ## See also +- [Using the Fetch API](/en-US/docs/Web/API/Fetch_API/Using_Fetch) - [HTML in XMLHttpRequest](/en-US/docs/Web/API/XMLHttpRequest_API/HTML_in_XMLHttpRequest) - [HTTP access control](/en-US/docs/Web/HTTP/CORS) - [XMLHttpRequest - REST and the Rich User Experience](https://www.peej.co.uk/articles/rich-user-experience.html) -- ["Using the XMLHttpRequest Object" (jibbering.com)](https://jibbering.com/2002/4/httprequest.html) - [The `XMLHttpRequest` object: WHATWG specification](https://xhr.spec.whatwg.org/) From 21ed195dd72d2f11c0c7e0fdd0ed0aaf31068de1 Mon Sep 17 00:00:00 2001 From: rhires Date: Thu, 9 Nov 2023 15:33:51 -0500 Subject: [PATCH 27/52] Minor grammar fix (#30165) Update index.md fix typo --- .../css/css_grid_layout/basic_concepts_of_grid_layout/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/en-us/web/css/css_grid_layout/basic_concepts_of_grid_layout/index.md b/files/en-us/web/css/css_grid_layout/basic_concepts_of_grid_layout/index.md index 82026d2a41ba629..4dbc8dcfa39bf86 100644 --- a/files/en-us/web/css/css_grid_layout/basic_concepts_of_grid_layout/index.md +++ b/files/en-us/web/css/css_grid_layout/basic_concepts_of_grid_layout/index.md @@ -643,7 +643,7 @@ In this case the nested grid has no relationship to the parent. As you can see i ### Subgrid -In addition to regular grids, _subgrid_ let us create nested grids that use the track definition of the parent grid. +In addition to regular grids, _subgrid_ lets us create nested grids that use the track definition of the parent grid. To use them, we edit the above nested grid example to change the track definition of `grid-template-columns: repeat(3, 1fr)`, to `grid-template-columns: subgrid`. The nested grid then use the parent grid tracks to layout items. From 5bcd5923642bcf6b761c2e03e3fc2028233dc9cc Mon Sep 17 00:00:00 2001 From: nathan <50345854+superpotato9@users.noreply.github.com> Date: Thu, 9 Nov 2023 12:35:46 -0800 Subject: [PATCH 28/52] fixed minor spelling error (#30164) --- .../live_streaming_web_audio_and_video/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/en-us/web/guide/audio_and_video_delivery/live_streaming_web_audio_and_video/index.md b/files/en-us/web/guide/audio_and_video_delivery/live_streaming_web_audio_and_video/index.md index 9b3a39e51f45235..3634fbbd9b3723b 100644 --- a/files/en-us/web/guide/audio_and_video_delivery/live_streaming_web_audio_and_video/index.md +++ b/files/en-us/web/guide/audio_and_video_delivery/live_streaming_web_audio_and_video/index.md @@ -14,7 +14,7 @@ The key consideration when streaming media to a browser is the fact that rather In this case, we are using static media to describe media that is represented by a file, whether it be an mp3 or WebM file. This file sits on a server and can be delivered — like most other files — to the browser. This is often known as a progressive download. -Livestreamed media lacks a finite start and end time as rather as a static file, it is a stream of data that the server passes on down the line to the browser and is often adaptive (see below). Usually, we require different formats and special server-side software to achieve this. +Livestreamed media lacks a finite start and end time rather than a static file, it is a stream of data that the server passes on down the line to the browser and is often adaptive (see below). Usually, we require different formats and special server-side software to achieve this. ## Adaptive streaming From edf90fe0a1b82b97e9b84b62b9508619e4dcf632 Mon Sep 17 00:00:00 2001 From: Vadim Makeev Date: Thu, 9 Nov 2023 21:45:44 +0100 Subject: [PATCH 29/52] Add line height units example (#30153) * Add line height units example * Add link to repeating-linear-gradient * Apply suggestions Co-authored-by: Estelle Weyl * Apply suggestions Co-authored-by: Estelle Weyl * Make demo taller * Update files/en-us/learn/css/building_blocks/values_and_units/index.md * Update files/en-us/learn/css/building_blocks/values_and_units/index.md Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update files/en-us/learn/css/building_blocks/values_and_units/index.md Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --------- Co-authored-by: Estelle Weyl Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .../building_blocks/values_and_units/index.md | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/files/en-us/learn/css/building_blocks/values_and_units/index.md b/files/en-us/learn/css/building_blocks/values_and_units/index.md index 6b9cbfe1549cddd..9bbeb7f8fd70549 100644 --- a/files/en-us/learn/css/building_blocks/values_and_units/index.md +++ b/files/en-us/learn/css/building_blocks/values_and_units/index.md @@ -265,6 +265,62 @@ However, if you change the `` element's `font-size` in the CSS you will se {{EmbedGHLiveSample("css-examples/learn/values-units/em-rem.html", '100%', 1100)}} +#### Line height units + +`lh` and `rlh` are relative lenghts units similar to `em` and `rem`. The difference between `lh` and `rlh` is that the first one is relative to the line height of the element itself, while the second one is relative to the line height of the root element, usually ``. + +Using these units, we can precisely align box decoration to the text. In this example, we use `lh` unit to create notepad-like lines using [`repeating-linear-gradient()`](/en-US/docs/Web/CSS/gradient/repeating-linear-gradient). It doesn't matter what's the line height of the text, the lines will always start in the right place. + +```css hidden +body { + margin: 0; + display: grid; + grid-template-columns: 1fr 1fr; + padding: 24px; + gap: 24px; + background-color: floralwhite; + font-family: sans-serif; +} + +@supports not (height: 1lh) { + body::before { + grid-column: 1 / -1; + padding: 8px; + border-radius: 4px; + background-color: tomato; + color: white; + content: "You browser doesn’t support lh unit just yet"; + } +} +``` + +```css +p { + margin: 0; + background-image: repeating-linear-gradient( + to top, + lightskyblue 0 2px, + transparent 2px 1lh + ); +} +``` + +```html +

+ Summer is a time for adventure, and this year was no exception. I had many + exciting experiences, but two of my favorites were my trip to the beach and my + week at summer camp. +

+ +

+ At the beach, I spent my days swimming, collecting shells, and building + sandcastles. I also went on a boat ride and saw dolphins swimming alongside + us. +

+``` + +{{EmbedLiveSample("line_height_units", "100%", "370")}} + ### Percentages In a lot of cases, a percentage is treated in the same way as a length. The thing with percentages is that they are always set relative to some other value. For example, if you set an element's `font-size` as a percentage, it will be a percentage of the `font-size` of the element's parent. If you use a percentage for a `width` value, it will be a percentage of the `width` of the parent. From eccf9de9ab568d5f5ce2ebdf33de1464b56e032a Mon Sep 17 00:00:00 2001 From: Joshua Chen Date: Thu, 9 Nov 2023 16:00:18 -0500 Subject: [PATCH 30/52] Reference for stage 3 set-methods (#28414) * Reference for stage 3 set-methods * Add core-js links * Address some reviews * Improve alt text * Little change --- .../global_objects/set/difference/diagram.svg | 1 + .../global_objects/set/difference/index.md | 72 ++++++++++++++ .../reference/global_objects/set/index.md | 99 +++++++++++++++++++ .../set/intersection/diagram.svg | 1 + .../global_objects/set/intersection/index.md | 72 ++++++++++++++ .../set/isdisjointfrom/diagram.svg | 1 + .../set/isdisjointfrom/index.md | 80 +++++++++++++++ .../global_objects/set/issubsetof/diagram.svg | 1 + .../global_objects/set/issubsetof/index.md | 89 +++++++++++++++++ .../set/issupersetof/diagram.svg | 1 + .../global_objects/set/issupersetof/index.md | 89 +++++++++++++++++ .../set/symmetricdifference/diagram.svg | 1 + .../set/symmetricdifference/index.md | 69 +++++++++++++ .../global_objects/set/union/diagram.svg | 1 + .../global_objects/set/union/index.md | 69 +++++++++++++ 15 files changed, 646 insertions(+) create mode 100644 files/en-us/web/javascript/reference/global_objects/set/difference/diagram.svg create mode 100644 files/en-us/web/javascript/reference/global_objects/set/difference/index.md create mode 100644 files/en-us/web/javascript/reference/global_objects/set/intersection/diagram.svg create mode 100644 files/en-us/web/javascript/reference/global_objects/set/intersection/index.md create mode 100644 files/en-us/web/javascript/reference/global_objects/set/isdisjointfrom/diagram.svg create mode 100644 files/en-us/web/javascript/reference/global_objects/set/isdisjointfrom/index.md create mode 100644 files/en-us/web/javascript/reference/global_objects/set/issubsetof/diagram.svg create mode 100644 files/en-us/web/javascript/reference/global_objects/set/issubsetof/index.md create mode 100644 files/en-us/web/javascript/reference/global_objects/set/issupersetof/diagram.svg create mode 100644 files/en-us/web/javascript/reference/global_objects/set/issupersetof/index.md create mode 100644 files/en-us/web/javascript/reference/global_objects/set/symmetricdifference/diagram.svg create mode 100644 files/en-us/web/javascript/reference/global_objects/set/symmetricdifference/index.md create mode 100644 files/en-us/web/javascript/reference/global_objects/set/union/diagram.svg create mode 100644 files/en-us/web/javascript/reference/global_objects/set/union/index.md diff --git a/files/en-us/web/javascript/reference/global_objects/set/difference/diagram.svg b/files/en-us/web/javascript/reference/global_objects/set/difference/diagram.svg new file mode 100644 index 000000000000000..4081a39269de934 --- /dev/null +++ b/files/en-us/web/javascript/reference/global_objects/set/difference/diagram.svg @@ -0,0 +1 @@ +AB diff --git a/files/en-us/web/javascript/reference/global_objects/set/difference/index.md b/files/en-us/web/javascript/reference/global_objects/set/difference/index.md new file mode 100644 index 000000000000000..ae57aa47e1356cf --- /dev/null +++ b/files/en-us/web/javascript/reference/global_objects/set/difference/index.md @@ -0,0 +1,72 @@ +--- +title: Set.prototype.difference() +slug: Web/JavaScript/Reference/Global_Objects/Set/difference +page-type: javascript-instance-method +browser-compat: javascript.builtins.Set.difference +--- + +{{JSRef}} + +The **`difference()`** method of {{jsxref("Set")}} instances takes a set and returns a new set containing elements in this set but not in the given set. + +## Syntax + +```js-nolint +difference(other) +``` + +### Parameters + +- `other` + - : A {{jsxref("Set")}} object, or [set-like](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set#set-like_objects) object. + +### Return value + +A new {{jsxref("Set")}} object containing elements in this set but not in the `other` set. + +## Description + +In mathematical notation, _difference_ is defined as: + +AB={xAxB}A\setminus B = \{x\in A\mid x\notin B\} + +And using Venn diagram: + +![A Venn diagram where two circles overlap. The difference of A and B is the part of A that is not overlapping B.](diagram.svg) + +`difference()` accepts [set-like](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set#set-like_objects) objects as the `other` parameter. It requires {{jsxref("Operators/this", "this")}} to be an actual {{jsxref("Set")}} instance, because it directly retrieves the underlying data stored in `this` without invoking any user code. Then, its behavior depends on the sizes of `this` and `other`: + +- If there are more elements in `this` than `other.size`, then it iterates over `other` by calling its `keys()` method, and constructs a new set with all elements in `this` that are not seen in `other`. +- Otherwise, it iterates over the elements in `this`, and constructs a new set with all elements `e` in `this` that cause `other.has(e)` to return a [falsy](/en-US/docs/Glossary/Falsy) value. + +The order of elements in the returned set is the same as in `this`. + +## Examples + +### Using difference() + +The following example computes the difference between the set of odd numbers (<10) and the set of perfect squares (<10). The result is the set of odd numbers that are not perfect squares. + +```js +const odds = new Set([1, 3, 5, 7, 9]); +const squares = new Set([1, 4, 9]); +console.log(odds.difference(squares)); // Set(3) { 3, 5, 7 } +``` + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## See also + +- [Polyfill of `Set.prototype.difference` in `core-js`](https://github.com/zloirock/core-js#new-set-methods) +- {{jsxref("Set.prototype.intersection()")}} +- {{jsxref("Set.prototype.isDisjointFrom()")}} +- {{jsxref("Set.prototype.isSubsetOf()")}} +- {{jsxref("Set.prototype.isSupersetOf()")}} +- {{jsxref("Set.prototype.symmetricDifference()")}} +- {{jsxref("Set.prototype.union()")}} diff --git a/files/en-us/web/javascript/reference/global_objects/set/index.md b/files/en-us/web/javascript/reference/global_objects/set/index.md index c607c14bf1e4aa8..6242739c2059195 100644 --- a/files/en-us/web/javascript/reference/global_objects/set/index.md +++ b/files/en-us/web/javascript/reference/global_objects/set/index.md @@ -23,6 +23,91 @@ Value equality is based on the [SameValueZero](/en-US/docs/Web/JavaScript/Equali The [`has`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/has) method checks if a value is in the set, using an approach that is, on average, quicker than testing most of the elements that have previously been added to the set. In particular, it is, on average, faster than the [`Array.prototype.includes`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes) method when an array has a `length` equal to a set's `size`. +### Set composition + +The `Set` object provides some methods that allow you to compose sets like you would with mathematical operations. These methods include: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MethodReturn typeMathematical equivalentVenn diagram
{{jsxref("Set/difference", "A.difference(B)")}}SetABA\setminus BA Venn diagram where two circles overlap. The difference of A and B is the part of A that is not overlapping B.
{{jsxref("Set/intersection", "A.intersection(B)")}}SetABA\cap BA Venn diagram where two circles overlap. The intersection of A and B is the part where they overlap.
{{jsxref("Set/symmetricDifference", "A.symmetricDifference(B)")}}Set(AB)(BA)(A\setminus B)\cup(B\setminus A)A Venn diagram where two circles overlap. The symmetric difference of A and B is the region contained by either circle but not both.
{{jsxref("Set/union", "A.union(B)")}}SetABA\cup BA Venn diagram where two circles overlap. The symmetric difference of A and B is the region contained by either or both circles.
{{jsxref("Set/isDisjointFrom", "A.isDisjointFrom(B)")}}BooleanAB=A\cap B = \emptyA Venn diagram with two circles. A and B are disjoint because the circles have no region of overlap.
{{jsxref("Set/isSubsetOf", "A.isSubsetOf(B)")}}BooleanABA\subseteq BA Venn diragram with two circles. A is a subset of B because A is completely contained in B.
{{jsxref("Set/isSupersetOf", "A.isSupersetOf(B)")}}BooleanABA\supseteq BA Venn diagram with two circles. A is a superset of B because B is completely contained in A.
+ +To make them more generalizable, these methods don't just accept `Set` objects, but anything that's [set-like](#set-like_objects). + +### Set-like objects + +All [set methods](#set_methods) require {{jsxref("Operators/this", "this")}} to be an actual `Set` instance, but their arguments just need to be set-like. A _set-like object_ is an object that provides the following: + +- A {{jsxref("Set/size", "size")}} property that contains a number. +- A {{jsxref("Set/has", "has()")}} method that takes an element and returns a boolean. +- A {{jsxref("Set/keys", "keys()")}} method that returns an [iterator](/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) of the elements in the set. + +For example, {{jsxref("Map")}} objects are set-like because they also have {{jsxref("Map/size", "size")}}, {{jsxref("Map/has", "has()")}}, and {{jsxref("Map/keys", "keys()")}}, so they behave just like sets of keys when used in set methods: + +```js +const a = new Set([1, 2, 3]); +const b = new Map([ + [1, "one"], + [2, "two"], + [4, "four"], +]); +console.log(a.union(b)); // Set(4) {1, 2, 3, 4} +``` + +> **Note:** The set-like protocol invokes the `keys()` method instead of [`[@@iterator]()`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/@@iterator) to produce elements. This is to make maps valid set-like objects, because for maps, the iterator produces _entries_ but the `has()` method takes _keys_. + +[Arrays](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) are not set-like because they don't have a `has()` method or the `size` property, and their `keys()` method produces indices instead of elements. {{jsxref("WeakSet")}} objects are also not set-like because they don't have a `keys()` method. + ### Set-like browser APIs Browser **`Set`-like objects** (or "setlike objects") are [Web API](/en-US/docs/Web/API) interfaces that behave in many ways like a `Set`. @@ -88,14 +173,28 @@ These properties are defined on `Set.prototype` and shared by all `Set` instance - : Removes all elements from the `Set` object. - {{jsxref("Set.prototype.delete()")}} - : Removes the element associated to the `value` and returns a boolean asserting whether an element was successfully removed or not. `Set.prototype.has(value)` will return `false` afterwards. +- {{jsxref("Set.prototype.difference()")}} + - : Takes a set and returns a new set containing elements in this set but not in the given set. - {{jsxref("Set.prototype.entries()")}} - : Returns a new iterator object that contains **an array of `[value, value]`** for each element in the `Set` object, in insertion order. This is similar to the {{jsxref("Map")}} object, so that each entry's _key_ is the same as its _value_ for a `Set`. - {{jsxref("Set.prototype.forEach()")}} - : Calls `callbackFn` once for each value present in the `Set` object, in insertion order. If a `thisArg` parameter is provided, it will be used as the `this` value for each invocation of `callbackFn`. - {{jsxref("Set.prototype.has()")}} - : Returns a boolean asserting whether an element is present with the given value in the `Set` object or not. +- {{jsxref("Set.prototype.intersection()")}} + - : Takes a set and returns a new set containing elements in both this set and the given set. +- {{jsxref("Set.prototype.isDisjointFrom()")}} + - : Takes a set and returns a boolean indicating if this set has no elements in common with the given set. +- {{jsxref("Set.prototype.isSubsetOf()")}} + - : Takes a set and returns a boolean indicating if all elements of this set are in the given set. +- {{jsxref("Set.prototype.isSupersetOf()")}} + - : Takes a set and returns a boolean indicating if all elements of the given set are in this set. - {{jsxref("Set.prototype.keys()")}} - : An alias for {{jsxref("Set.prototype.values()")}}. +- {{jsxref("Set.prototype.symmetricDifference()")}} + - : Takes a set and returns a new set containing elements which are in either this set or the given set, but not in both. +- {{jsxref("Set.prototype.union()")}} + - : Takes a set and returns a new set containing elements which are in either or both of this set and the given set. - {{jsxref("Set.prototype.values()")}} - : Returns a new iterator object that yields the **values** for each element in the `Set` object in insertion order. - [`Set.prototype[@@iterator]()`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/@@iterator) diff --git a/files/en-us/web/javascript/reference/global_objects/set/intersection/diagram.svg b/files/en-us/web/javascript/reference/global_objects/set/intersection/diagram.svg new file mode 100644 index 000000000000000..da5370e7c9a88c4 --- /dev/null +++ b/files/en-us/web/javascript/reference/global_objects/set/intersection/diagram.svg @@ -0,0 +1 @@ +AB \ No newline at end of file diff --git a/files/en-us/web/javascript/reference/global_objects/set/intersection/index.md b/files/en-us/web/javascript/reference/global_objects/set/intersection/index.md new file mode 100644 index 000000000000000..201bef572816cc8 --- /dev/null +++ b/files/en-us/web/javascript/reference/global_objects/set/intersection/index.md @@ -0,0 +1,72 @@ +--- +title: Set.prototype.intersection() +slug: Web/JavaScript/Reference/Global_Objects/Set/intersection +page-type: javascript-instance-method +browser-compat: javascript.builtins.Set.intersection +--- + +{{JSRef}} + +The **`intersection()`** method of {{jsxref("Set")}} instances takes a set and returns a new set containing elements in both this set and the given set. + +## Syntax + +```js-nolint +intersection(other) +``` + +### Parameters + +- `other` + - : A {{jsxref("Set")}} object, or [set-like](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set#set-like_objects) object. + +### Return value + +A new {{jsxref("Set")}} object containing elements in both this set and the `other` set. + +## Description + +In mathematical notation, _intersection_ is defined as: + +AB={xAxB}A\cap B = \{x\in A\mid x\in B\} + +And using Venn diagram: + +![A Venn diagram where two circles overlap. The intersection of A and B is the part where they overlap.](diagram.svg) + +`intersection()` accepts [set-like](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set#set-like_objects) objects as the `other` parameter. It requires {{jsxref("Operators/this", "this")}} to be an actual {{jsxref("Set")}} instance, because it directly retrieves the underlying data stored in `this` without invoking any user code. Then, its behavior depends on the sizes of `this` and `other`: + +- If there are more elements in `this` than `other.size`, then it iterates over `other` by calling its `keys()` method, and constructs a new set with all elements produced that are also present in `this`. +- Otherwise, it iterates over the elements in `this`, and constructs a new set with all elements `e` in `this` that cause `other.has(e)` to return a [truthy](/en-US/docs/Glossary/Truthy) value. + +Because of this implementation, the efficiency of `intersection()` mostly depends on the size of the smaller set between `this` and `other` (assuming sets can be accessed in sublinear time). The order of elements in the returned set is the same as that of the smaller of `this` and `other`. + +## Examples + +### Using intersection() + +The following example computes the intersection between the set of odd numbers (<10) and the set of perfect squares (<10). The result is the set of odd numbers that are perfect squares. + +```js +const odds = new Set([1, 3, 5, 7, 9]); +const squares = new Set([1, 4, 9]); +console.log(odds.intersection(squares)); // Set(2) { 1, 9 } +``` + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## See also + +- [Polyfill of `Set.prototype.intersection` in `core-js`](https://github.com/zloirock/core-js#new-set-methods) +- {{jsxref("Set.prototype.difference()")}} +- {{jsxref("Set.prototype.isDisjointFrom()")}} +- {{jsxref("Set.prototype.isSubsetOf()")}} +- {{jsxref("Set.prototype.isSupersetOf()")}} +- {{jsxref("Set.prototype.symmetricDifference()")}} +- {{jsxref("Set.prototype.union()")}} diff --git a/files/en-us/web/javascript/reference/global_objects/set/isdisjointfrom/diagram.svg b/files/en-us/web/javascript/reference/global_objects/set/isdisjointfrom/diagram.svg new file mode 100644 index 000000000000000..f84e5f12b633204 --- /dev/null +++ b/files/en-us/web/javascript/reference/global_objects/set/isdisjointfrom/diagram.svg @@ -0,0 +1 @@ +AB \ No newline at end of file diff --git a/files/en-us/web/javascript/reference/global_objects/set/isdisjointfrom/index.md b/files/en-us/web/javascript/reference/global_objects/set/isdisjointfrom/index.md new file mode 100644 index 000000000000000..f1028ea002c65e8 --- /dev/null +++ b/files/en-us/web/javascript/reference/global_objects/set/isdisjointfrom/index.md @@ -0,0 +1,80 @@ +--- +title: Set.prototype.isDisjointFrom() +slug: Web/JavaScript/Reference/Global_Objects/Set/isDisjointFrom +page-type: javascript-instance-method +browser-compat: javascript.builtins.Set.isDisjointFrom +--- + +{{JSRef}} + +The **`isDisjointFrom()`** method of {{jsxref("Set")}} instances takes a set and returns a boolean indicating if this set has no elements in common with the given set. + +## Syntax + +```js-nolint +isDisjointFrom(other) +``` + +### Parameters + +- `other` + - : A {{jsxref("Set")}} object, or [set-like](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set#set-like_objects) object. + +### Return value + +`true` if this set has no elements in common with the `other` set, and `false` otherwise. + +## Description + +Two sets are _disjoint_ if they have no elements in common. In mathematical notation: + +A is disjoint from BAB=A\text{ is disjoint from }B \Leftrightarrow A\cap B = \empty + +And using Venn diagram: + +![A Venn diagram with two circles. A and B are disjoint because the circles have no region of overlap.](diagram.svg) + +`isDisjointFrom()` accepts [set-like](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set#set-like_objects) objects as the `other` parameter. It requires {{jsxref("Operators/this", "this")}} to be an actual {{jsxref("Set")}} instance, because it directly retrieves the underlying data stored in `this` without invoking any user code. Then, its behavior depends on the sizes of `this` and `other`: + +- If there are more elements in `this` than `other.size`, then it iterates over `other` by calling its `keys()` method, and if any element in `other` is present in `this`, it returns `false` (and closes the `keys()` iterator by calling its `return()` method). Otherwise, it returns `true`. +- Otherwise, it iterates over the elements in `this`, and returns `false` if any element `e` in `this` causes `other.has(e)` to return a [truthy](/en-US/docs/Glossary/Truthy) value. Otherwise, it returns `true`. + +Because of this implementation, the efficiency of `isDisjointFrom()` mostly depends on the size of the smaller set between `this` and `other` (assuming sets can be accessed in sublinear time). + +## Examples + +### Using isDisjointFrom() + +The set of perfect squares (<20) is disjoint from the set of prime numbers (<20), because a perfect square is by definition decomposable into the product of two integers, while 1 is also not considered a prime number: + +```js +const primes = new Set([2, 3, 5, 7, 11, 13, 17, 19]); +const squares = new Set([1, 4, 9, 16]); +console.log(primes.isDisjointFrom(squares)); // true +``` + +The set of perfect squares (<20) is not disjoint from the set of composite numbers (<20), because all non-1 perfect squares are by definition composite numbers: + +```js +const composites = new Set([4, 6, 8, 9, 10, 12, 14, 15, 16, 18]); +const squares = new Set([1, 4, 9, 16]); +console.log(composites.isDisjointFrom(squares)); // false +``` + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## See also + +- [Polyfill of `Set.prototype.isDisjointFrom` in `core-js`](https://github.com/zloirock/core-js#new-set-methods) +- {{jsxref("Set.prototype.difference()")}} +- {{jsxref("Set.prototype.intersection()")}} +- {{jsxref("Set.prototype.isSubsetOf()")}} +- {{jsxref("Set.prototype.isSupersetOf()")}} +- {{jsxref("Set.prototype.symmetricDifference()")}} +- {{jsxref("Set.prototype.union()")}} diff --git a/files/en-us/web/javascript/reference/global_objects/set/issubsetof/diagram.svg b/files/en-us/web/javascript/reference/global_objects/set/issubsetof/diagram.svg new file mode 100644 index 000000000000000..557c37e13cfd019 --- /dev/null +++ b/files/en-us/web/javascript/reference/global_objects/set/issubsetof/diagram.svg @@ -0,0 +1 @@ +AB \ No newline at end of file diff --git a/files/en-us/web/javascript/reference/global_objects/set/issubsetof/index.md b/files/en-us/web/javascript/reference/global_objects/set/issubsetof/index.md new file mode 100644 index 000000000000000..d1e7fed9be8dc2e --- /dev/null +++ b/files/en-us/web/javascript/reference/global_objects/set/issubsetof/index.md @@ -0,0 +1,89 @@ +--- +title: Set.prototype.isSubsetOf() +slug: Web/JavaScript/Reference/Global_Objects/Set/isSubsetOf +page-type: javascript-instance-method +browser-compat: javascript.builtins.Set.isSubsetOf +--- + +{{JSRef}} + +The **`isSubsetOf()`** method of {{jsxref("Set")}} instances takes a set and returns a boolean indicating if all elements of this set are in the given set. + +## Syntax + +```js-nolint +isSubsetOf(other) +``` + +### Parameters + +- `other` + - : A {{jsxref("Set")}} object, or [set-like](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set#set-like_objects) object. + +### Return value + +`true` if all elements in this set are also in the `other` set, and `false` otherwise. + +## Description + +In mathematical notation, _subset_ is defined as: + +ABxA,xBA\subseteq B \Leftrightarrow \forall x\in A,\,x\in B + +And using Venn diagram: + +![A Venn diragram with two circles. A is a subset of B because A is completely contained in B.](diagram.svg) + +> **Note:** The _subset_ relationship is not _proper subset_, which means `isSubsetOf()` returns `true` if `this` and `other` contain the same elements. + +`isSubsetOf()` accepts [set-like](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set#set-like_objects) objects as the `other` parameter. It requires {{jsxref("Operators/this", "this")}} to be an actual {{jsxref("Set")}} instance, because it directly retrieves the underlying data stored in `this` without invoking any user code. Then, its behavior depends on the sizes of `this` and `other`: + +- If there are more elements in `this` than `other.size`, then it directly returns `false`. +- Otherwise, it iterates over the elements in `this`, and returns `false` if any element `e` in `this` causes `other.has(e)` to return a [falsy](/en-US/docs/Glossary/Falsy) value. Otherwise, it returns `true`. + +## Examples + +### Using isSubsetOf() + +The set of multiples of 4 (<20) is a subset of even numbers (<20): + +```js +const fours = new Set([4, 8, 12, 16]); +const evens = new Set([2, 4, 6, 8, 10, 12, 14, 16, 18]); +console.log(fours.isSubsetOf(evens)); // true +``` + +The set of prime numbers (<20) is not a subset of all odd numbers (<20), because 2 is prime but not odd: + +```js +const primes = new Set([2, 3, 5, 7, 11, 13, 17, 19]); +const odds = new Set([3, 5, 7, 9, 11, 13, 15, 17, 19]); +console.log(primes.isSubsetOf(odds)); // false +``` + +Equivalent sets are subsets of each other: + +```js +const set1 = new Set([1, 2, 3]); +const set2 = new Set([1, 2, 3]); +console.log(set1.isSubsetOf(set2)); // true +console.log(set2.isSubsetOf(set1)); // true +``` + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## See also + +- [Polyfill of `Set.prototype.isSubsetOf` in `core-js`](https://github.com/zloirock/core-js#new-set-methods) +- {{jsxref("Set.prototype.difference()")}} +- {{jsxref("Set.prototype.intersection()")}} +- {{jsxref("Set.prototype.isDisjointFrom()")}} +- {{jsxref("Set.prototype.isSupersetOf()")}} +- {{jsxref("Set.prototype.symmetricDifference()")}} +- {{jsxref("Set.prototype.union()")}} diff --git a/files/en-us/web/javascript/reference/global_objects/set/issupersetof/diagram.svg b/files/en-us/web/javascript/reference/global_objects/set/issupersetof/diagram.svg new file mode 100644 index 000000000000000..70bca6068591208 --- /dev/null +++ b/files/en-us/web/javascript/reference/global_objects/set/issupersetof/diagram.svg @@ -0,0 +1 @@ +AB \ No newline at end of file diff --git a/files/en-us/web/javascript/reference/global_objects/set/issupersetof/index.md b/files/en-us/web/javascript/reference/global_objects/set/issupersetof/index.md new file mode 100644 index 000000000000000..faa1c3f9dc685b7 --- /dev/null +++ b/files/en-us/web/javascript/reference/global_objects/set/issupersetof/index.md @@ -0,0 +1,89 @@ +--- +title: Set.prototype.isSupersetOf() +slug: Web/JavaScript/Reference/Global_Objects/Set/isSupersetOf +page-type: javascript-instance-method +browser-compat: javascript.builtins.Set.isSupersetOf +--- + +{{JSRef}} + +The **`isSupersetOf()`** method of {{jsxref("Set")}} instances takes a set and returns a boolean indicating if all elements of the given set are in this set. + +## Syntax + +```js-nolint +isSupersetOf(other) +``` + +### Parameters + +- `other` + - : A {{jsxref("Set")}} object, or [set-like](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set#set-like_objects) object. + +### Return value + +`true` if all elements in the `other` set are also in this set, and `false` otherwise. + +## Description + +In mathematical notation, _superset_ is defined as: + +ABxB,xAA\supseteq B \Leftrightarrow \forall x\in B,\,x\in A + +And using Venn diagram: + +![A Venn diagram with two circles. A is a superset of B because B is completely contained in A.](diagram.svg) + +> **Note:** The _superset_ relationship is not _proper superset_, which means `isSupersetOf()` returns `true` if `this` and `other` contain the same elements. + +`isSupersetOf()` accepts [set-like](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set#set-like_objects) objects as the `other` parameter. It requires {{jsxref("Operators/this", "this")}} to be an actual {{jsxref("Set")}} instance, because it directly retrieves the underlying data stored in `this` without invoking any user code. Then, its behavior depends on the sizes of `this` and `other`: + +- If there are fewer elements in `this` than `other.size`, then it directly returns `false`. +- Otherwise, it iterates over `other` by calling its `keys()` method, and if any element in `other` is not present in `this`, it returns `false` (and closes the `keys()` iterator by calling its `return()` method). Otherwise, it returns `true`. + +## Examples + +### Using isSupersetOf() + +The set of even numbers (<20) is a superset of multiples of 4 (<20): + +```js +const evens = new Set([2, 4, 6, 8, 10, 12, 14, 16, 18]); +const fours = new Set([4, 8, 12, 16]); +console.log(evens.isSupersetOf(fours)); // true +``` + +The set of all odd numbers (<20) is not a superset of prime numbers (<20), because 2 is prime but not odd: + +```js +const primes = new Set([2, 3, 5, 7, 11, 13, 17, 19]); +const odds = new Set([3, 5, 7, 9, 11, 13, 15, 17, 19]); +console.log(odds.isSupersetOf(primes)); // false +``` + +Equivalent sets are supersets of each other: + +```js +const set1 = new Set([1, 2, 3]); +const set2 = new Set([1, 2, 3]); +console.log(set1.isSupersetOf(set2)); // true +console.log(set2.isSupersetOf(set1)); // true +``` + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## See also + +- [Polyfill of `Set.prototype.isSupersetOf` in `core-js`](https://github.com/zloirock/core-js#new-set-methods) +- {{jsxref("Set.prototype.difference()")}} +- {{jsxref("Set.prototype.intersection()")}} +- {{jsxref("Set.prototype.isDisjointFrom()")}} +- {{jsxref("Set.prototype.isSubsetOf()")}} +- {{jsxref("Set.prototype.symmetricDifference()")}} +- {{jsxref("Set.prototype.union()")}} diff --git a/files/en-us/web/javascript/reference/global_objects/set/symmetricdifference/diagram.svg b/files/en-us/web/javascript/reference/global_objects/set/symmetricdifference/diagram.svg new file mode 100644 index 000000000000000..68d603897f1aea8 --- /dev/null +++ b/files/en-us/web/javascript/reference/global_objects/set/symmetricdifference/diagram.svg @@ -0,0 +1 @@ +AB \ No newline at end of file diff --git a/files/en-us/web/javascript/reference/global_objects/set/symmetricdifference/index.md b/files/en-us/web/javascript/reference/global_objects/set/symmetricdifference/index.md new file mode 100644 index 000000000000000..3bf0a6e7d28f4aa --- /dev/null +++ b/files/en-us/web/javascript/reference/global_objects/set/symmetricdifference/index.md @@ -0,0 +1,69 @@ +--- +title: Set.prototype.symmetricDifference() +slug: Web/JavaScript/Reference/Global_Objects/Set/symmetricDifference +page-type: javascript-instance-method +browser-compat: javascript.builtins.Set.symmetricDifference +--- + +{{JSRef}} + +The **`symmetricDifference()`** method of {{jsxref("Set")}} instances takes a set and returns a new set containing elements which are in either this set or the given set, but not in both. + +## Syntax + +```js-nolint +symmetricDifference(other) +``` + +### Parameters + +- `other` + - : A {{jsxref("Set")}} object, or [set-like](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set#set-like_objects) object. + +### Return value + +A new {{jsxref("Set")}} object containing elements which are in either this set or the `other` set, but not in both. + +## Description + +In mathematical notation, _symmetric difference_ is defined as: + +AB=(AB)(BA)A\ominus B = (A\setminus B)\cup(B\setminus A) + +And using Venn diagram: + +![A Venn diagram where two circles overlap. The symmetric difference of A and B is the region contained by either circle but not both.](diagram.svg) + +`symmetricDifference()` accepts [set-like](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set#set-like_objects) objects as the `other` parameter. It requires {{jsxref("Operators/this", "this")}} to be an actual {{jsxref("Set")}} instance, because it directly retrieves the underlying data stored in `this` without invoking any user code. Then, it iterates over `other` by calling its `keys()` method, and constructs a new set with all elements in `this` that are not seen in `other`, and all elements in `other` that are not seen in `this`. + +The order of elements in the returned set is first those in `this` followed by those in `other`. + +## Examples + +### Using symmetricDifference() + +The following example computes the symmetric difference between the set of even numbers (<10) and the set of perfect squares (<10). The result is the set of numbers that are either even or a perfect square, but not both. + +```js +const evens = new Set([2, 4, 6, 8]); +const squares = new Set([1, 4, 9]); +console.log(evens.symmetricDifference(squares)); // Set(5) { 1, 2, 6, 8, 9 } +``` + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## See also + +- [Polyfill of `Set.prototype.symmetricDifference` in `core-js`](https://github.com/zloirock/core-js#new-set-methods) +- {{jsxref("Set.prototype.difference()")}} +- {{jsxref("Set.prototype.intersection()")}} +- {{jsxref("Set.prototype.isDisjointFrom()")}} +- {{jsxref("Set.prototype.isSubsetOf()")}} +- {{jsxref("Set.prototype.isSupersetOf()")}} +- {{jsxref("Set.prototype.union()")}} diff --git a/files/en-us/web/javascript/reference/global_objects/set/union/diagram.svg b/files/en-us/web/javascript/reference/global_objects/set/union/diagram.svg new file mode 100644 index 000000000000000..93135dff19eb992 --- /dev/null +++ b/files/en-us/web/javascript/reference/global_objects/set/union/diagram.svg @@ -0,0 +1 @@ +AB diff --git a/files/en-us/web/javascript/reference/global_objects/set/union/index.md b/files/en-us/web/javascript/reference/global_objects/set/union/index.md new file mode 100644 index 000000000000000..a1828d0ed67a002 --- /dev/null +++ b/files/en-us/web/javascript/reference/global_objects/set/union/index.md @@ -0,0 +1,69 @@ +--- +title: Set.prototype.union() +slug: Web/JavaScript/Reference/Global_Objects/Set/union +page-type: javascript-instance-method +browser-compat: javascript.builtins.Set.union +--- + +{{JSRef}} + +The **`union()`** method of {{jsxref("Set")}} instances takes a set and returns a new set containing elements which are in either or both of this set and the given set. + +## Syntax + +```js-nolint +union(other) +``` + +### Parameters + +- `other` + - : A {{jsxref("Set")}} object, or [set-like](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set#set-like_objects) object. + +### Return value + +A new {{jsxref("Set")}} object containing elements which are in either or both of this set and the `other` set. + +## Description + +In mathematical notation, _union_ is defined as: + +AB={xxA or xB}A\cup B = \{x\midx\in A\text{ or }x\in B\} + +And using Venn diagram: + +![A Venn diagram where two circles overlap. The symmetric difference of A and B is the region contained by either or both circles.](diagram.svg) + +`union()` accepts [set-like](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set#set-like_objects) objects as the `other` parameter. It requires {{jsxref("Operators/this", "this")}} to be an actual {{jsxref("Set")}} instance, because it directly retrieves the underlying data stored in `this` without invoking any user code. Then, it iterates over `other` by calling its `keys()` method, and constructs a new set with all elements in `this`, followed by all elements in `other` that are not present in `this`. + +The order of elements in the returned set is first those in `this` followed by those in `other`. + +## Examples + +### Using union() + +The following example computes the union between the set of even numbers (<10) and the set of perfect squares (<10). The result is the set of numbers that are either even or a perfect square, or both. + +```js +const evens = new Set([2, 4, 6, 8]); +const squares = new Set([1, 4, 9]); +console.log(evens.union(squares)); // Set(6) { 1, 2, 4, 6, 8, 9 } +``` + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## See also + +- [Polyfill of `Set.prototype.union` in `core-js`](https://github.com/zloirock/core-js#new-set-methods) +- {{jsxref("Set.prototype.difference()")}} +- {{jsxref("Set.prototype.intersection()")}} +- {{jsxref("Set.prototype.isDisjointFrom()")}} +- {{jsxref("Set.prototype.isSubsetOf()")}} +- {{jsxref("Set.prototype.isSupersetOf()")}} +- {{jsxref("Set.prototype.symmetricDifference()")}} From 9b0add5f0eada45392717c7f4095f4dbc3e0aade Mon Sep 17 00:00:00 2001 From: Julio J Date: Thu, 9 Nov 2023 19:44:37 -0300 Subject: [PATCH 31/52] Fix typo (#30167) --- files/en-us/learn/forms/form_validation/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/en-us/learn/forms/form_validation/index.md b/files/en-us/learn/forms/form_validation/index.md index fb80df217f78879..c76ec4eb192021c 100644 --- a/files/en-us/learn/forms/form_validation/index.md +++ b/files/en-us/learn/forms/form_validation/index.md @@ -721,7 +721,7 @@ input.invalid { background-color: #fdd; } -input:focus.invalid { +input:focus:invalid { outline: none; } From fe56d8fca2128efccc5500de4ca17760ba9e0a5d Mon Sep 17 00:00:00 2001 From: rebloor Date: Fri, 10 Nov 2023 14:31:23 +1300 Subject: [PATCH 32/52] Background page load fail bug fix release note (#30097) * Background page load fail bug fix release note * Apply suggestions from review Co-authored-by: Rob Wu * small edits * Feedback updates * Apply suggestions from review Co-authored-by: Rob Wu * Feedback update * Apply suggestions from review Co-authored-by: Rob Wu * Apply linter suggestion Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --------- Co-authored-by: Rob Wu Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .../manifest.json/background/index.md | 87 +++++++++++++++---- .../mozilla/firefox/releases/121/index.md | 5 ++ 2 files changed, 76 insertions(+), 16 deletions(-) diff --git a/files/en-us/mozilla/add-ons/webextensions/manifest.json/background/index.md b/files/en-us/mozilla/add-ons/webextensions/manifest.json/background/index.md index 3804518d6f47b82..b9bf3cedb302b79 100644 --- a/files/en-us/mozilla/add-ons/webextensions/manifest.json/background/index.md +++ b/files/en-us/mozilla/add-ons/webextensions/manifest.json/background/index.md @@ -34,18 +34,34 @@ browser-compat: webextensions.manifest.background -Use the `background` key to include one or more background scripts or a background page in your extension. +Use the `background` key to include one or more background scripts, a background page, or a Service worker in your extension. -Background scripts are the place to put code that needs to maintain a long-term state, or perform long-term operations, independently of the lifetime of any particular web pages or browser windows. +Background scripts are the place to put code that needs to maintain a long-term state or perform long-term operations independently of the lifetime of any particular web pages or browser windows. -Background scripts are loaded as soon as the extension is loaded and stay loaded until the extension is disabled or uninstalled unless `persistent` is specified as `false`. You can use any WebExtension APIs in the script as long as you have requested the necessary [permissions](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/permissions). +Background scripts are loaded as soon as the extension is loaded and stay loaded until the extension is disabled or uninstalled unless `persistent` is specified as `false`. You can use any WebExtension APIs in the script if you have requested the necessary [permissions](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/permissions). See [Background scripts](/en-US/docs/Mozilla/Add-ons/WebExtensions/Background_scripts) for some more details. -The `background` key is an object that must have one of these properties: +The `background` key is an object that must have one of these properties (for more information on how these properties are supported, see [Browser support](#browser_support)): + + + + - + @@ -107,7 +115,7 @@ The `background` key can also contain this optional property:
page +

+ If you need specific content in the background page, you can define a + page using the page property. This is a + String representing a path relative to the manifest.json + file to an HTML document included in your extension bundle. +

+

+ If you use this property, you can not specify background scripts using + scripts, but you can include scripts from the + page, just like a normal web page. +

+
scripts @@ -81,18 +97,10 @@ The `background` key is an object that must have one of these properties:
pageservice_worker

- If you need specific content in the background page, you can define a - page using the page property. This is a - String representing a path, relative to the manifest.json - file, to an HTML document included in your extension bundle. -

-

- If you use this property, you can not specify background scripts using - scripts, but you can include scripts from the - page, just like a normal web page. + Specify a JavaScript file as the extension [service worker](/en-US/docs/Web/API/Service_Worker_API). A service worker is a background script that acts as the extension's main event handler.

persistent

A Boolean value.

-

If omitted, this property default to true in Manifest V2 and false in Manifest V3. Setting to true in Manifest V3 results in an error.

+

If omitted, this property defaults to true in Manifest V2 and false in Manifest V3. Setting to true in Manifest V3 results in an error.

  • true indicates the background page is to be kept in @@ -150,7 +158,54 @@ The `background` key can also contain this optional property:
-## Example +## Browser support + +Support for the `scripts`, `page`, and `service_worker` properties varies between browsers like this: + +- Chrome: + - supports `background.service_worker`. + - supports `background.scripts` (and `background.page`) in Manifest V2 extensions only. + - before Chrome 121, Chrome refuses to load a Manifest V3 extension with `background.scripts` or `background.page` present. From Chrome 121, their presence in a Manifest V3 extension is ignored. +- Firefox: + - `background.service_worker` is not supported (see [Firefox bug 1573659](https://bugzilla.mozilla.org/show_bug.cgi?id=1573659)). + - supports `background.scripts` (or `background.page`) if `service_worker` is not specified or the service worker feature is disabled. Before Firefox 120, Firefox did not start the background page if `service_worker` was present (see [Firefox bug 1860304](https://bugzil.la/1860304)). From Firefox 121, the background page starts as expected, regardless of the presence of `service_worker`. +- Safari: + - supports `background.service_worker`. + - supports `background.scripts` (or `background.page`) if `service_worker` is not specified. + +To illustrate, this is a simple example of a cross-browser extension that supports `scripts` and `service_worker`. The example has this manifest.json file: + +```json +{ + "name": "Demo of service worker + event page", + "version": "1", + "manifest_version": 3, + "background": { + "scripts": ["background.js"], + "service_worker": "background.js" + } +} +``` + +And, background.js contains: + +```javascript +if (typeof browser == "undefined") { + // Chrome does not support the browser namespace yet. + globalThis.browser = chrome; +} +browser.runtime.onInstalled.addListener(() => { + browser.tabs.create({ url: "http://example.com/firstrun.html" }); +}); +``` + +When the extension is executed, this happens: + +- in Chrome, the `service_worker` property is used, and a service worker starts that opens the tab because, in a Manifest V3 extension, Chrome only supports service workers for background scripts. +- in Firefox, the `scripts` property is used, and a script starts that opens the tab because Firefox only supports scripts for background scripts. +- in Safari, the `service_worker` property is used, and a service worker starts that opens the tab because Safari gives priority to using service workers for background scripts. + +## Examples ```json "background": { diff --git a/files/en-us/mozilla/firefox/releases/121/index.md b/files/en-us/mozilla/firefox/releases/121/index.md index 201522e8f18d708..942c18f6bcb29bf 100644 --- a/files/en-us/mozilla/firefox/releases/121/index.md +++ b/files/en-us/mozilla/firefox/releases/121/index.md @@ -62,6 +62,11 @@ This article provides information about the changes in Firefox 121 that affect d ### Other +- Fixed a bug that resulted in background pages not starting when a manifest.json `background` key contains `service_worker` and `scripts` declarations ([Firefox bug 1860304](https://bugzil.la/1860304)). + + > **Note:** Incidentally, a change in Chrome 121 sees the `scripts` property ignored when specified with the `service_worker` property. Previously, Chrome refused to load extensions containing both properties ([Chromium bug 1418934](https://crbug.com/1418934)). + > For more information, see [Browser support of the `background` manifest key](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/background#browser_support). + ## Older versions {{Firefox_for_developers(120)}} From 20c7e7153b08f4f34d7112f87baac70feea21153 Mon Sep 17 00:00:00 2001 From: Fuqiao Xue Date: Thu, 9 Nov 2023 19:39:29 -0600 Subject: [PATCH 33/52] Link to W3C Internationalization Activity (#30144) Fix #29588. --- files/en-us/glossary/internationalization/index.md | 1 + 1 file changed, 1 insertion(+) diff --git a/files/en-us/glossary/internationalization/index.md b/files/en-us/glossary/internationalization/index.md index 73aeafba1d7f8b1..c29d56d6cf9f264 100644 --- a/files/en-us/glossary/internationalization/index.md +++ b/files/en-us/glossary/internationalization/index.md @@ -22,5 +22,6 @@ The work of the [Unicode Consortium](https://home.unicode.org/) is a fundamental ## See also - {{glossary("Localization")}} +- [W3C Internationalization Activity](https://www.w3.org/International/) - [Unicode Consortium](https://home.unicode.org/) - [JavaScript Internationalization API](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl) From 518246cb0ff6754d7e616fea796160cd83a52dc9 Mon Sep 17 00:00:00 2001 From: skyclouds2001 <95597335+skyclouds2001@users.noreply.github.com> Date: Fri, 10 Nov 2023 12:52:30 +0800 Subject: [PATCH 34/52] update Prioritized Task Scheduling API group data (#30176) --- files/jsondata/GroupData.json | 1 - 1 file changed, 1 deletion(-) diff --git a/files/jsondata/GroupData.json b/files/jsondata/GroupData.json index 634e5cce61fa3c6..6b25e2f47df44b3 100644 --- a/files/jsondata/GroupData.json +++ b/files/jsondata/GroupData.json @@ -1132,7 +1132,6 @@ "Scheduling", "TaskController", "TaskSignal", - "AbortSignal", "TaskPriorityChangeEvent" ], "methods": [], From 2ab867c3b25a2339996149d80dd16a6926222d18 Mon Sep 17 00:00:00 2001 From: wbamberg Date: Thu, 9 Nov 2023 22:04:03 -0800 Subject: [PATCH 35/52] Delete web audio migration guides (#30173) --- files/en-us/_redirects.txt | 14 +- files/en-us/_wikihistory.json | 17 - .../howto/write_an_api_reference/index.md | 1 - files/en-us/web/api/web_audio_api/index.md | 1 - .../index.md | 411 ------------------ .../web/api/web_audio_api/tools/index.md | 1 - .../guide/audio_and_video_delivery/index.md | 1 - .../web_audio_api_cross_browser/index.md | 64 --- files/jsondata/GroupData.json | 1 - 9 files changed, 8 insertions(+), 503 deletions(-) delete mode 100644 files/en-us/web/api/web_audio_api/migrating_from_webkitaudiocontext/index.md delete mode 100644 files/en-us/web/guide/audio_and_video_delivery/web_audio_api_cross_browser/index.md diff --git a/files/en-us/_redirects.txt b/files/en-us/_redirects.txt index 3dbf1a3fe628611..cb901782e3c07d5 100644 --- a/files/en-us/_redirects.txt +++ b/files/en-us/_redirects.txt @@ -10088,7 +10088,8 @@ /en-US/docs/Web/API/Web_Animations_API/Animation_timing_properties/fill /en-US/docs/Web/API/KeyframeEffect/KeyframeEffect /en-US/docs/Web/API/Web_Animations_API/Animation_timing_properties/iterationStart /en-US/docs/Web/API/KeyframeEffect/KeyframeEffect /en-US/docs/Web/API/Web_Animations_API/Animation_timing_properties/iterations /en-US/docs/Web/API/KeyframeEffect/KeyframeEffect -/en-US/docs/Web/API/Web_Audio_API/Porting_webkitAudioContext_code_to_standards_based_AudioContext /en-US/docs/Web/API/Web_Audio_API/Migrating_from_webkitAudioContext +/en-US/docs/Web/API/Web_Audio_API/Migrating_from_webkitAudioContext /en-US/docs/Web/API/Web_Audio_API +/en-US/docs/Web/API/Web_Audio_API/Porting_webkitAudioContext_code_to_standards_based_AudioContext /en-US/docs/Web/API/Web_Audio_API /en-US/docs/Web/API/Web_Audio_API/Targeting /en-US/docs/Web/API/WebXR_Device_API/Targeting /en-US/docs/Web/API/Web_Audio_API/Web_audio_spatialisation_basics /en-US/docs/Web/API/Web_Audio_API/Web_audio_spatialization_basics /en-US/docs/Web/API/Web_Audio_API/ended_event /en-US/docs/Web/API/AudioScheduledSourceNode/ended_event @@ -10976,7 +10977,7 @@ /en-US/docs/Web/Apps/Build/Audio_and_video_delivery/Setting_up_adaptive_streaming_media_sources /en-US/docs/Web/Guide/Audio_and_video_delivery/Setting_up_adaptive_streaming_media_sources /en-US/docs/Web/Apps/Build/Audio_and_video_delivery/Video_player_styling_basics /en-US/docs/Web/Guide/Audio_and_video_delivery/Video_player_styling_basics /en-US/docs/Web/Apps/Build/Audio_and_video_delivery/WebAudio_playbackRate_explained /en-US/docs/Web/Guide/Audio_and_video_delivery/WebAudio_playbackRate_explained -/en-US/docs/Web/Apps/Build/Audio_and_video_delivery/Web_Audio_API_cross_browser /en-US/docs/Web/Guide/Audio_and_video_delivery/Web_Audio_API_cross_browser +/en-US/docs/Web/Apps/Build/Audio_and_video_delivery/Web_Audio_API_cross_browser /en-US/docs/Web/API/Web_Audio_API /en-US/docs/Web/Apps/Build/Audio_and_video_delivery/buffering_seeking_time_ranges /en-US/docs/Web/Guide/Audio_and_video_delivery/buffering_seeking_time_ranges /en-US/docs/Web/Apps/Build/Audio_and_video_delivery/cross_browser_video_player /en-US/docs/Web/Guide/Audio_and_video_delivery/cross_browser_video_player /en-US/docs/Web/Apps/Build/Audio_and_video_manipulation /en-US/docs/Web/Guide/Audio_and_video_manipulation @@ -10991,7 +10992,7 @@ /en-US/docs/Web/Apps/Build/Manipulating_media/Live_streaming_web_audio_and_video /en-US/docs/Web/Guide/Audio_and_video_delivery/Live_streaming_web_audio_and_video /en-US/docs/Web/Apps/Build/Manipulating_media/Setting_up_adaptive_streaming_media_sources /en-US/docs/Web/Guide/Audio_and_video_delivery/Setting_up_adaptive_streaming_media_sources /en-US/docs/Web/Apps/Build/Manipulating_media/Video_player_styling_basics /en-US/docs/Web/Guide/Audio_and_video_delivery/Video_player_styling_basics -/en-US/docs/Web/Apps/Build/Manipulating_media/Web_Audio_API_cross_browser /en-US/docs/Web/Guide/Audio_and_video_delivery/Web_Audio_API_cross_browser +/en-US/docs/Web/Apps/Build/Manipulating_media/Web_Audio_API_cross_browser /en-US/docs/Web/API/Web_Audio_API /en-US/docs/Web/Apps/Build/Manipulating_media/buffering_seeking_time_ranges /en-US/docs/Web/Guide/Audio_and_video_delivery/buffering_seeking_time_ranges /en-US/docs/Web/Apps/Build/Manipulating_media/cross_browser_video_player /en-US/docs/Web/Guide/Audio_and_video_delivery/cross_browser_video_player /en-US/docs/Web/Apps/Build/Performance/CSS_JavaScript_animation_performance /en-US/docs/Web/Performance/CSS_JavaScript_animation_performance @@ -11013,7 +11014,7 @@ /en-US/docs/Web/Apps/Developing/JavaScript_API/navigator.mozApps.mgmt.removeEventListener /en-US/docs/Web/API/EventTarget/removeEventListener /en-US/docs/Web/Apps/Developing/Manipulating_media /en-US/docs/Web/Guide/Audio_and_video_delivery /en-US/docs/Web/Apps/Developing/Manipulating_media/H.264_support_in_Firefox /en-US/docs/Web/Guide/Audio_and_video_delivery -/en-US/docs/Web/Apps/Developing/Manipulating_media/Web_Audio_API_cross_browser /en-US/docs/Web/Guide/Audio_and_video_delivery/Web_Audio_API_cross_browser +/en-US/docs/Web/Apps/Developing/Manipulating_media/Web_Audio_API_cross_browser /en-US/docs/Web/API/Web_Audio_API /en-US/docs/Web/Apps/Developing/Optimizing_startup_performance /en-US/docs/Web/Performance/Optimizing_startup_performance /en-US/docs/Web/Apps/Developing/Performance/Optimizing_startup_performance /en-US/docs/Web/Performance/Optimizing_startup_performance /en-US/docs/Web/Apps/Developing/Performance/Performance_fundamentals /en-US/docs/Web/Performance/Fundamentals @@ -11025,7 +11026,7 @@ /en-US/docs/Web/Apps/Fundamentals/Audio_and_video_delivery/Setting_up_adaptive_streaming_media_sources /en-US/docs/Web/Guide/Audio_and_video_delivery/Setting_up_adaptive_streaming_media_sources /en-US/docs/Web/Apps/Fundamentals/Audio_and_video_delivery/Video_player_styling_basics /en-US/docs/Web/Guide/Audio_and_video_delivery/Video_player_styling_basics /en-US/docs/Web/Apps/Fundamentals/Audio_and_video_delivery/WebAudio_playbackRate_explained /en-US/docs/Web/Guide/Audio_and_video_delivery/WebAudio_playbackRate_explained -/en-US/docs/Web/Apps/Fundamentals/Audio_and_video_delivery/Web_Audio_API_cross_browser /en-US/docs/Web/Guide/Audio_and_video_delivery/Web_Audio_API_cross_browser +/en-US/docs/Web/Apps/Fundamentals/Audio_and_video_delivery/Web_Audio_API_cross_browser /en-US/docs/Web/API/Web_Audio_API /en-US/docs/Web/Apps/Fundamentals/Audio_and_video_delivery/buffering_seeking_time_ranges /en-US/docs/Web/Guide/Audio_and_video_delivery/buffering_seeking_time_ranges /en-US/docs/Web/Apps/Fundamentals/Audio_and_video_delivery/cross_browser_video_player /en-US/docs/Web/Guide/Audio_and_video_delivery/cross_browser_video_player /en-US/docs/Web/Apps/Fundamentals/Audio_and_video_manipulation /en-US/docs/Web/Guide/Audio_and_video_manipulation @@ -11981,6 +11982,7 @@ /en-US/docs/Web/Guide/API/WebRTC/WebRTC_architecture /en-US/docs/Web/API/WebRTC_API/Connectivity /en-US/docs/Web/Guide/API/WebRTC/WebRTC_basics /en-US/docs/Web/API/WebRTC_API/Signaling_and_video_calling /en-US/docs/Web/Guide/Audio_and_video_delivery/H.264_support_in_Firefox /en-US/docs/Web/Guide/Audio_and_video_delivery +/en-US/docs/Web/Guide/Audio_and_video_delivery/Web_Audio_API_cross_browser /en-US/docs/Web/API/Web_Audio_API /en-US/docs/Web/Guide/CSS /en-US/docs/Learn/CSS /en-US/docs/Web/Guide/CSS/CSS_Image_Sprites /en-US/docs/Web/CSS/CSS_images/Implementing_image_sprites_in_CSS /en-US/docs/Web/Guide/CSS/Consistent_list_indentation /en-US/docs/Web/CSS/CSS_lists/Consistent_list_indentation @@ -13114,7 +13116,7 @@ /en-US/docs/WebSockets/Writing_WebSocket_server /en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_server /en-US/docs/WebSockets/Writing_WebSocket_servers /en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_servers /en-US/docs/Web_Audio_API /en-US/docs/Web/API/Web_Audio_API -/en-US/docs/Web_Audio_API/Porting_webkitAudioContext_code_to_standards_based_AudioContext /en-US/docs/Web/API/Web_Audio_API/Migrating_from_webkitAudioContext +/en-US/docs/Web_Audio_API/Porting_webkitAudioContext_code_to_standards_based_AudioContext /en-US/docs/Web/API/Web_Audio_API /en-US/docs/Web_Audio_API/Using_Web_Audio_API /en-US/docs/Web/API/Web_Audio_API/Using_Web_Audio_API /en-US/docs/Web_Development /en-US/docs/Web/Guide /en-US/docs/Web_Development/HTTP_cookies /en-US/docs/Web/HTTP/Cookies diff --git a/files/en-us/_wikihistory.json b/files/en-us/_wikihistory.json index b34a5012b968377..505e39b3509e2a1 100644 --- a/files/en-us/_wikihistory.json +++ b/files/en-us/_wikihistory.json @@ -65703,19 +65703,6 @@ "modified": "2020-12-12T16:10:34.316Z", "contributors": ["bershanskiy", "Sheppy"] }, - "Web/API/Web_Audio_API/Migrating_from_webkitAudioContext": { - "modified": "2020-04-28T12:54:23.540Z", - "contributors": [ - "Sheppy", - "stephaniehobson", - "Cwiiis", - "chrisdavidmills", - "teoli", - "Ehsan", - "padenot", - "cwilso" - ] - }, "Web/API/Web_Audio_API/Simple_synth": { "modified": "2020-06-16T14:49:12.422Z", "contributors": ["jmcantrell", "DianeLooney", "Sheppy"] @@ -92248,10 +92235,6 @@ "teoli" ] }, - "Web/Guide/Audio_and_video_delivery/Web_Audio_API_cross_browser": { - "modified": "2019-03-18T20:51:50.321Z", - "contributors": ["chrisdavidmills", "Syedfaisal"] - }, "Web/Guide/Audio_and_video_delivery/buffering_seeking_time_ranges": { "modified": "2019-04-12T10:12:05.792Z", "contributors": [ diff --git a/files/en-us/mdn/writing_guidelines/howto/write_an_api_reference/index.md b/files/en-us/mdn/writing_guidelines/howto/write_an_api_reference/index.md index 7ecb58fa7c04871..953c5e4064e3db8 100644 --- a/files/en-us/mdn/writing_guidelines/howto/write_an_api_reference/index.md +++ b/files/en-us/mdn/writing_guidelines/howto/write_an_api_reference/index.md @@ -166,7 +166,6 @@ These articles should all be created as subpages of the API overview page. For e - [https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/Using_Web_Audio_API](/en-US/docs/Web/API/Web_Audio_API/Using_Web_Audio_API) - [https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/Visualizations_with_Web_Audio_API](/en-US/docs/Web/API/Web_Audio_API/Visualizations_with_Web_Audio_API) - [https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/Web_audio_spatialization_basics](/en-US/docs/Web/API/Web_Audio_API/Web_audio_spatialization_basics) -- [https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/Porting_webkitAudioContext_code_to_standards_based_AudioContext](/en-US/docs/Web/API/Web_Audio_API/Migrating_from_webkitAudioContext) - [https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/Basic_concepts_behind_Web_Audio_API](/en-US/docs/Web/API/Web_Audio_API/Basic_concepts_behind_Web_Audio_API) #### Examples diff --git a/files/en-us/web/api/web_audio_api/index.md b/files/en-us/web/api/web_audio_api/index.md index 3ba8b03069860e1..b0faf26d8f8b758 100644 --- a/files/en-us/web/api/web_audio_api/index.md +++ b/files/en-us/web/api/web_audio_api/index.md @@ -215,7 +215,6 @@ You can find a number of examples at our [webaudio-example repo](https://github. - [Controlling multiple parameters with ConstantSourceNode](/en-US/docs/Web/API/Web_Audio_API/Controlling_multiple_parameters_with_ConstantSourceNode) - [Mixing Positional Audio and WebGL (2012)](https://web.dev/articles/webaudio-positional-audio) - [Developing Game Audio with the Web Audio API (2012)](https://auth.web.dev/webaudio-games/) -- [Porting webkitAudioContext code to standards based AudioContext](/en-US/docs/Web/API/Web_Audio_API/Migrating_from_webkitAudioContext) ### Libraries diff --git a/files/en-us/web/api/web_audio_api/migrating_from_webkitaudiocontext/index.md b/files/en-us/web/api/web_audio_api/migrating_from_webkitaudiocontext/index.md deleted file mode 100644 index 7f83227bf41ae9d..000000000000000 --- a/files/en-us/web/api/web_audio_api/migrating_from_webkitaudiocontext/index.md +++ /dev/null @@ -1,411 +0,0 @@ ---- -title: Migrating from webkitAudioContext -slug: Web/API/Web_Audio_API/Migrating_from_webkitAudioContext -page-type: guide ---- - -{{DefaultAPISidebar("Web Audio API")}} - -In this article, we cover the differences in Web Audio API since it was first implemented in WebKit and how to update your code to use the modern Web Audio API. - -The Web Audio standard was first implemented in [WebKit](https://webkit.org/), and the implementation was built in parallel with the work on the [specification](https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html) of the API. As the specification evolved and changes were made to the spec, some of the old implementation pieces were not removed from the WebKit (and Blink) implementations due to backwards compatibility reasons. - -New engines implementing the Web Audio spec (such as Gecko) will only implement the official, final version of the specification, which means that code using `webkitAudioContext` or old naming conventions in the Web Audio specification may not immediately work out of the box in a compliant Web Audio implementation. This article attempts to summarize the areas where developers are likely to encounter these problems and provide examples on how to port such code to standards based {{domxref("AudioContext")}}, which will work across different browser engines. - -> **Note:** There is a library called [webkitAudioContext monkeypatch](https://github.com/cwilso/webkitAudioContext-MonkeyPatch), which automatically fixes some of these changes to make most code targeting `webkitAudioContext` to work on the standards based `AudioContext` out of the box, but it currently doesn't handle all of the cases below. Please consult the [README file](https://github.com/cwilso/webkitAudioContext-MonkeyPatch/blob/gh-pages/README.md) for that library to see a list of APIs that are automatically handled by it. - -## Changes to the creator methods - -Three of the creator methods on `webkitAudioContext` have been renamed in {{domxref("AudioContext")}}. - -- `createGainNode()` has been renamed to {{domxref("createGain")}}. -- `createDelayNode()` has been renamed to {{domxref("createDelay")}}. -- `createJavaScriptNode()` has been renamed to {{domxref("createScriptProcessor")}}. - -These are simple renames that were made in order to improve the consistency of these method names on {{domxref("AudioContext")}}. If your code uses either of these names, like in the example below: - -```js -// Old method names -const gain = context.createGainNode(); -const delay = context.createDelayNode(); -const js = context.createJavaScriptNode(1024); -``` - -you can rename the methods to look like this: - -```js -// New method names -const gain = context.createGain(); -const delay = context.createDelay(); -const js = context.createScriptProcessor(1024); -``` - -The semantics of these methods remain the same in the renamed versions. - -## Changes to starting and stopping nodes - -In `webkitAudioContext`, there are two ways to start and stop {{domxref("AudioBufferSourceNode")}} and {{domxref("OscillatorNode")}}: the `noteOn()` and `noteOff()` methods, and the `start()` and `stop()` methods. ({{domxref("AudioBufferSourceNode")}} has yet another way of starting output: the `noteGrainOn()` method.) The `noteOn()`/`noteGrainOn()`/`noteOff()` methods were the original way to start/stop output in these nodes, and in the newer versions of the specification, the `noteOn()` and `noteGrainOn()` methods were consolidated into a single `start()` method, and the `noteOff()` method was renamed to the `stop()` method. - -In order to port your code, you can just rename the method that you're using. For example, if you have code like the below: - -```js -const osc = context.createOscillator(); -osc.noteOn(1); -osc.noteOff(1.5); - -const src = context.createBufferSource(); -src.noteGrainOn(1, 0.25); -src.noteOff(2); -``` - -you can change it like this in order to port it to the standard AudioContext API: - -```js -const osc = context.createOscillator(); -osc.start(1); -osc.stop(1.5); - -const src = context.createBufferSource(); -src.start(1, 0.25); -src.stop(2); -``` - -## Remove synchronous buffer creation - -In the old WebKit implementation of Web Audio, there were two versions of `createBuffer()`, one which created an initially empty buffer, and one which took an existing {{jsxref("ArrayBuffer")}} containing encoded audio, decoded it and returned the result in the form of an {{domxref("AudioBuffer")}}. The latter version of `createBuffer()` was potentially expensive, because it had to decode the audio buffer synchronously, and with the buffer being arbitrarily large, it could take a lot of time for this method to complete its work, and no other part of your web page's code could execute in the mean time. - -Because of these problems, this version of the `createBuffer()` method has been removed, and you should use the asynchronous `decodeAudioData()` method instead. - -The example below shows old code which downloads an audio file over the network, and then decoded it using `createBuffer()`: - -```js -const xhr = new XMLHttpRequest(); -xhr.open("GET", "/path/to/audio.ogg", true); -xhr.responseType = "arraybuffer"; -xhr.send(); -xhr.onload = () => { - const decodedBuffer = context.createBuffer(xhr.response, false); - if (decodedBuffer) { - // Decoding was successful, do something useful with the audio buffer - } else { - alert("Decoding the audio buffer failed"); - } -}; -``` - -Converting this code to use `decodeAudioData()` is relatively simple, as can be seen below: - -```js -const xhr = new XMLHttpRequest(); -xhr.open("GET", "/path/to/audio.ogg", true); -xhr.responseType = "arraybuffer"; -xhr.send(); -xhr.onload = () => { - context.decodeAudioData( - xhr.response, - (decodedBuffer) => { - // Decoding was successful, do something useful with the audio buffer - }, - () => { - alert("Decoding the audio buffer failed"); - }, - ); -}; -``` - -Note that the `decodeAudioData()` method is asynchronous, which means that it will return immediately, and then when the decoding finishes, one of the success or failure callback functions will get called depending on whether the audio decoding was successful. This means that you may need to restructure your code to run the part which happened after the `createBuffer()` call in the success callback, as you can see in the example above. - -## Renaming of AudioParam.setTargetValueAtTime - -The `setTargetValueAtTime()` method on the {{domxref("AudioParam")}} interface has been renamed to `setTargetAtTime()`. This is also a simple rename to improve the understandability of the API, and the semantics of the method are the same. If your code is using `setTargetValueAtTime()`, you can rename it to use `setTargetAtTime()`. For example, if we have code that looks like this: - -```js -const gainNode = context.createGain(); -gainNode.gain.setTargetValueAtTime(0.0, 10.0, 1.0); -``` - -you can rename the method, and be compliant with the standard, like so: - -```js -const gainNode = context.createGain(); -gainNode.gain.setTargetAtTime(0.0, 10.0, 1.0); -``` - -## Enumerated values that changed - -The original `webkitAudioContext` API used C-style number based enumerated values in the API. Those values have since been changed to use the Web IDL based enumerated values, which should be familiar because they are similar to things like the {{domxref("HTMLInputElement")}} property {{domxref("HTMLInputElement.type", "type")}}. - -### OscillatorNode.type - -{{domxref("OscillatorNode")}}'s type property has been changed to use Web IDL enums. Old code using `webkitAudioContext` can be ported to standards based {{domxref("AudioContext")}} like below: - -```js -// Old webkitAudioContext code: -const osc = context.createOscillator(); -osc.type = osc.SINE; // sine waveform -osc.type = osc.SQUARE; // square waveform -osc.type = osc.SAWTOOTH; // sawtooth waveform -osc.type = osc.TRIANGLE; // triangle waveform -osc.setWaveTable(table); -const isCustom = osc.type === osc.CUSTOM; // isCustom will be true -``` - -```js -// New standard AudioContext code: -const osc = context.createOscillator(); -osc.type = "sine"; // sine waveform -osc.type = "square"; // square waveform -osc.type = "sawtooth"; // sawtooth waveform -osc.type = "triangle"; // triangle waveform -osc.setPeriodicWave(table); // Note: setWaveTable has been renamed to setPeriodicWave! -const isCustom = osc.type === "custom"; // isCustom will be true -``` - -### BiquadFilterNode.type - -{{domxref("BiquadFilterNode")}}'s type property has been changed to use Web IDL enums. Old code using `webkitAudioContext` can be ported to standards based {{domxref("AudioContext")}} like below: - -```js -// Old webkitAudioContext code: -const filter = context.createBiquadFilter(); -filter.type = filter.LOWPASS; // lowpass filter -filter.type = filter.HIGHPASS; // highpass filter -filter.type = filter.BANDPASS; // bandpass filter -filter.type = filter.LOWSHELF; // lowshelf filter -filter.type = filter.HIGHSHELF; // highshelf filter -filter.type = filter.PEAKING; // peaking filter -filter.type = filter.NOTCH; // notch filter -filter.type = filter.ALLPASS; // allpass filter -``` - -```js -// New standard AudioContext code: -const filter = context.createBiquadFilter(); -filter.type = "lowpass"; // lowpass filter -filter.type = "highpass"; // highpass filter -filter.type = "bandpass"; // bandpass filter -filter.type = "lowshelf"; // lowshelf filter -filter.type = "highshelf"; // highshelf filter -filter.type = "peaking"; // peaking filter -filter.type = "notch"; // notch filter -filter.type = "allpass"; // allpass filter -``` - -### PannerNode.panningModel - -{{domxref("PannerNode")}}'s panningModel property has been changed to use Web IDL enums. Old code using `webkitAudioContext` can be ported to standards based {{domxref("AudioContext")}} like below: - -```js -// Old webkitAudioContext code: -const panner = context.createPanner(); -panner.panningModel = panner.EQUALPOWER; // equalpower panning -panner.panningModel = panner.HRTF; // HRTF panning -``` - -```js -// New standard AudioContext code: -const panner = context.createPanner(); -panner.panningModel = "equalpower"; // equalpower panning -panner.panningModel = "HRTF"; // HRTF panning -``` - -### PannerNode.distanceModel - -{{domxref("PannerNode")}}'s `distanceModel` property has been changed to use Web IDL enums. Old code using `webkitAudioContext` can be ported to standards based {{domxref("AudioContext")}} like below: - -```js -// Old webkitAudioContext code: -const panner = context.createPanner(); -panner.distanceModel = panner.LINEAR_DISTANCE; // linear distance model -panner.distanceModel = panner.INVERSE_DISTANCE; // inverse distance model -panner.distanceModel = panner.EXPONENTIAL_DISTANCE; // exponential distance model -``` - -```js -// Mew standard AudioContext code: -const panner = context.createPanner(); -panner.distanceModel = "linear"; // linear distance model -panner.distanceModel = "inverse"; // inverse distance model -panner.distanceModel = "exponential"; // exponential distance model -``` - -## Gain control moved to its own node type - -The Web Audio standard now controls all gain using the {{domxref("GainNode")}}. Instead of setting a `gain` property directly on an audio source, you connect the source to a gain node and then control the gain using that node's `gain` parameter. - -### AudioBufferSourceNode - -The `gain` attribute of {{domxref("AudioBufferSourceNode")}} has been removed. The same functionality can be achieved by connecting the {{domxref("AudioBufferSourceNode")}} to a gain node. See the following example: - -```js -// Old webkitAudioContext code: -const src = context.createBufferSource(); -src.buffer = someBuffer; -src.gain.value = 0.5; -src.connect(context.destination); -src.noteOn(0); -``` - -```js -// New standard AudioContext code: -const src = context.createBufferSource(); -src.buffer = someBuffer; -const gain = context.createGain(); -src.connect(gain); -gain.gain.value = 0.5; -gain.connect(context.destination); -src.start(0); -``` - -### AudioBuffer - -The `gain` attribute of {{domxref("AudioBuffer")}} has been removed. The same functionality can be achieved by connecting the {{domxref("AudioBufferSourceNode")}} that owns the buffer to a gain node. See the following example: - -```js -// Old webkitAudioContext code: -const src = context.createBufferSource(); -src.buffer = someBuffer; -src.buffer.gain = 0.5; -src.connect(context.destination); -src.noteOn(0); -``` - -```js -// New standard AudioContext code: -const src = context.createBufferSource(); -src.buffer = someBuffer; -const gain = context.createGain(); -src.connect(gain); -gain.gain.value = 0.5; -gain.connect(context.destination); -src.start(0); -``` - -## Removal of AudioBufferSourceNode.looping - -The `looping` attribute of {{domxref("AudioBufferSourceNode")}} has been removed. This attribute was an alias of the `loop` attribute, so you can just use the `loop` attribute instead. Instead of having code like this: - -```js -const source = context.createBufferSource(); -source.looping = true; -``` - -you can change it to respect the last version of the specification: - -```js -const source = context.createBufferSource(); -source.loop = true; -``` - -Note, the `loopStart` and `loopEnd` attributes are not supported in `webkitAudioContext`. - -## Changes to determining playback state - -The `playbackState` attribute of {{domxref("AudioBufferSourceNode")}} and {{domxref("OscillatorNode")}} has been removed. Depending on why you used this attribute, you can use the following techniques to get the same information: - -- If you need to compare this attribute to `UNSCHEDULED_STATE`, you can basically remember whether you've called `start()` on the node or not. -- If you need to compare this attribute to `SCHEDULED_STATE`, you can basically remember whether you've called `start()` on the node or not. You can compare the value of {{domxref("BaseAudioContext.currentTime")}} to the first argument passed to `start()` to know whether playback has started or not. -- If you need to compare this attribute to `PLAYING_STATE`, you can compare the value of {{domxref("BaseAudioContext.currentTime")}} to the first argument passed to `start()` to know whether playback has started or not. -- If you need to know when playback of the node is finished (which is the most significant use case of `playbackState`), there is a new ended event which you can use to know when playback is finished. Please see this code example: - -```js -// Old webkitAudioContext code: -const src = context.createBufferSource(); -// Some time later... -const isFinished = src.playbackState === src.FINISHED_STATE; -``` - -```js -// New AudioContext code: -let isFinished = false; -const src = context.createBufferSource(); -src.onended = (event) => { - isFinished = true; -}; -``` - -The exact same changes have been applied to both {{domxref("AudioBufferSourceNode")}} and {{domxref("OscillatorNode")}}, so you can apply the same techniques to both kinds of nodes. - -## Removal of AudioContext.activeSourceCount - -The `activeSourceCount` attribute has been removed from {{domxref("AudioContext")}}. If you need to count the number of playing source nodes, you can maintain the count by handling the ended event on the source nodes, as shown above. - -Code using the `activeSourceCount` attribute of the {{domxref("AudioContext")}}, like this snippet: - -```js -const src0 = context.createBufferSource(); -const src1 = context.createBufferSource(); -// Set buffers and other parameters... -src0.start(0); -src1.start(0); -// Some time later... -console.log(context.activeSourceCount); -``` - -could be rewritten like that: - -```js -// Array to track the playing source nodes: -const sources = []; - -// When starting the source, put it at the end of the array, -// and set a handler to make sure it gets removed when the -// AudioBufferSourceNode reaches its end. -// First argument is the AudioBufferSourceNode to start, other arguments are -// the argument to the |start()| method of the AudioBufferSourceNode. -function startSource(src, ...startArgs) { - src.onended = () => { - sources.splice(sources.indexOf(src), 1); - }; - sources.push(src); - src.start.apply(src, startArgs); -} - -function activeSources() { - return sources.length; -} - -const src0 = context.createBufferSource(); -const src1 = context.createBufferSource(); - -// Set buffers and other parameters... -startSource(src0, 0); -startSource(src1, 0); - -// Some time later, query the number of sources... -console.log(activeSources()); -``` - -## Renaming of WaveTable - -The {{domxref("WaveTable")}} interface has been renamed to {{domxref("PeriodicWave")}}. Here is how you can port old code using `WaveTable` to the standard AudioContext API: - -```js -// Old webkitAudioContext code: -const osc = context.createOscillator(); -const table = context.createWaveTable(realArray, imaginaryArray); -osc.setWaveTable(table); -``` - -```js -// New standard AudioContext code: -const osc = context.createOscillator(); -const table = context.createPeriodicWave(realArray, imaginaryArray); -osc.setPeriodicWave(table); -``` - -## Removal of some of the AudioParam read-only attributes - -The following read-only attributes have been removed from AudioParam: `name`, `units`, `minValue`, and `maxValue`. These used to be informational attributes. Here is some information on how you can get these values if you need them: - -- The `name` attribute is a string representing the name of the {{domxref("AudioParam")}} object. For example, the name of {{domxref("GainNode.gain")}} is `"gain"`. You can track where the {{domxref("AudioParam")}} object is coming from in your code if you need this information. -- The `minValue` and `maxValue` attributes are read-only values representing the nominal range for the {{domxref("AudioParam")}}. For example, for {{domxref("GainNode") }}, these values are 0 and 1, respectively. Note that these bounds are not enforced by the engine, and are merely used for informational purposes. As an example, it's perfectly valid to set a gain value to 2, or even -1. In order to find out these nominal values, you can consult the [specification](https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html). -- The `units` attribute as implemented in `webkitAudioContext` implementations is unused, and always returns 0. There is no reason why you should need this attribute. - -## Removal of MediaElementAudioSourceNode.mediaElement - -The `mediaElement` attribute of {{domxref("MediaElementAudioSourceNode")}} has been removed. You can keep a reference to the media element used to create this node if you need to access it later. - -## Removal of MediaStreamAudioSourceNode.mediaStream - -The `mediaStream` attribute of {{domxref("MediaStreamAudioSourceNode")}} has been removed. You can keep a reference to the media stream used to create this node if you need to access it later. diff --git a/files/en-us/web/api/web_audio_api/tools/index.md b/files/en-us/web/api/web_audio_api/tools/index.md index 2ee84090ab158c5..a430a0b0137b6ed 100644 --- a/files/en-us/web/api/web_audio_api/tools/index.md +++ b/files/en-us/web/api/web_audio_api/tools/index.md @@ -28,4 +28,3 @@ _Add information for developers working in Safari._ - [Web Audio API](/en-US/docs/Web/API/Web_Audio_API) - [Using the Web Audio API](/en-US/docs/Web/API/Web_Audio_API/Using_Web_Audio_API) -- [Writing Web Audio API code that works in every browser](/en-US/docs/Web/Guide/Audio_and_video_delivery/Web_Audio_API_cross_browser) diff --git a/files/en-us/web/guide/audio_and_video_delivery/index.md b/files/en-us/web/guide/audio_and_video_delivery/index.md index 363c818ff60917d..64d8dafef0743e5 100644 --- a/files/en-us/web/guide/audio_and_video_delivery/index.md +++ b/files/en-us/web/guide/audio_and_video_delivery/index.md @@ -527,7 +527,6 @@ A number of audio and video JavaScript libraries exist. The most popular librari - [Adding captions and subtitles to HTML video](/en-US/docs/Web/Guide/Audio_and_video_delivery/Adding_captions_and_subtitles_to_HTML5_video) - : This article explains how to add captions and subtitles to HTML {{ htmlelement("video") }}, using [Web_Video_Text_Tracks_Format](/en-US/docs/Web/API/WebVTT_API) and the {{ htmlelement("track") }} element. -- [Writing Web Audio API code that works in every browser](/en-US/docs/Web/Guide/Audio_and_video_delivery/Web_Audio_API_cross_browser) - : A guide to writing cross browser Web Audio API code. - [Easy audio capture with the MediaRecorder API](https://hacks.mozilla.org/2014/06/easy-audio-capture-with-the-mediarecorder-api/) - : Explains the basics of using the MediaStream Recording API to directly record a media stream. diff --git a/files/en-us/web/guide/audio_and_video_delivery/web_audio_api_cross_browser/index.md b/files/en-us/web/guide/audio_and_video_delivery/web_audio_api_cross_browser/index.md deleted file mode 100644 index 612eaa2942ea216..000000000000000 --- a/files/en-us/web/guide/audio_and_video_delivery/web_audio_api_cross_browser/index.md +++ /dev/null @@ -1,64 +0,0 @@ ---- -title: Writing Web Audio API code that works in every browser -slug: Web/Guide/Audio_and_video_delivery/Web_Audio_API_cross_browser -page-type: guide ---- - -{{QuickLinksWithSubPages("/en-US/docs/Web/Guide/Audio_and_video_delivery")}} - -You probably have already read [the announcement](https://hacks.mozilla.org/2013/07/web-audio-api-comes-to-firefox/) on the Web Audio API coming to Firefox, and are totally excited and ready to make your _until-now-WebKit-only_ sites work with Firefox, which uses the unprefixed version of [the spec](https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html). - -Unfortunately, Chrome, Safari and Opera still use the `webkitAudioContext` prefixed name. Furthermore, as a result of the spec being still in flux, some browsers use deprecated properties and method names that are not present in standards-compliant browsers: Safari uses the old method names, Firefox uses the new ones, and Chrome and Opera use both. In addition, not all features of Web Audio are already implemented in Firefox _yet_. - -_What do we do!?_ - -We don't want to maintain two or more separate code bases, and feature detection code is cumbersome! Plus we want to write code that reliably works in the future, or at least, works with a minimum amount of changes. Is there a way to satisfy all these constraints at the same time? _Probably!_ - -## Writing for today (and tomorrow) - -First, get a copy of [AudioContext-MonkeyPatch](https://github.com/cwilso/AudioContext-MonkeyPatch/) by Chris Wilson. This little library will "normalize" the interfaces for you and make it look as if your code is running in a standards compliant browser, by aliasing prefixed names to the unprefixed versions. And it won't do anything if the unprefixed versions are already present. - -Once you include it in your page, you can write in "modern Web Audio API" style, and do things such as: - -```js -const audioContext = new AudioContext(); -``` - -everywhere, including Chrome/ium, Opera, Safari, and ---of course!--- Firefox. - -Also, if new methods such as `start` are not detected in some nodes, the library will also alias them to their old names. Thus, `start` is mapped to `noteOn`, `stop` to `noteOff`, and so on. - -If you're porting moderately "old" code (say, a year old) it's possible that it uses some methods that `AudioContext-MonkeyPatch` doesn't alias, because it helps you to write code in the _new_ style. For example, the way to create instances of `GainNode` used to be - -```js -const gain = audioContext.createGainNode(); -``` - -but nowadays it is just - -```js -const gain = audioContext.createGain(); -``` - -Since the old method names are not present in Firefox, existing code may crash with something like `createGainNode is not a function`, and you now know why. - -There's [a section](https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#OldNames) in the spec that lists the old names and their updated equivalences; be sure to check it out and change your code accordingly. You can also check [this article](/en-US/docs/Web/API/Web_Audio_API/Migrating_from_webkitAudioContext) on porting which covers more cases and has many code samples. - -## Things that are not ready yet - -Second, ensure that your project doesn't use node types that are not implemented yet in Firefox: [MediaStreamAudioSourceNode](https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#MediaStreamAudioSourceNode), [MediaElementAudioSourceNode](https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#MediaElementAudioSourceNode) and [OscillatorNode](https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#OscillatorNode). - -If it's using, for example, `OscillatorNode`, you will have to wait until it is supported, or maybe, if you're really eager, hack in some replacement using [ScriptProcessorNode](https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#ScriptProcessorNode-section), which allows you to write a node with callbacks that get called periodically, so that your JavaScript code generates or processes audio. - -The node parameters you use must also be supported in Firefox too. If they aren't, you might be able to change them into something "acceptable" for the time being, and count on the talented audio developers to implement those very soon. - -For example, up until a couple of days ago [PannerNode](https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#PannerNode-section) did not support the default HRTF panning model yet, and attempting to use a `PannerNode` with that configuration resulted in silence or a mono output coming out from that node, depending on the build you used. - -Today the support is already present in [Nightly](https://www.mozilla.org/en-US/firefox/channel/desktop/), but not quite yet in [Aurora](https://www.mozilla.org/en-US/firefox/channel/desktop/). In the meantime, you can explicitly specify `'equalpower'` instead: - -```js -const panner = new audioContext.PannerNode(); -panner.panningModel = "equalpower"; -``` - -Note that there's a [list of projects](https://github.com/WebAudio/demo-list) built with the Web Audio API, specifying which ones use the standard `AudioContext` and which browsers do they work on. If you're a person that learns by example, it might be interesting to have a look at their source and see how they have resolved the compatibility issues. diff --git a/files/jsondata/GroupData.json b/files/jsondata/GroupData.json index 6b25e2f47df44b3..b675660ddcdef45 100644 --- a/files/jsondata/GroupData.json +++ b/files/jsondata/GroupData.json @@ -1630,7 +1630,6 @@ "/docs/Web/API/Web_Audio_API/Advanced_techniques", "/docs/Web/API/Web_Audio_API/Using_AudioWorklet", "/docs/Web/API/Web_Audio_API/Controlling_multiple_parameters_with_ConstantSourceNode", - "/docs/Web/API/Web_Audio_API/Porting_webkitAudioContext_code_to_standards_based_AudioContext", "/docs/Web/API/Web_Audio_API/Simple_synth", "/docs/Web/API/Web_Audio_API/Tools", "/docs/Web/API/Web_Audio_API/Using_IIR_filters", From 1f48c7cf6dbbbc6949e9aeba2e0ab957cd477fdd Mon Sep 17 00:00:00 2001 From: Hamish Willee Date: Fri, 10 Nov 2023 17:24:34 +1100 Subject: [PATCH 36/52] RTCRtpEncodingParameters - removal (#30080) * RTCRtpEncodingParameters - move into RTCRtpSender.setParameters() * RTCPeerConnection.addTransceiver() - cross link to setParameters * Copy the incomplete values into getParameters * Delete /RTCRtpEncodingParameters and redirect to RTCRtpSenser.setParameters * setParameters - remove non-standard parameters * getParameters - remove the ssrc, rtx, etc FF only values --- files/en-us/_redirects.txt | 4 ++ files/en-us/_wikihistory.json | 20 ++++++++ .../mozilla/firefox/releases/101/index.md | 2 +- .../mozilla/firefox/releases/110/index.md | 2 +- .../mozilla/firefox/releases/64/index.md | 2 +- .../rtcpeerconnection/addtransceiver/index.md | 13 ++--- .../web/api/rtcrtpencodingparameters/index.md | 44 ----------------- .../maxbitrate/index.md | 41 ---------------- .../maxframerate/index.md | 32 ------------- .../scaleresolutiondownby/index.md | 48 ------------------- .../api/rtcrtpsender/getparameters/index.md | 45 +++++++++++++++-- .../api/rtcrtpsender/setparameters/index.md | 41 +++++++++++++++- 12 files changed, 113 insertions(+), 181 deletions(-) delete mode 100644 files/en-us/web/api/rtcrtpencodingparameters/index.md delete mode 100644 files/en-us/web/api/rtcrtpencodingparameters/maxbitrate/index.md delete mode 100644 files/en-us/web/api/rtcrtpencodingparameters/maxframerate/index.md delete mode 100644 files/en-us/web/api/rtcrtpencodingparameters/scaleresolutiondownby/index.md diff --git a/files/en-us/_redirects.txt b/files/en-us/_redirects.txt index cb901782e3c07d5..2781c482e68afd7 100644 --- a/files/en-us/_redirects.txt +++ b/files/en-us/_redirects.txt @@ -9530,6 +9530,10 @@ /en-US/docs/Web/API/RTCRtpContributingSource/rtpTimestamp /en-US/docs/Web/API/RTCRtpReceiver/getContributingSources /en-US/docs/Web/API/RTCRtpContributingSource/source /en-US/docs/Web/API/RTCRtpReceiver/getContributingSources /en-US/docs/Web/API/RTCRtpContributingSource/timestamp /en-US/docs/Web/API/RTCRtpReceiver/getContributingSources +/en-US/docs/Web/API/RTCRtpEncodingParameters /en-US/docs/Web/API/RTCRtpSender/setParameters +/en-US/docs/Web/API/RTCRtpEncodingParameters/maxBitrate /en-US/docs/Web/API/RTCRtpSender/setParameters +/en-US/docs/Web/API/RTCRtpEncodingParameters/maxFramerate /en-US/docs/Web/API/RTCRtpSender/setParameters +/en-US/docs/Web/API/RTCRtpEncodingParameters/scaleResolutionDownBy /en-US/docs/Web/API/RTCRtpSender/setParameters /en-US/docs/Web/API/RTCRtpParameters /en-US/docs/Web/API/RTCRtpSender/setParameters /en-US/docs/Web/API/RTCRtpReceiveParameters /en-US/docs/Web/API/RTCRtpReceiver/getParameters /en-US/docs/Web/API/RTCRtpReceiver/getCapabilities /en-US/docs/Web/API/RTCRtpReceiver/getCapabilities_static diff --git a/files/en-us/_wikihistory.json b/files/en-us/_wikihistory.json index 505e39b3509e2a1..e0d12e399345a8f 100644 --- a/files/en-us/_wikihistory.json +++ b/files/en-us/_wikihistory.json @@ -55024,6 +55024,26 @@ "modified": "2019-05-20T18:28:16.993Z", "contributors": ["Sheppy"] }, + "Web/API/RTCRtpContributingSource": { + "modified": "2020-10-15T21:55:35.352Z", + "contributors": ["Sheppy", "fscholz", "Onkar316", "jpmedley"] + }, + "Web/API/RTCRtpContributingSource/audioLevel": { + "modified": "2020-10-15T21:55:34.869Z", + "contributors": ["fscholz", "Sheppy", "jpmedley"] + }, + "Web/API/RTCRtpContributingSource/rtpTimestamp": { + "modified": "2020-10-15T22:25:34.965Z", + "contributors": ["Sheppy"] + }, + "Web/API/RTCRtpContributingSource/source": { + "modified": "2020-10-15T21:55:40.516Z", + "contributors": ["fscholz", "Sheppy", "jpmedley"] + }, + "Web/API/RTCRtpContributingSource/timestamp": { + "modified": "2020-10-15T21:55:38.833Z", + "contributors": ["sideshowbarker", "fscholz", "Sheppy", "jpmedley"] + }, "Web/API/RTCRtpEncodingParameters": { "modified": "2020-10-15T22:01:53.269Z", "contributors": ["Sheppy"] diff --git a/files/en-us/mozilla/firefox/releases/101/index.md b/files/en-us/mozilla/firefox/releases/101/index.md index a6ae93fdaaf3625..7f017556b2874ad 100644 --- a/files/en-us/mozilla/firefox/releases/101/index.md +++ b/files/en-us/mozilla/firefox/releases/101/index.md @@ -48,7 +48,7 @@ No notable changes. [`MediaCapabilities.decodingInfo()`](/en-US/docs/Web/API/MediaCapabilities/decodingInfo) will also use the information to accurately report on "efficient decoding" of AV1 videos. For more information, see [Firefox bug 1757861](https://bugzil.la/1757861). -- [`RTCRtpEncodingParameters.maxFramerate`](/en-US/docs/Web/API/RTCRtpEncodingParameters/maxFramerate) is now supported for setting the maximum framerate that can be used to send an encoding (in {{domxref("RTCPeerConnection.addTransceiver()")}} and {{domxref("RTCRtpSender.setParameters()")}}). +- `maxFramerate` is now supported for setting the maximum framerate that can be used to send an encoding (in {{domxref("RTCPeerConnection.addTransceiver()")}} and {{domxref("RTCRtpSender.setParameters()")}}). Note that zero if a valid frame rate value, but is interpreted by Firefox as "no frame rate limit". For more information, see [Firefox bug 1611957](https://bugzil.la/1611957). diff --git a/files/en-us/mozilla/firefox/releases/110/index.md b/files/en-us/mozilla/firefox/releases/110/index.md index 271f06172c1b745..3899d1cd044630f 100644 --- a/files/en-us/mozilla/firefox/releases/110/index.md +++ b/files/en-us/mozilla/firefox/releases/110/index.md @@ -36,7 +36,7 @@ No notable changes. - {{domxref("ReadableStream")}} now supports [asynchronous iteration over the chunks in a stream](/en-US/docs/Web/API/ReadableStream#async_iteration) using the `for await...of` syntax ([Firefox bug 1734244](https://bugzil.la/1734244)). - WebRTC now supports sending the set of available encodings when adding a transceiver to a peer connection, and also getting the active encoding associated with a sender. - Specifically, {{domxref("RTCPeerConnection.addTransceiver()")}} now supports using the [`sendEncodings`](/en-US/docs/Web/API/RTCPeerConnection/addTransceiver#sendencodings) option in the [`init`](/en-US/docs/Web/API/RTCPeerConnection/addTransceiver#init) parameter object, and [`RTCRtpEncodingParameters.active`](/en-US/docs/Web/API/RTCRtpEncodingParameters#active) can be used to determine whether or not the encoding is being used to send data. + Specifically, {{domxref("RTCPeerConnection.addTransceiver()")}} now supports using the [`sendEncodings`](/en-US/docs/Web/API/RTCPeerConnection/addTransceiver#sendencodings) option in the [`init`](/en-US/docs/Web/API/RTCPeerConnection/addTransceiver#init) parameter object, and `active` can be used to determine whether or not the encoding is being used to send data. (See [Firefox bug 1676855](https://bugzil.la/1676855) for more details.) - WebRTC methods {{domxref("RTCRtpSender.getParameters()")}}, {{domxref("RTCRtpSender.setParameters()")}}, and {{domxref("RTCRtpReceiver.getParameters()")}} are now compliant with the specification ([Firefox bug 1401592](https://bugzil.la/1401592)). diff --git a/files/en-us/mozilla/firefox/releases/64/index.md b/files/en-us/mozilla/firefox/releases/64/index.md index 7c33361167d10f8..e8d078406290ba4 100644 --- a/files/en-us/mozilla/firefox/releases/64/index.md +++ b/files/en-us/mozilla/firefox/releases/64/index.md @@ -91,7 +91,7 @@ _No changes._ #### Media, Web Audio, and WebRTC - The {{domxref("PannerNode.refDistance")}}, {{domxref("PannerNode.maxDistance")}}, {{domxref("PannerNode.rolloffFactor")}}, and {{domxref("PannerNode.coneOuterGain")}} properties now correctly throw exceptions when set to values outside their accepted ranges ([Firefox bug 1487963](https://bugzil.la/1487963)). -- {{domxref("RTCRtpEncodingParameters")}} settings changed via {{domxref("RTCRtpSender.setParameters()")}} used to not update if the changes were made during a call. They will now update live, without renegotiation ([Firefox bug 1253499](https://bugzil.la/1253499)). +- `RTCRtpEncodingParameters` settings changed via {{domxref("RTCRtpSender.setParameters()")}} used to not update if the changes were made during a call. They will now update live, without renegotiation ([Firefox bug 1253499](https://bugzil.la/1253499)). - {{domxref("RTCIceCandidateStats.relayProtocol")}} has been implemented — this is the standardized version of `RTCIceCandidateStats.mozLocalTransport`, which has now been deprecated ([Firefox bug 1435789](https://bugzil.la/1435789)). - Automatic Gain Control (AGC) is now enabled by default; this can be changed using the preference `media.getusermedia.agc_enabled` ([Firefox bug 1496714](https://bugzil.la/1496714)). diff --git a/files/en-us/web/api/rtcpeerconnection/addtransceiver/index.md b/files/en-us/web/api/rtcpeerconnection/addtransceiver/index.md index e4e26f26cd8fd69..35318212fe76887 100644 --- a/files/en-us/web/api/rtcpeerconnection/addtransceiver/index.md +++ b/files/en-us/web/api/rtcpeerconnection/addtransceiver/index.md @@ -8,12 +8,8 @@ browser-compat: api.RTCPeerConnection.addTransceiver {{APIRef("WebRTC")}} -The {{domxref("RTCPeerConnection")}} method -**`addTransceiver()`** creates a new -{{domxref("RTCRtpTransceiver")}} and adds it to the set of transceivers associated -with the `RTCPeerConnection`. Each transceiver represents a -bidirectional stream, with both an {{domxref("RTCRtpSender")}} and an -{{domxref("RTCRtpReceiver")}} associated with it. +The {{domxref("RTCPeerConnection")}} method **`addTransceiver()`** creates a new {{domxref("RTCRtpTransceiver")}} and adds it to the set of transceivers associated with the `RTCPeerConnection`. +Each transceiver represents a bidirectional stream, with both an {{domxref("RTCRtpSender")}} and an {{domxref("RTCRtpReceiver")}} associated with it. ## Syntax @@ -35,7 +31,8 @@ addTransceiver(trackOrKind, init) - `direction` {{optional_inline}} - : The new transceiver's preferred directionality. This value is used to initialize the new {{domxref("RTCRtpTransceiver")}} object's {{domxref("RTCRtpTransceiver.direction")}} property. - `sendEncodings` {{optional_inline}} - - : A list of encodings to allow when sending RTP media from the {{domxref("RTCRtpSender")}}. Each entry is of type {{domxref("RTCRtpEncodingParameters")}}. + - : An array of encodings to allow when sending RTP media from the {{domxref("RTCRtpSender")}}. + This is the same as the [`parameter.encodings`](/en-US/docs/Web/API/RTCRtpSender/setParameters#encodings) array passed to {{domxref("RTCRtpSender.setParameters()")}}. - `streams` {{optional_inline}} - : A list of {{domxref("MediaStream")}} objects to add to the transceiver's {{domxref("RTCRtpReceiver")}}; when the remote peer's {{domxref("RTCPeerConnection")}}'s {{domxref("RTCPeerConnection.track_event", "track")}} event occurs, these are the streams that will be specified by that event. @@ -53,7 +50,7 @@ The {{domxref("RTCRtpTransceiver")}} object which will be used to exchange the m - {{jsxref("RangeError")}} - - : Thrown if any of the `sendEncodings` encodings have a {{domxref("RTCRtpEncodingParameters.maxFramerate", "maxFramerate")}} value less than 0.0, or a {{domxref("RTCRtpEncodingParameters.scaleResolutionDownBy", "scaleResolutionDownBy")}} value of less than 1.0. + - : Thrown if any of the `sendEncodings` encodings have a `maxFramerate` value less than 0.0, or a `scaleResolutionDownBy` value of less than 1.0. - `InvalidStateError` {{domxref("DOMException")}} diff --git a/files/en-us/web/api/rtcrtpencodingparameters/index.md b/files/en-us/web/api/rtcrtpencodingparameters/index.md deleted file mode 100644 index 62be5d429549f16..000000000000000 --- a/files/en-us/web/api/rtcrtpencodingparameters/index.md +++ /dev/null @@ -1,44 +0,0 @@ ---- -title: RTCRtpEncodingParameters -slug: Web/API/RTCRtpEncodingParameters -page-type: web-api-interface -browser-compat: api.RTCRtpEncodingParameters ---- - -{{APIRef("WebRTC")}} - -An instance of the [WebRTC](/en-US/docs/Web/API/WebRTC_API) API's **`RTCRtpEncodingParameters`** dictionary describes a single configuration of a {{Glossary("codec")}} for an {{domxref("RTCRtpSender")}}. - -This dictionary is used to describe the configuration of an RTP sender's `encodings` when calling {{domxref("RTCRtpSender.getParameters()")}} or {{domxref("RTCRtpSender.setParameters()")}}. - -## Instance properties - -- {{domxref("RTCRtpEncodingParameters.active", "active")}} - - : If `true`, the described encoding is currently actively being used. That is, for RTP senders, the encoding is currently being used to send data, while for receivers, the encoding is being used to decode received data. The default value is `true`. -- {{domxref("RTCRtpEncodingParameters.dtx", "dtx")}} {{Deprecated_Inline}} {{Non-standard_Inline}} - - : Only used for an {{domxref("RTCRtpSender")}} whose {{domxref("MediaStreamTrack.kind", "kind")}} is `audio`, this property indicates whether or not to use discontinuous transmission (a feature by which a phone is turned off or the microphone muted automatically in the absence of voice activity). The value is taken either `enabled` or `disabled`. -- {{domxref("RTCRtpEncodingParameters.maxBitrate", "maxBitrate")}} - - : An unsigned long integer indicating the maximum number of bits per second to allow for this encoding. Other parameters may further constrain the bit rate, such as the value of `maxFramerate` or transport or physical network limitations. -- {{domxref("RTCRtpEncodingParameters.maxFramerate", "maxFramerate")}} - - : A value specifying the maximum number of frames per second to allow for this encoding. -- `priority` - - : A string indicating the priority of the {{domxref("RTCRtpSender")}}, which may determine how the user agent allocates bandwidth between senders. - Allowed values are `very-low`, `low` (default), `medium`, `high`. -- {{domxref("RTCRtpEncodingParameters.rid", "rid")}} - - : A string which, if set, specifies an _RTP stream ID_ (_RID_) to be sent using the RID header extension. This parameter cannot be modified using {{domxref("RTCRtpSender.setParameters", "setParameters()")}}. Its value can only be set when the transceiver is first created. -- {{domxref("RTCRtpEncodingParameters.scaleResolutionDownBy", "scaleResolutionDownBy")}} - - : Only used for senders whose track's {{domxref("MediaStreamTrack.kind", "kind")}} is `video`, this is a double-precision floating-point value specifying a factor by which to scale down the video during encoding. The default value, 1.0, means that the sent video's size will be the same as the original. A value of 2.0 scales the video frames down by a factor of 2 in each dimension, resulting in a video 1/4 the size of the original. The value must not be less than 1.0 (you can't use this to scale the video up). - -## Specifications - -{{Specifications}} - -## Browser compatibility - -{{Compat}} - -## See also - -- {{domxref("RTCRtpDecodingParameters")}} is used to describe the configuration of an RTP receiver's encodings. -- [Introduction to the Real-time Transport Protocol (RTP)](/en-US/docs/Web/API/WebRTC_API/Intro_to_RTP) -- {{domxref("RTCRtpSender")}}, {{domxref("RTCRtpReceiver")}}, and {{domxref("RTCRtpTransceiver")}} diff --git a/files/en-us/web/api/rtcrtpencodingparameters/maxbitrate/index.md b/files/en-us/web/api/rtcrtpencodingparameters/maxbitrate/index.md deleted file mode 100644 index d51a2065eca23b3..000000000000000 --- a/files/en-us/web/api/rtcrtpencodingparameters/maxbitrate/index.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -title: "RTCRtpEncodingParameters: maxBitrate property" -short-title: maxBitrate -slug: Web/API/RTCRtpEncodingParameters/maxBitrate -page-type: web-api-instance-property -browser-compat: api.RTCRtpEncodingParameters.maxBitrate ---- - -{{APIRef("WebRTC")}} - -The {{domxref("RTCRtpEncodingParameters")}} dictionary's -**`maxBitrate`** property specifies the maximum number of bits -per second to allow a track encoded with this encoding to use. - -## Value - -An unsigned long integer value specifying the maximum bandwidth this encoding is -permitted to use for a track of media it encodes in terms of bits per second. Other -parameters may further reduce the bandwidth used by the track; for example, -{{domxref("RTCRtpEncodingParameters.maxFramerate", "maxFramerate")}} will, if set low -enough, constrain the bandwidth as well. - -In addition, there's no guarantee that the network interface can support the specified -bandwidth, in which case the actual bandwidth will be lower. - -This value is computed using the standard Transport Independent Application Specific -Maximum (TIAS) bandwidth as defined by {{RFC(3890, "", "6.2.2")}}; this is the maximum -bandwidth needed without considering protocol overheads from IP, TCP or UDP, and so -forth. - -## Specifications - -{{Specifications}} - -## Browser compatibility - -{{Compat}} - -## See also - -- {{domxref("RTCRtpEncodingParameters.maxFramerate")}} diff --git a/files/en-us/web/api/rtcrtpencodingparameters/maxframerate/index.md b/files/en-us/web/api/rtcrtpencodingparameters/maxframerate/index.md deleted file mode 100644 index 0be435b123508f4..000000000000000 --- a/files/en-us/web/api/rtcrtpencodingparameters/maxframerate/index.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -title: "RTCRtpEncodingParameters: maxFramerate property" -short-title: maxFramerate -slug: Web/API/RTCRtpEncodingParameters/maxFramerate -page-type: web-api-instance-property -browser-compat: api.RTCRtpEncodingParameters.maxFramerate ---- - -{{APIRef("WebRTC")}} - -The **`maxFramerate`** property of the {{domxref("RTCRtpEncodingParameters")}} dictionary specifies the maximum framerate that can be used to send the encoding, in frames per second. - -The user agent is free to allocate bandwidth between the encodings, as long as the `maxFramerate` value is not exceeded. - -The frame rate is a positive real number ({{domxref("RTCPeerConnection.addTransceiver()")}} and {{domxref("RTCRtpSender.setParameters()")}} will throw a {{jsxref("RangeError")}} exception if the value is less than 0.0). -Setting the maximum frame rate to zero using {{domxref("RTCRtpSender.setParameters()")}} has the effect of freezing the video on the next frame. - -## Value - -A positive real number indicating the maximum frame rate for the specified encoding, in frames per second. - -## Specifications - -{{Specifications}} - -## Browser compatibility - -{{Compat}} - -## See also - -- {{domxref("RTCRtpEncodingParameters.maxBitrate")}} diff --git a/files/en-us/web/api/rtcrtpencodingparameters/scaleresolutiondownby/index.md b/files/en-us/web/api/rtcrtpencodingparameters/scaleresolutiondownby/index.md deleted file mode 100644 index a91a7b859abb663..000000000000000 --- a/files/en-us/web/api/rtcrtpencodingparameters/scaleresolutiondownby/index.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -title: "RTCRtpEncodingParameters: scaleResolutionDownBy property" -short-title: scaleResolutionDownBy -slug: Web/API/RTCRtpEncodingParameters/scaleResolutionDownBy -page-type: web-api-instance-property -browser-compat: api.RTCRtpEncodingParameters.scaleResolutionDownBy ---- - -{{APIRef("WebRTC")}} - -The {{domxref("RTCRtpEncodingParameters")}} dictionary's -**`scaleResolutionDownBy`** property can be used to specify a -factor by which to reduce the size of a video track during encoding. - -This property is only available for tracks whose {{domxref("MediaStreamTrack.kind", - "kind")}} is `video`. - -## Syntax - -```js-nolint -rtpEncodingParameters.scaleResolutionDownBy = scalingFactor - -rtpEncodingParameters = { - scaleResolutionDownBy: scalingFactor -} -``` - -### Value - -A double-precision floating-point number specifying the amount by which to reduce the -size of the video during encoding. The default value, 1.0, means that the video will be -encoded at its original size. A value of 2.0 would reduce the size of the video by a -factor of 2 both horizontally and vertically, resulting in a video 25% the original -size. - -A value less than 1.0 would cause the video to get larger rather than smaller, which is -not the intent of this property. Therefore, specifying a value less than 1.0 is not -permitted and will cause a {{jsxref("RangeError")}} exception to be thrown by -{{domxref("RTCPeerConnection.addTransceiver()")}} or -{{domxref("RTCRtpSender.setParameters()")}}. - -## Specifications - -{{Specifications}} - -## Browser compatibility - -{{Compat}} diff --git a/files/en-us/web/api/rtcrtpsender/getparameters/index.md b/files/en-us/web/api/rtcrtpsender/getparameters/index.md index 0423389fde788ef..9058d461a2d6754 100644 --- a/files/en-us/web/api/rtcrtpsender/getparameters/index.md +++ b/files/en-us/web/api/rtcrtpsender/getparameters/index.md @@ -27,12 +27,49 @@ An object indicating the current configuration of the sender. - `encodings` - - : An array of {{domxref("RTCRtpEncodingParameters")}} objects, each specifying the parameters and settings for a single codec that could be used to encode the track's media. + + - : An array of objects, each specifying the parameters and settings for a single codec that could be used to encode the track's media. + The properties of the objects include: + + - `active` + + - : `true` (the default) if the encoding is being sent, `false` if it is not being sent or used. + + - `dtx` {{Deprecated_Inline}} {{Non-standard_Inline}} + + - : Only used for an {{domxref("RTCRtpSender")}} whose {{domxref("MediaStreamTrack.kind", "kind")}} is `audio`, this property indicates whether or not discontinuous transmission is being used (a feature by which a phone is turned off or the microphone muted automatically in the absence of voice activity). + The value is taken either `enabled` or `disabled`. + + - `maxBitrate` + + - : A positive integer indicating the maximum number of bits per second that the user agent is allowed to grant to tracks encoded with this encoding. + Other parameters may further constrain the bit rate, such as the value of `maxFramerate`, or the bandwidth available for the transport or physical network. + + The value is computed using the standard Transport Independent Application Specific Maximum (TIAS) bandwidth as defined by {{RFC(3890, "", "6.2.2")}}; this is the maximum bandwidth needed without considering protocol overheads from IP, TCP or UDP, and so forth. + + Note that the bitrate can be achieved in a number of ways, depending on the media and encoding. + For example, for video a low bit rate might be achieved by dropping frames (a bitrate of zero might allow just one frame to be sent), while for audio the track might have to stop playing if the bitrate is too low for it to be sent. + + - `maxFramerate` + - : A value specifying the maximum number of frames per second to allow for this encoding. + - `priority` + - : A string indicating the priority of the {{domxref("RTCRtpSender")}}, which may determine how the user agent allocates bandwidth between senders. + Allowed values are `very-low`, `low` (default), `medium`, `high`. + - `rid` + - : A string which, if set, specifies an _RTP stream ID_ (_RID_) to be sent using the RID header extension. + This parameter cannot be modified using {{domxref("RTCRtpSender.setParameters", "setParameters()")}}. + Its value can only be set when the transceiver is first created. + - `scaleResolutionDownBy` + - : Only used for senders whose track's {{domxref("MediaStreamTrack.kind", "kind")}} is `video`, this is a floating-point value specifying a factor by which to scale down the video during encoding. + The default value, 1.0, means that the video will be encoded at its original size. + A value of 2.0 scales the video frames down by a factor of 2 in each dimension, resulting in a video 1/4 the size of the original. + The value must not be less than 1.0 (attempting to scale the video to a larger size will throw a {{jsxref("RangeError")}}). + - `transactionId` - : A string containing a unique ID. - This value is used to ensure that {{domxref("RTCRtpSender.setParameters", "setParameters()")}} can only be called to modify the parameters returned by a specific previous call to `getParameters()`. - This parameter cannot be changed by the caller. - + This value is used to ensure that {{domxref("RTCRtpSender.setParameters", "setParameters()")}} can only be called to modify the parameters returned by a specific previous call to `getParameters()`. + This parameter cannot be changed by the caller. + - `codecs` - : An array of {{domxref("RTCRtpCodecParameters")}} objects describing the set of codecs from which the sender or receiver will choose. This parameter cannot be changed once initially set. diff --git a/files/en-us/web/api/rtcrtpsender/setparameters/index.md b/files/en-us/web/api/rtcrtpsender/setparameters/index.md index 8da17e12bde8a2d..39802f199cde72d 100644 --- a/files/en-us/web/api/rtcrtpsender/setparameters/index.md +++ b/files/en-us/web/api/rtcrtpsender/setparameters/index.md @@ -27,7 +27,46 @@ setParameters(parameters) The available parameters are: - `encodings` - - : An array of {{domxref("RTCRtpEncodingParameters")}} objects, each specifying the parameters for a single codec that could be used to encode the track's media. + + - : An array of objects, each specifying the parameters for a single codec that could be used to encode the track's media. + The properties of the objects include: + + - `active` + + - : Setting this value `true` (the default) causes this encoding to be sent, while `false` stops it from being sent and used (but does not cause the SSRC to be removed). + + - `dtx` {{Deprecated_Inline}} {{Non-standard_Inline}} + + - : Only used for an {{domxref("RTCRtpSender")}} whose {{domxref("MediaStreamTrack.kind", "kind")}} is `audio`, this property indicates whether or not to use discontinuous transmission (a feature by which a phone is turned off or the microphone muted automatically in the absence of voice activity). + The value is taken either `enabled` or `disabled`. + + - `maxBitrate` + + - : A positive integer indicating the maximum number of bits per second that the user agent is allowed to grant to tracks encoded with this encoding. + Other parameters may further constrain the bit rate, such as the value of `maxFramerate`, or the bandwidth available for the transport or physical network. + + The value is computed using the standard Transport Independent Application Specific Maximum (TIAS) bandwidth as defined by {{RFC(3890, "", "6.2.2")}}; this is the maximum bandwidth needed without considering protocol overheads from IP, TCP or UDP, and so forth. + + Note that the bitrate can be achieved in a number of ways, depending on the media and encoding. + For example, for video a low bit rate might be achieved by dropping frames (a bitrate of zero might allow just one frame to be sent), while for audio the track might have to stop playing if the bitrate is too low for it to be sent. + + - `maxFramerate` + - : A value specifying the maximum number of frames per second to allow for this encoding. + - `priority` + - : A string indicating the priority of the {{domxref("RTCRtpSender")}}, which may determine how the user agent allocates bandwidth between senders. + Allowed values are `very-low`, `low` (default), `medium`, `high`. + - `rid` + + - : A string which, if set, specifies an _RTP stream ID_ (_RID_) to be sent using the RID header extension. + This parameter cannot be modified using {{domxref("RTCRtpSender.setParameters", "setParameters()")}}. + Its value can only be set when the transceiver is first created. + + - `scaleResolutionDownBy` + - : Only used for senders whose track's {{domxref("MediaStreamTrack.kind", "kind")}} is `video`, this is a floating-point value specifying a factor by which to scale down the video during encoding. + The default value, 1.0, means that the video will be encoded at its original size. + A value of 2.0 scales the video frames down by a factor of 2 in each dimension, resulting in a video 1/4 the size of the original. + The value must not be less than 1.0 (attempting to scale the video to a larger size will throw a {{jsxref("RangeError")}}). + - `transactionId` - : A string containing a unique ID. This ID is set in the previous {{domxref("RTCRtpSender.getParameters", "getParameters()")}} call, and ensures that the parameters originated from a previous call to {{domxref("RTCRtpSender.getParameters", "getParameters()")}}. From c14eec4402b64ba2abb72c9e54598c8f52632d80 Mon Sep 17 00:00:00 2001 From: Hamish Willee Date: Fri, 10 Nov 2023 17:55:01 +1100 Subject: [PATCH 37/52] Django fixes to allow safe deletion of Books (#30057) * Django fixes to allow safe deletion of Books * Update the authentication and forms * Update forms --- .../server-side/django/admin_site/index.md | 12 +- .../django/authentication/index.md | 12 +- .../forms/forms_example_create_author.png | Bin 6342 -> 8472 bytes .../forms_example_detail_author_update.png | Bin 0 -> 11790 bytes .../learn/server-side/django/forms/index.md | 147 ++++++++++++++---- .../server-side/django/home_page/index.md | 7 +- .../learn/server-side/django/models/index.md | 59 +++++-- .../learn/server-side/django/testing/index.md | 32 +++- 8 files changed, 201 insertions(+), 68 deletions(-) create mode 100644 files/en-us/learn/server-side/django/forms/forms_example_detail_author_update.png diff --git a/files/en-us/learn/server-side/django/admin_site/index.md b/files/en-us/learn/server-side/django/admin_site/index.md index fcf564da535f8b6..89b8e4af0ff7a82 100644 --- a/files/en-us/learn/server-side/django/admin_site/index.md +++ b/files/en-us/learn/server-side/django/admin_site/index.md @@ -21,8 +21,7 @@ Now that we've created models for the [LocalLibrary](/en-US/docs/Learn/Server-si Objective: - To understand the benefits and limitations of the Django admin site, and - use it to create some records for our models. + To understand the benefits and limitations of the Django admin site, and use it to create some records for our models. @@ -49,15 +48,16 @@ from django.contrib import admin Register the models by copying the following text into the bottom of the file. This code imports the models and then calls `admin.site.register` to register each of them. ```python -from .models import Author, Genre, Book, BookInstance +from .models import Author, Genre, Book, BookInstance, Language admin.site.register(Book) admin.site.register(Author) admin.site.register(Genre) admin.site.register(BookInstance) +admin.site.register(Language) ``` -> **Note:** If you accepted the challenge to create a model to represent the natural language of a book ([see the models tutorial article](/en-US/docs/Learn/Server-side/Django/Models)), import and register it too! +> **Note:** The lines above assume that you accepted the challenge to create a model to represent the natural language of a book ([see the models tutorial article](/en-US/docs/Learn/Server-side/Django/Models))! This is the simplest way of registering a model, or models, with the site. The admin site is highly customizable, and we'll talk more about the other ways of registering your models further down. @@ -91,7 +91,7 @@ Enter values for the fields. You can create new authors or genres by pressing th ![Admin Site - Book Add](admin_book_add.png) -> **Note:** At this point we'd like you to spend some time adding a few books, authors, and genres (e.g. Fantasy) to your application. Make sure that each author and genre includes a couple of different books (this will make your list and detail views more interesting when we implement them later on in the article series). +> **Note:** At this point we'd like you to spend some time adding a few books, authors, languages, and genres (e.g. Fantasy) to your application. Make sure that each author and genre includes a couple of different books (this will make your list and detail views more interesting when we implement them later on in the article series). When you've finished adding books, click on the **Home** link in the top bookmark to be taken back to the main admin page. Then click on the **Books** link to display the current list of books (or on one of the other links to see other model lists). Now that you've added a few books, the list might look similar to the screenshot below. The title of each book is displayed; this is the value returned in the Book model's `__str__()` method that we specified in the last article. @@ -114,7 +114,7 @@ What you won't have is any _Book Instances_, because these are not created from Create a number of these records for each of your books. Set the status as _Available_ for at least some records and _On loan_ for others. If the status is **not** _Available_, then also set a future _Due back_ date. -That's it! You've now learned how to set up and use the administration site. You've also created records for `Book`, `BookInstance`, `Genre`, and `Author` that we'll be able to use once we create our own views and templates. +That's it! You've now learned how to set up and use the administration site. You've also created records for `Book`, `BookInstance`, `Genre`, `Language` and `Author` that we'll be able to use once we create our own views and templates. ## Advanced configuration diff --git a/files/en-us/learn/server-side/django/authentication/index.md b/files/en-us/learn/server-side/django/authentication/index.md index 9f1f553cfae461d..adcd09c12104fbe 100644 --- a/files/en-us/learn/server-side/django/authentication/index.md +++ b/files/en-us/learn/server-side/django/authentication/index.md @@ -136,9 +136,11 @@ Django provides almost everything you need to create authentication pages to han In this section, we show how to integrate the default system into the _LocalLibrary_ website and create the templates. We'll put them in the main project URLs. -> **Note:** You don't have to use any of this code, but it is likely that you'll want to because it makes things a lot easier. You'll almost certainly need to change the form handling code if you change your user model (an advanced topic!) but even so, you would still be able to use the stock view functions. +> **Note:** You don't have to use any of this code, but it is likely that you'll want to because it makes things a lot easier. +> You'll almost certainly need to change the form handling code if you change your user model, but even so, you would still be able to use the stock view functions. -> **Note:** In this case, we could reasonably put the authentication pages, including the URLs and templates, inside our catalog application. However, if we had multiple applications it would be better to separate out this shared login behavior and have it available across the whole site, so that is what we've shown here! +> **Note:** In this case, we could reasonably put the authentication pages, including the URLs and templates, inside our catalog application. +> However, if we had multiple applications it would be better to separate out this shared login behavior and have it available across the whole site, so that is what we've shown here! ### Project URLs @@ -716,9 +718,9 @@ from django.contrib.auth.mixins import PermissionRequiredMixin class MyView(PermissionRequiredMixin, View): permission_required = 'catalog.can_mark_returned' # Or multiple permissions - permission_required = ('catalog.can_mark_returned', 'catalog.can_edit') - # Note that 'catalog.can_edit' is just an example - # the catalog application doesn't have such permission! + permission_required = ('catalog.can_mark_returned', 'catalog.change_book') + # Note that 'catalog.change_book' is permission + # Is created automatically for the book model, along with add_book, and delete_book ``` > **Note:** There is a small default difference in the behavior above. By **default** for a logged-in user with a permission violation: diff --git a/files/en-us/learn/server-side/django/forms/forms_example_create_author.png b/files/en-us/learn/server-side/django/forms/forms_example_create_author.png index a3239020f9361b399e01cabb39aac38d1b83e92d..5e312d5048ab33674a8db4f12cda2dfe5df148ba 100644 GIT binary patch literal 8472 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 literal 6342 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
@@ -463,7 +463,7 @@ If you were to enter an invalid date, you'd additionally get a list of the error id="id_renewal_date" name="renewal_date" type="text" - value="2015-11-08" + value="2023-11-08" required />
@@ -622,28 +622,61 @@ Open the views file (**locallibrary/catalog/views.py**) and append the following ```python from django.views.generic.edit import CreateView, UpdateView, DeleteView from django.urls import reverse_lazy +from .models import Author -from catalog.models import Author - -class AuthorCreate(CreateView): +class AuthorCreate(PermissionRequiredMixin, CreateView): model = Author fields = ['first_name', 'last_name', 'date_of_birth', 'date_of_death'] - initial = {'date_of_death': '11/06/2020'} + initial = {'date_of_death': '11/11/2023'} + permission_required = 'catalog.add_author' -class AuthorUpdate(UpdateView): +class AuthorUpdate(PermissionRequiredMixin, UpdateView): model = Author - fields = '__all__' # Not recommended (potential security issue if more fields added) + # Not recommended (potential security issue if more fields added) + fields = '__all__' + permission_required = 'catalog.change_author' -class AuthorDelete(DeleteView): +class AuthorDelete(PermissionRequiredMixin, DeleteView): model = Author success_url = reverse_lazy('authors') + permission_required = 'catalog.delete_author' + + def form_valid(self, form): + try: + self.object.delete() + return HttpResponseRedirect(self.success_url) + except Exception as e: + return HttpResponseRedirect( + reverse("author-delete", kwargs={"pk": self.object.pk}) + ) ``` As you can see, to create, update, or delete the views you need to derive from `CreateView`, `UpdateView`, and `DeleteView` (respectively) and then define the associated model. +We also restrict calling these views to only logged in users with the `add_author`, `change_author`, and `delete_author` permissions, respectively. + +For the "create" and "update" cases you also need to specify the fields to display in the form (using the same syntax as for `ModelForm`). In this case, we show how to list them individually and the syntax to list "all" fields. You can also specify initial values for each of the fields using a dictionary of _field_name_/_value_ pairs (here we arbitrarily set the date of death for demonstration purposes — you might want to remove that). By default, these views will redirect on success to a page displaying the newly created/edited model item, which in our case will be the author detail view we created in a previous tutorial. You can specify an alternative redirect location by explicitly declaring parameter `success_url`. + +The `AuthorDelete` class doesn't need to display any of the fields, so these don't need to be specified. +We so set a `success_url` (as shown above), because there is no obvious default URL for Django to navigate to after successfully deleting the `Author`. Above we use the [`reverse_lazy()`](https://docs.djangoproject.com/en/4.2/ref/urlresolvers/#reverse-lazy) function to redirect to our author list after an author has been deleted — `reverse_lazy()` is a lazily executed version of `reverse()`, used here because we're providing a URL to a class-based view attribute. -For the "create" and "update" cases you also need to specify the fields to display in the form (using the same syntax as for `ModelForm`). In this case, we show how to list them individually and the syntax to list "all" fields. You can also specify initial values for each of the fields using a dictionary of _field_name_/_value_ pairs (here we arbitrarily set the date of death for demonstration purposes — you might want to remove that). By default, these views will redirect on success to a page displaying the newly created/edited model item, which in our case will be the author detail view we created in a previous tutorial. You can specify an alternative redirect location by explicitly declaring parameter `success_url` (as done for the `AuthorDelete` class). +If deletion of authors should always succeed that would be it. +Unfortunately deleting an `Author` will cause an exception if the author has an associated book, because our [`Book` model](/en-US/docs/Learn/Server-side/Django/Models#book_model) specifies `on_delete=models.RESTRICT` for the author `ForeignKey` field. +To handle this case the view overrides the [`form_valid()`](https://docs.djangoproject.com/en/4.2/ref/class-based-views/mixins-editing/#django.views.generic.edit.FormMixin.form_valid) method so that if deleting the `Author` succeeds it redirects to the `success_url`, but if not, it just redirects back to the same form. +We'll update the template below to make clear that you can't delete an `Author` instance that is used in any `Book`. + +### URL configurations -The `AuthorDelete` class doesn't need to display any of the fields, so these don't need to be specified. You do however need to specify the `success_url`, because there is no obvious default value for Django to use. In this case, we use the [`reverse_lazy()`](https://docs.djangoproject.com/en/4.2/ref/urlresolvers/#reverse-lazy) function to redirect to our author list after an author has been deleted — `reverse_lazy()` is a lazily executed version of `reverse()`, used here because we're providing a URL to a class-based view attribute. +Open your URL configuration file (**locallibrary/catalog/urls.py**) and add the following configuration to the bottom of the file: + +```python +urlpatterns += [ + path('author/create/', views.AuthorCreate.as_view(), name='author-create'), + path('author//update/', views.AuthorUpdate.as_view(), name='author-update'), + path('author//delete/', views.AuthorDelete.as_view(), name='author-delete'), +] +``` + +There is nothing particularly new here! You can see that the views are classes, and must hence be called via `.as_view()`, and you should be able to recognize the URL patterns in each case. We must use `pk` as the name for our captured primary key value, as this is the parameter name expected by the view classes. ### Templates @@ -667,62 +700,112 @@ Create the template file `locallibrary/catalog/templates/catalog/author_form.htm This is similar to our previous forms and renders the fields using a table. Note also how again we declare the `{% csrf_token %}` to ensure that our forms are resistant to CSRF attacks. -The "delete" view expects to find a template named with the format \_`model_name_confirm_delete.html` (again, you can change the suffix using `template_name_suffix` in your view). Create the template file `locallibrary/catalog/templates/catalog/author_confirm_delete.html` and copy the text below. +The "delete" view expects to find a template named with the format \_`model_name_confirm_delete.html` (again, you can change the suffix using `template_name_suffix` in your view). +Create the template file `locallibrary/catalog/templates/catalog/author_confirm_delete.html` and copy the text below. ```django {% extends "base_generic.html" %} {% block content %} -

Delete Author

+

Delete Author: {{ author }}

+ +{% if author.book_set.all %} -

Are you sure you want to delete the author: \{{ author }}?

+

You can't delete this author until all their books have been deleted:

+
    + {% for book in author.book_set.all %} +
  • {{book}} ({{book.bookinstance_set.all.count}})
  • + {% endfor %} +
+ +{% else %} +

Are you sure you want to delete the author?

{% csrf_token %} - +
+{% endif %} {% endblock %} ``` -### URL configurations +The template should be familiar. +It first checks if the author is used in any books, and if so displays the list of books that must be deleted before the author record can be deleted. +If not, it displays a form asking the user to confirm they want to delete the author record. -Open your URL configuration file (**locallibrary/catalog/urls.py**) and add the following configuration to the bottom of the file: +The final step is to hook the pages into the sidebar. +First we'll add a link for creating the author into the _base template_, so that it is visible in all pages for logged in users who are considered "staff" and who have permission to create authors (`catalog.add_author`). +Open **/locallibrary/catalog/templates/base_generic.html** and add the lines that allow users with the permission to create the author (in the same block as the link that shows "All Borrowed" books). +Remember to reference the URL using it's name `'author-create'` as shown below. -```python -urlpatterns += [ - path('author/create/', views.AuthorCreate.as_view(), name='author-create'), - path('author//update/', views.AuthorUpdate.as_view(), name='author-update'), - path('author//delete/', views.AuthorDelete.as_view(), name='author-delete'), -] +```django +{% if user.is_staff %} +
+ +{% endif %} ``` -There is nothing particularly new here! You can see that the views are classes, and must hence be called via `.as_view()`, and you should be able to recognize the URL patterns in each case. We must use `pk` as the name for our captured primary key value, as this is the parameter name expected by the view classes. +We'll add the links to update and delete authors to the author detail page. +Open **catalog/templates/catalog/author_detail.html** and append the following code: -The author create, update, and delete pages are now ready to test (we won't bother hooking them into the site sidebar in this case, although you can do so if you wish). +```django +{% block sidebar %} + {{ block.super }} + + {% if perms.catalog.change_author or perms.catalog.delete_author %} +
+ + {% endif %} -> **Note:** Observant users will have noticed that we didn't do anything to prevent unauthorized users from accessing the pages! We leave that as an exercise for you (hint: you could use the `PermissionRequiredMixin` and either create a new permission or reuse our `can_mark_returned` permission). +{% endblock %} +``` + +This block overrides the `sidebar` block in the base template and then pulls in the original content using `{{ block.super }}`. +It then appends links to update or delete the author, but when the user has the correct permissions and the author record isn't associated with any books. + +The pages are now ready to test! ### Testing the page -First, log in to the site with an account that has whatever permissions you decided are needed to access the author editing pages. +First, log in to the site with an account that has author add, change and delete permissions. -Then navigate to the author create page, `http://127.0.0.1:8000/catalog/author/create/`, which should look like the screenshot below. +Navigate to any page, and select "Create author" in the sidebar (with URL `http://127.0.0.1:8000/catalog/author/create/`). +The page should look like the screenshot below. ![Form Example: Create Author](forms_example_create_author.png) -Enter values for the fields and then press **Submit** to save the author record. You should now be taken to a detail view for your new author, with a URL of something like `http://127.0.0.1:8000/catalog/author/10`. +Enter values for the fields and then press **Submit** to save the author record. +You should now be taken to a detail view for your new author, with a URL of something like `http://127.0.0.1:8000/catalog/author/10`. + +![Form Example: Author Detail showing Update and Delete links](forms_example_detail_author_update.png) -You can test editing records by appending _/update/_ to the end of the detail view URL (e.g. `http://127.0.0.1:8000/catalog/author/10/update/`) — we don't show a screenshot because it looks just like the "create" page! +You can test editing the record by selecting the "Update author" link (with URL something like `http://127.0.0.1:8000/catalog/author/10/update/`) — we don't show a screenshot because it looks just like the "create" page! -Finally, we can delete the page by appending delete to the end of the author detail-view URL (e.g. `http://127.0.0.1:8000/catalog/author/10/delete/`). Django should display the delete page shown below. Press "**Yes, delete.**" to remove the record and be taken to the list of all authors. +Finally, we can delete the page by selecting "Delete author" from the sidebar on the detail page. +Django should display the delete page shown below if the author record isn't used in any books. +Press "**Yes, delete.**" to remove the record and be taken to the list of all authors. ![Form with option to delete author](forms_example_delete_author.png) ## Challenge yourself -Create some forms to create, edit, and delete `Book` records. You can use exactly the same structure as for `Authors`. If your **book_form.html** template is just a copy-renamed version of the **author_form.html** template, then the new "create book" page will look like the screenshot below: +Create some forms to create, edit, and delete `Book` records. You can use exactly the same structure as for `Authors` (for the deletion, remember that you can't delete a `Book` until all its associated `BookInstance` records are deleted) and you must use the correct permissions. +If your **book_form.html** template is just a copy-renamed version of the **author_form.html** template, then the new "create book" page will look like the screenshot below: ![Screenshot displaying various fields in the form like title, author, summary, ISBN, genre and language](forms_example_create_book.png) diff --git a/files/en-us/learn/server-side/django/home_page/index.md b/files/en-us/learn/server-side/django/home_page/index.md index dc214bd89586ebf..ede7f4b06af7131 100644 --- a/files/en-us/learn/server-side/django/home_page/index.md +++ b/files/en-us/learn/server-side/django/home_page/index.md @@ -231,11 +231,10 @@ Create a new file **base_generic.html** in **/locallibrary/catalog/templates/** {% endblock %} - + integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" + crossorigin="anonymous"> {% load static %} diff --git a/files/en-us/learn/server-side/django/models/index.md b/files/en-us/learn/server-side/django/models/index.md index aa2d492a95ad483..bf3523f3d717353 100644 --- a/files/en-us/learn/server-side/django/models/index.md +++ b/files/en-us/learn/server-side/django/models/index.md @@ -119,6 +119,10 @@ The following common arguments can be used when declaring many/most of the diffe - [null](https://docs.djangoproject.com/en/4.2/ref/models/fields/#null): If `True`, Django will store blank values as `NULL` in the database for fields where this is appropriate (a `CharField` will instead store an empty string). The default is `False`. - [blank](https://docs.djangoproject.com/en/4.2/ref/models/fields/#blank): If `True`, the field is allowed to be blank in your forms. The default is `False`, which means that Django's form validation will force you to enter a value. This is often used with `null=True`, because if you're going to allow blank values, you also want the database to be able to represent them appropriately. - [choices](https://docs.djangoproject.com/en/4.2/ref/models/fields/#choices): A group of choices for this field. If this is provided, the default corresponding form widget will be a select box with these choices instead of the standard text field. +- [unique](https://docs.djangoproject.com/en/4.2/ref/models/fields/#unique): + If `True`, ensures that the field value is unique across the database. + This can be used to prevent duplication of fields that can't have the same values. + The default is `False`. - [primary_key](https://docs.djangoproject.com/en/4.2/ref/models/fields/#primary-key): If `True`, sets the current field as the primary key for the model (A primary key is a special database column designated to uniquely identify all the different table records). If no field is specified as the primary key, Django will automatically add a field for this purpose. @@ -288,18 +292,35 @@ As mentioned above, we've created the genre as a model rather than as free text ```python class Genre(models.Model): """Model representing a book genre.""" - name = models.CharField(max_length=200, help_text='Enter a book genre (e.g. Science Fiction)') + name = models.CharField( + max_length=200, + unique=True, + help_text="Enter a book genre (e.g. Science Fiction, French Poetry etc.)" + ) def __str__(self): """String for representing the Model object.""" return self.name + + def get_absolute_url(self): + """Returns the url to access a particular genre instance.""" + return reverse('genre-detail', args=[str(self.id)]) ``` -The model has a single `CharField` field (`name`), which is used to describe the genre (this is limited to 200 characters and has some `help_text`). At the end of the model, we declare a `__str__()` method, which returns the name of the genre defined by a particular record. No verbose name has been defined, so the field will be called `Name` in forms. +The model has a single `CharField` field (`name`), which is used to describe the genre (this is limited to 200 characters and has some `help_text`). +We've set this field to be unique (`unique=True`) because there should only be one record for each genre. + +After the field, we declare a `__str__()` method, which returns the name of the genre defined by a particular record. No verbose name has been defined, so the field will be called `Name` in forms. +The final method, `get_absolute_url()` returns a URL that can be used to access a detail record for this model (for this to work, we will have to define a URL mapping that has the name `genre-detail`, and define an associated view and template). ### Book model -Copy the `Book` model below and again paste it into the bottom of your file. The `Book` model represents all information about an available book in a general sense, but not a particular physical "instance" or "copy" available for loan. The model uses a `CharField` to represent the book's `title` and `isbn`. For `isbn`, note how the first unnamed parameter explicitly sets the label as "ISBN" (otherwise, it would default to "Isbn"). We also set the parameter `unique` as `true` to ensure all books have a unique ISBN (the unique parameter makes the field value globally unique in a table). The model uses `TextField` for the `summary`, because this text may need to be quite long. +Copy the `Book` model below and again paste it into the bottom of your file. The `Book` model represents all information about an available book in a general sense, but not a particular physical "instance" or "copy" available for loan. + +The model uses a `CharField` to represent the book's `title` and `isbn`. +For `isbn`, note how the first unnamed parameter explicitly sets the label as "ISBN" (otherwise, it would default to "Isbn"). We also set the parameter `unique` as `true` to ensure all books have a unique ISBN (the unique parameter makes the field value globally unique in a table). +Unlike for the `isbn` (and the genre name), the `title` is is not set to be unique, because it is possible for different books to have the same name. +The model uses `TextField` for the `summary`, because this text may need to be quite long. ```python from django.urls import reverse # Used to generate URLs by reversing the URL patterns @@ -307,18 +328,21 @@ from django.urls import reverse # Used to generate URLs by reversing the URL pat class Book(models.Model): """Model representing a book (but not a specific copy of a book).""" title = models.CharField(max_length=200) + author = models.ForeignKey('Author', on_delete=models.RESTRICT, null=True) + # Foreign Key used because book can only have one author, but authors can have multiple books. + # Author as a string rather than object because it hasn't been declared yet in file. - # Foreign Key used because book can only have one author, but authors can have multiple books - # Author is a string rather than an object because it hasn't been declared yet in the file - author = models.ForeignKey('Author', on_delete=models.SET_NULL, null=True) - - summary = models.TextField(max_length=1000, help_text='Enter a brief description of the book') - isbn = models.CharField('ISBN', max_length=13, unique=True, - help_text='13 Character ISBN number') + summary = models.TextField( + max_length=1000, help_text="Enter a brief description of the book") + isbn = models.CharField('ISBN', max_length=13, + unique=True, + help_text='13 Character ISBN number') # ManyToManyField used because genre can contain many books. Books can cover many genres. # Genre class has already been defined so we can specify the object above. - genre = models.ManyToManyField(Genre, help_text='Select a genre for this book') + genre = models.ManyToManyField( + Genre, help_text="Select a genre for this book") def __str__(self): """String for representing the Model object.""" @@ -331,11 +355,11 @@ class Book(models.Model): The genre is a `ManyToManyField`, so that a book can have multiple genres and a genre can have many books. The author is declared as `ForeignKey`, so each book will only have one author, but an author may have many books (in practice a book might have multiple authors, but not in this implementation!) -In both field types the related model class is declared as the first unnamed parameter using either the model class or a string containing the name of the related model. You must use the name of the model as a string if the associated class has not yet been defined in this file before it is referenced! The other parameters of interest in the `author` field are `null=True`, which allows the database to store a `Null` value if no author is selected, and `on_delete=models.SET_NULL`, which will set the value of the book's author field to `Null` if the associated author record is deleted. +In both field types the related model class is declared as the first unnamed parameter using either the model class or a string containing the name of the related model. You must use the name of the model as a string if the associated class has not yet been defined in this file before it is referenced! The other parameters of interest in the `author` field are `null=True`, which allows the database to store a `Null` value if no author is selected, and `on_delete=models.RESTRICT`, which will prevent the book's associated author being deleted if it is referenced by any book. -> **Warning:** By default `on_delete=models.CASCADE`, which means that if the author was deleted, this book would be deleted too! We use `SET_NULL` here, but we could also use `PROTECT` or `RESTRICT` to prevent the author being deleted while any book uses it. +> **Warning:** By default `on_delete=models.CASCADE`, which means that if the author was deleted, this book would be deleted too! We use `RESTRICT` here, but we could also use `PROTECT` to prevent the author being deleted while any book uses it or `SET_NULL` to set the book's author to `Null` if the record is deleted. -The model also defines `__str__()`, using the book's `title` field to represent a `Book` record. The final method, `get_absolute_url()` returns a URL that can be used to access a detail record for this model (for this to work, we will have to define a URL mapping that has the name `book-detail`, and define an associated view and template). +The model also defines `__str__()`, using the book's `title` field to represent a `Book` record. The final method, `get_absolute_url()` returns a URL that can be used to access a detail record for this model (we will have to define a URL mapping that has the name `book-detail`, and define an associated view and template). ### BookInstance model @@ -350,8 +374,10 @@ Some of the fields and methods will now be familiar. The model uses: import uuid # Required for unique book instances class BookInstance(models.Model): + """Model representing a specific copy of a book (i.e. that can be borrowed from the library).""" - id = models.UUIDField(primary_key=True, default=uuid.uuid4, help_text='Unique ID for this particular book across whole library') + id = models.UUIDField(primary_key=True, default=uuid.uuid4, + help_text="Unique ID for this particular book across whole library") book = models.ForeignKey('Book', on_delete=models.RESTRICT, null=True) imprint = models.CharField(max_length=200) due_back = models.DateField(null=True, blank=True) @@ -381,7 +407,8 @@ class BookInstance(models.Model): We additionally declare a few new types of field: -- `UUIDField` is used for the `id` field to set it as the `primary_key` for this model. This type of field allocates a globally unique value for each instance (one for every book you can find in the library). +- `UUIDField` is used for the `id` field to set it as the `primary_key` for this model. + This type of field allocates a globally unique value for each instance (one for every book you can find in the library). - `DateField` is used for the `due_back` date (at which the book is expected to become available after being borrowed or in maintenance). This value can be `blank` or `null` (needed for when the book is available). The model metadata (`Class Meta`) uses this field to order records when they are returned in a query. - `status` is a `CharField` that defines a choice/selection list. As you can see, we define a tuple containing tuples of key-value pairs and pass it to the choices argument. The value in a key/value pair is a display value that a user can select, while the keys are the values that are actually saved if the option is selected. We've also set a default value of 'm' (maintenance) as books will initially be created unavailable before they are stocked on the shelves. diff --git a/files/en-us/learn/server-side/django/testing/index.md b/files/en-us/learn/server-side/django/testing/index.md index 477d6513237c343..95ecf15f747a947 100644 --- a/files/en-us/learn/server-side/django/testing/index.md +++ b/files/en-us/learn/server-side/django/testing/index.md @@ -925,17 +925,39 @@ While there are numerous other test tools that you can use, we'll just highlight ## Challenge yourself -There are a lot more models and views we can test. As a simple task, try to create a test case for the `AuthorCreate` view. +There are a lot more models and views we can test. As a challenge, try to create a test case for the `AuthorCreate` view. ```python class AuthorCreate(PermissionRequiredMixin, CreateView): model = Author - fields = '__all__' - initial = {'date_of_death':'12/10/2016'} - permission_required = 'catalog.can_mark_returned' + fields = ['first_name', 'last_name', 'date_of_birth', 'date_of_death'] + initial = {'date_of_death': '11/11/2023'} + permission_required = 'catalog.add_author' ``` -Remember that you need to check anything that you specify or that is part of the design. This will include who has access, the initial date, the template used, and where the view redirects on success. +Remember that you need to check anything that you specify or that is part of the design. +This will include who has access, the initial date, the template used, and where the view redirects on success. + +You might use the following code to set up your test and assign your user the appropriate permission + +```python +class AuthorCreateViewTest(TestCase): + """Test case for the AuthorCreate view (Created as Challenge).""" + + def setUp(self): + # Create a user + test_user = User.objects.create_user( + username='test_user', password='some_password') + + content_typeAuthor = ContentType.objects.get_for_model(Author) + permAddAuthor = Permission.objects.get( + codename="add_author", + content_type=content_typeAuthor, + ) + + test_user.user_permissions.add(permAddAuthor) + test_user.save() +``` ## Summary From 2f73a717381fef092be73baec3deb8aae19d67b5 Mon Sep 17 00:00:00 2001 From: wbamberg Date: Thu, 9 Nov 2023 23:49:27 -0800 Subject: [PATCH 38/52] Fix issue 30014: pushState is not asynchronous (#30169) --- files/en-us/web/api/history/pushstate/index.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/files/en-us/web/api/history/pushstate/index.md b/files/en-us/web/api/history/pushstate/index.md index d41c82d30b28cb2..fbfb15c08b83ca3 100644 --- a/files/en-us/web/api/history/pushstate/index.md +++ b/files/en-us/web/api/history/pushstate/index.md @@ -12,8 +12,6 @@ In an [HTML](/en-US/docs/Web/HTML) document, the **`history.pushState()`** method adds an entry to the browser's session history stack. -This method is {{glossary("asynchronous")}}. Add a listener for the {{domxref("Window/popstate_event", "popstate")}} event in order to determine when the navigation has completed. The `state` parameter will be available in it. - ## Syntax ```js-nolint From 44cf523714745d626317192bfbe849b47144f3ab Mon Sep 17 00:00:00 2001 From: Onkar Ruikar <87750369+OnkarRuikar@users.noreply.github.com> Date: Fri, 10 Nov 2023 18:56:54 +0530 Subject: [PATCH 39/52] Synchronize with BCD v5.3.30 (#30179) * Synchronize with BCD v5.3.30 * Update index.md --------- Co-authored-by: OnkarRuikar --- .../web/api/beforeunloadevent/returnvalue/index.md | 2 +- .../canvasrenderingcontext2d/fontstretch/index.md | 4 +--- .../fontvariantcaps/index.md | 4 +--- .../web/api/canvasrenderingcontext2d/index.md | 4 ++-- files/en-us/web/api/html_sanitizer_api/index.md | 2 +- .../api/htmlelement/beforetoggle_event/index.md | 4 +--- .../web/api/htmlelement/toggle_event/index.md | 4 +--- files/en-us/web/api/navigator/donottrack/index.md | 3 ++- .../api/navigator/globalprivacycontrol/index.md | 3 ++- files/en-us/web/api/navigator/index.md | 6 +++--- files/en-us/web/api/navigator/usb/index.md | 4 +--- files/en-us/web/api/notification/index.md | 2 +- .../api/notification/requireinteraction/index.md | 4 +--- .../api/offscreencanvasrenderingcontext2d/index.md | 4 ++-- .../deliverytype/index.md | 2 +- files/en-us/web/api/screen/index.md | 2 +- files/en-us/web/api/videocolorspace/index.md | 2 +- .../api/videocolorspace/videocolorspace/index.md | 4 +--- files/en-us/web/api/window/clearimmediate/index.md | 2 +- files/en-us/web/api/window/setimmediate/index.md | 2 +- .../web/api/windowclient/ancestororigins/index.md | 4 +++- files/en-us/web/api/windowclient/index.md | 2 +- .../workernavigator/globalprivacycontrol/index.md | 3 ++- files/en-us/web/api/workernavigator/index.md | 4 ++-- files/en-us/web/api/workernavigator/usb/index.md | 4 +--- files/en-us/web/css/-webkit-line-clamp/index.md | 2 +- files/en-us/web/css/@scope/index.md | 4 +++- files/en-us/web/css/_colon_popover-open/index.md | 4 +--- files/en-us/web/css/break-after/index.md | 4 ++-- files/en-us/web/css/break-before/index.md | 4 ++-- files/en-us/web/css/offset-position/index.md | 4 +--- files/en-us/web/html/element/link/index.md | 2 +- .../element/script/type/speculationrules/index.md | 12 +++++++----- files/en-us/web/http/headers/dnt/index.md | 3 ++- .../web/http/headers/permissions-policy/index.md | 4 ++-- .../publickey-credentials-get/index.md | 4 +--- files/en-us/web/http/headers/sec-gpc/index.md | 3 ++- files/en-us/web/http/headers/tk/index.md | 3 ++- .../global_objects/set/difference/index.md | 4 +++- .../reference/global_objects/set/index.md | 14 +++++++------- .../global_objects/set/intersection/index.md | 4 +++- .../global_objects/set/isdisjointfrom/index.md | 4 +++- .../global_objects/set/issubsetof/index.md | 4 +++- .../global_objects/set/issupersetof/index.md | 4 +++- .../set/symmetricdifference/index.md | 4 +++- .../reference/global_objects/set/union/index.md | 4 +++- 46 files changed, 90 insertions(+), 86 deletions(-) diff --git a/files/en-us/web/api/beforeunloadevent/returnvalue/index.md b/files/en-us/web/api/beforeunloadevent/returnvalue/index.md index 7a09b3fc509c3a2..f8ff582ec9e6b80 100644 --- a/files/en-us/web/api/beforeunloadevent/returnvalue/index.md +++ b/files/en-us/web/api/beforeunloadevent/returnvalue/index.md @@ -8,7 +8,7 @@ status: browser-compat: api.BeforeUnloadEvent.returnValue --- -{{APIRef("HTML DOM")}} +{{APIRef("HTML DOM")}}{{deprecated_header}} The **`returnValue`** property of the {{domxref("BeforeUnloadEvent")}} interface, when set to a truthy value, triggers a browser-generated confirmation dialog asking users to confirm if they _really_ want to leave the page when they try to close or reload it, or navigate somewhere else. This is intended to help prevent loss of unsaved data. diff --git a/files/en-us/web/api/canvasrenderingcontext2d/fontstretch/index.md b/files/en-us/web/api/canvasrenderingcontext2d/fontstretch/index.md index cbe7f440da6afc2..c31702e6a1486fe 100644 --- a/files/en-us/web/api/canvasrenderingcontext2d/fontstretch/index.md +++ b/files/en-us/web/api/canvasrenderingcontext2d/fontstretch/index.md @@ -3,12 +3,10 @@ title: "CanvasRenderingContext2D: fontStretch property" short-title: fontStretch slug: Web/API/CanvasRenderingContext2D/fontStretch page-type: web-api-instance-property -status: - - experimental browser-compat: api.CanvasRenderingContext2D.fontStretch --- -{{APIRef}}{{SeeCompatTable}} +{{APIRef}} The **`CanvasRenderingContext2D.fontStretch`** property of the [Canvas API](/en-US/docs/Web/API/Canvas_API) specifies how the font may be expanded or condensed when drawing text. diff --git a/files/en-us/web/api/canvasrenderingcontext2d/fontvariantcaps/index.md b/files/en-us/web/api/canvasrenderingcontext2d/fontvariantcaps/index.md index f3dc3505c026a52..f8d4e978cf77e0f 100644 --- a/files/en-us/web/api/canvasrenderingcontext2d/fontvariantcaps/index.md +++ b/files/en-us/web/api/canvasrenderingcontext2d/fontvariantcaps/index.md @@ -3,12 +3,10 @@ title: "CanvasRenderingContext2D: fontVariantCaps property" short-title: fontVariantCaps slug: Web/API/CanvasRenderingContext2D/fontVariantCaps page-type: web-api-instance-property -status: - - experimental browser-compat: api.CanvasRenderingContext2D.fontVariantCaps --- -{{APIRef}}{{SeeCompatTable}} +{{APIRef}} The **`CanvasRenderingContext2D.fontVariantCaps`** property of the [Canvas API](/en-US/docs/Web/API/Canvas_API) specifies an alternative capitalization of the rendered text. diff --git a/files/en-us/web/api/canvasrenderingcontext2d/index.md b/files/en-us/web/api/canvasrenderingcontext2d/index.md index 8c49f5da2b2c5cf..9f0be69529bc003 100644 --- a/files/en-us/web/api/canvasrenderingcontext2d/index.md +++ b/files/en-us/web/api/canvasrenderingcontext2d/index.md @@ -120,9 +120,9 @@ The following properties control how text is laid out. - : Letter spacing. Default: `0px`. - {{domxref("CanvasRenderingContext2D.fontKerning")}} - : Font kerning. Possible values: `auto` (default), `normal`, `none`. -- {{domxref("CanvasRenderingContext2D.fontStretch")}} {{experimental_inline}} +- {{domxref("CanvasRenderingContext2D.fontStretch")}} - : Font stretch. Possible values: `ultra-condensed`, `extra-condensed`, `condensed`, `semi-condensed`, `normal` (default), `semi-expanded`, `expanded`, `extra-expanded`, `ultra-expanded`. -- {{domxref("CanvasRenderingContext2D.fontVariantCaps")}} {{experimental_inline}} +- {{domxref("CanvasRenderingContext2D.fontVariantCaps")}} - : Font variant caps. Possible values: `normal` (default), `small-caps`, `all-small-caps`, `petite-caps`, `all-petite-caps`, `unicase`, `titling-caps`. - {{domxref("CanvasRenderingContext2D.textRendering")}} - : Text rendering. Possible values: `auto` (default), `optimizeSpeed`, `optimizeLegibility`, `geometricPrecision`. diff --git a/files/en-us/web/api/html_sanitizer_api/index.md b/files/en-us/web/api/html_sanitizer_api/index.md index 9c723013d59440b..a3fbd81c76685f7 100644 --- a/files/en-us/web/api/html_sanitizer_api/index.md +++ b/files/en-us/web/api/html_sanitizer_api/index.md @@ -7,7 +7,7 @@ status: browser-compat: api.Sanitizer --- -{{DefaultAPISidebar("HTML Sanitizer API")}} +{{DefaultAPISidebar("HTML Sanitizer API")}}{{SeeCompatTable}} > **Note:** This documentation reflects stale browser implementations. > The specification has changed significantly since the docs were written, and they will need to be updated once browser implementations catch up. diff --git a/files/en-us/web/api/htmlelement/beforetoggle_event/index.md b/files/en-us/web/api/htmlelement/beforetoggle_event/index.md index bd8154bade91473..0ccd5da271d36ab 100644 --- a/files/en-us/web/api/htmlelement/beforetoggle_event/index.md +++ b/files/en-us/web/api/htmlelement/beforetoggle_event/index.md @@ -2,12 +2,10 @@ title: "HTMLElement: beforetoggle event" slug: Web/API/HTMLElement/beforetoggle_event page-type: web-api-event -status: - - experimental browser-compat: api.HTMLElement.beforetoggle_event --- -{{APIRef}}{{SeeCompatTable}} +{{APIRef}} The **`beforetoggle`** event of the {{domxref("HTMLElement")}} interface fires on a {{domxref("Popover_API", "popover", "", "nocode")}} element (i.e. one that has a valid [`popover`](/en-US/docs/Web/HTML/Global_attributes/popover) attribute) just before it is shown or hidden. diff --git a/files/en-us/web/api/htmlelement/toggle_event/index.md b/files/en-us/web/api/htmlelement/toggle_event/index.md index 9bbbd9fdafacf3f..5f9e1b95f6b4ce2 100644 --- a/files/en-us/web/api/htmlelement/toggle_event/index.md +++ b/files/en-us/web/api/htmlelement/toggle_event/index.md @@ -2,12 +2,10 @@ title: "HTMLElement: toggle event" slug: Web/API/HTMLElement/toggle_event page-type: web-api-event -status: - - experimental browser-compat: api.HTMLElement.toggle_event --- -{{APIRef}}{{SeeCompatTable}} +{{APIRef}} The **`toggle`** event of the {{domxref("HTMLElement")}} interface fires on a {{domxref("Popover_API", "popover", "", "nocode")}} element (i.e. one that has a valid [`popover`](/en-US/docs/Web/HTML/Global_attributes/popover) attribute) just after it is shown or hidden. diff --git a/files/en-us/web/api/navigator/donottrack/index.md b/files/en-us/web/api/navigator/donottrack/index.md index 1b28e10b43d8738..6200eff76e72e19 100644 --- a/files/en-us/web/api/navigator/donottrack/index.md +++ b/files/en-us/web/api/navigator/donottrack/index.md @@ -5,10 +5,11 @@ slug: Web/API/Navigator/doNotTrack page-type: web-api-instance-property status: - deprecated + - non-standard browser-compat: api.Navigator.doNotTrack --- -{{ApiRef("HTML DOM")}}{{Deprecated_header}} +{{ApiRef("HTML DOM")}}{{Deprecated_header}}{{non-standard_header}} The **`Navigator.doNotTrack`** property returns the user's Do Not Track setting, which indicates whether the user is requesting websites and advertisers to not track them. diff --git a/files/en-us/web/api/navigator/globalprivacycontrol/index.md b/files/en-us/web/api/navigator/globalprivacycontrol/index.md index 658b095cfe7cec3..787cbb8420b0fb1 100644 --- a/files/en-us/web/api/navigator/globalprivacycontrol/index.md +++ b/files/en-us/web/api/navigator/globalprivacycontrol/index.md @@ -5,10 +5,11 @@ slug: Web/API/Navigator/globalPrivacyControl page-type: web-api-instance-property status: - experimental + - non-standard browser-compat: api.Navigator.globalPrivacyControl --- -{{APIRef("DOM")}}{{SeeCompatTable}} +{{APIRef("DOM")}}{{SeeCompatTable}}{{non-standard_header}} The **`Navigator.globalPrivacyControl`** read-only property returns the user's [Global Privacy Control](globalprivacycontrol.org) setting for the current website. This setting indicates whether the user consents to the website or service selling or sharing their personal information with third parties. diff --git a/files/en-us/web/api/navigator/index.md b/files/en-us/web/api/navigator/index.md index 74ef922cd089c01..6d5cb8ca2b7242a 100644 --- a/files/en-us/web/api/navigator/index.md +++ b/files/en-us/web/api/navigator/index.md @@ -73,7 +73,7 @@ _Doesn't inherit any properties._ - : Returns a {{domxref("ServiceWorkerContainer")}} object, which provides access to registration, removal, upgrade, and communication with the {{domxref("ServiceWorker")}} objects for the [associated document](https://html.spec.whatwg.org/multipage/browsers.html#concept-document-window). - {{domxref("Navigator.storage")}} {{ReadOnlyInline}} - : Returns the singleton {{domxref('StorageManager')}} object used for managing persistence permissions and estimating available storage on a site-by-site/app-by-app basis. -- {{domxref("Navigator.usb")}} {{ReadOnlyInline}} {{Experimental_Inline}} +- {{domxref("Navigator.usb")}} {{ReadOnlyInline}} - : Returns a {{domxref("USB")}} object for the current document, providing access to [WebUSB API](/en-US/docs/Web/API/WebUSB_API) functionality. - {{domxref("Navigator.userActivation")}} {{ReadOnlyInline}} - : Returns a {{domxref("UserActivation")}} object containing information about the current window's user activation state. @@ -96,7 +96,7 @@ _Doesn't inherit any properties._ - {{domxref("Navigator.buildID")}} {{ReadOnlyInline}} {{Non-standard_Inline}} - : Returns the build identifier of the browser. In modern browsers this property now returns a fixed timestamp as a privacy measure, e.g. `20181001000000` in Firefox 64 onwards. -- {{domxref("Navigator.globalPrivacyControl")}} {{ReadOnlyInline}} {{Experimental_Inline}} +- {{domxref("Navigator.globalPrivacyControl")}} {{ReadOnlyInline}} {{Experimental_Inline}} {{non-standard_inline}} - : Returns a boolean indicating a user's consent to their information being shared or sold. - {{domxref("Navigator.securitypolicy")}} {{Non-standard_Inline}} - : Returns an empty string. In Netscape 4.7x, returns "US & CA domestic policy" or "Export policy". @@ -113,7 +113,7 @@ _Doesn't inherit any properties._ - : Always returns `'Netscape'`, in any browser. - {{domxref("Navigator.appVersion")}} {{ReadOnlyInline}} {{Deprecated_Inline}} - : Returns the version of the browser as a string. Do not rely on this property to return the correct value. -- {{domxref("Navigator.doNotTrack")}} {{ReadOnlyInline}} {{Deprecated_Inline}} +- {{domxref("Navigator.doNotTrack")}} {{ReadOnlyInline}} {{Deprecated_Inline}} {{non-standard_inline}} - : Reports the value of the user's do-not-track preference. When this value is "1", your website or application should not track the user. - {{domxref("Navigator.mimeTypes")}} {{ReadOnlyInline}} {{Deprecated_Inline}} - : Returns an {{domxref("MimeTypeArray")}} listing the MIME types supported by the browser. diff --git a/files/en-us/web/api/navigator/usb/index.md b/files/en-us/web/api/navigator/usb/index.md index 04ed5e4532cf647..cc682209927f9e7 100644 --- a/files/en-us/web/api/navigator/usb/index.md +++ b/files/en-us/web/api/navigator/usb/index.md @@ -3,12 +3,10 @@ title: "Navigator: usb property" short-title: usb slug: Web/API/Navigator/usb page-type: web-api-instance-property -status: - - experimental browser-compat: api.Navigator.usb --- -{{SeeCompatTable}}{{APIRef("WebUSB API")}} +{{APIRef("WebUSB API")}} The **`usb`** read-only property of the {{domxref("Navigator")}} interface returns a {{domxref("USB")}} object for the current document, providing access to [WebUSB API](/en-US/docs/Web/API/WebUSB_API) functionality. diff --git a/files/en-us/web/api/notification/index.md b/files/en-us/web/api/notification/index.md index 0032bff4c24e036..8258fce24bd5ff3 100644 --- a/files/en-us/web/api/notification/index.md +++ b/files/en-us/web/api/notification/index.md @@ -57,7 +57,7 @@ These properties are available only on instances of the `Notification` object. - : The URL of an image to be displayed as part of the notification, as specified in the constructor's `options` parameter. - {{domxref("Notification.renotify")}} {{ReadOnlyInline}} {{Experimental_Inline}} - : Specifies whether the user should be notified after a new notification replaces an old one. -- {{domxref("Notification.requireInteraction")}} {{ReadOnlyInline}} {{Experimental_Inline}} +- {{domxref("Notification.requireInteraction")}} {{ReadOnlyInline}} - : A boolean value indicating that a notification should remain active until the user clicks or dismisses it, rather than closing automatically. - {{domxref("Notification.silent")}} {{ReadOnlyInline}} - : Specifies whether the notification should be silent — i.e., no sounds or vibrations should be issued, regardless of the device settings. diff --git a/files/en-us/web/api/notification/requireinteraction/index.md b/files/en-us/web/api/notification/requireinteraction/index.md index 796d90c85d73ecd..e9ff586ac459f61 100644 --- a/files/en-us/web/api/notification/requireinteraction/index.md +++ b/files/en-us/web/api/notification/requireinteraction/index.md @@ -3,12 +3,10 @@ title: "Notification: requireInteraction property" short-title: requireInteraction slug: Web/API/Notification/requireInteraction page-type: web-api-instance-property -status: - - experimental browser-compat: api.Notification.requireInteraction --- -{{APIRef("Web Notifications")}}{{AvailableInWorkers}}{{SecureContext_Header}}{{SeeCompatTable}} +{{APIRef("Web Notifications")}}{{AvailableInWorkers}}{{SecureContext_Header}} The **`requireInteraction`** read-only property of the {{domxref("Notification")}} interface returns a boolean value indicating that a notification should remain active until the user clicks or dismisses it, rather than closing automatically. diff --git a/files/en-us/web/api/offscreencanvasrenderingcontext2d/index.md b/files/en-us/web/api/offscreencanvasrenderingcontext2d/index.md index 6a2901d458a0e02..12c7ec9f8ea1ebe 100644 --- a/files/en-us/web/api/offscreencanvasrenderingcontext2d/index.md +++ b/files/en-us/web/api/offscreencanvasrenderingcontext2d/index.md @@ -122,9 +122,9 @@ The following properties control how text is laid out. - : Letter spacing. Default: `0px`. - {{domxref("CanvasRenderingContext2D.fontKerning")}} - : Font kerning. Possible values: `auto` (default), `normal`, `none`. -- {{domxref("CanvasRenderingContext2D.fontStretch")}} {{experimental_inline}} +- {{domxref("CanvasRenderingContext2D.fontStretch")}} - : Font stretch. Possible values: `ultra-condensed`, `extra-condensed`, `condensed`, `semi-condensed`, `normal` (default), `semi-expanded`, `expanded`, `extra-expanded`, `ultra-expanded`. -- {{domxref("CanvasRenderingContext2D.fontVariantCaps")}} {{experimental_inline}} +- {{domxref("CanvasRenderingContext2D.fontVariantCaps")}} - : Font variant caps. Possible values: `normal` (default), `small-caps`, `all-small-caps`, `petite-caps`, `all-petite-caps`, `unicase`, `titling-caps`. - {{domxref("CanvasRenderingContext2D.textRendering")}} {{experimental_inline}} - : Text rendering. Possible values: `auto` (default), `optimizeSpeed`, `optimizeLegibility`, `geometricPrecision`. diff --git a/files/en-us/web/api/performanceresourcetiming/deliverytype/index.md b/files/en-us/web/api/performanceresourcetiming/deliverytype/index.md index b05b8b820da353b..10ad89c09a3dcea 100644 --- a/files/en-us/web/api/performanceresourcetiming/deliverytype/index.md +++ b/files/en-us/web/api/performanceresourcetiming/deliverytype/index.md @@ -18,7 +18,7 @@ A string, which can be one of the following values: - `"cache"` - : The resource was retrieved from the cache. -- `"navigational-prefetch"` +- `"navigational-prefetch"` {{experimental_inline}} - : The resource was retrieved from a prefetched response stored in an in-memory cache via the [Speculation Rules API](/en-US/docs/Web/API/Speculation_Rules_API). - `""` (empty string) - : Returned if none of the above delivery types apply. diff --git a/files/en-us/web/api/screen/index.md b/files/en-us/web/api/screen/index.md index 09702bb51ef0652..28b309db32e93fa 100644 --- a/files/en-us/web/api/screen/index.md +++ b/files/en-us/web/api/screen/index.md @@ -48,7 +48,7 @@ The following properties are specified as part of the [Window Management API](/e - : A number representing the y-coordinate (top edge) of the available screen area. - {{domxref("ScreenDetailed.left", "Screen.left")}} {{ReadOnlyInline}} {{Non-standard_Inline}} - : A number representing the x-coordinate (left-hand edge) of the total screen area. -- {{domxref("ScreenDetailed.top", "Screen.top")}} {{ReadOnlyInline}} {{Non-standard_Inline}} +- {{domxref("ScreenDetailed.top", "Screen.top")}} {{ReadOnlyInline}} {{Non-standard_Inline}} {{deprecated_inline}} - : A number representing the y-coordinate (top edge) of the total screen area. ## Instance methods diff --git a/files/en-us/web/api/videocolorspace/index.md b/files/en-us/web/api/videocolorspace/index.md index f826ae9a82eae39..a0c1ae36dfa5868 100644 --- a/files/en-us/web/api/videocolorspace/index.md +++ b/files/en-us/web/api/videocolorspace/index.md @@ -11,7 +11,7 @@ The **`VideoColorSpace`** interface of the {{domxref('WebCodecs API','','',' ')} ## Constructor -- {{domxref("VideoColorSpace.VideoColorSpace", "VideoColorSpace()")}} {{Experimental_Inline}} +- {{domxref("VideoColorSpace.VideoColorSpace", "VideoColorSpace()")}} - : Creates a new `VideoColorSpace` object. ## Instance properties diff --git a/files/en-us/web/api/videocolorspace/videocolorspace/index.md b/files/en-us/web/api/videocolorspace/videocolorspace/index.md index 3ee874f2356bf4f..69dbf7bb36019a4 100644 --- a/files/en-us/web/api/videocolorspace/videocolorspace/index.md +++ b/files/en-us/web/api/videocolorspace/videocolorspace/index.md @@ -3,12 +3,10 @@ title: "VideoColorSpace: VideoColorSpace() constructor" short-title: VideoColorSpace() slug: Web/API/VideoColorSpace/VideoColorSpace page-type: web-api-constructor -status: - - experimental browser-compat: api.VideoColorSpace.VideoColorSpace --- -{{APIRef("WebCodecs API")}}{{SeeCompatTable}} +{{APIRef("WebCodecs API")}} The **`VideoColorSpace()`** constructor creates a new {{domxref("VideoColorSpace")}} object which represents a video color space. diff --git a/files/en-us/web/api/window/clearimmediate/index.md b/files/en-us/web/api/window/clearimmediate/index.md index 9ffedeca96947c3..8cd319cbf425fe8 100644 --- a/files/en-us/web/api/window/clearimmediate/index.md +++ b/files/en-us/web/api/window/clearimmediate/index.md @@ -9,7 +9,7 @@ status: browser-compat: api.Window.clearImmediate --- -{{APIRef("HTML DOM")}} {{deprecated_header}} +{{APIRef("HTML DOM")}} {{deprecated_header}}{{non-standard_header}} This method clears the action specified by {{DOMxRef("window.setImmediate")}}. diff --git a/files/en-us/web/api/window/setimmediate/index.md b/files/en-us/web/api/window/setimmediate/index.md index 79c05d123ba653d..109d62af8246d24 100644 --- a/files/en-us/web/api/window/setimmediate/index.md +++ b/files/en-us/web/api/window/setimmediate/index.md @@ -9,7 +9,7 @@ status: browser-compat: api.Window.setImmediate --- -{{APIRef("HTML DOM")}} {{deprecated_header}} +{{APIRef("HTML DOM")}} {{deprecated_header}}{{non-standard_header}} This method is used to break up long running operations and run a callback function immediately after the browser has completed other operations such as events and display updates. diff --git a/files/en-us/web/api/windowclient/ancestororigins/index.md b/files/en-us/web/api/windowclient/ancestororigins/index.md index 006858cfa99b101..427448e0607838d 100644 --- a/files/en-us/web/api/windowclient/ancestororigins/index.md +++ b/files/en-us/web/api/windowclient/ancestororigins/index.md @@ -3,10 +3,12 @@ title: "WindowClient: ancestorOrigins property" short-title: ancestorOrigins slug: Web/API/WindowClient/ancestorOrigins page-type: web-api-instance-property +status: + - experimental browser-compat: api.WindowClient.ancestorOrigins --- -{{APIRef("Service Workers API")}} +{{APIRef("Service Workers API")}}{{SeeCompatTable}} The **`ancestorOrigins`** read-only property of the {{domxref("WindowClient")}} interface is an array of strings listing the origins of all ancestors of the browsing context represented by this `WindowClient` in reverse order. diff --git a/files/en-us/web/api/windowclient/index.md b/files/en-us/web/api/windowclient/index.md index 098bcc9b7448e20..db915b5be92cf29 100644 --- a/files/en-us/web/api/windowclient/index.md +++ b/files/en-us/web/api/windowclient/index.md @@ -24,7 +24,7 @@ _`WindowClient` inherits methods from its parent interface, {{domxref("Client")} _`WindowClient` inherits properties from its parent interface, {{domxref("Client")}}._ -- {{domxref("WindowClient.ancestorOrigins")}} {{ReadOnlyInline}} +- {{domxref("WindowClient.ancestorOrigins")}} {{ReadOnlyInline}} {{experimental_inline}} - : An array of strings that indicates the ancestor origins of the browsing context represented by this `WindowClient` in reverse order. - {{domxref("WindowClient.focused")}} {{ReadOnlyInline}} - : A boolean that indicates whether the current client has focus. diff --git a/files/en-us/web/api/workernavigator/globalprivacycontrol/index.md b/files/en-us/web/api/workernavigator/globalprivacycontrol/index.md index a17a305cc72f09b..5a14905d480039d 100644 --- a/files/en-us/web/api/workernavigator/globalprivacycontrol/index.md +++ b/files/en-us/web/api/workernavigator/globalprivacycontrol/index.md @@ -5,10 +5,11 @@ slug: Web/API/WorkerNavigator/globalPrivacyControl page-type: web-api-instance-property status: - experimental + - non-standard browser-compat: api.WorkerNavigator.globalPrivacyControl --- -{{APIRef("DOM")}}{{SeeCompatTable}} +{{APIRef("DOM")}}{{SeeCompatTable}}{{non-standard_header}} The **`WorkerNavigator.globalPrivacyControl`** read-only property returns the user's Global Privacy Control setting for the current website. This setting indicates whether the user consents to the website or service selling or sharing their personal information with third parties. diff --git a/files/en-us/web/api/workernavigator/index.md b/files/en-us/web/api/workernavigator/index.md index b7e9d3d9bf672d4..698844f6cd0b667 100644 --- a/files/en-us/web/api/workernavigator/index.md +++ b/files/en-us/web/api/workernavigator/index.md @@ -21,7 +21,7 @@ _The `WorkerNavigator` interface doesn't inherit any property._ - : Returns the version of the browser as a string. Do not rely on this property to return the correct value. - {{DOMxRef("WorkerNavigator.connection")}} {{ReadOnlyInline}} - : Provides a {{DOMxRef("NetworkInformation")}} object containing information about the network connection of a device. -- {{domxref("WorkerNavigator.globalPrivacyControl")}} {{ReadOnlyInline}} {{Experimental_Inline}} +- {{domxref("WorkerNavigator.globalPrivacyControl")}} {{ReadOnlyInline}} {{Experimental_Inline}} {{non-standard_inline}} - : Returns a boolean indicating a user's consent to their information being shared or sold. - {{domxref("WorkerNavigator.gpu")}} {{ReadOnlyInline}} {{Experimental_Inline}} - : Returns the {{domxref("GPU")}} object for the current worker context. The entry point for the {{domxref("WebGPU_API", "WebGPU API", "", "nocode")}}. @@ -47,7 +47,7 @@ _The `WorkerNavigator` interface doesn't inherit any property._ - : Returns a {{domxref("Serial")}} object, which represents the entry point into the {{domxref("Web Serial API")}} to enable the control of serial ports. - {{DOMxRef("WorkerNavigator.storage")}} {{ReadOnlyInline}} - : Returns a {{DOMxRef('StorageManager')}} interface for managing persistence permissions and estimating available storage. -- {{domxref("WorkerNavigator.usb")}} {{ReadOnlyInline}} {{Experimental_Inline}} +- {{domxref("WorkerNavigator.usb")}} {{ReadOnlyInline}} - : Returns a {{domxref("USB")}} object for the current document, providing access to [WebUSB API](/en-US/docs/Web/API/WebUSB_API) functionality. - {{DOMxRef("WorkerNavigator.userAgent")}} {{ReadOnlyInline}} - : Returns the user agent string for the current browser. diff --git a/files/en-us/web/api/workernavigator/usb/index.md b/files/en-us/web/api/workernavigator/usb/index.md index f64918fdea701ba..b6e1d954b0a2795 100644 --- a/files/en-us/web/api/workernavigator/usb/index.md +++ b/files/en-us/web/api/workernavigator/usb/index.md @@ -3,12 +3,10 @@ title: "WorkerNavigator: usb property" short-title: usb slug: Web/API/WorkerNavigator/usb page-type: web-api-instance-property -status: - - experimental browser-compat: api.WorkerNavigator.usb --- -{{SeeCompatTable}}{{APIRef("WebUSB API")}} +{{APIRef("WebUSB API")}} The **`usb`** read-only property of the {{domxref("WorkerNavigator")}} interface returns a {{domxref("USB")}} object for the current document, providing access to [WebUSB API](/en-US/docs/Web/API/WebUSB_API) functionality. diff --git a/files/en-us/web/css/-webkit-line-clamp/index.md b/files/en-us/web/css/-webkit-line-clamp/index.md index 7d2fcb7f017e248..ed9e141c567744f 100644 --- a/files/en-us/web/css/-webkit-line-clamp/index.md +++ b/files/en-us/web/css/-webkit-line-clamp/index.md @@ -37,7 +37,7 @@ When applied to anchor elements, the truncating can happen in the middle of the ### Values -- `none` +- `none` {{experimental_inline}} - : This value specifies that the content won't be clamped. - {{cssxref("integer")}} - : This value specifies the number of lines after which the content will be clamped. It must be greater than 0. diff --git a/files/en-us/web/css/@scope/index.md b/files/en-us/web/css/@scope/index.md index 956f04a456162d6..86c2d7f8237fc07 100644 --- a/files/en-us/web/css/@scope/index.md +++ b/files/en-us/web/css/@scope/index.md @@ -2,10 +2,12 @@ title: "@scope" slug: Web/CSS/@scope page-type: css-at-rule +status: + - experimental browser-compat: css.at-rules.scope --- -{{CSSRef}} +{{CSSRef}}{{SeeCompatTable}} The **`@scope`** [CSS](/en-US/docs/Web/CSS) [at-rule](/en-US/docs/Web/CSS/At-rule) lets you specify CSS rules and assign values to a limited subtree of the DOM without adding extra specificity to selectors. This makes it easier to override the CSS. diff --git a/files/en-us/web/css/_colon_popover-open/index.md b/files/en-us/web/css/_colon_popover-open/index.md index b837f61562733fa..4f8578a4b85bc0c 100644 --- a/files/en-us/web/css/_colon_popover-open/index.md +++ b/files/en-us/web/css/_colon_popover-open/index.md @@ -2,12 +2,10 @@ title: ":popover-open" slug: Web/CSS/:popover-open page-type: css-pseudo-class -status: - - experimental browser-compat: css.selectors.popover-open --- -{{CSSRef}}{{SeeCompatTable}} +{{CSSRef}} The **`:popover-open`** [CSS](/en-US/docs/Web/CSS) [pseudo-class](/en-US/docs/Web/CSS/Pseudo-classes) represents a {{domxref("Popover API", "popover", "", "nocode")}} element (i.e. one with a [`popover` attribute](/en-US/docs/Web/HTML/Global_attributes/popover)) that is in the showing state. You can use this to apply style to popover elements only when they are shown. diff --git a/files/en-us/web/css/break-after/index.md b/files/en-us/web/css/break-after/index.md index b705edd3dc7274e..3d1e1b003e2fa72 100644 --- a/files/en-us/web/css/break-after/index.md +++ b/files/en-us/web/css/break-after/index.md @@ -76,9 +76,9 @@ Once forced breaks have been applied, soft breaks may be added if needed, but no - : Forces one or two page breaks right after the principal box, whichever will make the next page into a left page. It's the page placed on the left side of the spine of the book or the back side of the page in duplex printing. - `right` - : Forces one or two page breaks right after the principal box, whichever will make the next page into a right page. It's the page placed on the right side of the spine of the book or the front side of the page in duplex printing. -- `recto` {{experimental_inline}} +- `recto` - : Forces one or two page breaks right after the principal box, whichever will make the next page into a recto page. (A recto page is a right page in a left-to-right spread or a left page in a right-to-left spread.) -- `verso` {{experimental_inline}} +- `verso` - : Forces one or two page breaks right after the principal box, whichever will make the next page into a verso page. (A verso page is a left page in a left-to-right spread or a right page in a right-to-left spread.) #### Column break values diff --git a/files/en-us/web/css/break-before/index.md b/files/en-us/web/css/break-before/index.md index bf697e5ed5022ae..4ecdc40bfd902c1 100644 --- a/files/en-us/web/css/break-before/index.md +++ b/files/en-us/web/css/break-before/index.md @@ -76,9 +76,9 @@ Once forced breaks have been applied, soft breaks may be added if needed, but no - : Forces one or two page breaks right before the principal box, whichever will make the next page into a left page. It's the page placed on the left side of the spine of the book or the back side of the page in duplex printing. - `right` - : Forces one or two page breaks right before the principal box, whichever will make the next page into a right page. It's the page placed on the right side of the spine of the book or the front side of the page in duplex printing. -- `recto` {{experimental_inline}} +- `recto` - : Forces one or two page breaks right before the principal box, whichever will make the next page into a recto page. (A recto page is a right page in a left-to-right spread or a left page in a right-to-left spread.) -- `verso` {{experimental_inline}} +- `verso` - : Forces one or two page breaks right before the principal box, whichever will make the next page into a verso page. (A verso page is a left page in a left-to-right spread or a right page in a right-to-left spread.) #### Column break values diff --git a/files/en-us/web/css/offset-position/index.md b/files/en-us/web/css/offset-position/index.md index 6248f6d6b06eb3a..e77280bbd29b4e9 100644 --- a/files/en-us/web/css/offset-position/index.md +++ b/files/en-us/web/css/offset-position/index.md @@ -2,12 +2,10 @@ title: offset-position slug: Web/CSS/offset-position page-type: css-property -status: - - experimental browser-compat: css.properties.offset-position --- -{{CSSRef}}{{SeeCompatTable}} +{{CSSRef}} The **`offset-position`** [CSS](/en-US/docs/Web/CSS) property defines the initial position of an element along a path. This property is typically used in combination with the {{cssxref("offset-path")}} property to create a motion effect. The value of `offset-position` determines where the element gets placed initially for moving along an `offset-path` if the offset-path function does not specify its own starting position. diff --git a/files/en-us/web/html/element/link/index.md b/files/en-us/web/html/element/link/index.md index f2b6f863f5eee19..42da55509d3af6d 100644 --- a/files/en-us/web/html/element/link/index.md +++ b/files/en-us/web/html/element/link/index.md @@ -242,7 +242,7 @@ This element includes the [global attributes](/en-US/docs/Web/HTML/Global_attrib - `rel` - : This attribute names a relationship of the linked document to the current document. The attribute must be a space-separated list of [link type values](/en-US/docs/Web/HTML/Attributes/rel). -- `sizes` {{Experimental_Inline}} +- `sizes` - : This attribute defines the sizes of the icons for visual media contained in the resource. It must be present only if the [`rel`](#rel) contains a value of `icon` or a non-standard type such as Apple's `apple-touch-icon`. diff --git a/files/en-us/web/html/element/script/type/speculationrules/index.md b/files/en-us/web/html/element/script/type/speculationrules/index.md index 46b08a0f26ce7b6..676c1102d0ecfd9 100644 --- a/files/en-us/web/html/element/script/type/speculationrules/index.md +++ b/files/en-us/web/html/element/script/type/speculationrules/index.md @@ -2,10 +2,12 @@ title: