There is actually https://developer.mozilla.org/en-US/docs/Web/API/Element/matches that could potentially used here like: ``` function isDisabled(elem) { return elem.matches(":disabled"); } ``` As such we won't need recursion anymore and could directly return the disabled state. I'll check by adding various tests.
Bug 1863266 Comment 2 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
There is actually https://developer.mozilla.org/en-US/docs/Web/API/Element/matches that could potentially used here like: ``` function isDisabled(elem) { return elem.matches(":disabled"); } ``` As such we won't need recursion anymore and could directly return the disabled state. I'll check by adding various tests. Note that the call might trigger a flush of layout/styling, which we might not want. So lets check that with a perf profile.