-
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.
Rework prefix resolution during serialization
This re-implements the algorithms used to determine what prefixes to assign and what declarations to output for them during serialization. The algorithms in the DOM parsing and serialization spec contain too many bugs that have so far not been addressed, and contain complicated branching that makes it hard to reason about them. In the replacement I've tried to remain close to the original behavior in spirit. That is, existing prefixes (or, for elements, an inherited default namespace) are preferred over authored prefixes but only if they are still in scope. Authored prefixes are preferred over generated ones. A new prefix is generated only if the authored prefix of an attribute conflicts with a declaration on the same element. Declaration attributes in the DOM are only preserved if they actually represent a change to the namespaces in scope for their element and do not cause conflicts - the spec preserved default namespace declarations in a few other cases but those seemed unnecessary.
- Loading branch information
Showing
6 changed files
with
282 additions
and
609 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,3 @@ | ||
{ | ||
"jest.jestCommandLine": "npm run test --" | ||
} |
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.