Skip to content

Commit 84b648d

Browse files
committed
push changes
1 parent 1910c42 commit 84b648d

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

packages/core/ui/core/dom/src/nodes/document-fragment/DocumentFragment.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ export default class DocumentFragment extends ParentNode {
88
public nodeName: string = '#document-fragment';
99
public localName: string = '#document-fragment';
1010
isParentNode = true;
11+
// Set this to true if you want the
12+
// children of this fragment to render.
13+
// By default native counerparts of the
14+
// elements inside a DocumentFragement are
15+
// not created.
16+
canRender = false;
1117
constructor() {
1218
super();
1319
this._rootNode = this;

packages/core/ui/core/dom/src/nodes/element/Element.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,8 +391,11 @@ export default class Element extends ParentNode {
391391
const updateAttributeNS = (self: Element, namespace: string, name: string, value: any) => {
392392
let attr = findWhere(self.attributes, createAttributeFilter(namespace, name), false, false);
393393
if (!attr) self.attributes.push((attr = { namespaceURI: namespace, name } as IAttr));
394-
395394
if (attr.value === value) return;
395+
attr.value = value;
396+
if (self.canRender && self['isNativeElement']) {
397+
self[name] = value;
398+
}
396399

397400
if (self.attributeChangedCallback && (<typeof Element>self.constructor)._observedAttributes && (<typeof Element>self.constructor)._observedAttributes.includes(name)) {
398401
self.attributeChangedCallback(name, attr.value, value);

packages/core/ui/core/dom/src/nodes/node/Node.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ export default class Node extends Observable {
211211
else this.firstChild = newNode;
212212
}
213213
assignParentNode(newNode);
214+
newNode['canRender'] = this.canRender;
214215
if (newNode.connectedCallback) newNode.connectedCallback();
215216
return newNode;
216217
}
@@ -250,6 +251,7 @@ export default class Node extends Observable {
250251
node._rootNode = null;
251252
if (node.disconnectedCallback) node.disconnectedCallback();
252253
assignParentNode(node);
254+
node.canRender = true;
253255
return node;
254256
}
255257

packages/core/ui/core/dom/src/xml-parser/XMLParser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,6 @@ export default class XMLParser {
236236
if (namespaceURI === NamespaceURI.svg) {
237237
return name;
238238
}
239-
return name.toLowerCase();
239+
return name;
240240
}
241241
}

0 commit comments

Comments
 (0)