gecko-dev/dom/base/crashtests/1459688.html
Emilio Cobos Álvarez e6040e95d1 Bug 1459688: Properly traverse the stylesheet list of the shadow root. r=smaug
This is sound because the unlink implementation of the stylesheet drops the
preserved wrapper, and there are no strong references back to any node from the
stylesheet or any of the non-unlinked members.

This almost is the same setup that works for document sheets. We need to account
for a double reference in case the sheet is applicable because Servo keeps
another reference to it in that case, instead of in the StyleSet / PresShell.

Added the testcase as a crashtest, in the hopes that if it regresses leak
reporting on automation will catch it.

MozReview-Commit-ID: Kcc5oaOvP9A
2018-05-07 20:42:20 +02:00

7 lines
185 B
HTML

<!doctype html>
<div id="host"></div>
<script>
host.attachShadow({ mode: "open" }).innerHTML = `<style></style>`;
host.shadowRoot.styleSheets[0].foobie = host.shadowRoot;
</script>