fix: add InlineTextBox as a non-element a11y role (#11142)
This commit is contained in:
parent
b020e77991
commit
8aa6cb37d2
@ -23,6 +23,8 @@ import type {AwaitableIterable} from '../common/types.js';
|
|||||||
import {assert} from '../util/assert.js';
|
import {assert} from '../util/assert.js';
|
||||||
import {AsyncIterableUtil} from '../util/AsyncIterableUtil.js';
|
import {AsyncIterableUtil} from '../util/AsyncIterableUtil.js';
|
||||||
|
|
||||||
|
const NON_ELEMENT_NODE_ROLES = new Set(['StaticText', 'InlineTextBox']);
|
||||||
|
|
||||||
const queryAXTree = async (
|
const queryAXTree = async (
|
||||||
client: CDPSession,
|
client: CDPSession,
|
||||||
element: ElementHandle<Node>,
|
element: ElementHandle<Node>,
|
||||||
@ -35,7 +37,7 @@ const queryAXTree = async (
|
|||||||
role,
|
role,
|
||||||
});
|
});
|
||||||
return nodes.filter((node: Protocol.Accessibility.AXNode) => {
|
return nodes.filter((node: Protocol.Accessibility.AXNode) => {
|
||||||
return !node.role || node.role.value !== 'StaticText';
|
return !node.role || !NON_ELEMENT_NODE_ROLES.has(node.role.value);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user