Skip to content

Commit d3686ad

Browse files
ddbeckcaptainbrossetfoolip
authored
Add feature for moveBefore() DOM methods (and group some DOM features) (#2660)
* Add `moveBefore()` feature * Add DOM group * Revise description Co-authored-by: Patrick Brosset <[email protected]> * Use PR URL for moveBefore spec instead of issue Co-authored-by: Philip Jägenstedt <[email protected]> * Fix wording on spec exception Co-authored-by: Patrick Brosset <[email protected]> * Make spec URL consistent * Fix typo * Undo putting DOM Geometry into the DOM group Surprising, but correct. * Undo adding structured-clone to DOM It's a more generic operation. Co-authored-by: Philip Jägenstedt <[email protected]> * Change ID from movebefore to move-before --------- Co-authored-by: Patrick Brosset <[email protected]> Co-authored-by: Philip Jägenstedt <[email protected]>
1 parent 8550757 commit d3686ad

10 files changed

+35
-1
lines changed

features/declarative-shadow-dom.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ description: The `shadowrootmode` attribute on `<template>` creates a shadow roo
33
spec: https://html.spec.whatwg.org/multipage/scripting.html#attr-template-shadowrootmode
44
group:
55
- html
6+
- dom
67
- web-components
78
caniuse: declarative-shadow-dom
89
status:

features/dom.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: DOM
22
description: The DOM (Document Object Model) API represents HTML and XML documents as trees of nodes. You can use the API to inspect and modify the structure and content of a document.
33
spec: https://dom.spec.whatwg.org/
4+
group: dom
45
status:
56
compute_from: api.Document
67
compat_features:

features/gethtml.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: getHTML()
22
description: The `getHTML()` method of `Element` and `ShadowRoot` objects serializes an element's DOM to an HTML string.
33
spec: https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#html-serialization-methods
4+
group: dom
45
compat_features:
56
- api.Element.getHTML
67
- api.ShadowRoot.getHTML

features/move-before.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: moveBefore()
2+
description: The `moveBefore()` DOM method relocates a node while preserving its state. For example, you can move the active element without losing focus, move an animated element without resetting the animation, or move an iframe without reloading its content.
3+
spec: https://github.com/whatwg/dom/pull/1307
4+
group: dom
5+
compat_features:
6+
- api.Document.moveBefore
7+
- api.DocumentFragment.moveBefore
8+
- api.Element.moveBefore

features/move-before.yml.dist

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Generated from: move-before.yml
2+
# Do not edit this file by hand. Edit the source file instead!
3+
4+
status:
5+
baseline: false
6+
support:
7+
chrome: "133"
8+
chrome_android: "133"
9+
edge: "133"
10+
compat_features:
11+
- api.Document.moveBefore
12+
- api.DocumentFragment.moveBefore
13+
- api.Element.moveBefore

features/mutation-events.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: Mutation events
22
description: Mutation events like `DOMSubtreeModified`, `DOMNodeInserted`, or `DOMNodeRemoved` fire when DOM changes occur.
33
# The latest spec doesn't mention them at all anymore.
44
spec: https://w3c.github.io/uievents/
5+
group: dom
56
discouraged:
67
according_to:
78
- https://www.w3.org/TR/2024/WD-uievents-20240906/#legacy-mutationevent-events

features/mutationobserver.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: MutationObserver
22
description: The `MutationObserver` API watches for changes to the DOM tree and calls a callback function when DOM changes occur.
33
spec: https://dom.spec.whatwg.org/#interface-mutationobserver
4+
group: dom
45
compat_features:
56
- api.MutationObserver
67
- api.MutationObserver.MutationObserver

features/shadow-dom.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ name: Shadow DOM
22
description: Shadow DOM allows you to attach encapsulated "shadow" DOM trees to elements. A shadow DOM tree is a separate component, isolated from the scripts and styles in other parts of the document. This is a part of Web Components.
33
spec: https://dom.spec.whatwg.org/#shadow-trees
44
caniuse: shadowdomv1
5-
group: web-components
5+
group:
6+
- dom
7+
- web-components
68
status:
79
compute_from: api.Element.attachShadow
810
compat_features:

groups/dom.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Features that manipulate the tree of nodes that make up a document.
2+
name: DOM

scripts/specs.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@ const defaultAllowlist: allowlistItem[] = [
120120
[
121121
"https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/DocumentSubtitle/explainer.md",
122122
"Allowed because this is where the application-title meta tag is spec'd at the moment. Remove when https://github.com/whatwg/html/issues/8909 is fixed."
123+
],
124+
[
125+
"https://github.com/whatwg/dom/pull/1307",
126+
"This is only place moveBefore() is spec'd. Remove this exception when https://github.com/whatwg/dom/pull/1307 merges."
123127
]
124128
];
125129

0 commit comments

Comments
 (0)