@@ -2275,3 +2275,78 @@ def test_ARIASwitchRole():
22752275 ]),
22762276 message = "Report focus" ,
22772277 )
2278+
2279+
2280+ def test_i13307 ():
2281+ """
2282+ Even if (to avoid duplication) NVDA may choose to not speak a landmark or region's label
2283+ when arrowing into a landmark or region with an aria-labelledby,
2284+ it should still speak the label when junping inside the landmark or region
2285+ from outside using quicknav or focus.
2286+ """
2287+ _chrome .prepareChrome (
2288+ """
2289+ <p>navigation landmark with aria-label</p>
2290+ <nav aria-label="label">
2291+ <button>inner element</button>
2292+ </nav>
2293+ <p>Navigation landmark with aria-labelledby</p>
2294+ <nav aria-labelledby="innerHeading1">
2295+ <h1 id="innerHeading1">labelled by</h1>
2296+ <button>inner element</button>
2297+ </nav>
2298+ <p>Region with aria-label</p>
2299+ <section aria-label="label">
2300+ <button>inner element</button>
2301+ </section>
2302+ <p>Region with aria-labelledby</p>
2303+ <section aria-labelledby="innerHeading2">
2304+ <h1 id="innerHeading2">labelled by</h1>
2305+ <button>inner element</button>
2306+ </section>
2307+ """
2308+ )
2309+ actualSpeech = _chrome .getSpeechAfterKey ("tab" )
2310+ _asserts .strings_match (
2311+ actualSpeech ,
2312+ SPEECH_SEP .join ([
2313+ "label" ,
2314+ "navigation landmark" ,
2315+ "inner element" ,
2316+ "button" ,
2317+ ]),
2318+ message = "jumping into landmark with aria-label should speak label" ,
2319+ )
2320+ actualSpeech = _chrome .getSpeechAfterKey ("tab" )
2321+ _asserts .strings_match (
2322+ actualSpeech ,
2323+ SPEECH_SEP .join ([
2324+ "labelled by" ,
2325+ "navigation landmark" ,
2326+ "inner element" ,
2327+ "button" ,
2328+ ]),
2329+ message = "jumping into landmark with aria-labelledby should speak label" ,
2330+ )
2331+ actualSpeech = _chrome .getSpeechAfterKey ("tab" )
2332+ _asserts .strings_match (
2333+ actualSpeech ,
2334+ SPEECH_SEP .join ([
2335+ "label" ,
2336+ "region" ,
2337+ "inner element" ,
2338+ "button" ,
2339+ ]),
2340+ message = "jumping into region with aria-label should speak label" ,
2341+ )
2342+ actualSpeech = _chrome .getSpeechAfterKey ("tab" )
2343+ _asserts .strings_match (
2344+ actualSpeech ,
2345+ SPEECH_SEP .join ([
2346+ "labelled by" ,
2347+ "region" ,
2348+ "inner element" ,
2349+ "button" ,
2350+ ]),
2351+ message = "jumping into region with aria-labelledby should speak label" ,
2352+ )
0 commit comments