diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
commit | 6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch) | |
tree | a68f146d7fa01f0134297619fbe7e33db084e0aa /accessible/tests/mochitest/test_bug420863.html | |
parent | Initial commit. (diff) | |
download | thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.tar.xz thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.zip |
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'accessible/tests/mochitest/test_bug420863.html')
-rw-r--r-- | accessible/tests/mochitest/test_bug420863.html | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/accessible/tests/mochitest/test_bug420863.html b/accessible/tests/mochitest/test_bug420863.html new file mode 100644 index 0000000000..4f3a608fe1 --- /dev/null +++ b/accessible/tests/mochitest/test_bug420863.html @@ -0,0 +1,99 @@ +<!DOCTYPE html> +<html> +<!-- +https://bugzilla.mozilla.org/show_bug.cgi?id=420863 +--> +<head> + <title>Table indexes chrome tests</title> + <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" /> + + <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> + + <script type="application/javascript" + src="common.js"></script> + <script type="application/javascript" + src="events.js"></script> + <script type="application/javascript" + src="actions.js"></script> + + <script type="application/javascript"> + var gClickHandler = null; + + function doTest() { + // Actions should be exposed on any accessible having related DOM node + // with registered 'click' event handler. + + // //////////////////////////////////////////////////////////////////////// + // generic td + var td1Acc = getAccessible("td1"); + if (!td1Acc) { + SimpleTest.finish(); + return; + } + + is(td1Acc.actionCount, 0, + "Simple table cell shouldn't have any actions"); + + // //////////////////////////////////////////////////////////////////////// + // one td with 'onclick' attribute and one with registered click handler + var td3Node = getNode("td3"); + + // register 'click' event handler + gClickHandler = { + handleEvent: function handleEvent(aEvent) { + }, + }; + td3Node.addEventListener("click", gClickHandler); + + // check actions + var actionsArray = [ + { + ID: "td2", // "onclick" attribute + actionName: "click", + actionIndex: 0, + events: CLICK_EVENTS, + }, + { + ID: td3Node, + actionName: "click", + actionIndex: 0, + events: CLICK_EVENTS, + checkOnClickEvent: function check(aEvent) { + // unregister click event handler + this.ID.removeEventListener("click", gClickHandler); + + // check actions + is(getAccessible(this.ID).actionCount, 0, + "td3 shouldn't have actions"); + }, + }, + ]; + + testActions(actionsArray); // will call SimpleTest.finish() + } + + SimpleTest.waitForExplicitFinish(); + addA11yLoadEvent(doTest); + </script> +</head> +<body> + + <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=420863" + title="If an HTML element has an onClick attribute, expose its click action on the element rather than its child text leaf node." + target="_blank">Mozilla Bug 420863</a> + <p id="display"></p> + <div id="content" style="display: none"></div> + <pre id="test"> + </pre> + + <table> + <tr> + <td id="td1">Can't click this cell</td> + <td onclick="gTdClickAttr = true;" + id="td2">Cell with 'onclick' attribute</td> + <td id="td3">Cell with registered 'click' event handler</td> + </tr> + </table> + +</body> +</html> |