Skip to content

Remove custom element state when is attribute is blocked#396

Open
evilpie wants to merge 4 commits into
WICG:mainfrom
evilpie:is-attribute
Open

Remove custom element state when is attribute is blocked#396
evilpie wants to merge 4 commits into
WICG:mainfrom
evilpie:is-attribute

Conversation

@evilpie
Copy link
Copy Markdown
Collaborator

@evilpie evilpie commented Apr 16, 2026

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

Comment thread index.bs Outdated
Comment thread index.bs Outdated
@otherdaniel
Copy link
Copy Markdown
Collaborator

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.

@evilpie
Copy link
Copy Markdown
Collaborator Author

evilpie commented Apr 29, 2026

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 div.setHTML('<div is="custom-div"></div>') in Firefox Nightly.

@evilpie
Copy link
Copy Markdown
Collaborator Author

evilpie commented May 18, 2026

Rebased. Should be ready for review, but can't land before #387 of course.

@evilpie evilpie marked this pull request as ready for review May 18, 2026 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The is non-attribute allows custom elements to sneak in

3 participants