Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/auto-cleanup-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ jobs:
persist-credentials: false

- name: Setup Node.js environment
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version-file: ".nvmrc"
package-manager-cache: false

- name: Install all yarn packages
run: yarn --frozen-lockfile
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/interfacedata-updater.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ jobs:
persist-credentials: false

- name: Setup node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version-file: "mdn-content/.nvmrc"
package-manager-cache: false

- name: Checkout webref
uses: actions/checkout@v5
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/markdown-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
persist-credentials: false

- name: Setup Node.js environment
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version-file: ".nvmrc"
cache: yarn
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-check-lint_content.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:

- name: Setup Node.js environment
if: steps.check.outputs.HAS_FILES == 'true'
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version-file: ".nvmrc"
cache: yarn
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-check_cspell_lists.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
persist-credentials: false

- name: Setup Node.js environment
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version-file: ".nvmrc"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-check_javascript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
persist-credentials: false

- name: Setup Node.js environment
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version-file: ".nvmrc"
cache: yarn
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-check_json.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
persist-credentials: false

- name: Setup Node.js environment
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version-file: ".nvmrc"
cache: yarn
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-check_redirects.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
persist-credentials: false

- name: Setup Node.js environment
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version-file: ".nvmrc"
cache: yarn
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/pr-check_scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
persist-credentials: false

- name: Setup Node.js environment
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version-file: ".nvmrc"
cache: yarn
Expand All @@ -45,7 +45,7 @@ jobs:
persist-credentials: false

- name: Setup Node.js environment
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version-file: ".nvmrc"
cache: yarn
Expand Down Expand Up @@ -87,7 +87,7 @@ jobs:
persist-credentials: false

- name: Setup Node.js environment
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version-file: ".nvmrc"
cache: yarn
Expand All @@ -109,7 +109,7 @@ jobs:
persist-credentials: false

- name: Setup Node.js environment
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version-file: ".nvmrc"
cache: yarn
Expand All @@ -135,7 +135,7 @@ jobs:
persist-credentials: false

- name: Setup Node.js environment
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version-file: ".nvmrc"
cache: yarn
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-check_url-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
persist-credentials: false

- name: Setup Node.js environment
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version-file: ".nvmrc"
cache: yarn
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-check_yml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
persist-credentials: false

- name: Setup Node.js environment
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version-file: ".nvmrc"
cache: yarn
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/pr-review-companion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,11 @@ jobs:
persist-credentials: false

- name: Setup (mdn/content)
uses: actions/setup-node@v4
uses: actions/setup-node@v6
if: steps.check.outputs.HAS_ARTIFACT
with:
node-version-file: "content/.nvmrc"
package-manager-cache: false

- name: Install (mdn/content)
if: steps.check.outputs.HAS_ARTIFACT
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:

- name: Setup Node.js environment
if: steps.check.outputs.HAS_FILES == 'true'
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version-file: ".nvmrc"
cache: yarn
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/spelling-check-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ jobs:
persist-credentials: false

- name: Setup Node.js environment
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version-file: ".nvmrc"
package-manager-cache: false

- name: Install all yarn packages
run: yarn --frozen-lockfile
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/glossary/cia/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ sidebar: glossarysidebar

## See also

- [CIA](https://en.wikipedia.org/wiki/Information_security#Key_concepts) on Wikipedia
- [CIA](https://en.wikipedia.org/wiki/Information_security#CIA_triad) on Wikipedia
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,9 @@ In our demo, the position of the picker is set relative to its anchor by using t

This results in the top edge of the picker always being positioned 1 pixel down from the bottom edge of the select button, and the left edge of the picker always being positioned `10%` of the select button's width across from its left edge.

> [!NOTE]
> If you want to remove the implicit anchor reference to stop the picker from being anchored to the `<select>` element, you can do so by setting the `position-anchor` property of the picker to an anchor name that doesn't exist in the current document, such as `--not-an-anchor-name`. See also [removing an anchor association](/en-US/docs/Web/CSS/CSS_anchor_positioning/Using#removing_an_anchor_association).

## Final result

After the last two sections, the final updated state of our `<select>` is rendered like this:
Expand Down
31 changes: 18 additions & 13 deletions files/en-us/mdn/kitchensink/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -366,24 +366,29 @@ if (5 < 30 && 55 > 20 && 5 < 20 && 55 > 10) {
```js
Crafty.init(200, 200);

var dim1 = {x: 5, y: 5, w: 50, h: 50}
var dim2 = {x: 20, y: 10, w: 60, h: 40}
var dim1 = { x: 5, y: 5, w: 50, h: 50 };
var dim2 = { x: 20, y: 10, w: 60, h: 40 };

var rect1 = Crafty.e("2D, Canvas, Color").attr(dim1).color("red");

var rect2 = Crafty.e("2D, Canvas, Color, Keyboard, Fourway").fourway(2).attr(dim2).color("blue");
var rect2 = Crafty.e("2D, Canvas, Color, Keyboard, Fourway")
.fourway(2)
.attr(dim2)
.color("blue");

rect2.bind("EnterFrame", function () {
if (rect1.x > rect2.x + rect2.w &#x26;&#x26;
rect1.x + rect1.w > rect2.x &#x26;&#x26;
rect1.y > rect2.y + rect2.h &#x26;&#x26;
rect1.h + rect1.y > rect2.y) {
// collision detected!
this.color("green");
} else {
// no collision
this.color("blue");
}
if (
rect1.x > rect2.x + rect2.w &&
rect1.x + rect1.w > rect2.x &&
rect1.y > rect2.y + rect2.h &&
rect1.h + rect1.y > rect2.y
) {
// collision detected!
this.color("green");
} else {
// no collision
this.color("blue");
}
});
```

Expand Down
1 change: 1 addition & 0 deletions files/en-us/web/api/gpusupportedfeatures/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ The following additional features are defined in WebGPU. Bear in mind that the e
| `float32-blendable` | When enabled, allows [blending](/en-US/docs/Web/API/GPUDevice/createRenderPipeline#blend) of `r32float`-, `rg32float`-, and `rgba32float`-[`format`](/en-US/docs/Web/API/GPUDevice/createTexture#format) {{domxref("GPUTexture")}}s. |
| `float32-filterable` | When enabled, allows [filtering](/en-US/docs/Web/API/GPUDevice/createSampler#magfilter) of `r32float`-, `rg32float`-, and `rgba32float`-[`format`](/en-US/docs/Web/API/GPUDevice/createTexture#format) {{domxref("GPUTexture")}}s. |
| `indirect-first-instance` | When enabled, allows the use of non-zero `firstInstance` values in the `indirectBuffer` property of the `drawIndirect()` and `drawIndexedIndirect()` methods available on {{domxref("GPURenderPassEncoder")}} and {{domxref("GPURenderBundleEncoder")}} instances. |
| `primitive-index` | When enabled, allows the use of the [`primitive_index`](https://gpuweb.github.io/gpuweb/wgsl/#built-in-values-primitive_index) shader built-in in WSGL. This built-in provides a per-primitive index to fragment shaders on supported hardware, similar to the existing [`vertex_index`](https://gpuweb.github.io/gpuweb/wgsl/#vertex-index-builtin-value) and [`instance_index`](https://gpuweb.github.io/gpuweb/wgsl/#instance-index-builtin-value) built-ins. The `primitive_index` built-in is useful for advanced graphical techniques, such as virtualized geometry. |
| `rg11b10ufloat-renderable` | When enabled, allows `RENDER_ATTACHMENT` [`usage`](/en-US/docs/Web/API/GPUDevice/createTexture#usage) of `rg11b10ufloat`-[`format`](/en-US/docs/Web/API/GPUDevice/createTexture#format) {{domxref("GPUTexture")}}s, as well as their blending and multisampling. |
| `shader-f16` | When enabled, allows the use of the half-precision floating-point type [`f16`](https://gpuweb.github.io/gpuweb/wgsl/#extension-f16) in WGSL. |
| `subgroups` | When enabled, allows the use of [subgroups](https://gpuweb.github.io/gpuweb/wgsl/#extension-subgroups) in WGSL. Subgroups enable SIMD-level parallelism, allowing threads in a workgroup to communicate and execute collective math operations such as calculating a sum of numbers, and offering an efficient method for cross-thread data sharing. Note that the {{domxref("GPUAdapterInfo.subgroupMinSize", "subgroupMinSize")}} and {{domxref("GPUAdapterInfo.subgroupMaxSize", "subgroupMaxSize")}} properties can be useful to check if, for example, you have a hardcoded algorithm that requires a subgroup of a certain size. You can use f16 values with subgroups when you request a GPUDevice with both the `shader-f16` and `subgroups` features. |
Expand Down
3 changes: 3 additions & 0 deletions files/en-us/web/api/popover_api/using/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,9 @@ See [Using CSS anchor positioning](/en-US/docs/Web/CSS/CSS_anchor_positioning/Us
> [!NOTE]
> For an example that uses this implicit association, see our [popover hint demo](https://mdn.github.io/dom-examples/popover-api/popover-hint/) ([source](https://github.com/mdn/dom-examples/tree/main/popover-api/popover-hint)). If you check out the CSS code, you'll see that no explicit anchor associations are made using the {{cssxref("anchor-name")}} and {{cssxref("position-anchor")}} properties.

> [!NOTE]
> If you want to remove the implicit anchor reference to stop the popover from being anchored to its invoker, you can do so by setting the `position-anchor` property of the popover to an anchor name that doesn't exist in the current document, such as `--not-an-anchor-name`. See also [removing an anchor association](/en-US/docs/Web/CSS/CSS_anchor_positioning/Using#removing_an_anchor_association).

## Animating popovers

Popovers are set to `display: none;` when hidden and `display: block;` when shown, as well as being removed from / added to the {{glossary("top layer")}} and the [accessibility tree](/en-US/docs/Web/Performance/Guides/How_browsers_work#building_the_accessibility_tree). Therefore, for popovers to be animated, the {{cssxref("display")}} property needs to be animatable. [Supporting browsers](/en-US/docs/Web/CSS/display#browser_compatibility) animate `display` with a variation on the [discrete animation type](/en-US/docs/Web/CSS/CSS_animated_properties#discrete). Specifically, the browser will flip between `none` and another value of `display` so that the animated content is shown for the entire animation duration. So, for example:
Expand Down
3 changes: 3 additions & 0 deletions files/en-us/web/css/_doublecolon_picker/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ A further side-effect of the implicit invoker/popover relationship mentioned abo
block-start span-inline-start;
```

> [!NOTE]
> If you want to remove the implicit anchor reference to stop the picker from being anchored to the `<select>` element, you can do so by setting the `position-anchor` property of the picker to an anchor name that doesn't exist in the current document, such as `--not-an-anchor-name`. See also [removing an anchor association](/en-US/docs/Web/CSS/CSS_anchor_positioning/Using#removing_an_anchor_association).

## Examples

### Basic custom select usage
Expand Down
24 changes: 21 additions & 3 deletions files/en-us/web/css/css_anchor_positioning/using/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,33 @@ The anchor and infobox are now associated, but for the moment you'll have to tru

### Implicit anchor association

In some cases, an implicit anchor reference will be made between two elements, due to the semantic nature of their relationship. For example, when using the [Popover API](/en-US/docs/Web/API/Popover_API) to associate a popover with a control, an implicit anchor reference is made between the two. This can occur when:
In some cases, an implicit anchor reference will be made between two elements, due to the semantic nature of their relationship:

- Declaratively associating a popover with a control using the [`popovertarget`](/en-US/docs/Web/HTML/Reference/Elements/button#popovertarget) and [`id`](/en-US/docs/Web/HTML/Reference/Global_attributes/id) attributes.
- Programmatically associating a popover action such as {{domxref("HTMLElement.showPopover", "showPopover()")}} with a control using the `source` option.
- When using the [Popover API](/en-US/docs/Web/API/Popover_API) to associate a popover with a control, an implicit anchor reference is made between the two. This can occur when:
- Declaratively associating a popover with a control using the [`popovertarget`](/en-US/docs/Web/HTML/Reference/Elements/button#popovertarget) and [`id`](/en-US/docs/Web/HTML/Reference/Global_attributes/id) attributes or the [`commandfor`](/en-US/docs/Web/HTML/Reference/Elements/button#commandfor) and `id` attributes.
- Programmatically associating a popover action such as {{domxref("HTMLElement.showPopover", "showPopover()")}} with a control using the `source` option.
- A {{htmlelement("select")}} element and its dropdown picker are opted into [customizable select element](/en-US/docs/Learn_web_development/Extensions/Forms/Customizable_select) functionality via the {{cssxref("appearance")}} property `base-select` value. In this case, an implicit popover-invoker relationship is created between the two, which also means they'll have an implicit anchor reference.

> [!NOTE]
> The methods above associate an anchor with an element, but they are not yet tethered. To tether them together, the positioned element needs to be positioned relative to its anchor, which is done with CSS.

### Removing an anchor association

If you wish to remove an explicit anchor association previously made between an anchor element and a positioned element, you can do one of the following:

1. Set the anchor's `anchor-name` property value to `none`, or to a different `<dashed-ident>`, if you want a different element to be anchored to it.
2. Set the `position-anchor` property of the positioned element to an anchor name that doesn't exist in the current document, such as `--not-an-anchor-name`.

However, in the case of implicit anchor associations, you'll need to use the second method — the first method doesn't work. This is because the association is controlled internally, and you can't remove the `anchor-name` via CSS.

For example, to stop a customizable `<select>` element's picker from being anchored to the `<select>` element itself, you could use the following rule:

```css
::picker(select) {
position-anchor: --not-an-anchor-name;
}
```

## Positioning elements relative to their anchor

As we saw above, associating a positioned element with an anchor is not really much use on its own. Our goal is to place the positioned element relative to its associated anchor element. This is done either by setting a [CSS `anchor()` function](#using_inset_properties_with_anchor_function_values) value on an [inset property](/en-US/docs/Glossary/Inset_properties), [specifying a `position-area`](#setting_a_position-area), or centering the positioned element with the [`anchor-center` placement value](#centering_on_the_anchor_using_anchor-center).
Expand Down