mirror of
https://github.com/servo/servo.git
synced 2025-10-14 15:30:27 +01:00
39 lines
1.5 KiB
HTML
39 lines
1.5 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8"/>
|
|
<title>MathML tabIndex attribute</title>
|
|
<link rel="help" href="https://mathml-refresh.github.io/mathml-core/#css-styling">
|
|
<link rel="help" href="https://mathml-refresh.github.io/mathml-core/#the-top-level-math-element">
|
|
<meta name="assert" content="Verify default values for the tabIndex attribute">
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<script>
|
|
window.addEventListener("load", function() {
|
|
test(() => {
|
|
const mrow = document.getElementById('mrow');
|
|
assert_equals(mrow.tabIndex, -1, "no attribute");
|
|
mrow.setAttribute("tabindex", "invalid");
|
|
assert_equals(mrow.tabIndex, -1, "invalid");
|
|
mrow.setAttribute("tabindex", "9999999999");
|
|
assert_equals(mrow.tabIndex, -1, "too large integer");
|
|
}, "default and invalid values on mrow");
|
|
test(() => {
|
|
const mrowLink = document.getElementById('mrow-link');
|
|
assert_equals(mrow.tabIndex, 0, "no attribute");
|
|
mrow.setAttribute("tabindex", "invalid");
|
|
assert_equals(mrow.tabIndex, 0, "invalid");
|
|
mrow.setAttribute("tabindex", "9999999999");
|
|
assert_equals(mrow.tabIndex, 0, "too large integer");
|
|
}, "default and invalid values on MathML link");
|
|
});
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<div id="log"></div>
|
|
<math>
|
|
<mrow id="mrow" onfocus="alert('fail')"></mrow>
|
|
<mrow id="mrow-link" href="javascript:alert('fail')" onfocus="alert('fail')"></mrow>
|
|
</math>
|
|
</body>
|
|
</html>
|