Skip to content

Commit 7c16038

Browse files
committed
Creating normalized fragments
There is a method I've never used that *might* speed things up in terms of tree walking, and improve, in general, layout expectations. This branch is here to test that's the case.
1 parent cf2a494 commit 7c16038

10 files changed

Lines changed: 24 additions & 19 deletions

File tree

async.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cjs/node.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ const isImportNodeLengthWrong = importNode.length != 1;
3434
// later on, so that paths are retrieved from one already parsed,
3535
// hence without missing child nodes once re-cloned.
3636
const createFragment = isImportNodeLengthWrong ?
37-
(text, type) => importNode.call(
37+
(text, type, normalize) => importNode.call(
3838
document,
39-
createContent(text, type),
39+
createContent(text, type, normalize),
4040
true
4141
) :
4242
createContent;

cjs/rabbit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const createEntry = (type, template) => {
5454
// operation based on the same template, i.e. data => html`<p>${data}</p>`
5555
const mapTemplate = (type, template) => {
5656
const text = instrument(template, prefix, type === 'svg');
57-
const content = createFragment(text, type);
57+
const content = createFragment(text, type, true);
5858
// once instrumented and reproduced as fragment, it's crawled
5959
// to find out where each update is in the fragment tree
6060
const tw = createWalker(content);

0 commit comments

Comments
 (0)