ARIA और विजेट पैटर्न

WAI-ARIA, W3C का एक specification है जिसके attributes (role और aria-* attributes) assistive technology को बताते हैं कि कोई custom control क्या है और किस state में है, जब HTML में उसके लिए कोई element नहीं होता। Tabs component के लिए कोई native element नहीं है, इसलिए developer container पर role="tablist", हर tab पर role="tab" और जिस tab का panel दिख रहा है उस पर aria-selected="true" लगाता है। ARIA सिर्फ़ वही बदलता है जो accessibility tree में उजागर होता है: tabs से users जिस arrow-key व्यवहार की उम्मीद करते हैं, वह फिर भी script में लिखना पड़ता है।

W3C का ARIA Authoring Practices Guide (APG) बताता है कि आम widgets को कैसा व्यवहार करना चाहिए: हर एक को कौन-से roles, states और properties चाहिए और कौन-सी keys उसे चलाती हैं। Tester के लिए APG pattern एक तैयार expected result है: यह lesson pattern pages को पाँच आम widgets के tests में, और pattern व WCAG 4.1.2 पर आधारित defects में बदलना सिखाता है।

यह क्यों ज़रूरी है

आधुनिक web applications में custom widgets उन जगहों में हैं जहाँ accessibility सबसे आसानी से टूटती है, क्योंकि native element जो कुछ मुफ़्त देता है, वह सब हाथ से दोबारा बनाना पड़ता है: role, name, state, focus की हलचल और हर key। ऐसा dialog जिससे focus पीछे के पेज पर निकल जाए, ऐसे tabs जिनकी selected state कभी न बदले, या ऐसा combobox जिसका highlighted option कभी announce न हो, कीबोर्ड या स्क्रीन रीडर user को payment या form पूरा करने से रोक सकता है। ये WCAG 2.2 के 4.1.2 Name, Role, Value, 2.1.1 Keyboard और 2.4.3 Focus Order जैसे success criteria में failures हैं, तीनों Level A।

ग़लत ARIA बिना ARIA से भी बुरा हो सकता है: role एक व्यवहार का वादा करता है, और जब वह व्यवहार न हो तो user गुमराह होता है। Tester के लिए patterns "tabs accessible नहीं हैं" जैसी धुँधली finding को सटीक, जाँचने लायक expectations में बदल देते हैं जिन पर developer काम कर सके, और असली WCAG failures को किसी convention से हटने वाली बातों से अलग करने में मदद करते हैं।

ARIA एक पैराग्राफ़ में, और पहला नियम

Screen reader testing guide ARIA को विस्तार से समझाता है; यह वह छोटा सार है जिस पर यह lesson टिका है। Roles बताते हैं कि element क्या है (tab, dialog, menu, combobox)। States वे स्थितियाँ हैं जो user के काम करते समय बदलती हैं (aria-expanded, aria-selected, aria-checked)। Properties ज़्यादा स्थिर विशेषताएँ और संबंध हैं (aria-label, aria-labelledby, aria-controls, aria-haspopup)। Accessible name अब भी वैसे ही compute होता है जैसा वह guide बताता है, जिसमें aria-labelledby और aria-label को प्राथमिकता मिलती है। कुछ roles का अर्थ सिर्फ़ अपने context में है: tab एक tablist के अंदर, option एक listbox के अंदर, और menuitem एक menu के अंदर होता है।

ARIA के इस्तेमाल का पहला नियम: अगर किसी native HTML element या attribute में ज़रूरी semantics और व्यवहार पहले से हैं, तो ARIA जोड़ने की बजाय वही इस्तेमाल करें। <button>, <div role="button"> से बेहतर है क्योंकि वह focus लेता है और Enter व Space ख़ुद सँभालता है; <details> और <summary> तैयार disclosure देते हैं; showModal() से खुला <dialog> बाक़ी पेज को inert कर देता है। इसलिए किसी भी custom widget के review में पहला सवाल यही है कि क्या उसे ARIA की ज़रूरत है भी। Tabs, menu buttons और custom list वाले comboboxes का कोई पूरा native विकल्प नहीं है, इसीलिए testers के लिए उनके patterns अहम हैं।

APG pattern page कैसे पढ़ें

हर APG pattern page एक जैसे हिस्सों से बना है, और हर हिस्सा एक तरह के test में बदलता है। Product खोलने से पहले expected results लिख लें।

उदाहरण के लिए, Tabs pattern की Right Arrow वाली entry एक कीबोर्ड test बन जाती है: किसी tab पर focus रखें, Right Arrow दबाएँ, अगले tab पर focus की उम्मीद करें, और आख़िरी tab पर उम्मीद करें कि focus घूमकर पहले tab पर आए। उसका roles वाला हिस्सा tree check बन जाता है: हर tab एक tablist के अंदर tab है, और सिर्फ़ उसी tab पर aria-selected="true" है जिसका panel दिख रहा है।

  • About This Pattern: widget किसलिए है। Widget को उसके व्यवहार से पहचानें, रूप से नहीं: buttons की एक row जो उसी जगह panels बदलती है, tabs है; "Show more" button एक disclosure है; और नीचे खुलने वाली site links की list navigation है, menu नहीं।
  • Keyboard Interaction: हर key के लिए एक entry, और हर entry expected result वाला एक test step। "(Optional)" लिखी keys, जैसे tabs में Home और End, ज़रूरी नहीं हैं, लेकिन अगर product उन्हें implement करता है तो उन्हें बताए अनुसार काम करना चाहिए।
  • WAI-ARIA Roles, States, and Properties: roles और कौन किसके अंदर होगा, runtime पर बदलने वाली states, और हिस्सों को नाम देने व जोड़ने वाली properties। हर line accessibility tree में एक check है। शर्तें ध्यान से पढ़ें: "if the tab list has a visible label" ही तय करता है कि aria-labelledby लगेगा या aria-label।
  • Examples: चलते हुए demos, हर एक के साथ keyboard support table और roles, properties, states व tabindex values की table। tabindex column बताता है कि example कौन-सी focus technique इस्तेमाल करता है।
  • Pattern जो विकल्प खुले छोड़ता है: tabs का automatic या manual activation, horizontal या vertical orientation। Team से पूछें कि उन्होंने कौन-सा variant चुना और उसे test basis में दर्ज करें; वरना आप defect और design decision में फ़र्क नहीं कर पाएँगे।
Markup में APG Tabs pattern: नाम वाली tablist, ऐसे tabs जिनकी aria-selected state और roving tabindex साथ-साथ चलते हैं, और अपने tab से नाम पाने वाले panels।

Order page के दो tabs, पहला selected

<div भाग 1:role="tablist" भाग 2:aria-label="Order details">
  <button भाग 3:role="tab" id="t1" भाग 4:aria-selected="true"
          भाग 5:aria-controls="p1" भाग 6:tabindex="0">Items</button>
  <button भाग 3:role="tab" id="t2" भाग 4:aria-selected="false"
          भाग 5:aria-controls="p2" भाग 6:tabindex="-1">Delivery</button>
</div>
<div भाग 7:role="tabpanel" id="p1" भाग 8:aria-labelledby="t1"
     भाग 9:tabindex="0">…</div>
<div भाग 7:role="tabpanel" id="p2" भाग 8:aria-labelledby="t2"
     भाग 9:tabindex="0" भाग 10:hidden>…</div>
  1. 1Tab listहर tab इसके अंदर है; पूरी list एक Tab stop है।
  2. 2Tab list का नामदिखने वाला label हो तो aria-labelledby, वरना aria-label।
  3. 3हर tab पर tab roleTablist के अंदर; native <button> Enter और Space सँभालता है।
  4. 4Selected stateसिर्फ़ एक true, उस tab पर जिसका panel दिख रहा है; यह panel के साथ बदलता है और बदलाव announce होता है।4.1.2
  5. 5Tab अपने panel की ओर इशारा करता हैValue panel की id है।
  6. 6Roving tabindexTab sequence में सिर्फ़ selected tab है; automatic activation में Left और Right Arrow focus, 0 और selection को साथ-साथ आगे ले जाते हैं और किनारों पर घूम जाते हैं।
  7. 7Tab panelहर tab का एक panel।
  8. 8Panel का नाम उसके tab सेPanel में आने वाला user सुनता है कि वह किस tab का है।
  9. 9Tab sequence में panelTab list के बाद अगला Tab यहाँ आता है, अगर panel content की शुरुआत में कुछ focusable न हो।
  10. 10Inactive panel छिपा हुआजब तक उसका tab select न हो, accessibility tree और Tab order से बाहर।

Keys: Tab list में selected tab पर आता है और अगला Tab panel पर जाता है; Left और Right Arrow tabs के बीच चलते और घूमते हैं; Home और End optional हैं; manual activation में Enter या Space panel दिखाते हैं।

पाँच patterns को शुरू से अंत तक verify करना

हर pattern को तीन passes में verify करें, क्योंकि हर pass अलग defects पकड़ता है। पहले browser के DevTools में accessibility tree: हर interaction से पहले और बाद role, name और states। फिर सिर्फ़ कीबोर्ड: pattern की हर key, दिखने वाला focus indicator, और widget खुलने या बंद होने पर focus कहाँ पहुँचता है। आख़िर में स्क्रीन रीडर: focus आने पर क्या announce होता है और क्या हर state change announce होता है। कोई widget tree में सही दिखकर भी कीबोर्ड में fail हो सकता है, या दोनों pass करके भी ठीक से announce न हो, क्योंकि स्क्रीन रीडर किसी role को अलग-अलग तरह support करते हैं।

  • Modal dialog। Tree: role dialog, जिसका नाम उसके दिखने वाले title से आता है, custom dialog पर aria-modal="true" के साथ, या showModal() से खुला native <dialog>। कीबोर्ड: खुलते ही focus dialog के अंदर जाता है, Tab और Shift+Tab उसी के अंदर घूमते हैं, Escape उसे बंद करता है, और focus उस control पर लौटता है जिसने उसे खोला था। स्क्रीन रीडर: खुलने पर dialog का role और name announce होते हैं, और arrow keys से पढ़ते हुए पीछे का पेज नहीं पढ़ा जाता।
  • Disclosure और accordion। Tree: एक button जिसका aria-expanded दिख रही स्थिति से मेल खाता है; accordion में हर header button एक heading के अंदर होता है। कीबोर्ड: Enter और Space section खोलते और बंद करते हैं, और बंद content तक Tab नहीं पहुँचता। स्क्रीन रीडर: button दबाने पर "collapsed" बदलकर "expanded" हो जाता है।
  • Tabs। Tree: नाम वाली tablist; aria-controls और aria-selected वाले tab elements; aria-labelledby से अपने tab का नाम पाने वाले tabpanel elements, और inactive panels छिपे हुए। कीबोर्ड: tab list एक Tab stop है जो active tab पर रुकता है; Left और Right Arrow tabs के बीच चलते हैं और किनारों पर घूम जाते हैं; अगला Tab panel में जाता है, जो ख़ुद tabindex="0" लेता है अगर उसके content की शुरुआत में कुछ focusable न हो। Right-to-left layout में वही arrow direction जाँचें जो आपकी team ने दर्ज की है। स्क्रीन रीडर: हर tab अपना name, role और selected state बोलता है, आम तौर पर अपनी position के साथ, जैसे 2 of 3।
  • Menu button। Tree: aria-haspopup वाला button, जिस पर menu खुले रहने तक aria-expanded="true" रहता है, और जो menuitem elements वाला menu खोलता है। कीबोर्ड: Enter या Space menu को पहले item पर खोलता है (Down Arrow भी खोल सकता है), Up और Down Arrow चलते हैं, Enter item चलाकर menu बंद करता है, Escape menu बंद करके focus button पर लौटाता है। स्क्रीन रीडर: button बताता है कि वह menu खोलता है, और हर item menu item के रूप में announce होता है।
  • Combobox। Tree: input का role combobox, उसके label से name, list की स्थिति से मेल खाता aria-expanded, option elements वाली listbox की ओर इशारा करता aria-controls, और highlighted option की id पर set aria-activedescendant, जिस option पर aria-selected="true" होता है। कीबोर्ड: typing options को filter करती है, Down Arrow options में चलता है जबकि focus input में ही रहता है, Enter option स्वीकार करता है, Escape list बंद करता है। स्क्रीन रीडर: चलते समय हर highlighted option पढ़ा जाता है, और typing चलती रहती है।

आज़माएँ: HTML फ़ॉर्मेटर आज़माएँ: टेस्ट केस जनरेटर

Roving tabindex और aria-activedescendant

Tabs, menus, listboxes और grids जैसे composite widgets एक Tab stop होते हैं, और उनके अंदर arrow keys चलती हैं। APG इसे बनाने के दो तरीके बताता है। Roving tabindex में मौजूदा item पर tabindex="0" और बाक़ी हर item पर tabindex="-1" होता है; हर arrow key पर script 0 को नए item पर ले जाती है और उस पर focus() call करती है। DOM focus सच में हिलता है, browser item को view में scroll करता है, और user Tab से बाहर जाकर लौटे तो focus उसी item पर आता है जिसे उसने छोड़ा था।

aria-activedescendant में DOM focus एक ही element पर रहता है (container, या combobox का input) और script attribute को active item की id पर set करती है, जिसे assistive technology focused मान लेती है। Visual focus बनाना और item को view में scroll करना script को ख़ुद करना होता है, क्योंकि browser इनमें से कुछ नहीं करता। Combobox को यही technique चाहिए ताकि user options में चलते हुए typing जारी रख सके।

दोनों में फ़र्क करने के लिए Chrome या Edge DevTools का Elements panel खोलें और arrow keys दबाएँ: देखें कौन-सा attribute बदलता है। फिर document.activeElement को live expression के रूप में जोड़ें (Console के ऊपर eye icon से), जो लगातार दिखाता रहता है कि DOM focus असल में कहाँ है। हर technique पहचानने लायक तरीकों से टूटती है:

  • Roving: कई items पर tabindex="0" रह जाता है, इसलिए Tab panel पर जाने की बजाय हर tab से गुज़रता है; या re-render के बाद किसी item पर 0 नहीं रहता और widget तक Tab से पहुँचा ही नहीं जा सकता (2.1.1)।
  • Roving: arrow key highlight तो हिलाती है पर focus() कभी call नहीं होता, इसलिए focus indicator और स्क्रीन रीडर पुराने item पर ही रहते हैं।
  • Roving: 0 पहले item पर ही रह जाता है, इसलिए Shift+Tab से लौटने पर focus ऐसे tab पर आता है जो selected नहीं है।
  • Active descendant: attribute ऐसी id की ओर इशारा करता है जो अब मौजूद नहीं, आम तौर पर list filter होकर दोबारा बनने के बाद; highlight हिलता है पर स्क्रीन रीडर कुछ नहीं बोलता।
  • Active descendant: attribute बदलता है पर कोई highlight नहीं बनता, इसलिए देख सकने वाले कीबोर्ड users नहीं जान पाते कि वे कहाँ हैं (आम तौर पर 2.4.7 Focus Visible के तहत report होता है); या active option view से बाहर scroll हुआ रहता है।
  • Active descendant: जिस element की ओर इशारा है उसका option या menuitem role नहीं है, या वह widget और उसकी controlled list से बाहर है, इसलिए वह सादे text की तरह पढ़ा जाता है या बिल्कुल नहीं।

Worked example: order tabs टेस्ट करना और defects लिखना

एक order page पर तीन tabs हैं: Items, Delivery और Payment। Refinement में team ने automatic activation वाला APG Tabs pattern चुना, इसलिए वही test basis है। तीनों passes से चार findings निकलती हैं, और हर एक को report करने से पहले classify किया जाता है।

एक उपयोगी ARIA defect component और pattern variant का नाम लेता है, exact key sequence देता है, expected और actual role, name या state वैसे लिखता है जैसे tree दिखाता है और स्क्रीन रीडर announce करता है, और WCAG criterion तभी cite करता है जब product सच में उसमें fail हो। नीचे चारों findings classify की हुई हैं, फिर दूसरी finding की report:

  • Tree: container एक सादा <div> है, इसलिए तीनों tabs ऐसे generic node के नीचे हैं जिसका न tablist role है न नाम। WAI-ARIA के अनुसार tab को tablist के अंदर होना चाहिए; users को दिखने वाला grouping उजागर नहीं है, जो 1.3.1 Info and Relationships में fail है, वही criterion जिससे W3C का ACT rule "ARIA required context role" इसे जोड़ता है।
  • Tree और स्क्रीन रीडर: Right Arrow से Delivery पर जाने के बाद Delivery panel दिखता है, पर aria-selected="true" Items पर ही रहता है, और स्क्रीन रीडर Delivery को selected नहीं बताता। स्क्रीन पर दिखने वाली state उजागर state नहीं है: 4.1.2 failure, severity Major, क्योंकि दृष्टिहीन user नहीं जान पाता कि वह कौन-सा panel पढ़ रहा है।
  • कीबोर्ड: हर tab पर tabindex="0" है, इसलिए Tab panel तक पहुँचने से पहले तीनों tabs से गुज़रता है, और Payment पर Right Arrow घूमकर Items पर जाने की बजाय कुछ नहीं करता। फिर भी हर tab कीबोर्ड से चलता है, इसलिए 2.1.1 पूरा होता है: इसे APG keyboard interaction से deviation के रूप में, severity Minor, बिना WCAG criterion के report करें।
  • Tree: panels का role tabpanel है पर aria-labelledby नहीं, इसलिए user panel में बिना यह सुने पहुँचता है कि वह किस tab का है। WAI-ARIA 1.2 में tabpanel के लिए name ज़रूरी है, इसलिए इसे pattern और WAI-ARIA के आधार पर severity Minor के साथ report करें।
Title:     Order tabs: "Delivery" पर जाने के बाद भी selected state "Items" पर रहती है
Component: Order details tabs, /orders/1042 · APG Tabs, automatic activation
Env:       Windows 11 · Firefox · NVDA (versions attachment में)
Steps:     1. Tab से "Items" tab पर जाएँ।  2. Right Arrow दबाएँ।
Expected:  Focus, panel और selection "Delivery" पर जाएँ:
           Delivery पर aria-selected="true" और Items पर "false";
           स्क्रीन रीडर Delivery को selected tab बताए।
Actual:    Delivery panel दिखता है, पर aria-selected="true" Items पर ही रहता है;
           NVDA selected state announce नहीं करता।
Criterion: WCAG 2.2 4.1.2 Name, Role, Value (Level A)
Severity:  Major
Evidence:  पहले और बाद के accessibility pane screenshots; DOM snippet

आज़माएँ: AI बग विवरण जनरेटर

आम गलतियाँ

  • जहाँ native element काफ़ी हो वहाँ ARIA जोड़ना, और फिर यह पूछने की बजाय कि ARIA क्यों है, ARIA को ही टेस्ट करना। <div role="button"> को focus और Enter व Space handling चाहिए, जो <button> में पहले से है।
  • सिर्फ़ यह जाँचना कि roles मौजूद हैं। Roles स्थिर हैं; ज़्यादातर defects ऐसी states हैं जो बदलती नहीं, जैसे aria-expanded और aria-selected, और ऐसा focus जो हिलता नहीं। हर key से पहले और बाद tree जाँचें।
  • APG से हर अंतर को WCAG failure मानना। WCAG कीबोर्ड से operation और उजागर name, role व value माँगता है, APG की key bindings नहीं: arrows की बजाय Tab से चलने वाले tabs pattern से हटते हैं, पर 2.1.1 फिर भी पूरा कर सकते हैं।
  • aria-activedescendant वाले widget में दिखने वाले highlight पर भरोसा करना। Highlight और attribute अलग-अलग set होते हैं, इसलिए पक्का करें कि attribute सही role वाले मौजूद element की ओर इशारा करता है।
  • WCAG 2.2 audit में ग़लत ARIA के लिए 4.1.1 Parsing cite करना। WCAG 2.2 में 4.1.1 obsolete और हटाया गया है; users असल में जो खोते हैं उसके अनुसार 4.1.2, 1.3.1 या 2.1.1 cite करें।

QA का नज़रिया

Team में pattern की बातचीत build से पहले होनी चाहिए। जब कोई story कोई custom widget लाए, तो पूछें कि क्या native element काफ़ी है, और अगर नहीं, तो वह कौन-सा APG pattern और variant follow करेगा। Pattern का नाम और variant acceptance criteria में लिखें, ताकि designers, developers और testers का expected result एक हो और pattern की keyboard table definition of done का हिस्सा बन जाए।

टेस्ट करते समय हर component के लिए उसके pattern page से बनी checklist रखें और उसे तीनों passes में चलाएँ, versions के साथ browser और स्क्रीन रीडर की जोड़ी दर्ज करते हुए। हर finding को उस pattern नियम के साथ report करें जिसे वह तोड़ती है, और अलग से उस WCAG criterion के साथ जिसमें वह fail होती है, अगर कोई हो, ताकि triage conformance failures को consistency issues से अलग कर सके। Shared design system के components पर सबसे ज़्यादा ध्यान दें: library में एक टूटा combobox हर उस पेज पर वही defect है जो उसे इस्तेमाल करता है, और एक fix सबको ठीक कर देता है।

अभ्यास

City combobox verify करें और जो fail हो उसे report करें

आपका काम

Delivery address form में City field एक editable combobox है जो listbox popup वाले APG Combobox pattern को follow करता है। Page load पर उसका markup नीचे है। कीबोर्ड और स्क्रीन रीडर से टेस्ट करते हुए आप देखते हैं: (1) Tab field तक पहुँचता है और स्क्रीन रीडर name City और combobox role बोलता है; (2) "Da" type करने पर एक city, Dammam, वाली list दिखती है, पर aria-expanded "false" ही रहता है; (3) Down Arrow Dammam को highlight करता है और focus input में रहता है, पर aria-activedescendant "opt-3" पर set होता है जबकि दोबारा बनी list में अब सिर्फ़ <li id="opt-1" role="option">Dammam</li> है, और स्क्रीन रीडर कुछ नहीं बोलता; (4) Enter Dammam को field में डालकर list बंद करता है, और list खुली हो तो Escape उसे बंद करता है।

तय करें कि widget कौन-सी focus technique इस्तेमाल करता है और आप इसे कैसे पक्का कर सकते हैं। हर observation को pass या fail में classify करें, हर failure के लिए WCAG criterion या pattern नियम बताएँ, और हर failure के लिए एक defect title लिखें।

सामग्री
<label for="city">City</label>
<input id="city" role="combobox" aria-autocomplete="list"
       aria-expanded="false" aria-controls="city-list">
<ul id="city-list" role="listbox" hidden>
  <li id="opt-1" role="option">Riyadh</li>
  <li id="opt-2" role="option">Jeddah</li>
  <li id="opt-3" role="option">Dammam</li>
</ul>
चरण
  1. इस markup के लिए APG Combobox pattern जिन roles, states और properties की उम्मीद करता है, उनकी list बनाएँ।
  2. DOM focus कहाँ रहता है और कौन-सा attribute बदलता है, इससे focus technique पहचानें।
  3. हर observation की तुलना pattern के keyboard और attribute नियमों से करें।
  4. हर failure को classify करें: WCAG criterion, या सिर्फ़ pattern deviation।
  5. हर failure के लिए component, टूटी state और उसका असर बताने वाला एक defect title लिखें।
मॉडल उत्तर दिखाएँ
मॉडल उत्तर

इस markup के लिए expected (step 1): input का role combobox और name <label> से; list छिपी हो तो aria-expanded "false" और दिख रही हो तो "true"; aria-controls उस listbox city-list की ओर इशारा करे जिसमें option elements हैं; aria-autocomplete="list" filtering से मेल खाए; कोई option highlighted हो तो aria-activedescendant में उसकी id हो और उसी option पर aria-selected="true" हो; DOM focus input में ही रहे।

Technique: aria-activedescendant। Down Arrow से highlight हिलते समय document.activeElement input ही रहता है और सिर्फ़ attribute बदलता है। Combobox के लिए pattern यही उम्मीद करता है, इसलिए technique का चुनाव सही है; उसका implementation नहीं।

Observations 1 और 4 pass हैं: name <label> से आता है, role combobox है, Enter option स्वीकार करके list बंद करता है, और Escape खुली list बंद करता है।

Observation 2 fail है: list दिखते समय aria-expanded "true" होना चाहिए, वरना स्क्रीन रीडर users को पता नहीं चलता कि suggestions आए हैं; WAI-ARIA 1.2 में combobox के लिए aria-expanded ज़रूरी है। WCAG 2.2 4.1.2 Name, Role, Value (state उजागर नहीं)। Title: "City combobox: suggestion list दिखते समय भी aria-expanded false रहता है"।

Observation 3 fail है: filtering के बाद attribute ऐसी id की ओर इशारा करता है जो अब मौजूद नहीं, इसलिए assistive technology के पास कोई active option नहीं और highlighted city कभी announce नहीं होती। यह भी 4.1.2 है, severity कम से कम Major, क्योंकि user नहीं सुन पाता कि वह कौन-सी city स्वीकार करने वाला है। Title: "City combobox: highlighted city announce नहीं होती; filtering के बाद aria-activedescendant हटाए गए option की id की ओर इशारा करता है"। हर city के लिए स्थिर ids, या हर render के बाद attribute update करने का सुझाव दें, और ऐसे filters से दोबारा टेस्ट करें जो list की लंबाई बदलते हैं।

अक्सर पूछे जाने वाले सवाल

क्या APG ऐसा standard है जिसमें product fail हो सकता है?

नहीं। APG, W3C की informative guidance है जो दिखाती है कि WAI-ARIA कैसे लागू करें; conformance WCAG 2.2 से मापा जाता है। Test cases में APG patterns को expected व्यवहार की तरह इस्तेमाल करें, WCAG criterion तभी cite करें जब users वह खोएँ जो वह criterion माँगता है, और pattern से बाक़ी अंतरों को consistency या usability defects के रूप में report करें।

Tabs focus मिलते ही activate हों या सिर्फ़ Enter पर?

APG दोनों तरीके बताता है। Panel बिना ध्यान देने लायक देरी के दिख सके तो वह automatic activation की सलाह देता है, और panel दिखाना धीमा हो तो Enter या Space वाले manual activation की। दोनों सही हैं अगर team ने सोच-समझकर चुना हो और लगातार लागू किया हो, इसलिए यह चुनाव acceptance criteria में दर्ज करें।

कौन बेहतर है: roving tabindex या aria-activedescendant?

आम तौर पर कोई नहीं। Roving tabindex असली focus हिलाता है, इसलिए browser focused item तक scroll करता है और उसे style करता है। aria-activedescendant focus एक element पर रखता है, जो combobox को चाहिए ताकि user typing जारी रख सके। Widget जो technique इस्तेमाल करता है, उसे उसी के टूटने के संकेतों से टेस्ट करें।

अगर accessibility tree सही दिखे तो क्या फिर भी स्क्रीन रीडर चाहिए?

हाँ, कम से कम एक जोड़ी के साथ। Tree दिखाता है कि browser क्या उजागर करता है; users क्या सुनते हैं, यह सिर्फ़ स्क्रीन रीडर दिखाता है, जिसमें announce न होने वाले state changes और किसी role के support में स्क्रीन रीडरों के अंतर शामिल हैं।

संदर्भ

  • ARIA Authoring Practices Guide (APG)W3C Web Accessibility Initiative (WAI)आम विजेट (tabs, menus, dialogs, comboboxes) के पैटर्न, अपेक्षित कीबोर्ड इंटरैक्शन और ARIA उपयोग के साथ — वह संदर्भ जिससे टेस्टर कस्टम कंपोनेंट की तुलना करते हैं।
  • Accessible Rich Internet Applications (WAI-ARIA) 1.2W3C · 2023W3C Recommendation जो ARIA roles, states और properties परिभाषित करती है — कस्टम विजेट अपना अर्थ सहायक तकनीक को कैसे बताते हैं।
  • Web Content Accessibility Guidelines (WCAG) 2.2W3C · 2024W3C की Recommendation जो सुलभ वेब कंटेंट के लिए टेस्ट करने योग्य success criteria तय करती है — चार सिद्धांतों और तीन conformance स्तरों (A, AA, AAA) में व्यवस्थित।
  • Understanding WCAG 2.2W3C Web Accessibility Initiative (WAI)WCAG 2.2 की हर guideline और success criterion की व्याख्या: उद्देश्य, किसे लाभ, उदाहरण और तकनीकें (नॉर्मेटिव नहीं)।

Mutqan tools से अभ्यास करें

नेस्टेड एलिमेंट को सही इंडेंटेशन देकर HTML सुंदर बनाएँ, pre, script और style ब्लॉक सुरक्षित रखते हुए।

फ़ॉर्मेटिंग

फ़ीचर के विवरण और फ़ील्ड सूची से संरचित टेस्ट केस (id, शीर्षक, पूर्व-शर्तें, स्टेप, अपेक्षित परिणाम, प्राथमिकता) जनरेट करें।

टेस्ट डिज़ाइन

Mutqan AI से किसी भी फ़ीचर के लिए अनुकूलित QA चेकलिस्ट (functional, UI, API, security, performance, accessibility, release) बनाएँ।

टेस्ट जनरेशन AI

मोटे-मोटे नोट्स को पूरी बग रिपोर्ट में बदलें: reproduce करने के स्टेप, अपेक्षित बनाम वास्तविक, environment, गंभीरता और attachments चेकलिस्ट।

बग विश्लेषण AI

और गहराई से

इस topic में आपकी प्रगति

QA रोडमैप का हिस्सा