Re: [whatwg/dom] Add active template mutation records (PR #1518)

noamr left a comment (whatwg/dom#1518)

All items from this review have been resolved and applied:

- D1: `active template`'s `attribute map` had no initial value, leaving an unpopulated struct undefined if read directly. Fixed in 2b0daeb.
- D2: `insert` and `remove` exported `activeTemplate` and `activeTemplateStatus` without exporting `suppressObservers`, preventing external callers such as HTML's `prepare content patching` from linking `suppressObservers` by name. Fixed in c6e9934.
- D3: `queue a mutation record` accepted a non-null `activeTemplate` with a null `activeTemplateStatus`, which would return a non-null `activeTemplateAttributes` alongside a null `activeTemplateStatus`. Fixed in 261c9e6.
- D4: `active template`'s `attributes objects` map held strong references to `MutationObserver` keys across the lifetime of an open `<template for>`. Fixed in 4a9f0af.
- D5: `MutationObserver-activeTemplateAttributeFilter.html`'s `childList: true` subtest passed even when `activeTemplateAttributeFilter` was unimplemented, and several spec branches lacked WPT coverage. Fixed in [6784583](https://github.com/web-platform-tests/wpt/commit/6784583a28966291f6e3c78b784bb8f45dadff75).
- Q1: When the same `MutationObserver` matched a mutation through both a target registration and an ancestor `subtree: true` registration (or a transient registration) with different `activeTemplateAttributeFilter` lists, `queue a mutation record` overwrote the filter in arbitrary registration order, and re-calling `observe()` mid-patch ignored the updated filter on subsequent templates unless cached per template. Decided on option b (union matching `activeTemplateAttributeFilter` lists in reverse tree order and cache `activeTemplateAttributes` once per `(activeTemplate, observer)` from the first record queued for that observer); fixed in 8ecc1ae and [80edcfc](https://github.com/web-platform-tests/wpt/commit/80edcfc98ce4a36f07105ee9fbb4bc0d6e9ef22f).

<details><summary>Reviewed commits</summary>

Reviewed at b6e28f4 on 3c53f93, together with whatwg/html#13181 at ce9e0be, with web-platform-tests/wpt#64641 at 41c938c, using spec-pr-review.
</details>


-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/pull/1518#issuecomment-6954195296
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/dom/pull/1518/c6954195296@github.com>

Received on Tuesday, 17 November 2026 16:31:57 UTC