From 43a97878ce14b72f0981164f87f2e35e14151312 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:22:09 +0200 Subject: Adding upstream version 110.0.1. Signed-off-by: Daniel Baumann --- accessible/tests/mochitest/hyperlink/a11y.ini | 7 + accessible/tests/mochitest/hyperlink/hyperlink.js | 46 ++++ .../tests/mochitest/hyperlink/test_general.html | 279 +++++++++++++++++++++ .../tests/mochitest/hyperlink/test_general.xhtml | 98 ++++++++ 4 files changed, 430 insertions(+) create mode 100644 accessible/tests/mochitest/hyperlink/a11y.ini create mode 100644 accessible/tests/mochitest/hyperlink/hyperlink.js create mode 100644 accessible/tests/mochitest/hyperlink/test_general.html create mode 100644 accessible/tests/mochitest/hyperlink/test_general.xhtml (limited to 'accessible/tests/mochitest/hyperlink') diff --git a/accessible/tests/mochitest/hyperlink/a11y.ini b/accessible/tests/mochitest/hyperlink/a11y.ini new file mode 100644 index 0000000000..60804a70c8 --- /dev/null +++ b/accessible/tests/mochitest/hyperlink/a11y.ini @@ -0,0 +1,7 @@ +[DEFAULT] +support-files = hyperlink.js + !/accessible/tests/mochitest/*.js + !/accessible/tests/mochitest/letters.gif + +[test_general.html] +[test_general.xhtml] diff --git a/accessible/tests/mochitest/hyperlink/hyperlink.js b/accessible/tests/mochitest/hyperlink/hyperlink.js new file mode 100644 index 0000000000..93caa9090c --- /dev/null +++ b/accessible/tests/mochitest/hyperlink/hyperlink.js @@ -0,0 +1,46 @@ +/* import-globals-from ../common.js */ +/* import-globals-from ../events.js */ +/* import-globals-from ../states.js */ + +/** + * Focus hyperlink invoker. + * + * @param aID [in] hyperlink identifier + * @param aSelectedAfter [in] specifies if hyperlink is selected/focused after + * the focus + */ +function focusLink(aID, aSelectedAfter) { + this.node = getNode(aID); + this.accessible = getAccessible(this.node); + + this.eventSeq = []; + this.unexpectedEventSeq = []; + + var checker = new invokerChecker(EVENT_FOCUS, this.accessible); + if (aSelectedAfter) { + this.eventSeq.push(checker); + } else { + this.unexpectedEventSeq.push(checker); + } + + this.invoke = function focusLink_invoke() { + var expectedStates = aSelectedAfter ? STATE_FOCUSABLE : 0; + var unexpectedStates = + (!aSelectedAfter ? STATE_FOCUSABLE : 0) | STATE_FOCUSED; + testStates(aID, expectedStates, 0, unexpectedStates, 0); + + this.node.focus(); + }; + + this.finalCheck = function focusLink_finalCheck() { + var expectedStates = aSelectedAfter ? STATE_FOCUSABLE | STATE_FOCUSED : 0; + var unexpectedStates = !aSelectedAfter + ? STATE_FOCUSABLE | STATE_FOCUSED + : 0; + testStates(aID, expectedStates, 0, unexpectedStates, 0); + }; + + this.getID = function focusLink_getID() { + return "focus hyperlink " + prettyName(aID); + }; +} diff --git a/accessible/tests/mochitest/hyperlink/test_general.html b/accessible/tests/mochitest/hyperlink/test_general.html new file mode 100644 index 0000000000..c652f1d962 --- /dev/null +++ b/accessible/tests/mochitest/hyperlink/test_general.html @@ -0,0 +1,279 @@ + + + + + nsIHyperLinkAccessible chrome tests + + + + + + + + + + + + + + + +Mozilla Bug 418368

+  

Simple link:
Mozilla Foundation
ARIA link:
Mozilla Foundation Home
Invalid, non-focusable hyperlink:
Invalid link
Image map:
ba
Empty link:

Link with embedded span
Heise Online
Named anchor, must not have "linked" state for it to be exposed correctly:
This should never be of state_linked
Link having no attributes, must not have "linked" state:This should never be of state_linked
Link with registered 'click' event: This should have state_linked
Link with title attribute (no name from subtree):
Link with title attribute (name from subtree): the name from subtree
Link with title attribute (name from nested image): The title for link

Map that is used to group links (www.w3.org/TR/WCAG10-HTML-TECHS/#group-bypass), also see the bug 431615:
+ diff --git a/accessible/tests/mochitest/hyperlink/test_general.xhtml b/accessible/tests/mochitest/hyperlink/test_general.xhtml new file mode 100644 index 0000000000..8aa50633bb --- /dev/null +++ b/accessible/tests/mochitest/hyperlink/test_general.xhtml @@ -0,0 +1,98 @@ + + + + + + + + + + + Mozilla Bug 421066 + +

+ +
+    
+ + + +
-- cgit v1.2.3