Commit c13b9f1
committed
CustomElementRegistry.prototype.initialize should upgrade custom elements
https://bugs.webkit.org/show_bug.cgi?id=302534
Reviewed by Anne van Kesteren.
Implement whatwg/html#11913. This PR also fixes a few bugs in the existing code, which were revealed by
the newly introduced test.
Test: imported/w3c/web-platform-tests/custom-elements/registries/scoped-registry-initialize-upgrades.html
* LayoutTests/imported/w3c/web-platform-tests/custom-elements/registries/pseudo-class-defined.window-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/custom-elements/registries/pseudo-class-defined.window.js:
* LayoutTests/imported/w3c/web-platform-tests/custom-elements/registries/scoped-registry-initialize-upgrades-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/custom-elements/registries/scoped-registry-initialize-upgrades.html: Added.
* Source/WebCore/bindings/js/JSCustomElementInterface.cpp:
(WebCore::JSCustomElementInterface::tryToConstructCustomElement): Replaced the bad assertion with a code to get the global object
through the script execution context associated with this custom element interface.
* Source/WebCore/dom/CustomElementRegistry.cpp:
(WebCore::CustomElementRegistry::initialize): Implement the new semantics.
* Source/WebCore/dom/Document.cpp:
(WebCore::createUpgradeCandidateElement): Call setUsesNullCustomElementRegistry in the callers of this function (createElementNS
and createElementForBindings).
(WebCore::Document::createElementForBindings):
(WebCore::Document::createElementNS):
Canonical link: https://commits.webkit.org/303250@main1 parent bd68a87 commit c13b9f1
File tree
7 files changed
+126
-19
lines changed- LayoutTests/imported/w3c/web-platform-tests/custom-elements/registries
- Source/WebCore
- bindings/js
- dom
7 files changed
+126
-19
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | | - | |
28 | 26 | | |
29 | | - | |
| 27 | + | |
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
Lines changed: 90 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
124 | | - | |
| 123 | + | |
| 124 | + | |
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
129 | | - | |
| 128 | + | |
| 129 | + | |
130 | 130 | | |
131 | | - | |
| 131 | + | |
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
222 | 226 | | |
223 | | - | |
| 227 | + | |
224 | 228 | | |
225 | | - | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
226 | 232 | | |
| 233 | + | |
| 234 | + | |
227 | 235 | | |
228 | 236 | | |
229 | 237 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1524 | 1524 | | |
1525 | 1525 | | |
1526 | 1526 | | |
1527 | | - | |
1528 | | - | |
1529 | | - | |
1530 | | - | |
1531 | 1527 | | |
1532 | 1528 | | |
1533 | 1529 | | |
| |||
1597 | 1593 | | |
1598 | 1594 | | |
1599 | 1595 | | |
| 1596 | + | |
1600 | 1597 | | |
1601 | | - | |
1602 | 1598 | | |
1603 | 1599 | | |
1604 | 1600 | | |
1605 | | - | |
| 1601 | + | |
| 1602 | + | |
| 1603 | + | |
1606 | 1604 | | |
1607 | 1605 | | |
1608 | 1606 | | |
| |||
2035 | 2033 | | |
2036 | 2034 | | |
2037 | 2035 | | |
| 2036 | + | |
2038 | 2037 | | |
2039 | | - | |
2040 | 2038 | | |
2041 | 2039 | | |
2042 | 2040 | | |
2043 | | - | |
| 2041 | + | |
| 2042 | + | |
| 2043 | + | |
2044 | 2044 | | |
2045 | 2045 | | |
2046 | 2046 | | |
| |||
0 commit comments