WebKit Bugzilla
Attachment 345910 Details for
Bug 184307
: Custom elements in a reaction queue can lose its JS wrapper and become HTMLUnknownElement
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
testcase (reformatted)
bug184307-custom-element-innerHTML.html (text/html), 957 bytes, created by
Frédéric Wang (:fredw)
on 2018-07-27 03:05:49 PDT
(
hide
)
Description:
testcase (reformatted)
Filename:
MIME Type:
Creator:
Frédéric Wang (:fredw)
Created:
2018-07-27 03:05:49 PDT
Size:
957 bytes
patch
obsolete
><html> > <head> > <script> > class MyComponent extends HTMLElement { > constructor() { > super(); > } > connectedCallback() { > if (this instanceof HTMLUnknownElement) > console.log("HTMLUnknownElement"); > else if (this instanceof MyComponent) > console.log("MyComponent"); > } > } > customElements.define("my-component", MyComponent); > function startLoop() { > var content = ''; > for (var i = 0; i < 1000; i++) > content += '<my-component></my-component>' > var container = document.getElementById("elementContainer"); > console.group("looping"); > for (var i = 0; i < 500; i++) > container.innerHTML = content; > console.log("done"); > console.groupEnd(); > } > > </script> > </head> > <body> > <button onclick="startLoop()">Start Loop</button> > <div id="elementContainer"></div> > </body> ></html>
<html> <head> <script> class MyComponent extends HTMLElement { constructor() { super(); } connectedCallback() { if (this instanceof HTMLUnknownElement) console.log("HTMLUnknownElement"); else if (this instanceof MyComponent) console.log("MyComponent"); } } customElements.define("my-component", MyComponent); function startLoop() { var content = ''; for (var i = 0; i < 1000; i++) content += '<my-component></my-component>' var container = document.getElementById("elementContainer"); console.group("looping"); for (var i = 0; i < 500; i++) container.innerHTML = content; console.log("done"); console.groupEnd(); } </script> </head> <body> <button onclick="startLoop()">Start Loop</button> <div id="elementContainer"></div> </body> </html>
View Attachment As Raw
Actions:
View
Attachments on
bug 184307
:
337178
|
345910
|
349736
|
349740
|
349844
|
350093
|
350146
|
350157
|
350178