fix: resolve foreign content namespace the way a parser re-reads it - #51
Open
dkautomation23 wants to merge 2 commits into
Open
dkautomation23 wants to merge 2 commits into
dkautomation23 wants to merge 2 commits into
Conversation
Decide whether raw-text content is emitted raw or escaped from the namespace a parser would assign when re-reading the serialized output, walking the ancestor chain top-down: - HTML integration points apply only inside their own namespace (desc/title/foreignObject in SVG; mi/mo/mn/ms/mtext and annotation-xml with an HTML encoding in MathML). - Start tags that break out of foreign content (div, p, span, table, font with color/face/size, ...) switch back to HTML. - The element's own closing tag is always escaped, since a breakout tag earlier in the same foreign container can return the parser to HTML. The cache stores each element's own namespace and stops at the first cached ancestor, so serialization cost stays in line with main. Builds on angular#33.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Builds on #33 (its commit is included unchanged; only the last commit is new). Happy to rebase once #33 lands.
Details are in the commit message and in the new tests in test/xss.js. Full suite: 2,241 passing locally.