fix(accessibility): don't filter everything when the page has a title (#2909)
This commit is contained in:
parent
d8bedd851d
commit
9140063c90
|
|
@ -145,7 +145,7 @@ class CRAXNode implements accessibility.AXNode {
|
|||
// Here and below: Android heuristics
|
||||
if (this._hasFocusableChild())
|
||||
return false;
|
||||
if (this._focusable && this._name)
|
||||
if (this._focusable && this._role !== 'WebArea' && this._name)
|
||||
return true;
|
||||
if (this._role === 'heading' && this._name)
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ class FFAXNode implements accessibility.AXNode {
|
|||
// Here and below: Android heuristics
|
||||
if (this._hasFocusableChild())
|
||||
return false;
|
||||
if (this._focusable && this._name)
|
||||
if (this._focusable && this._role !== 'document' && this._name)
|
||||
return true;
|
||||
if (this._role === 'heading' && this._name)
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -347,4 +347,13 @@ describe('Accessibility', function() {
|
|||
});
|
||||
});
|
||||
});
|
||||
it('should work when there is a title ', async ({page}) => {
|
||||
await page.setContent(`
|
||||
<title>This is the title</title>
|
||||
<div>This is the content</div>
|
||||
`);
|
||||
const snapshot = await page.accessibility.snapshot();
|
||||
expect(snapshot.name).toBe('This is the title');
|
||||
expect(snapshot.children[0].name).toBe('This is the content');
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue