diff --git a/reports/2022.html b/reports/2022.html
index e0c110a..7d197ca 100644
--- a/reports/2022.html
+++ b/reports/2022.html
@@ -19,6 +19,10 @@
name: "Westbrook Johnson",
url: "https://westbrookjohnson.com",
},
+ {
+ name: "Alan Dávalos",
+ url: "https://github.com/alangdm",
+ },
],
github: "w3c/webcomponents-cg",
shortName: "webcomponents-cg",
@@ -109,7 +113,7 @@
Table of Contents
Children changed callback |
WICG/webcomponents#809 |
High |
- --- |
+ Uncertain |
| Open styling of shadow roots |
@@ -661,51 +665,73 @@ Links
Previous WCCG Report(s)
2021
GitHub issues:
- ---
+
+
+
Browser positions:
---
+ Polyfills/Libraries
+ For the parsing behavior
Description
- ---
+ Provide a callback that triggers whenever the parser finishes parsing children or when a new child is inserted or an old child is removed.
Status
- - ---
+ - Uncertain - no concrete proposal or consensus on spec
Initial API Summary/Quick API Proposal
- Summary or proposal based on current status; paragraph(s) and code.
+ No concrete API proposal exists so far but the discussions seem to refer to using the callback similar to the attributeChangedCallback.
+ A component using said callback would look like this:
+
+ class ChildrenChangedCallbackSample extends HTMLElement {
+ childrenChangedCallback() {}
+ }
+
Key Scenarios
- ---
+
+ - Children parsed: This proposal would act as a cross-browser method of detecting when a custom element's children have been fully parsed reliably.
+ - Children inserted/removed: This proposal would provide better ergonomics to react to insertion or removal of children nodes than using a MutationObserver.
+
Concerns
- - ---
+ - Too expensive to implement: this is no longer the case, all engines have mechanisms for this already
+ - The addition of the parsing behavior might encourage assuming a set of initial children exists and not reacting to changes in them.
Dissenting Opinion
- - ---
+ - Some people believe using a MutationObserver is enough to cover the insertion/removal cases and want to avoid creating a duplicate similar API for custom elements. But the async nature of MutationObserver seems to cause timing issues.
+ - Some other people don't want to add this API if it will only cover the use case when the parser finishes parsing children. (See the second concern)
Open Questions
- - ---
+ - Should this API really cover both use cases to begin with? Arguments for both sides have been mentioned in all referenced discussions with no conclusion
+ - Should this be one or two separate callback functions?
+ - Would it be better to implement this behavior as part of the slotchange event as suggested in this other issue? This might lead to engine security bugs so the callback seems a better option in that regard.