Skip to content

Should sanitizer be allowed to remove attributes that create a declarative shadow root? #388

@noamr

Description

@noamr

To create a declarative shadow root, attributes on the template must be set, e.g.:

<my-custom-element>
  <template shadowrootmode=open shadowrootdelegatesfocus>...</template>
</my-custom-element>

However, those attributes are handled at parse time, and the sanitizer doesn't recognize them as "attributes". This means that in the current spec, removeAttributes: ["shadowrootmode"] doesn't prevent declarative shadow roots, and likewise removeElements: ["template"].

Is this WAI, or an oversight?

(Note, this is different from #45 which was about allowing the sanitizer to "see into" the shadow root)

cc @mozfreddyb @otherdaniel

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions