Introduce CustomElementRegistry#whenDefined() method

This patch introduces |CustomElementRegistry#whenDefined()| as specified in [1],
and makes |CustomElementRegistry::define()| to resolve a promise associated to
newly defined name.

[1] // https://html.spec.whatwg.org/multipage/scripting.html#dom-customelementsregistry-whendefined

BUG=594918
TEST=LayoutTests/custom-elements/spec/custom-elements-registry/when_defined.html

Review-Url: https://codereview.chromium.org/2048343002
Cr-Commit-Position: refs/heads/master@{#399171}
5 files changed