-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This fixes attributes being allowed to adopt the default namespace (with empty prefix) and ancestor declarations not being considered as candidates.
- Loading branch information
Showing
4 changed files
with
133 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
const { Document, serializeToWellFormedString } = require('.'); | ||
|
||
const TABLE_SIZE = 1000; | ||
|
||
function createTable() { | ||
const doc = new Document(); | ||
const table = doc.createElementNS("http://example.com", "table"); | ||
doc.appendChild(table); | ||
|
||
for (let num = 1; num < TABLE_SIZE; ++num) { | ||
const newRow = doc.createElementNS("http://example.com", "tr"); | ||
table.appendChild(newRow); | ||
|
||
for (let i = 1; i < num; ++i) { | ||
const newCell = doc.createElementNS("http://example.com", "td"); | ||
newRow.appendChild(newCell); | ||
} | ||
|
||
for (const row of table.childNodes) { | ||
const newCell = doc.createElementNS("http://example.com", "td"); | ||
row.appendChild(newCell); | ||
} | ||
} | ||
|
||
return doc; | ||
} | ||
|
||
console.group('createTable'); | ||
for (let i = 0; i < 20; ++i) { | ||
console.time(); | ||
createTable(); | ||
console.timeEnd(); | ||
} | ||
console.groupEnd(); | ||
|
||
console.group('serializeTable'); | ||
const doc = createTable(); | ||
for (let i = 0; i < 20; ++i) { | ||
console.time(); | ||
serializeToWellFormedString(doc); | ||
console.timeEnd(); | ||
} | ||
console.groupEnd(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.