chore: fix webkit visibility check in aria matcher (#33102)
This commit is contained in:
parent
a38ff6e0d8
commit
2c05d294a8
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
import { escapeWithQuotes } from '@isomorphic/stringUtils';
|
import { escapeWithQuotes } from '@isomorphic/stringUtils';
|
||||||
import { beginAriaCaches, endAriaCaches, getAriaRole, getElementAccessibleName, isElementIgnoredForAria } from './roleUtils';
|
import { beginAriaCaches, endAriaCaches, getAriaRole, getElementAccessibleName, isElementIgnoredForAria } from './roleUtils';
|
||||||
import { isElementVisible } from './domUtils';
|
import { isElementVisible, isElementStyleVisibilityVisible } from './domUtils';
|
||||||
|
|
||||||
type AriaNode = {
|
type AriaNode = {
|
||||||
role: string;
|
role: string;
|
||||||
|
|
@ -59,11 +59,7 @@ export function generateAriaTree(rootElement: Element): AriaNode {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const visible = isElementVisible(element);
|
const visible = isElementVisible(element);
|
||||||
const hasVisibleChildren = element.checkVisibility({
|
const hasVisibleChildren = isElementStyleVisibilityVisible(element);
|
||||||
opacityProperty: true,
|
|
||||||
visibilityProperty: true,
|
|
||||||
contentVisibilityAuto: true
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!hasVisibleChildren)
|
if (!hasVisibleChildren)
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -94,8 +94,20 @@ test('should allow text nodes', async ({ page }) => {
|
||||||
`);
|
`);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('details visibility', async ({ page, browserName }) => {
|
||||||
|
await page.setContent(`
|
||||||
|
<details>
|
||||||
|
<summary>Summary</summary>
|
||||||
|
<div>Details</div>
|
||||||
|
</details>
|
||||||
|
`);
|
||||||
|
|
||||||
|
await expect(page.locator('body')).toMatchAriaSnapshot(`
|
||||||
|
- group: Summary
|
||||||
|
`);
|
||||||
|
});
|
||||||
|
|
||||||
test('integration test', async ({ page, browserName }) => {
|
test('integration test', async ({ page, browserName }) => {
|
||||||
test.fixme(browserName === 'webkit');
|
|
||||||
await page.setContent(`
|
await page.setContent(`
|
||||||
<h1>Microsoft</h1>
|
<h1>Microsoft</h1>
|
||||||
<div>Open source projects and samples from Microsoft</div>
|
<div>Open source projects and samples from Microsoft</div>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue