Skip to content

Filling a DocumentFragment in the main document can have side effects #363

@noamr

Description

@noamr

"Set and filter HTML" (https://wicg.github.io/sanitizer-api/#set-and-filter-html) creates a DocumentFragment, which is the result of parsing the yet-to-be-sanitized HTML.

This fragment is part of the main document, which means elements that are added to it are created in the context of that document.
This can have side effects for things like image loading - an image loads at the moment it is created rather than at the moment it is connected to an active document.

A remediation for this would be to create that fragment in an inert document.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions