[whatwg/dom] [proposal]: getClientRects / getBoundingClientRect for pseudo elements (#1020)

One of the big challenges in automated accessibility testing is to test for color contrast. And one of the biggest challenges in testing for color contrast is to figure out what is going on with pseudo elements on the page. It would be very helpful if, similar to `window.getComputedStyle` the `Element.getClientRects` and `Element.getBoundingClientRect` methods could accept an argument which tells the browser to return rect(s) of the pseudo element instead. 

```js
const pseudoRects = elm.getClientRects(':after');
```

This would help tools like [axe-core](https://github.com/dequelabs/axe-core), and other accessibility tools, which currently just sort of have to guess what's going on with the pseudo elements based on computed styles.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/1020

Received on Monday, 27 September 2021 12:00:38 UTC