From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- accessible/tests/mochitest/hyperlink/a11y.toml | 8 + accessible/tests/mochitest/hyperlink/hyperlink.js | 46 ++++ .../tests/mochitest/hyperlink/test_general.html | 278 +++++++++++++++++++++ .../tests/mochitest/hyperlink/test_general.xhtml | 98 ++++++++ 4 files changed, 430 insertions(+) create mode 100644 accessible/tests/mochitest/hyperlink/a11y.toml 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.toml b/accessible/tests/mochitest/hyperlink/a11y.toml new file mode 100644 index 0000000000..77f551ee5d --- /dev/null +++ b/accessible/tests/mochitest/hyperlink/a11y.toml @@ -0,0 +1,8 @@ +[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..8b0eb39b01 --- /dev/null +++ b/accessible/tests/mochitest/hyperlink/test_general.html @@ -0,0 +1,278 @@ + + + + + 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..b006e58ef4 --- /dev/null +++ b/accessible/tests/mochitest/hyperlink/test_general.xhtml @@ -0,0 +1,98 @@ + + + + + + + + + + + Mozilla Bug 421066 + +

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