mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 02:05:07 +02:00
27 lines
850 B
HTML
27 lines
850 B
HTML
<!DOCTYPE html>
|
|
<meta charset="UTF-8">
|
|
<title>accessKeyLabel attribute</title>
|
|
<script src="../../resources/testharness.js"></script>
|
|
<script src="../../resources/testharnessreport.js"></script>
|
|
<body>
|
|
<script>
|
|
function createButtonWithAccessKey(accessKey) {
|
|
const button = document.createElement('button');
|
|
button.setAttribute('accesskey', accessKey);
|
|
return button;
|
|
}
|
|
|
|
// The modifiers are not the same across all browser vendors.
|
|
// Therefore, the test uses non empty.
|
|
test(() => {
|
|
const element = createButtonWithAccessKey('b');
|
|
assert_not_equals(element.accessKeyLabel, '');
|
|
}, 'Returns non empty string when accesskey is valid');
|
|
|
|
test(() => {
|
|
const element = createButtonWithAccessKey('s 0');
|
|
assert_equals(element.accessKeyLabel, '');
|
|
}, 'Returns empty string when accesskey is invalid');
|
|
</script>
|
|
</body>
|
|
</html> |