From 9fb6a51dc3c2bce9f4cdc7c0e157167618a58d36 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Wed, 3 Dec 2025 08:52:27 +0000
Subject: [PATCH 1/3] Initial plan
From 5093e0ca96e39a4c01fbade6f2820a0f0be23dbc Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Wed, 3 Dec 2025 09:07:21 +0000
Subject: [PATCH 2/3] Fix data-permanent to preserve element attributes, not
just descendants
Co-authored-by: javiercn <6995051+javiercn@users.noreply.github.com>
---
.../src/Rendering/DomMerging/DomSync.ts | 23 ++++++-----
src/Components/Web.JS/test/DomSync.test.ts | 38 +++++++++++++++++++
2 files changed, 49 insertions(+), 12 deletions(-)
diff --git a/src/Components/Web.JS/src/Rendering/DomMerging/DomSync.ts b/src/Components/Web.JS/src/Rendering/DomMerging/DomSync.ts
index b86ff3bd8d03..20d318d770b8 100644
--- a/src/Components/Web.JS/src/Rendering/DomMerging/DomSync.ts
+++ b/src/Components/Web.JS/src/Rendering/DomMerging/DomSync.ts
@@ -185,22 +185,21 @@ function treatAsMatch(destination: Node, source: Node) {
break;
}
case Node.ELEMENT_NODE: {
- const editableElementValue = getEditableElementValue(source as Element);
- synchronizeAttributes(destination as Element, source as Element);
- applyAnyDeferredValue(destination as Element);
-
if (isDataPermanentElement(destination as Element)) {
- // The destination element's content should be retained, so we avoid recursing into it.
+ // The destination element's content and attributes should be retained.
} else {
+ const editableElementValue = getEditableElementValue(source as Element);
+ synchronizeAttributes(destination as Element, source as Element);
+ applyAnyDeferredValue(destination as Element);
synchronizeDomContentCore(destination as Element, source as Element);
- }
- // This is a much simpler alternative to the deferred-value-assignment logic we use in interactive rendering.
- // Because this sync algorithm goes depth-first, we know all the attributes and descendants are fully in sync
- // by now, so setting any "special value" property is just a matter of assigning it right now (we don't have
- // to be concerned that it's invalid because it doesn't correspond to an