Remove custom element state when is attribute is blocked#396
Conversation
|
Looks good editorially, but I wonder whether this would execute the custom element constructor during parsing? As I understand this, this would create the custom element, and then later remove it again. If so, I'd expect this to execute the custom element's constructor, and thus bypass sanitization in a sense. |
No it doesn't AFAIK. The custom constructor (if not removed) is only invoked when inserting. IIRC because the custom elements registry is null for those documents we use for parsing? You can actually try this out with |
|
Rebased. Should be ready for review, but can't land before #387 of course. |
|
@otherdaniel I would appreciate your review on this! |
|
Maybe wait with this until after the upstream? |
…ute is blocked. r=emilio Implements WICG/sanitizer-api#396 Differential Revision: https://phabricator.services.mozilla.com/D301304
To be honest, I'm still a little confused here.
So... the way I read the specs, I'd still expect your example of As an additional point.. if the HTML fragment parsing algorithm doesn't run the custom element constructor anyhow, then why do we even bother with this whole thing? My understanding is that the sanitizer algorithm sits between the parsing and insertion in the document. If the whole logic only runs when inserting and thus after sanitization, wouldn't this whole point be moot? As said above... I find the whole thing confusing, and am not very confident in my analysis above. Our implementation seems to slightly deviate from what I find in the specs, in that a custom element registry is expressedly passed in to the parser, and when |scripting mode| is |
Implements WICG/sanitizer-api#396 Differential Revision: https://phabricator.services.mozilla.com/D301304 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=2040656 gecko-commit: d8f0a20748554395560938baabeaa80986c758cc gecko-commit-git: beca389380ebb98e7631ffc4c3f06e55d765b009 gecko-reviewers: emilio
…ute is blocked. r=emilio Implements WICG/sanitizer-api#396 Differential Revision: https://phabricator.services.mozilla.com/D301304 UltraBlame original commit: d8f0a20748554395560938baabeaa80986c758cc
…ute is blocked. r=emilio Implements WICG/sanitizer-api#396 Differential Revision: https://phabricator.services.mozilla.com/D301304 UltraBlame original commit: d8f0a20748554395560938baabeaa80986c758cc
…ute is blocked. r=emilio Implements WICG/sanitizer-api#396 Differential Revision: https://phabricator.services.mozilla.com/D301304 UltraBlame original commit: d8f0a20748554395560938baabeaa80986c758cc
This depends on changes in #385 that haven't happened yet.
I am not really certain if there isn't some other data structure that we need to patch for this. Presumably this would be easier to specify when we do streaming parsing.
Fixes #387.
Preview | Diff