Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Accessibility Tree と Accessibility Object Model

grgr-dkrk
February 04, 2020

Accessibility Tree と Accessibility Object Model

TBD

grgr-dkrk

February 04, 2020
Tweet

More Decks by grgr-dkrk

Other Decks in Programming

Transcript

  1. "DDFTTJCJMJUZ5SFF΁ͷΞΫηε +BWB4DSJQUͰͷΞΫηε͕ࠔ೉ 1VQQFUFFS΍ϒϥ΢βͷ*OTQFDUPSͳͲ࢖͏ import * as puppeteer from 'puppeteer' ;(async

    () => { const browser = await puppeteer.launch() const page = await browser.newPage() await page.goto('http://localhost:1234/') const snapshot = await page.accessibility.snapshot() console.info(snapshot) await browser.close() })()
  2. 8"*"3*" 4UBUFΛ؅ཧ͢ΔͨΊʹ΋࢖ΘΕΔ +BWB4DSJQU΍$44ͱ૊Έ߹ΘͤΔඞཁ͕͋Δ <div role="dialog" aria-hidden="true" aria-labelledby="dialogTitle" aria-describedby="dialogDesc" > <h1

    id="dialogTitle">Dialog</h1> <p id="dialogDesc">આ໌Ͱ͢Α</p> </div> 8FC"DDFTTJCJMJUZ*OJUJBUJWFr"DDFTTJCMF3JDI*OUFSOFU"QQMJDBUJPOT
  3. *%3&'Λ+BWB4DSJQUͰ੍ޚ͢Δ 4IBEPX%0.ͷڥքΛӽ͑ΒΕΔ ೉ߤͯ͠Δ C$VTUPN&MFNFOU4FNBOUJDT const input = comboBox.shadowRoot.querySelector('input') const optionList

    = comboBox.querySelector('custom-optionlist') input.activeDescendantElement = optionList.firstChild ίʔυ͸IUUQTXJDHHJUIVCJPBPNFYQMBJOFSIUNM
  4. ࢧԉٕज़޲͚ͷԾ૝/PEFΛ࡞Δ ΄ͱΜͲ4IBEPX%0. const canvas = document.getElementById('canvas') canvas.attachAccessibleRoot() const button =

    canvas.accessibleRoot.appendChild(new AccessibleNode()) button.role = 'button' button.offsetLeft = '30px' button.offsetTop = '20px' button.offsetWidth = '400px' button.offsetHeight = '300px' button.focusable = true 7JSUVBM"DDFTTJCJMJUZ/PEFT
  5. ܭࢉࡁͷ"DDFTTJCJMJUZ5SFFʹΞΫηε͢Δ &YQFSJNFOUBM͚ͩͲҰ෦ͷϒϥ΢βͰ࣮ߦՄ window.addEventListener('load', async () => { const ComputedAccessibleNode =

    ɹɹawait window.getComputedAccessibleNode(elm) console.log(ComputedAccessibleNode) }) $PNQVUFE"DDFTTJCJMJUZ5SFF