The HTML parser synchronously creates custom elements

This starts to make element creation match the HTML spec's "create an element for a token" steps <https://html.spec.whatwg.org/#create-an-element-for-the-token> In particular, it starts running custom element constructors synchronously.

This changes the relationship between CustomElementsRegistry and V0CustomElementRegistrationContext. These objects have references to one another to prevent competing definitions in V0 and V1. CustomElementsRegistry have affinity to a window; V0CustomElementRegistrationContexts have affinity to documents. Previously the relationship between CustomElementsRegistry and V0CustomElementsRegistrationContext was 1:1, but that is inaccurate, because a window may replace its document. Now it is 1:M.

For the same reason this adds a pointer from the CustomElementsRegistry back to its owner LocalDOMWindow, instead of holding onto the window's document directly. Consequently CustomElementsRegistryTests have all become DummyPageHolder browser tests because they need windows.

BUG=594918

Review-Url: https://codereview.chromium.org/2200613002
Cr-Commit-Position: refs/heads/master@{#411941}
18 files changed