Sanitize while parsing#12645
Conversation
2e43740 to
3ae9149
Compare
6dd79ba to
22ab343
Compare
22ab343 to
6714ff1
Compare
otherdaniel
left a comment
There was a problem hiding this comment.
Generally looks good to me, but I don't think I fully understand the subtleties here.
I had expected some sort of sanitizer tie-in somewhere around "create an element for a token" (parsing.html#create-an-element-for-the-token), to close the custom element/is-attribute loopholes. Did I overlook something?
You didn't, that would be a follow up where we apply the sanitizer on a token in particular situations. I added a comment to the OP about this. |
…h correct formatting and indentation
5814031 to
b7dd067
Compare
Instead of parsing into a fragment and then statically sanitizing that fragment, sanitize as we parse.
This entails the following changes:
DocumentFragment, and also to redirect elements to their nearest non-replaced ancestor when a child is stripped but its children are kept.Note that this still leaves out important follow ups, where we need to sometimes sanitize before the element is even created (e.g. declarative shadow roots and
is), and having a live sanitizer config while parsing gives us the infrastructure for that.Closes #12560
Closes #12543
(See WHATWG Working Mode: Changes for more details.)
/dynamic-markup-insertion.html ( diff )
/parsing.html ( diff )