Skip to content
Open
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
16 changes: 16 additions & 0 deletions packages/scoped-custom-element-registry/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
null registry
- `HTMLElement`, and classes extending it, inherit the statics of `Element`
and `Node` (e.g. `ELEMENT_NODE`)
- `new X()` gives the element the global registry
- `importNode` reads its options as WebIDL does: null or an object is a
dictionary, anything else a boolean
- A registry argument that isn't a `CustomElementRegistry` throws a
`TypeError`
- `define`, `get` and `whenDefined` convert the name to a string
- An element is customized at most once; as natively, a failed upgrade clears
its definition, and a constructor that throws before `super()` leaves it an
`HTMLElement`
- `attachInternals` throws for an element that isn't customized
- Form callbacks run on upgrade, and only for form-associated elements
- Initial `attributeChangedCallback`s run in attribute order
- An insertion that throws restores the registries it changed
- `Document` `append`/`prepend`/`replaceChildren`, `CharacterData`
`before`/`after`/`replaceWith`, `textContent`, `innerText`, `outerText` and
`setHTML` keep registries

### Changed

Expand Down
3 changes: 2 additions & 1 deletion packages/scoped-custom-element-registry/DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ registry.
Moving a node into another document changes null and global registries as
the spec says, to an _effective global registry_: the new document's global
registry, or null if the document's registry is scoped. Scoped registries are
kept. Patched insertion methods apply this before the native move.
kept. Patched insertion methods apply this before the native move, and undo
it if the move throws.

The polyfill's state is shared by same-origin windows, so nodes moved between
them work as natively.
Expand Down
5 changes: 3 additions & 2 deletions packages/scoped-custom-element-registry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,9 @@ Tests of these are skipped when the browser's native support is used.
one;
- a copy of an element with a global registry, in a document with a scoped
registry, gets that scoped registry instead of null;
- `ElementInternals.setFormValue` works for an element whose constructor
failed, which isn't form-associated;
- an element whose constructor failed keeps its definition, so
`ElementInternals.setFormValue` still works for it, and it can't attach a
shadow root if its class disables them;
- adopting a null-registry element gives it the document's registry,
instead of its new parent's (as an effective global registry);
- adopting a host gives its shadow root a null registry but leaves the
Expand Down
Loading
Loading