From ccc7b33220812cdb1715b96980aa7d9628fd75d3 Mon Sep 17 00:00:00 2001 From: Xiaocheng Hu Date: Mon, 1 May 2023 11:00:51 -0700 Subject: [PATCH] [scoped-registry] Implement scoped custom element upgrade This patch: 1. Changes CustomElement::Registry() to return tree-scoped registries instead of the global registry. As this function is used by a lot of callers (including upgrade), this allows these callers to use the scoped registry associated with the tree scope. 2. Custom element construction stack entries are augmented with the definition being used, so that later when calling `super()`, we can still know which custom element definition is being used. See https://github.com/WICG/webcomponents/issues/969 for details. Bug: 1304439 Change-Id: Id510ecea0f4c5cf6386f77a39d346918c9592e76 --- ...hadowRoot-innerHTML-upgrade.tentative.html | 116 +++++++++++++++ .../constructor-call.tentative.html | 42 ++++++ ...y-with-different-definition.tentative.html | 137 ++++++++++++++++++ 3 files changed, 295 insertions(+) create mode 100644 custom-elements/scoped-registry/ShadowRoot-innerHTML-upgrade.tentative.html create mode 100644 custom-elements/scoped-registry/constructor-call.tentative.html create mode 100644 custom-elements/scoped-registry/constructor-reentry-with-different-definition.tentative.html diff --git a/custom-elements/scoped-registry/ShadowRoot-innerHTML-upgrade.tentative.html b/custom-elements/scoped-registry/ShadowRoot-innerHTML-upgrade.tentative.html new file mode 100644 index 000000000000000..e21c9dd03326d68 --- /dev/null +++ b/custom-elements/scoped-registry/ShadowRoot-innerHTML-upgrade.tentative.html @@ -0,0 +1,116 @@ + + + + + + + + +
+ + diff --git a/custom-elements/scoped-registry/constructor-call.tentative.html b/custom-elements/scoped-registry/constructor-call.tentative.html new file mode 100644 index 000000000000000..19a8e3f4d8ac690 --- /dev/null +++ b/custom-elements/scoped-registry/constructor-call.tentative.html @@ -0,0 +1,42 @@ + + + + + + + + + + diff --git a/custom-elements/scoped-registry/constructor-reentry-with-different-definition.tentative.html b/custom-elements/scoped-registry/constructor-reentry-with-different-definition.tentative.html new file mode 100644 index 000000000000000..dc93e3c702d5789 --- /dev/null +++ b/custom-elements/scoped-registry/constructor-reentry-with-different-definition.tentative.html @@ -0,0 +1,137 @@ + + + + + + + + +
+
+ +