From d8bbc7858622b6d9c278469aab701ca0b609cddf Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 15 May 2024 05:35:49 +0200 Subject: Merging upstream version 126.0. Signed-off-by: Daniel Baumann --- .../mochitest/tests/Harness_sanity/xpcshell.toml | 2 ++ .../tests/SimpleTest/AccessibilityUtils.js | 27 ++++++++++++++++++---- testing/mochitest/tests/SimpleTest/EventUtils.js | 4 ++-- 3 files changed, 26 insertions(+), 7 deletions(-) (limited to 'testing/mochitest/tests') 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