Occasionally, properties that are set on window.customElements very early in the lifetime of the page are removed by garbage collection. To repro, put the attached files in the same directory and open 'index.html'. You may need to adjust the number of objects created in 'test.html' to balance the repro rate with the time per run. You can also trigger this (at a reduced rate) by putting an external script that spins for 10-20ms between the write / read instead of creating objects. This seems to affect 10, TP, and Nightly.
Created attachment 311187 [details] test.html
Created attachment 311188 [details] index.html
Comment on attachment 311187 [details] test.html <script> // Uncomment this section to prevent the bug. /* Object.defineProperty(window, 'customElements', { value: window.customElements, }); */ window.customElements.prop = 1234; const a = []; for (let i = 0; i < 1000000; i++) { a.push({}); } const pass = window.customElements.prop === 1234; window.parent.postMessage(pass, '*'); </script>
Created attachment 311189 [details] test.html
This seems like it's probably related to 171567.
<rdar://problem/32440668>
(In reply to Russell Bicknell from comment #5) > This seems like it's probably related to 171567. It's not.
Created attachment 346581 [details] Fixes the bug
Committed r234578: <https://trac.webkit.org/changeset/234578>
Comment on attachment 346581 [details] Fixes the bug View in context: https://bugs.webkit.org/attachment.cgi?id=346581&action=review > Source/WebCore/dom/CustomElementRegistry.idl:29 > EnabledAtRuntime=CustomElements, > - ImplementationLacksVTable, > JSGenerateToNativeObject, > + GenerateIsReachable=ImplScriptExecutionContext We’ve been sorting these alphabetically and putting commas on every line. So this should be a line higher and have a comma.
Sure. Fixed it in r234585.
Looks like the new test fast/custom-elements/custom-element-registry-wrapper-should-stay-alive.html is a constant timeout on all debug platforms. Test History: https://webkit-test-results.webkit.org/dashboards/flakiness_dashboard.html#showAllRuns=true&tests=fast%2Fcustom-elements%2Fcustom-element-registry-wrapper-should-stay-alive.html
Yeah, noticed. Will look into it today.
The test failure is tracked by https://bugs.webkit.org/show_bug.cgi?id=188353.