<!doctypehtml>
<meta charset="utf-8">
<title>Bug 1481500: click / activation on text activates the slot it's assigned to
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<script src="/tests/SimpleTest/EventUtils.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<script>
function generateLotsOfText() {
let text = "Some text. ";
for (let i = 0; i < 10; ++i)
text += text;
return text;
}
let slot = host.shadowRoot.querySelector('slot');
let mousedownFired = false;
let mouseupFired = false;
slot.addEventListener('mousedown', function() {
ok(true, "Mousedown should fire on the slot when clicking on text");
mousedownFired = true;
});
slot.addEventListener('click', function() {
ok(true, "Click should target the slot");
ok(mousedownFired, "mousedown should've fired");
ok(mouseupFired, "click should've fired");
SimpleTest.finish();
});
slot.addEventListener('mouseup', function() {
// FIXME: When we fix bug 1481517, this check should move to the mousedown listener.
ok(this.matches(":active"), "Slot should become active");
mouseupFired = true;
});
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.