[Bug 22466] [Custom]: Certain documents should not share registration contexts

https://www.w3.org/Bugs/Public/show_bug.cgi?id=22466

--- Comment #6 from Dominic Cooney <dominicc@chromium.org> ---
I just realized there's an important hair that should be split. For a given
document there are really two questions here:

1. Should this document process custom elements at all.

2. If this document processes custom elements, does it share a context with
another document?

In terms of Question 1, the experimental implementation in Blink processes
custom elements (or tries to) in HTML and XHTML documents of all kinds. This
includes XHR's responseXML, a document created by DOMParser, etc.

>From a security perspective, this sounds scary, because those documents may
contain content the author does not trust.

I think that this is OK because of Question 2: definitions are *not* shared
with these documents. So nothing is active unless the author opts into it by
calling document.register on the document. So attacking this would require
luring the author into calling document.register on one of these documents,
etc.

In terms of Question 2, the experimental implementation in Blink will (soon)
share registration contexts in these situations:

I. HTML Templates. Between a document and its template document.
II. HTML Imports. Between a document and its imported sub-documents.
III. DOMImplementation. Between a document and
document.implementation.createHTMLDocument() or createDocument with an XHTML
namespace URI.

This is way down in the weeds, but in my first cut implementation, the sharing
is really transitive between documents. So if document A has context P and
creates document B that doesn't process custom elements (for example, it is an
XML document, not a HTML or XHTML document) and then document B creates
document C that *does* process custom elements, document C will get a new,
different context Q.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Thursday, 25 July 2013 04:25:39 UTC