createHTML in conjunction with XML documents is a bit broken #612
Copy link
Copy link
Open
Description
See #569 for initial discussion
Currentlly, there is no way for a policy to tell whether the target document for an insertion is HTML.
This means that calling innerHTML on an XML document would trigger the default createHTML callback.
When this is an XHTML active document, the policy can check the global document's type.
However, inactive documents share the active document's default policy. e.g.:
const xml_document = document.implementation.createDocument(...);
// This will invoke the active document's default policy
xml_document.firstChild.innerHTML = "...";or
const xhr = new XMLHttpRequest();
xhr.addEventListener("load", () => {
const xml_doc = xhr.response.document;
// This will invoke the active document's default policy
xml_doc.firstChild.innerHTML = "...";
});
xhr.open("GET", "doc.xml");
xhr.send();Since these use cases are a bit funky to begin with and already generally broken, it might be better to throw an error in those occasions (probably when trying to apply the resulting TrustedHTML, or before consulting with the policy)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity