Skip to content

[0.42-r2 M2] __islandIntact element-child comparison is asymmetric for nested DSD (outerHTML) #582

Description

@SisyphusZheng

Severity: medium · Category: implementation bug

Evidence (verified in browser). For an element CHILD of an island, the comparison o.outerHTML !== nn.outerHTML compares a live subtree (DSD template consumed) against a freshly parsed one (template present): always unequal. An island whose light DOM contains a nested DSD element is therefore always judged 'changed' and replaced, resetting state on every morph.

Fix. Replace the outerHTML element-child comparison with a recursive comparison that applies the same normalization (skip template[shadowrootmode], skip whitespace-only text) on both sides.

Acceptance. a nested-DSD child compares intact; unit/e2e pins it.


Filed from the 0.42 round-2 review (docs/audit/2026-07-28-alpha5-round2-review.md). Target line: 0.42.0-alpha.6.

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.42.0-alpha.60.42 round-2 review remediation (morph client hardening)bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions