How to use accessible method in storybook-root

Best JavaScript code snippet using storybook-root

square_one.js

Source:square_one.js Github

copy

Full Screen

1const data = [ 2{ 'description': [ ' Entrance accessible ',3' Store interior somewhat accessible',4' Emergency exit'],5'stars': 3,6'title': 'Accents'},7{ 'description': [ ' Entrance accessible',8' Store interior accessible',9' Emergency exit'],10'stars': 5,11'title': 'Aldo'},12{ 'description': [ ' Entrance accessible',13' Store interior accessible',14' Emergency exit'],15'stars': 5,16'title': 'Aldo Accessories'},17{ 'description': [ ' Entrance accessible',18' Store interior accessible',19' Emergency exit'],20'stars': 5,21'title': 'Alex and Ani'},22{ 'description': [ ' Entrance accessible',23' Store interior accessible',24' Change room accessible',25' Emergency exit'],26'stars': 5,27'title': 'American Eagle'},28{ 'description': [ ' Entrance accessible',29' Store interior mostly accessible',30' Emergency exit'],31'stars': 4,32'title': 'Ann Taylor'},33{ 'description': [ ' Entrance accessible',34' Store interior barely accessible',35' Emergency exit'],36'stars': 2,37'title': 'Anna Bella'},38{ 'description': [ ' Entrance accessible',39' Store interior accessible',40' Emergency exit'],41'stars': 5,42'title': 'Apple'},43{ 'description': [ ' Entrance accessible',44' Store interior mostly accessible',45' Emergency exit'],46'stars': 4,47'title': 'Ardene'},48{ 'description': [ ' Entrance accessible',49' Store interior accessible',50' Change room accessible',51' Emergency exit'],52'stars': 5,53'title': 'Aritzia'},54{ 'description': [ ' Entrance accessible',55' Store interior accessible',56' Emergency exit'],57'stars': 5,58'title': 'Armand Jewellers'},59{ 'description': [ ' Entrance accessible',60' Store interior accessible',61' Emergency exit'],62'stars': 5,63'title': 'Armani Exchange'},64{ 'description': [ ' Entrance accessible',65' Store interior accessible',66' Emergency exit'],67'stars': 5,68'title': 'Aroma'},69{ 'description': [ ' Entrance accessible',70' Store interior accessible',71' Emergency exit'],72'stars': 5,73'title': "Arvinda's"},74{ 'description': [ ' Entrance accessible',75' Store interior accessible',76' Emergency exit'],77'stars': 5,78'title': "Auntie Anne's Pretzels"},79{ 'description': [ ' Entrance accessible',80' Store interior accessible',81' Emergency exit'],82'stars': 5,83'title': 'Aveda'},84{ 'description': [ ' Entrance accessible',85' Store interior accessible',86' Emergency exit'],87'stars': 5,88'title': 'B2 Shoes'},89{ 'description': [ ' Entrance accessible',90' Store interior mostly accessible',91' Emergency exit'],92'stars': 4,93'title': 'Babaton'},94{ 'description': [ ' Entrance accessible',95' Store interior accessible',96' Emergency exit'],97'stars': 5,98'title': 'Bake Three Fifty'},99{ 'description': [ ' Entrance accessible',100' Store interior somewhat accessible',101' Emergency exit'],102'stars': 3,103'title': 'Banana Republic'},104{ 'description': [ ' Entrance accessible',105' Store interior accessible',106' Emergency exit'],107'stars': 5,108'title': 'Bank of Montreal'},109{ 'description': [ ' Entrance accessible',110' Store interior accessible',111' Emergency exit'],112'stars': 5,113'title': "Barber's Chair"},114{ 'description': [ ' Entrance accessible',115' Store interior accessible',116' Emergency exit'],117'stars': 5,118'title': 'Baskin Robbins'},119{ 'description': [ ' Entrance accessible',120' Store interior accessible',121' Emergency exit'],122'stars': 5,123'title': 'Bath & Body Works'},124{ 'description': [ ' Entrance accessible',125' Store interior accessible',126' Emergency exit'],127'stars': 5,128'title': 'Bell'},129{ 'description': [ ' Entrance accessible',130' Store interior accessible',131' Emergency exit',132' Kiosk'],133'stars': 5,134'title': 'Bell Kiosk'},135{ 'description': [ ' Entrance accessible',136' Store interior somewhat accessible',137' Emergency exit'],138'stars': 3,139'title': 'Ben Sherman'},140{ 'description': [ ' Entrance accessible',141' Store interior barely accessible',142' Emergency exit'],143'stars': 2,144'title': 'Bentley'},145{ 'description': [ ' Entrance accessible',146' Store interior accessible',147' Emergency exit'],148'stars': 5,149'title': 'Best Buy Mobile'},150{ 'description': [ ' Entrance accessible',151' Store interior somewhat accessible',152' Emergency exit',153' Change room accessible'],154'stars': 3,155'title': 'Bikini Village'},156{ 'description': [ ' Entrance accessible',157' Store interior accessible',158' Emergency exit'],159'stars': 5,160'title': 'Birks '},161{ 'description': [ ' Entrance accessible',162' Store interior accessible',163' Emergency exit'],164'stars': 5,165'title': 'Bitter Sweet '},166{ 'description': [ ' Entrance accessible',167' Store interior accessible',168' Emergency exit'],169'stars': 5,170'title': 'Blackjack BBQ'},171{ 'description': [ ' Entrance accessible',172' Store interior accessible',173' Emergency exit'],174'stars': 5,175'title': 'Blackwell Supply Co.'},176{ 'description': [ ' Entrance accessible',177' Store interior barely accessible',178' Change room not accessible',179' Emergency exit'],180'stars': 2,181'title': 'Bluenotes'},182{ 'description': [ ' Entrance accessible',183' Store interior accessible',184' Emergency exit'],185'stars': 5,186'title': 'Bonlook'},187{ 'description': [ ' Entrance accessible',188' Store interior accessible',189' Emergency exit'],190'stars': 5,191'title': 'Booster Juice'},192{ 'description': [ ' Entrance accessible',193' Store interior accessible',194' Emergency exit'],195'stars': 5,196'title': 'Boston Pizza'},197{ 'description': [ ' Entrance accessible',198' Store interior accessible',199' Emergency exit'],200'stars': 5,201'title': 'Browns'},202{ 'description': [ ' Entrance accessible',203' Store interior accessible',204' Emergency exit'],205'stars': 5,206'title': 'Brød'},207{ 'description': [ ' Entrance accessible',208' Store interior accessible',209' Emergency exit'],210'stars': 5,211'title': 'Build-A-Bear'},212{ 'description': [ ' Entrance accessible',213' Store interior somewhat accessible',214' Emergency exit'],215'stars': 3,216'title': 'Bulk Barn'},217{ 'description': [ ' Entrance accessible',218' Store interior accessible',219' Emergency exit'],220'stars': 5,221'title': 'Call it Spring'},222{ 'description': [ ' Entrance accessible',223' Store interior accessible',224' Emergency exit'],225'stars': 5,226'title': 'Canada Post Office'},227{ 'description': [ ' Entrance accessible',228' Store interior accessible',229' Emergency exit'],230'stars': 5,231'title': 'Canyon Creek Crophouse'},232{ 'description': [ ' Entrance accessible',233' Store interior mostly accessible',234' Change room accessible',235' Emergency exit'],236'stars': 4,237'title': "Carter's | OshKosh"},238{ 'description': [ ' Entrance accessible',239' Store interior barely accessible',240' Emergency exit'],241'stars': 2,242'title': 'Caryl Baker Visage'},243{ 'description': [ ' Entrance accessible',244' Store interior somewhat accessible',245' Emergency exit'],246'stars': 3,247'title': 'Catalyst & Co'},248{ 'description': [ ' Entrance accessible',249' Store interior accessible',250' Emergency exit'],251'stars': 5,252'title': 'Cellicon'},253{ 'description': [ ' Entrance accessible',254' Store interior accessible',255' Emergency exit'],256'stars': 5,257'title': 'Champs'},258{ 'description': [ ' Entrance accessible',259' Store interior accessible',260' Emergency exit'],261'stars': 5,262'title': 'Chatime'},263{ 'description': [ ' Entrance accessible',264' Store interior accessible',265' Emergency exit'],266'stars': 5,267'title': 'Chatters Salon'},268{ 'description': [ ' Entrance accessible',269' Store interior barely accessible',270' Emergency exit'],271'stars': 3,272'title': "Chico's"},273{ 'description': [ ' Entrance accessible',274' Store interior accessible',275' Emergency exit'],276'stars': 5,277'title': 'Chocollata'},278{ 'description': [ ' Entrance accessible',279' Store interior accessible',280' Emergency exit'],281'stars': 5,282'title': 'Chronic Ink'},283{ 'description': [ ' Entrance accessible',284' Store interior accessible',285' Emergency exit'],286'stars': 5,287'title': 'CIBC ATM'},288{ 'description': [ ' Entrance accessible',289' Store interior accessible',290' Emergency exit'],291'stars': 5,292'title': 'Cineplex'},293{ 'description': [ ' Entrance accessible',294' Store interior accessible',295' Emergency exit',296' Kiosk'],297'stars': 5,298'title': 'City Shades'},299{ 'description': [ ' Entrance accessible',300' Store interior accessible',301' Emergency exit'],302'stars': 5,303'title': "Claire's"},304{ 'description': [ ' Entrance accessible',305' Store interior accessible',306' Emergency exit'],307'stars': 5,308'title': 'Classic Fit Alterations'},309{ 'description': [ ' Entrance accessible',310' Store interior accessible',311' Emergency exit'],312'stars': 5,313'title': 'Classic Fit Dry Cleaners'},314{ 'description': [ ' Entrance accessible',315' Store interior mostly accessible',316' Change room accessible',317' Emergency exit'],318'stars': 4,319'title': 'Cleo'},320{ 'description': [ ' Entrance accessible',321' Store interior accessible',322' Change room accessible',323' Emergency exit'],324'stars': 5,325'title': 'Club Monaco'},326{ 'description': [ ' Entrance accessible',327' Store interior accessible',328' Emergency exit'],329'stars': 5,330'title': 'Coach'},331{ 'description': [ ' Entrance accessible',332' Store interior accessible',333' Change room not accessible',334' Emergency exit'],335'stars': 4,336'title': 'COS'},337{ 'description': [ ' Entrance accessible',338' Store interior accessible',339' Emergency exit'],340'stars': 5,341'title': 'Crate and Barrel'},342{ 'description': [ ' Entrance accessible',343' Store interior accessible',344' Emergency exit'],345'stars': 5,346'title': 'Crêpe de Licious'},347{ 'description': [ ' Entrance accessible',348' Store interior accessible',349' Emergency exit',350' Kiosk'],351'stars': 5,352'title': 'CrystalizeIT'},353{ 'description': [ ' Entrance accessible',354' Store interior accessible',355' Emergency exit'],356'stars': 5,357'title': 'Davidâ\x80\x99s Tea'},358{ 'description': [ ' Entrance accessible',359' Store interior accessible',360' Emergency exit'],361'stars': 5,362'title': 'Deciem'},363{ 'description': [ ' Entrance accessible',364' Store interior accessible',365' Emergency exit'],366'stars': 5,367'title': 'Delta Optical'},368{ 'description': [ ' Entrance accessible',369' Store interior accessible',370' Emergency exit'],371'stars': 5,372'title': 'DHL Express'},373{ 'description': [ ' Entrance accessible',374' Store interior accessible',375' Emergency exit'],376'stars': 4,377'title': 'Disney'},378{ 'description': [ ' Entrance accessible',379' Store interior accessible',380' Emergency exit'],381'stars': 5,382'title': 'Dollarama'},383{ 'description': [ ' Entrance accessible',384' Store interior accessible',385' Emergency exit'],386'stars': 5,387'title': 'Donato Salon + Spa'},388{ 'description': [ ' Entrance accessible',389' Store interior accessible',390' Change room accessible',391' Emergency exit'],392'stars': 5,393'title': 'Dynamite'},394{ 'description': [ ' Entrance accessible',395' Store interior accessible',396' Emergency exit'],397'stars': 5,398'title': 'Earlâ\x80\x99s Kitchen + Bar'},399{ 'description': [ ' Entrance accessible',400' Store interior mostly accessible',401' Emergency exit'],402'stars': 4,403'title': 'EB Games'},404{ 'description': [ ' Entrance accessible',405' Store interior accessible',406' Emergency exit'],407'stars': 5,408'title': 'Ecco Shoes'},409{ 'description': [ ' Entrance accessible',410' Store interior accessible',411' Emergency exit'],412'stars': 5,413'title': 'European Jewellry'},414{ 'description': [ ' Entrance accessible',415' Store interior accessible',416' Emergency exit'],417'stars': 5,418'title': 'Evaâ\x80\x99s Original Chimneys'},419{ 'description': [ ' Entrance accessible',420' Store interior mostly accessible',421' Emergency exit'],422'stars': 4,423'title': 'Ever New'},424{ 'description': [ ' Entrance accessible',425' Store interior accessible',426' Emergency exit'],427'stars': 5,428'title': 'Eyestar Optical'},429{ 'description': [ ' Entrance accessible',430' Store interior somewhat accessible',431' Change room accessible',432' Emergency exit'],433'stars': 3,434'title': 'Fairweather'},435{ 'description': [ ' Entrance accessible',436' Store interior accessible',437' Emergency exit'],438'stars': 5,439'title': 'Fido'},440{ 'description': [ ' Entrance accessible',441' Store interior accessible',442' Emergency exit'],443'stars': 5,444'title': 'Fiorio'},445{ 'description': [ ' Entrance accessible',446' Store interior accessible',447' Emergency exit'],448'stars': 5,449'title': 'Flight Centre'},450{ 'description': [ ' Entrance accessible',451' Store interior accessible',452' Emergency exit'],453'stars': 5,454'title': 'Foot Locker/House of Hoops'},455{ 'description': [ ' Entrance accessible',456' Store interior barely accessible',457' Emergency exit'],458'stars': 2,459'title': 'Fossil'},460{ 'description': [ ' Entrance accessible',461' Store interior accessible',462' Emergency exit'],463'stars': 5,464'title': 'Freedom Mobile'},465{ 'description': [ ' Entrance accessible',466' Store interior accessible',467' Emergency exit'],468'stars': 5,469'title': 'Freshly Squeesed'},470{ 'description': [ ' Entrance accessible',471' Store interior accessible',472' Emergency exit'],473'stars': 5,474'title': 'Fuwa Fuwa'},475{ 'description': [ ' Entrance accessible',476' Store interior accessible',477' Change room accessible',478' Emergency exit'],479'stars': 5,480'title': 'Gap'},481{ 'description': [ ' Entrance accessible',482' Store interior accessible',483' Change room accessible',484' Emergency exit'],485'stars': 5,486'title': 'Garage'},487{ 'description': [ ' Entrance accessible',488' Store interior accessible',489' Emergency exit'],490'stars': 5,491'title': 'Genesis'},492{ 'description': [ ' Entrance accessible',493' Store interior accessible',494' Emergency exit'],495'stars': 5,496'title': 'Geox'},497{ 'description': [ ' Entrance accessible',498' Store interior somewhat accessible',499' Emergency exit'],500'stars': 3,501'title': 'GNC'},502{ 'description': [ ' Entrance accessible',503' Store interior accessible',504' Emergency exit'],505'stars': 5,506'title': 'Godiva'},507{ 'description': [ ' Entrance accessible',508' Store interior accessible',509' Emergency exit'],510'stars': 5,511'title': 'Goodlife Fitness'},512{ 'description': [ ' Entrance accessible',513' Store interior accessible',514' Change room accessible',515' Emergency exit'],516'stars': 5,517'title': 'GUESS'},518{ 'description': [ ' Entrance accessible',519' Store interior somewhat accessible',520' Change room accessible',521' Emergency exit'],522'stars': 3,523'title': 'H&M'},524{ 'description': [ ' Entrance accessible',525' Store interior accessible',526' Emergency exit'],527'stars': 5,528'title': 'H&R Block'},529{ 'description': [ ' Entrance accessible',530' Store interior accessible',531' Emergency exit'],532'stars': 5,533'title': 'Hakim Optical'},534{ 'description': [ ' Entrance accessible',535' Store interior accessible',536' Emergency exit'],537'stars': 5,538'title': 'Hale Coffee'},539{ 'description': [ ' Entrance accessible',540' Store interior accessible',541' Change room accessible',542' Emergency exit'],543'stars': 5,544'title': 'Harry Rosen'},545{ 'description': [ ' Entrance accessible',546' Store interior accessible',547' Emergency exit'],548'stars': 5,549'title': 'Hatley'},550{ 'description': [ ' Entrance accessible',551' Store interior accessible',552' Emergency exit'],553'stars': 5,554'title': 'Hearing Solutions'},555{ 'description': [ ' Entrance accessible',556' Store interior accessible',557' Change room accessible',558' Emergency exit'],559'stars': 5,560'title': 'Holt Renfrew'},561{ 'description': [ ' Entrance accessible',562' Store interior accessible',563' Change room accessible',564' Emergency exit'],565'stars': 5,566'title': 'Honey'},567{ 'description': [ ' Entrance accessible',568' Store interior barely accessible',569' Change room accessible',570' Emergency exit'],571'stars': 2,572'title': 'Hot Topic'},573{ 'description': [ ' Entrance accessible',574' Store interior mostly accessible',575' Change room accessible',576' Emergency exit'],577'stars': 4,578'title': 'Hudsonâ\x80\x99s Bay'},579{ 'description': [ ' Entrance accessible',580' Store interior accessible',581' Emergency exit'],582'stars': 5,583'title': 'ICE Currency Services'},584{ 'description': [ ' Entrance accessible',585' Store interior somewhat accessible',586' Emergency exit'],587'stars': 3,588'title': 'Icing'},589{ 'description': [ ' Entrance accessible',590' Store interior accessible',591' Emergency exit',592' Kiosk'],593'stars': 5,594'title': 'IG Memories'},595{ 'description': [ ' Entrance accessible',596' Store interior accessible',597' Emergency exit'],598'stars': 5,599'title': 'Indigo'},600{ 'description': [ ' Entrance accessible',601' Store interior accessible',602' Change room accessible',603' Emergency exit'],604'stars': 5,605'title': 'Indochino'},606{ 'description': [ ' Entrance accessible',607' Store interior barely accessible',608' Change room accessible',609' Emergency exit'],610'stars': 2,611'title': 'International Clothiers'},612{ 'description': [ ' Entrance accessible',613' Store interior accessible',614' Change room accessible',615' Emergency exit'],616'stars': 5,617'title': 'Jack & Jones'},618{ 'description': [ ' Entrance accessible',619' Store interior accessible',620' Emergency exit'],621'stars': 5,622'title': "Jack Astor's"},623{ 'description': [ ' Entrance accessible',624' Store interior accessible',625' Emergency exit'],626'stars': 5,627'title': "Jamie's Italian"},628{ 'description': [ ' Entrance accessible',629' Store interior accessible',630' Emergency exit'],631'stars': 5,632'title': 'Jimmy The Greek'},633{ 'description': [ ' Entrance accessible',634' Store interior accessible',635' Emergency exit'],636'stars': 5,637'title': 'Journeys'},638{ 'description': [ ' Entrance accessible',639' Store interior accessible',640' Change room not accessible',641' Emergency exit'],642'stars': 4,643'title': 'Just Cozy'},644{ 'description': [ ' Entrance accessible',645' Store interior somewhat accessible',646' Change room accessible',647' Emergency exit'],648'stars': 3,649'title': 'Justice'},650{ 'description': [ ' Entrance accessible',651' Store interior accessible',652' Emergency exit'],653'stars': 5,654'title': 'Kate Spade'},655{ 'description': [ ' Entrance accessible',656' Store interior accessible',657' Emergency exit'],658'stars': 5,659'title': 'Kernels'},660{ 'description': [ ' Entrance accessible',661' Store interior accessible',662' Emergency exit'],663'stars': 5,664'title': 'Kids Foot Locker/Fly Zone'},665{ 'description': [ ' Entrance accessible',666' Store interior accessible',667' Emergency exit'],668'stars': 5,669'title': 'Kiehlâ\x80\x99s'},670{ 'description': [ ' Entrance accessible',671' Store interior accessible',672' Emergency exit'],673'stars': 5,674'title': 'Koodo Mobile'},675{ 'description': [ ' Entrance accessible',676' Store interior accessible',677' Emergency exit'],678'stars': 5,679'title': 'La Carnita'},680{ 'description': [ ' Entrance accessible',681' Store interior accessible',682' Emergency exit',683' Kiosk'],684'stars': 5,685'title': 'La Mode Collection'},686{ 'description': [ ' Entrance accessible',687' Store interior accessible',688' Change room accessible',689' Emergency exit'],690'stars': 5,691'title': 'La Senza'},692{ 'description': [ ' Entrance accessible',693' Store interior somewhat accessible',694' Change room accessible',695' Emergency exit'],696'stars': 3,697'title': 'La Vie En Rose'},698{ 'description': [ ' Entrance accessible',699' Store interior accessible',700' Change room accessible',701' Emergency exit'],702'stars': 5,703'title': 'Lacoste'},704{ 'description': [ ' Entrance accessible',705' Store interior accessible',706' Change room accessible',707' Emergency exit'],708'stars': 5,709'title': 'Laura'},710{ 'description': [ ' Entrance accessible',711' Store interior accessible',712' Emergency exit'],713'stars': 5,714'title': 'Laura Secord'},715{ 'description': [ ' Entrance accessible',716' Store interior accessible',717' Emergency exit'],718'stars': 5,719'title': 'LCBO'},720{ 'description': [ ' Entrance accessible',721' Store interior barely accessible',722' Change room accessible',723' Emergency exit'],724'stars': 2,725'title': 'Le Chateau'},726{ 'description': [ ' Entrance accessible',727' Store interior accessible',728' Change room accessible',729' Emergency exit'],730'stars': 5,731'title': 'Le Chateau Menswear'},732{ 'description': [ ' Entrance accessible',733' Store interior accessible',734' Emergency exit'],735'stars': 5,736'title': 'Lense Crafters'},737{ 'description': [ ' Entrance accessible',738' Store interior mostly accessible',739' Change room accessible',740' Emergency exit'],741'stars': 4,742'title': 'Leviâ\x80\x99s'},743{ 'description': [ ' Entrance accessible',744' Store interior accessible',745' Emergency exit'],746'stars': 5,747'title': 'Lids'},748{ 'description': [ ' Entrance accessible',749' Store interior accessible',750' Emergency exit'],751'stars': 5,752'title': 'Lindt Chocolate'},753{ 'description': [ ' Entrance accessible',754' Store interior accessible',755' Emergency exit'],756'stars': 5,757'title': 'Lâ\x80\x99intervalle'},758{ 'description': [ ' Entrance accessible',759' Store interior accessible',760' Emergency exit'],761'stars': 5,762'title': 'Little Burgundy'},763{ 'description': [ ' Entrance accessible',764' Store interior accessible',765' Emergency exit'],766'stars': 5,767'title': 'Lâ\x80\x99Occitane'},768{ 'description': [ ' Entrance accessible',769' Store interior somewhat accessible',770' Change room not accessible',771' Emergency exit'],772'stars': 2,773'title': 'Loft'},774{ 'description': [ ' Entrance accessible',775' Store interior accessible',776' Emergency exit'],777'stars': 5,778'title': 'Love Me Sweet'},779{ 'description': [ ' Entrance accessible',780' Store interior somewhat accessible',781' Change room accessible',782' Emergency exit'],783'stars': 3,784'title': 'Lucky Brand Jeans'},785{ 'description': [ ' Entrance accessible',786' Store interior accessible',787' Emergency exit',788' Kiosk'],789'stars': 5,790'title': 'Lucky Lotto Centre'},791{ 'description': [ ' Entrance accessible',792' Store interior accessible',793' Change room accessible',794' Emergency exit'],795'stars': 5,796'title': 'Lululemon'},797{ 'description': [ ' Entrance accessible',798' Store interior accessible',799' Emergency exit'],800'stars': 5,801'title': 'Lush'},802{ 'description': [ ' Entrance accessible',803' Store interior accessible',804' Change room accessible',805' Emergency exit'],806'stars': 5,807'title': 'M'},808{ 'description': [ ' Entrance accessible',809' Store interior accessible',810' Emergency exit'],811'stars': 5,812'title': 'MAC'},813{ 'description': [ ' Entrance accessible',814' Store interior accessible',815' Emergency exit'],816'stars': 5,817'title': 'Magenta Photo Studio'},818{ 'description': [ ' Entrance accessible',819' Store interior accessible',820' Change room accessible',821' Emergency exit'],822'stars': 5,823'title': 'Marc Cain'},824{ 'description': [ ' Entrance accessible',825' Store interior accessible',826' Emergency exit'],827'stars': 5,828'title': 'Maâ\x80\x99s Best Quality Soup'},829{ 'description': [ ' Entrance accessible',830' Store interior accessible',831' Change room accessible',832' Emergency exit'],833'stars': 5,834'title': 'Maska'},835{ 'description': [ ' Entrance accessible',836' Store interior accessible',837' Change room not accessible',838' Emergency exit'],839'stars': 4,840'title': 'Massimo Dutti'},841{ 'description': [ ' Entrance accessible',842' Store interior accessible',843' Emergency exit'],844'stars': 5,845'title': 'Matt & Nat'},846{ 'description': [ ' Entrance accessible',847' Store interior accessible',848' Emergency exit'],849'stars': 5,850'title': 'Maverick Studio For Men'},851{ 'description': [ ' Entrance accessible',852' Store interior accessible',853' Change room accessible',854' Emergency exit'],855'stars': 5,856'title': 'Melanie Lyne'},857{ 'description': [ ' Entrance accessible',858' Store interior mostly accessible',859' Change room accessible',860' Emergency exit'],861'stars': 4,862'title': 'Mendocino'},863{ 'description': [ ' Entrance accessible',864' Store interior accessible',865' Emergency exit'],866'stars': 5,867'title': 'Michael Hill'},868{ 'description': [ ' Entrance accessible',869' Store interior accessible',870' Emergency exit'],871'stars': 5,872'title': 'Michael Kors'},873{ 'description': [ ' Entrance accessible',874' Store interior accessible',875' Emergency exit'],876'stars': 5,877'title': 'Microsoft'},878{ 'description': [ ' Entrance accessible',879' Store interior accessible',880' Emergency exit'],881'stars': 5,882'title': 'MidiCi'},883{ 'description': [ ' Entrance accessible',884' Store interior accessible',885' Emergency exit'],886'stars': 5,887'title': 'Miniso'},888{ 'description': [ ' Entrance accessible',889' Store interior accessible',890' Emergency exit'],891'stars': 5,892'title': 'Mobile Klinik'},893{ 'description': [ ' Entrance accessible',894' Store interior accessible',895' Emergency exit'],896'stars': 5,897'title': 'Mobile Snap'},898{ 'description': [ ' Entrance accessible',899' Store interior accessible',900' Emergency exit'],901'stars': 5,902'title': 'Morphe'},903{ 'description': [ ' Entrance accessible',904' Store interior somewhat accessible',905' Change room accessible',906' Emergency exit'],907'stars': 3,908'title': 'Mountain Warehouse'},909{ 'description': [ ' Outside entrance accessible',910' No button for inner entrance',911' Store interior accessible',912' Emergency exit'],913'stars': 4,914'title': 'Moxieâ\x80\x99s'},915{ 'description': [ ' Entrance accessible',916' Store interior accessible',917' Emergency exit'],918'stars': 5,919'title': 'Mr. Pretzels'},920{ 'description': [ ' Entrance accessible',921' Store interior accessible',922' Change room accessible',923' Emergency exit'],924'stars': 5,925'title': 'Muji'},926{ 'description': [ ' Entrance accessible',927' Store interior accessible',928' Emergency exit'],929'stars': 5,930'title': 'Naturalizer'},931{ 'description': [ ' Entrance accessible',932' Store interior accessible',933' Emergency exit'],934'stars': 5,935'title': 'Nature Collection'},936{ 'description': [ ' Entrance accessible',937' Store interior accessible',938' Emergency exit'],939'stars': 5,940'title': 'Nespresso'},941{ 'description': [ ' Entrance accessible',942' Store interior accessible',943' Emergency exit',944' Kiosk'],945'stars': 5,946'title': 'New Steel'},947{ 'description': [ ' Entrance accessible',948' Store interior accessible',949' Change room accessible',950' Emergency exit'],951'stars': 5,952'title': 'Nike'},953{ 'description': [ ' Entrance accessible',954' Store interior accessible',955' Emergency exit'],956'stars': 5,957'title': 'Nugateau'},958{ 'description': [ ' Entrance accessible',959' Store interior somewhat accessible',960' Emergency exit'],961'stars': 3,962'title': 'Nutrition House'},963{ 'description': [ ' Entrance accessible',964' Store interior accessible',965' Emergency exit'],966'stars': 5,967'title': 'NYX'},968{ 'description': [ ' Outisde entrance accessible',969' No button for inner entrance',970' Store interior accessible',971' Emergency exit'],972'stars': 4,973'title': 'Okaidi'},974{ 'description': [ ' Entrance accessible',975' Store interior somewhat accessible',976' Change room accessible',977' Emergency exit'],978'stars': 3,979'title': 'Old Navy'},980{ 'description': [ ' Entrance accessible',981' Store interior accessible',982' Emergency exit'],983'stars': 5,984'title': 'Ollie Quinn'},985{ 'description': [ ' Entrance accessible',986' Store interior accessible',987' Change room accessible',988' Emergency exit'],989'stars': 5,990'title': 'Octoberâ\x80\x99s Very Own'},991{ 'description': [ ' Entrance accessible',992' Store interior mostly accessible',993' Emergency exit'],994'stars': 4,995'title': 'Pandora'},996{ 'description': [ ' Entrance accessible',997' Store interior accessible',998' Emergency exit'],999'stars': 5,1000'title': 'Panera'},1001{ 'description': [ ' Entrance accessible',1002' Store interior accessible',1003' Emergency exit'],1004'stars': 5,1005'title': 'Pappa Roti'},1006{ 'description': [ ' Entrance accessible',1007' Store interior accessible',1008' Emergency exit'],1009'stars': 5,1010'title': 'Papyrus'},1011{ 'description': [ ' Entrance accessible',1012' Store interior accessible',1013' Emergency exit',1014' Kiosk'],1015'stars': 5,1016'title': 'Peloton'},1017{ 'description': [ ' Entrance accessible',1018' Store interior accessible',1019' Emergency exit'],1020'stars': 5,1021'title': 'Peopleâ\x80\x99s Jewellers'},1022{ 'description': [ ' Entrance accessible',1023' Store interior accessible',1024' Emergency exit'],1025'stars': 5,1026'title': 'Perfume Shop'},1027{ 'description': [ ' Entrance accessible',1028' Store interior accessible',1029' Emergency exit'],1030'stars': 5,1031'title': 'Pierced'},1032{ 'description': [ ' Entrance accessible',1033' Store interior accessible',1034' Change room accessible',1035' Emergency exit'],1036'stars': 5,1037'title': 'Plus'},1038{ 'description': [ ' Entrance accessible',1039' Store interior accessible',1040' Emergency exit'],1041'stars': 5,1042'title': 'Point Zero'},1043{ 'description': [ ' No button on entrance',1044' Store interior accessible',1045' Emergency exit'],1046'stars': 4,1047'title': 'Popeyes'},1048{ 'description': [ ' Entrance accessible',1049' Store interior somewhat accessible',1050' Emergency exit'],1051'stars': 3,1052'title': 'Pro Image'},1053{ 'description': [ ' Entrance accessible',1054' Store interior accessible',1055' Emergency exit'],1056'stars': 5,1057'title': 'Purdys Chocolatier'},1058{ 'description': [ ' Entrance accessible',1059' Store interior accessible',1060' Emergency exit',1061' Kiosk'],1062'stars': 5,1063'title': 'Rainbow Jade'},1064{ 'description': [ ' Entrance accessible',1065' Store interior accessible',1066' Emergency exit'],1067'stars': 5,1068'title': 'Real Fruit Bubble Tea'},1069{ 'description': [ ' Entrance accessible',1070' Store interior accessible',1071' Emergency exit'],1072'stars': 5,1073'title': 'Reds Wine Tavern'},1074{ 'description': [ ' Entrance accessible',1075' Store interior mostly accessible',1076' Change room accessible',1077' Emergency exit'],1078'stars': 4,1079'title': 'Reitmans'},1080{ 'description': [ ' Entrance accessible',1081' Store interior accessible',1082' Emergency exit'],1083'stars': 5,1084'title': 'Richtree'},1085{ 'description': [ ' Entrance accessible',1086' Store interior accessible',1087' Emergency exit'],1088'stars': 5,1089'title': 'Rocky Mountain'},1090{ 'description': [ ' Entrance accessible',1091' Store interior accessible',1092' Emergency exit'],1093'stars': 5,1094'title': 'Rogers'},1095{ 'description': [ ' Entrance accessible',1096' Store interior accessible',1097' Emergency exit'],1098'stars': 5,1099'title': 'Rolex Boutique | Raffi Jewellers'},1100{ 'description': [ ' Entrance accessible',1101' Store interior accessible',1102' Change room accessible',1103' Emergency exit'],1104'stars': 5,1105'title': 'Roots'},1106{ 'description': [ ' Entrance accessible',1107' Store interior accessible',1108' Emergency exit'],1109'stars': 5,1110'title': 'Royal Bank ATM'},1111{ 'description': [ ' Entrance accessible',1112' Store interior accessible',1113' Emergency exit'],1114'stars': 5,1115'title': 'RUDSAK'},1116{ 'description': [ ' Entrance accessible',1117' Store interior somewhat accessible',1118' Emergency exit'],1119'stars': 3,1120'title': 'RW & Co.'},1121{ 'description': [ ' Entrance accessible',1122' Store interior accessible',1123' Emergency exit'],1124'stars': 5,1125'title': 'S&H Health Foods'},1126{ 'description': [ ' Entrance accessible',1127' Store interior accessible',1128' Emergency exit'],1129'stars': 5,1130'title': 'Saje'},1131{ 'description': [ ' Entrance accessible',1132' Store interior accessible',1133' Change room accessible',1134' Emergency exit'],1135'stars': 5,1136'title': 'Salvatore Ferragamo'},1137{ 'description': [ ' Entrance accessible',1138' Store interior accessible',1139' Emergency exit'],1140'stars': 5,1141'title': 'Sansotei Ramen'},1142{ 'description': [ ' Entrance accessible',1143' Store interior accessible',1144' Emergency exit'],1145'stars': 5,1146'title': 'Scaddabush'},1147{ 'description': [ ' Entrance accessible',1148' Store interior accessible',1149' Emergency exit'],1150'stars': 5,1151'title': 'Scotiabank'},1152{ 'description': [ ' Entrance accessible',1153' Store interior accessible',1154' Emergency exit'],1155'stars': 5,1156'title': 'Second Cup'},1157{ 'description': [ ' Entrance accessible',1158' Store interior accessible',1159' Emergency exit'],1160'stars': 5,1161'title': 'Sephora'},1162{ 'description': [ ' Entrance accessible',1163' Store interior accessible',1164' Emergency exit'],1165'stars': 5,1166'title': 'Shoppers Drug Mart'},1167{ 'description': [ ' Entrance accessible',1168' Store interior accessible',1169' Emergency exit'],1170'stars': 5,1171'title': 'Showcase'},1172{ 'description': [ ' Entrance accessible',1173' Store interior accessible',1174' Change room accessible',1175' Emergency exit'],1176'stars': 5,1177'title': 'Simons'},1178{ 'description': [ ' Entrance accessible',1179' Store interior accessible',1180' Emergency exit'],1181'stars': 5,1182'title': 'Sketchers'},1183{ 'description': [ ' Entrance accessible',1184' Store interior accessible',1185' Emergency exit'],1186'stars': 5,1187'title': 'Sleep Country'},1188{ 'description': [ ' Entrance accessible',1189' Store interior accessible',1190' Emergency exit'],1191'stars': 5,1192'title': 'SoftMoc'},1193{ 'description': [ ' Entrance accessible',1194' Store interior mostly accessible',1195' Change room accessible',1196' Emergency exit'],1197'stars': 4,1198'title': 'Soya & Kyo'},1199{ 'description': [ ' Entrance accessible',1200' Store interior accessible',1201' Emergency exit'],1202'stars': 5,1203'title': 'Spence Diamonds'},1204{ 'description': [ ' Entrance accessible',1205' Store interior mostly accessible',1206' Change room accessible',1207' Emergency exit'],1208'stars': 4,1209'title': 'Sport Check'},1210{ 'description': [ ' Entrance accessible',1211' Store interior accessible',1212' Emergency exit'],1213'stars': 5,1214'title': 'Squish Candies'},1215{ 'description': [ ' Entrance accessible',1216' Store interior accessible',1217' Emergency exit'],1218'stars': 5,1219'title': 'Starbucks'},1220{ 'description': [ ' Entrance accessible',1221' Store interior accessible',1222' Change room accessible',1223' Emergency exit'],1224'stars': 5,1225'title': 'Steve Madden'},1226{ 'description': [ ' Entrance accessible',1227' Store interior accessible',1228' Emergency exit',1229' Kiosk'],1230'stars': 5,1231'title': 'StickerYou: The Pop Up'},1232{ 'description': [ ' Entrance accessible',1233' Store interior accessible',1234' Emergency exit'],1235'stars': 5,1236'title': 'Stich It'},1237{ 'description': [ ' Entrance accessible',1238' Store interior accessible',1239' Change room accessible',1240' Emergency exit'],1241'stars': 5,1242'title': 'Strauss Menâ\x80\x99s Wear'},1243{ 'description': [ ' Entrance accessible',1244' Store interior accessible',1245' Emergency exit'],1246'stars': 5,1247'title': 'Stuart Weitzman'},1248{ 'description': [ ' Entrance accessible',1249' Store interior accessible',1250' Emergency exit'],1251'stars': 5,1252'title': 'Sukoshi Mart'},1253{ 'description': [ ' Entrance accessible',1254' Store interior accessible',1255' Emergency exit'],1256'stars': 5,1257'title': 'Sunglass Hut'},1258{ 'description': [ ' Entrance accessible',1259' Store interior somewhat accessible',1260' Change room accessible',1261' Emergency exit'],1262'stars': 3,1263'title': 'Suzy'},1264{ 'description': [ ' Entrance accessible',1265' Store interior accessible',1266' Emergency exit'],1267'stars': 5,1268'title': 'Swarovski'},1269{ 'description': [ ' Entrance accessible',1270' Store interior mostly accessible',1271' Change room accessible',1272' Emergency exit'],1273'stars': 4,1274'title': 'Swimco'},1275{ 'description': [ ' Entrance accessible',1276' Store interior accessible',1277' Emergency exit'],1278'stars': 5,1279'title': 'Szechuan Express'},1280{ 'description': [ ' Entrance accessible',1281' Store interior accessible',1282' Emergency exit'],1283'stars': 5,1284'title': 'Tbooth Wireless'},1285{ 'description': [ ' Entrance accessible',1286' Store interior accessible',1287' Emergency exit'],1288'stars': 5,1289'title': 'TD'},1290{ 'description': [ ' Entrance accessible',1291' Store interior accessible',1292' Emergency exit'],1293'stars': 5,1294'title': 'Telus Mobility'},1295{ 'description': [ ' Entrance accessible',1296' Store interior accessible',1297' Emergency exit'],1298'stars': 5,1299'title': 'Ten Renâ\x80\x99s Tea'},1300{ 'description': [ ' Entrance accessible',1301' Store interior accessible',1302' Emergency exit'],1303'stars': 5,1304'title': 'The Body Shop'},1305{ 'description': [ ' Entrance accessible',1306' Store interior barely accessible',1307' Change room accessible',1308' Emergency exit'],1309'stars': 2,1310'title': 'The Childrenâ\x80\x99s Place'},1311{ 'description': [ ' Entrance accessible',1312' Store interior accessible',1313' Emergency exit'],1314'stars': 5,1315'title': 'The Food District'},1316{ 'description': [ ' Entrance accessible',1317' Store interior accessible',1318' Emergency exit'],1319'stars': 5,1320'title': 'The Rec Room'},1321{ 'description': [ ' Entrance accessible',1322' Store interior accessible',1323' Emergency exit'],1324'stars': 5,1325'title': 'The Source'},1326{ 'description': [ ' Entrance accessible',1327' Store interior accessible',1328' Emergency exit'],1329'stars': 5,1330'title': 'The Wine Shop & Tasting Room'},1331{ 'description': [ ' Entrance accessible',1332' Store interior accessible',1333' Emergency exit'],1334'stars': 5,1335'title': 'Tim Hortons'},1336{ 'description': [ ' Entrance accessible',1337' Store interior accessible',1338' Emergency exit'],1339'stars': 5,1340'title': 'TONYC'},1341{ 'description': [ ' Entrance accessible',1342' Store interior accessible',1343' Change room accessible',1344' Emergency exit'],1345'stars': 5,1346'title': 'Topshop/Topman'},1347{ 'description': [ ' Entrance accessible',1348' Store interior accessible',1349' Change room accessible',1350' Emergency exit'],1351'stars': 5,1352'title': 'Torrid'},1353{ 'description': [ ' Entrance accessible',1354' Store interior accessible',1355' Change room accessible',1356' Emergency exit'],1357'stars': 5,1358'title': 'Tory Birch'},1359{ 'description': [ ' Entrance accessible',1360' Store interior accessible',1361' Emergency exit'],1362'stars': 5,1363'title': 'Town Shoes'},1364{ 'description': [ ' Entrance accessible',1365' Store interior accessible',1366' Emergency exit'],1367'stars': 5,1368'title': 'Toys Cubed'},1369{ 'description': [ ' Entrance accessible',1370' Store interior accessible',1371' Emergency exit'],1372'stars': 5,1373'title': 'Trade Secrets'},1374{ 'description': [ ' Entrance accessible',1375' Store interior accessible',1376' Emergency exit'],1377'stars': 5,1378'title': 'Travel currency Exchange'},1379{ 'description': [ ' Entrance accessible',1380' Store interior accessible',1381' Emergency exit'],1382'stars': 5,1383'title': 'Tripcentral'},1384{ 'description': [ ' Entrance accessible',1385' Store interior accessible',1386' Emergency exit'],1387'stars': 5,1388'title': 'Tsujiri'},1389{ 'description': [ ' Entrance accessible',1390' Store interior mostly accessible',1391' Change room accessible',1392' Emergency exit'],1393'stars': 4,1394'title': 'Tumi'},1395{ 'description': [ ' Entrance accessible',1396' Store interior accessible',1397' Emergency exit'],1398'stars': 5,1399'title': 'Uniqlo'},1400{ 'description': [ ' Entrance accessible',1401' Store interior mostly accessible',1402' Change room accessible',1403' Emergency exit from lower level'],1404'stars': 4,1405'title': 'Urban Behaviour'},1406{ 'description': [ ' Entrance accessible',1407' Store interior barely accessible',1408' Change room accessible',1409' Emergency exit'],1410'stars': 2,1411'title': 'Urban Kids'},1412{ 'description': [ ' Entrance accessible',1413' Store interior accessible',1414' Emergency exit'],1415'stars': 5,1416'title': 'Urban Outfitters'},1417{ 'description': [ ' Entrance accessible',1418' Store interior somewhat accessible',1419' Change room accessible',1420' Emergency exit'],1421'stars': 3,1422'title': 'Urban Planet'},1423{ 'description': [ ' Entrance accessible',1424' Store interior accessible',1425' Change room accessible',1426' Emergency exit'],1427'stars': 5,1428'title': 'Victoriaâ\x80\x99s Secret'},1429{ 'description': [ ' Entrance accessible',1430' Store interior accessible',1431' Change room accessible',1432' Emergency exit'],1433'stars': 5,1434'title': 'Victoriaâ\x80\x99s Secret Pink'},1435{ 'description': [ ' Entrance accessible',1436' Store interior accessible',1437' Emergency exit'],1438'stars': 5,1439'title': 'Virgin Mobile'},1440{ 'description': [ ' Entrance accessible',1441' Store interior accessible',1442' Emergency exit',1443' Kiosk'],1444'stars': 5,1445'title': 'Virgin Mobile Kiosk'},1446{ 'description': [ ' Entrance accessible',1447' Store interior accessible',1448' Emergency exit'],1449'stars': 5,1450'title': 'Walmart'},1451{ 'description': [ ' Entrance accessible',1452' Store interior accessible',1453' Emergency exit'],1454'stars': 5,1455'title': 'Watch It!'},1456{ 'description': [ ' Entrance accessible',1457' Store interior mostly accessible',1458' Change room accessible',1459' Emergency exit'],1460'stars': 4,1461'title': 'White House Black Market'},1462{ 'description': [ ' Entrance accessible',1463' Store interior accessible',1464' Emergency exit'],1465'stars': 5,1466'title': 'Whole Foods'},1467{ 'description': [ ' Entrance accessible',1468' Store interior mostly accessible',1469' Change room accessible',1470' Emergency exit'],1471'stars': 4,1472'title': 'Wilfred'},1473{ 'description': [ ' Entrance accessible',1474' Store interior accessible',1475' Emergency exit'],1476'stars': 5,1477'title': 'Wireless + Kiosks'},1478{ 'description': [ ' Entrance accessible',1479' Store interior accessible',1480' Emergency exit'],1481'stars': 5,1482'title': 'Wirelesswave'},1483{ 'description': [ ' Entrance accessible',1484' Store interior accessible',1485' Emergency exit',1486' Kiosk'],1487'stars': 5,1488'title': 'WOW Mobile Boutique'},1489{ 'description': [ ' Entrance accessible',1490' Store interior accessible',1491' Emergency exit',1492' Kiosk'],1493'stars': 5,1494'title': 'Yogen Früz'},1495{ 'description': [ ' Entrance accessible',1496' Store interior accessible',1497' Emergency exit'],1498'stars': 5,1499'title': 'Yves Rocher'},1500{ 'description': [ ' Entrance accessible',1501' Store interior mostly accessible',1502' Change room accessible',1503' Emergency exit'],1504'stars': 4,1505'title': 'Zara'},1506{ 'description': [ ' Entrance accessible',1507' Store interior somewhat accessible',1508' Change room not accessible',1509' Emergency exit'],1510'stars': 2,...

Full Screen

Full Screen

accessibility.js

Source:accessibility.js Github

copy

Full Screen

1/* This Source Code Form is subject to the terms of the Mozilla Public2 * License, v. 2.0. If a copy of the MPL was not distributed with this file,3 * You can obtain one at http://mozilla.org/MPL/2.0/. */4"use strict";5const {classes: Cc, interfaces: Ci, utils: Cu} = Components;6Cu.import("resource://gre/modules/Services.jsm");7Cu.import("resource://gre/modules/XPCOMUtils.jsm");8Cu.import("resource://gre/modules/Log.jsm");9const logger = Log.repository.getLogger("Marionette");10const {ElementNotAccessibleError} =11 Cu.import("chrome://marionette/content/error.js", {});12XPCOMUtils.defineLazyModuleGetter(13 this, "setInterval", "resource://gre/modules/Timer.jsm");14XPCOMUtils.defineLazyModuleGetter(15 this, "clearInterval", "resource://gre/modules/Timer.jsm");16XPCOMUtils.defineLazyGetter(this, "service", () => {17 try {18 return Cc["@mozilla.org/accessibilityService;1"]19 .getService(Ci.nsIAccessibilityService);20 } catch (e) {21 logger.warn("Accessibility module is not present");22 return undefined;23 }24});25this.EXPORTED_SYMBOLS = ["accessibility"];26/** @namespace */27this.accessibility = {28 get service() {29 return service;30 },31};32/**33 * Accessible states used to check element"s state from the accessiblity API34 * perspective.35 *36 * Note: if gecko is built with --disable-accessibility, the interfaces37 * are not defined. This is why we use getters instead to be able to use38 * these statically.39 */40accessibility.State = {41 get Unavailable() {42 return Ci.nsIAccessibleStates.STATE_UNAVAILABLE;43 },44 get Focusable() {45 return Ci.nsIAccessibleStates.STATE_FOCUSABLE;46 },47 get Selectable() {48 return Ci.nsIAccessibleStates.STATE_SELECTABLE;49 },50 get Selected() {51 return Ci.nsIAccessibleStates.STATE_SELECTED;52 },53};54/**55 * Accessible object roles that support some action.56 */57accessibility.ActionableRoles = new Set([58 "checkbutton",59 "check menu item",60 "check rich option",61 "combobox",62 "combobox option",63 "entry",64 "key",65 "link",66 "listbox option",67 "listbox rich option",68 "menuitem",69 "option",70 "outlineitem",71 "pagetab",72 "pushbutton",73 "radiobutton",74 "radio menu item",75 "rowheader",76 "slider",77 "spinbutton",78 "switch",79]);80/**81 * Factory function that constructs a new {@code accessibility.Checks}82 * object with enforced strictness or not.83 */84accessibility.get = function(strict = false) {85 return new accessibility.Checks(!!strict);86};87/**88 * Component responsible for interacting with platform accessibility89 * API.90 *91 * Its methods serve as wrappers for testing content and chrome92 * accessibility as well as accessibility of user interactions.93 */94accessibility.Checks = class {95 /**96 * @param {boolean} strict97 * Flag indicating whether the accessibility issue should be logged98 * or cause an error to be thrown. Default is to log to stdout.99 */100 constructor(strict) {101 this.strict = strict;102 }103 /**104 * Get an accessible object for an element.105 *106 * @param {DOMElement|XULElement} element107 * Element to get the accessible object for.108 * @param {boolean=} mustHaveAccessible109 * Flag indicating that the element must have an accessible object.110 * Defaults to not require this.111 *112 * @return {Promise.<nsIAccessible>}113 * Promise with an accessibility object for the given element.114 */115 getAccessible(element, mustHaveAccessible = false) {116 if (!this.strict) {117 return Promise.resolve();118 }119 return new Promise((resolve, reject) => {120 if (!accessibility.service) {121 reject();122 return;123 }124 // First, check if accessibility is ready.125 let docAcc = accessibility.service126 .getAccessibleFor(element.ownerDocument);127 let state = {};128 docAcc.getState(state, {});129 if ((state.value & Ci.nsIAccessibleStates.STATE_BUSY) == 0) {130 // Accessibility is ready, resolve immediately.131 let acc = accessibility.service.getAccessibleFor(element);132 if (mustHaveAccessible && !acc) {133 reject();134 } else {135 resolve(acc);136 }137 return;138 }139 // Accessibility for the doc is busy, so wait for the state to change.140 let eventObserver = {141 observe(subject, topic, data) {142 if (topic !== "accessible-event") {143 return;144 }145 // If event type does not match expected type, skip the event.146 let event = subject.QueryInterface(Ci.nsIAccessibleEvent);147 if (event.eventType !== Ci.nsIAccessibleEvent.EVENT_STATE_CHANGE) {148 return;149 }150 // If event's accessible does not match expected accessible,151 // skip the event.152 if (event.accessible !== docAcc) {153 return;154 }155 Services.obs.removeObserver(this, "accessible-event");156 let acc = accessibility.service.getAccessibleFor(element);157 if (mustHaveAccessible && !acc) {158 reject();159 } else {160 resolve(acc);161 }162 },163 };164 Services.obs.addObserver(eventObserver, "accessible-event");165 }).catch(() => this.error(166 "Element does not have an accessible object", element));167 }168 /**169 * Test if the accessible has a role that supports some arbitrary170 * action.171 *172 * @param {nsIAccessible} accessible173 * Accessible object.174 *175 * @return {boolean}176 * True if an actionable role is found on the accessible, false177 * otherwise.178 */179 isActionableRole(accessible) {180 return accessibility.ActionableRoles.has(181 accessibility.service.getStringRole(accessible.role));182 }183 /**184 * Test if an accessible has at least one action that it supports.185 *186 * @param {nsIAccessible} accessible187 * Accessible object.188 *189 * @return {boolean}190 * True if the accessible has at least one supported action,191 * false otherwise.192 */193 hasActionCount(accessible) {194 return accessible.actionCount > 0;195 }196 /**197 * Test if an accessible has a valid name.198 *199 * @param {nsIAccessible} accessible200 * Accessible object.201 *202 * @return {boolean}203 * True if the accessible has a non-empty valid name, or false if204 * this is not the case.205 */206 hasValidName(accessible) {207 return accessible.name && accessible.name.trim();208 }209 /**210 * Test if an accessible has a {@code hidden} attribute.211 *212 * @param {nsIAccessible} accessible213 * Accessible object.214 *215 * @return {boolean}216 * True if the accessible object has a {@code hidden} attribute,217 * false otherwise.218 */219 hasHiddenAttribute(accessible) {220 let hidden = false;221 try {222 hidden = accessible.attributes.getStringProperty("hidden");223 } catch (e) {}224 // if the property is missing, error will be thrown225 return hidden && hidden === "true";226 }227 /**228 * Verify if an accessible has a given state.229 * Test if an accessible has a given state.230 *231 * @param {nsIAccessible} accessible232 * Accessible object to test.233 * @param {number} stateToMatch234 * State to match.235 *236 * @return {boolean}237 * True if |accessible| has |stateToMatch|, false otherwise.238 */239 matchState(accessible, stateToMatch) {240 let state = {};241 accessible.getState(state, {});242 return !!(state.value & stateToMatch);243 }244 /**245 * Test if an accessible is hidden from the user.246 *247 * @param {nsIAccessible} accessible248 * Accessible object.249 *250 * @return {boolean}251 * True if element is hidden from user, false otherwise.252 */253 isHidden(accessible) {254 while (accessible) {255 if (this.hasHiddenAttribute(accessible)) {256 return true;257 }258 accessible = accessible.parent;259 }260 return false;261 }262 /**263 * Test if the element's visible state corresponds to its accessibility264 * API visibility.265 *266 * @param {nsIAccessible} accessible267 * Accessible object.268 * @param {DOMElement|XULElement} element269 * Element associated with |accessible|.270 * @param {boolean} visible271 * Visibility state of |element|.272 *273 * @throws ElementNotAccessibleError274 * If |element|'s visibility state does not correspond to275 * |accessible|'s.276 */277 assertVisible(accessible, element, visible) {278 if (!accessible) {279 return;280 }281 let hiddenAccessibility = this.isHidden(accessible);282 let message;283 if (visible && hiddenAccessibility) {284 message = "Element is not currently visible via the accessibility API " +285 "and may not be manipulated by it";286 } else if (!visible && !hiddenAccessibility) {287 message = "Element is currently only visible via the accessibility API " +288 "and can be manipulated by it";289 }290 this.error(message, element);291 }292 /**293 * Test if the element's unavailable accessibility state matches the294 * enabled state.295 *296 * @param {nsIAccessible} accessible297 * Accessible object.298 * @param {DOMElement|XULElement} element299 * Element associated with |accessible|.300 * @param {boolean} enabled301 * Enabled state of |element|.302 *303 * @throws ElementNotAccessibleError304 * If |element|'s enabled state does not match |accessible|'s.305 */306 assertEnabled(accessible, element, enabled) {307 if (!accessible) {308 return;309 }310 let win = element.ownerGlobal;311 let disabledAccessibility = this.matchState(312 accessible, accessibility.State.Unavailable);313 let explorable = win.getComputedStyle(element)314 .getPropertyValue("pointer-events") !== "none";315 let message;316 if (!explorable && !disabledAccessibility) {317 message = "Element is enabled but is not explorable via the " +318 "accessibility API";319 } else if (enabled && disabledAccessibility) {320 message = "Element is enabled but disabled via the accessibility API";321 } else if (!enabled && !disabledAccessibility) {322 message = "Element is disabled but enabled via the accessibility API";323 }324 this.error(message, element);325 }326 /**327 * Test if it is possible to activate an element with the accessibility328 * API.329 *330 * @param {nsIAccessible} accessible331 * Accessible object.332 * @param {DOMElement|XULElement} element333 * Element associated with |accessible|.334 *335 * @throws ElementNotAccessibleError336 * If it is impossible to activate |element| with |accessible|.337 */338 assertActionable(accessible, element) {339 if (!accessible) {340 return;341 }342 let message;343 if (!this.hasActionCount(accessible)) {344 message = "Element does not support any accessible actions";345 } else if (!this.isActionableRole(accessible)) {346 message = "Element does not have a correct accessibility role " +347 "and may not be manipulated via the accessibility API";348 } else if (!this.hasValidName(accessible)) {349 message = "Element is missing an accessible name";350 } else if (!this.matchState(accessible, accessibility.State.Focusable)) {351 message = "Element is not focusable via the accessibility API";352 }353 this.error(message, element);354 }355 /**356 * Test that an element's selected state corresponds to its357 * accessibility API selected state.358 *359 * @param {nsIAccessible} accessible360 * Accessible object.361 * @param {DOMElement|XULElement}362 * Element associated with |accessible|.363 * @param {boolean} selected364 * The |element|s selected state.365 *366 * @throws ElementNotAccessibleError367 * If |element|'s selected state does not correspond to368 * |accessible|'s.369 */370 assertSelected(accessible, element, selected) {371 if (!accessible) {372 return;373 }374 // element is not selectable via the accessibility API375 if (!this.matchState(accessible, accessibility.State.Selectable)) {376 return;377 }378 let selectedAccessibility =379 this.matchState(accessible, accessibility.State.Selected);380 let message;381 if (selected && !selectedAccessibility) {382 message = "Element is selected but not selected via the accessibility API";383 } else if (!selected && selectedAccessibility) {384 message = "Element is not selected but selected via the accessibility API";385 }386 this.error(message, element);387 }388 /**389 * Throw an error if strict accessibility checks are enforced and log390 * the error to the log.391 *392 * @param {string} message393 * @param {DOMElement|XULElement} element394 * Element that caused an error.395 *396 * @throws ElementNotAccessibleError397 * If |strict| is true.398 */399 error(message, element) {400 if (!message || !this.strict) {401 return;402 }403 if (element) {404 let {id, tagName, className} = element;405 message += `: id: ${id}, tagName: ${tagName}, className: ${className}`;406 }407 throw new ElementNotAccessibleError(message);408 }...

Full Screen

Full Screen

a11y.js

Source:a11y.js Github

copy

Full Screen

1/*2 Copyright (c) 2004-2006, The Dojo Foundation3 All Rights Reserved.4 Licensed under the Academic Free License version 2.1 or above OR the5 modified BSD license. For more information on Dojo licensing, see:6 http://dojotoolkit.org/community/licensing.shtml7*/8dojo.provide("dojo.a11y");9dojo.require("dojo.uri.*");10dojo.require("dojo.html.common");11dojo.a11y = {12 // imgPath: String path to the test image for determining if images are displayed or not13 // doAccessibleCheck: Boolean if true will perform check for need to create accessible widgets14 // accessible: Boolean uninitialized when null (accessible check has not been performed)15 // if true generate accessible widgets16 imgPath:dojo.uri.dojoUri("src/widget/templates/images"),17 doAccessibleCheck: true,18 accessible: null, 19 checkAccessible: function(){ 20 // summary: 21 // perform check for accessibility if accessibility checking is turned22 // on and the accessibility test has not been performed yet23 if(this.accessible === null){ 24 this.accessible = false; //default25 if(this.doAccessibleCheck == true){ 26 this.accessible = this.testAccessible();27 }28 }29 return this.accessible; /* Boolean */30 },31 32 testAccessible: function(){33 // summary: 34 // Always perform the accessibility check to determine if high 35 // contrast mode is on or display of images are turned off. Currently only checks 36 // in IE and Mozilla. 37 this.accessible = false; //default38 if (dojo.render.html.ie || dojo.render.html.mozilla){39 var div = document.createElement("div");40 //div.style.color="rgb(153,204,204)";41 div.style.backgroundImage = "url(\"" + this.imgPath + "/tab_close.gif\")";42 // must add to hierarchy before can view currentStyle below43 dojo.body().appendChild(div);44 // in FF and IE the value for the current background style of the added div45 // will be "none" in high contrast mode46 // in FF the return value will be url(invalid-url:) when running over http 47 var bkImg = null;48 if (window.getComputedStyle ) {49 var cStyle = getComputedStyle(div, ""); 50 bkImg = cStyle.getPropertyValue("background-image");51 }else{52 bkImg = div.currentStyle.backgroundImage;53 }54 var bUseImgElem = false;55 if (bkImg != null && (bkImg == "none" || bkImg == "url(invalid-url:)" )) {56 this.accessible = true;57 }58 /*59 if(this.accessible == false && document.images){60 // test if images are off in IE61 var testImg = new Image();62 if(testImg.fileSize) {63 testImg.src = this.imgPath + "/tab_close.gif";64 if(testImg.fileSize < 0){ 65 this.accessible = true;66 }67 } 68 }*/69 dojo.body().removeChild(div);70 }71 return this.accessible; /* Boolean */72 },73 74 setCheckAccessible: function(/* Boolean */ bTest){ 75 // summary: 76 // Set whether or not to check for accessibility mode. Default value77 // of module is true - perform check for accessibility modes. 78 // bTest: Boolean - true to check; false to turn off checking79 this.doAccessibleCheck = bTest;80 },81 setAccessibleMode: function(){82 // summary:83 // perform the accessibility check and sets the correct mode to load 84 // a11y widgets. Only runs if test for accessiiblity has not been performed yet. 85 // Call testAccessible() to force the test.86 if (this.accessible === null){87 if (this.checkAccessible()){88 dojo.render.html.prefixes.unshift("a11y");89 }90 }91 return this.accessible; /* Boolean */92 }93};94//dojo.hostenv.modulesLoadedListeners.unshift(function() { dojo.a11y.setAccessibleMode(); });...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1import { accessible } from 'storybook-addon-accessibility';2import { withKnobs } from '@storybook/addon-knobs';3import { addDecorator } from '@storybook/react';4addDecorator(withKnobs);5addDecorator(accessible);6export const accessibleStory = () => {7 return <div>Accessible Story</div>;8};9accessibleStory.story = {10 parameters: {11 a11y: {12 config: {},13 options: {},14 },15 },16};17export const nonAccessibleStory = () => {18 return <div>Non-Accessible Story</div>;19};20nonAccessibleStory.story = {21 parameters: {22 a11y: {23 config: {},24 options: {},25 },26 },27};28export const nonAccessibleStory2 = () => {29 return <div>Non-Accessible Story</div>;30};31nonAccessibleStory2.story = {32 parameters: {33 a11y: {34 config: {},35 options: {},36 },37 },38};39export const nonAccessibleStory3 = () => {40 return <div>Non-Accessible Story</div>;41};42nonAccessibleStory3.story = {43 parameters: {44 a11y: {45 config: {},46 options: {},47 },48 },49};50export const nonAccessibleStory4 = () => {51 return <div>Non-Accessible Story</div>;52};53nonAccessibleStory4.story = {54 parameters: {55 a11y: {56 config: {},57 options: {},58 },59 },60};61export const nonAccessibleStory5 = () => {62 return <div>Non-Accessible Story</div>;63};64nonAccessibleStory5.story = {65 parameters: {

Full Screen

Using AI Code Generation

copy

Full Screen

1import { accessible } from 'storybook-addon-accessibility';2describe('MyComponent', () => {3 it('should be accessible', async () => {4 await accessible('<MyComponent />');5 });6});7module.exports = {8};9import { addDecorator } from '@storybook/react';10import { withA11y } from '@storybook/addon-a11y';11import { withKnobs } from '@storybook/addon-knobs';12addDecorator(withA11y);13addDecorator(withKnobs);14module.exports = {15 module: {16 {17 test: /\.(js|jsx)$/,18 use: {19 },20 },21 },22};23import { configure } from '@storybook/react';24const req = require.context('../src', true, /.stories.js$/);25function loadStories() {26 req.keys().forEach(filename => req(filename));27}28configure(loadStories, module);29import 'storybook-addon-accessibility/register';

Full Screen

Using AI Code Generation

copy

Full Screen

1import { accessible } from 'storybook-addon-accessibility';2export default {3};4import { accessible } from 'storybook-addon-accessibility';5export default {6};7import { accessible } from 'storybook-addon-accessibility';8export default {9};10import { accessible } from 'storybook-addon-accessibility';11export default {12};13import { accessible } from 'storybook-addon-accessibility';14export default {15};

Full Screen

Using AI Code Generation

copy

Full Screen

1import { getStorybookUI, configure } from '@storybook/react-native';2import { loadStories } from './storyLoader';3configure(() => {4 loadStories();5}, module);6const StorybookUIRoot = getStorybookUI({ port: 7007, onDeviceUI: true });7export default StorybookUIRoot;8import { addDecorator, configure } from '@storybook/react-native';9import { withKnobs } from '@storybook/addon-knobs';10addDecorator(withKnobs);11configure(() => {12 require('./stories');13}, module);14import { storiesOf } from '@storybook/react-native';15import React from 'react';16import { Button } from 'react-native';17import { withKnobs } from '@storybook/addon-knobs';18storiesOf('Button', module)19 .addDecorator(withKnobs)20 .add('with text', () => (21 onPress={action('clicked-text')}22 .add('with some emoji', () => (23 onPress={action('clicked-emoji')}24 ));

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run storybook-root automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful