playwright/tests/assets/shadow-dom-link.html

29 lines
562 B
HTML

<html>
<head>
<script>
customElements.define('my-link',
class extends HTMLElement {
constructor() {
super();
const template = document.getElementById('my-link-template');
const templateContent = template.content;
this.attachShadow({mode: 'open'}).appendChild(
templateContent.cloneNode(true)
);
}
}
);
window.clickCount = 0;
</script>
</head>
<body>
<template id="my-link-template">
<a href="#" id="inner-link" onclick="clickCount++"><slot></slot></a>
</template>
<my-link>Sign up</my-link>
</body>
</html>