34 lines
1.2 KiB
HTML
34 lines
1.2 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<body>
|
|
<p>This tests clicking on a Text node assigned to a slot inside an anchor element. The link should be activated.<br>
|
|
To manually test, click "here" below and you should see "PASS" and the mouse cursor should indicate it's a hyperlink, not text:</p>
|
|
<script src="../../resources/ui-helper.js"></script>
|
|
<script>
|
|
|
|
var shadowHost = document.createElement('div');
|
|
document.body.appendChild(shadowHost);
|
|
|
|
shadowHost.innerHTML = `click here`;
|
|
var shadowRoot = shadowHost.attachShadow({mode: 'closed'});
|
|
shadowRoot.innerHTML = `<a href="javascript:activated()"><slot></slot></a>`;
|
|
|
|
document.write('<div>Activation: <span id="activation"><span></div>');
|
|
|
|
function activated() {
|
|
document.getElementById('activation').textContent = 'PASS';
|
|
if (window.internals)
|
|
document.getElementById('cursor').textContent = internals.getCurrentCursorInfo();
|
|
}
|
|
|
|
if (window.internals) {
|
|
testRunner.dumpAsText();
|
|
document.getElementById('activation').textContent = 'FAIL';
|
|
document.write('<div>Cursor: <span id="cursor">FAIL<span></div>');
|
|
UIHelper.wait(UIHelper.activateAt(shadowHost.offsetLeft + 5, shadowHost.offsetTop + 5));
|
|
}
|
|
|
|
</script>
|
|
</body>
|
|
</html>
|