summaryrefslogtreecommitdiffstats
path: root/testing/mochitest/tests
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
commitd8bbc7858622b6d9c278469aab701ca0b609cddf (patch)
treeeff41dc61d9f714852212739e6b3738b82a2af87 /testing/mochitest/tests
parentReleasing progress-linux version 125.0.3-1~progress7.99u1. (diff)
downloadfirefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz
firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/mochitest/tests')
-rw-r--r--testing/mochitest/tests/Harness_sanity/xpcshell.toml2
-rw-r--r--testing/mochitest/tests/SimpleTest/AccessibilityUtils.js27
-rw-r--r--testing/mochitest/tests/SimpleTest/EventUtils.js4
3 files changed, 26 insertions, 7 deletions
diff --git a/testing/mochitest/tests/Harness_sanity/xpcshell.toml b/testing/mochitest/tests/Harness_sanity/xpcshell.toml
index f203c1ef9f..e426c515fe 100644
--- a/testing/mochitest/tests/Harness_sanity/xpcshell.toml
+++ b/testing/mochitest/tests/Harness_sanity/xpcshell.toml
@@ -1,5 +1,7 @@
[DEFAULT]
["test_SpecialPowersSandbox.js"]
+prefs = ["dom.security.https_first=false"] #Disable https-first because createHttpServer does not support https
["test_SpecialPowersSpawn.js"]
+prefs = ["dom.security.https_first=false"] #Disable https-first because createHttpServer does not support https
diff --git a/testing/mochitest/tests/SimpleTest/AccessibilityUtils.js b/testing/mochitest/tests/SimpleTest/AccessibilityUtils.js
index cf4daaf416..27a0bdf1f5 100644
--- a/testing/mochitest/tests/SimpleTest/AccessibilityUtils.js
+++ b/testing/mochitest/tests/SimpleTest/AccessibilityUtils.js
@@ -614,12 +614,13 @@ this.AccessibilityUtils = (function () {
(node.tagName == "menuitem" &&
node.classList.contains("urlbarView-result-menuitem"));
+ let parentNode = node.getRootNode().host ?? node.parentNode;
const isParentMenu =
- node.parentNode.getAttribute("role") == "menu" ||
- (node.parentNode.tagName == "richlistbox" &&
- node.parentNode.classList.contains("autocomplete-richlistbox")) ||
- (node.parentNode.tagName == "menupopup" &&
- node.parentNode.classList.contains("urlbarView-result-menu"));
+ parentNode.getAttribute("role") == "menu" ||
+ (parentNode.tagName == "richlistbox" &&
+ parentNode.classList.contains("autocomplete-richlistbox")) ||
+ (parentNode.tagName == "menupopup" &&
+ parentNode.classList.contains("urlbarView-result-menu"));
return (
isMenuItem &&
isParentMenu &&
@@ -1078,6 +1079,22 @@ this.AccessibilityUtils = (function () {
}
// Walk a11y ancestors until we find one which is interactive.
for (; acc; acc = acc.parent) {
+ const relation = acc.getRelationByType(
+ Ci.nsIAccessibleRelation.RELATION_LABEL_FOR
+ );
+ if (
+ acc.role === Ci.nsIAccessibleRole.ROLE_LABEL &&
+ relation.targetsCount > 0
+ ) {
+ // If a <label> was clicked to activate a radiobutton or a checkbox,
+ // return the accessible of the related input.
+ // Note: aria-labelledby doesn't give the node a role of label, so this
+ // won't work for aria-labelledby cases. That said, aria-labelledby also
+ // doesn't have implicit click behaviour either and there's not really
+ // any way we can check for that.
+ const targetAcc = relation.getTarget(0);
+ return targetAcc;
+ }
if (INTERACTIVE_ROLES.has(acc.role)) {
return acc;
}
diff --git a/testing/mochitest/tests/SimpleTest/EventUtils.js b/testing/mochitest/tests/SimpleTest/EventUtils.js
index 8833b8bc59..59ad054714 100644
--- a/testing/mochitest/tests/SimpleTest/EventUtils.js
+++ b/testing/mochitest/tests/SimpleTest/EventUtils.js
@@ -42,8 +42,8 @@ window.__defineGetter__("_EU_ChromeUtils", function () {
window.__defineGetter__("_EU_OS", function () {
delete this._EU_OS;
try {
- this._EU_OS = _EU_ChromeUtils.import(
- "resource://gre/modules/AppConstants.jsm"
+ this._EU_OS = _EU_ChromeUtils.importESModule(
+ "resource://gre/modules/AppConstants.sys.mjs"
).platform;
} catch (ex) {
this._EU_OS = null;