Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
AX: inert attribute doesn't cause display:contents element to be ignored
https://bugs.webkit.org/show_bug.cgi?id=241022 Reviewed by Chris Fleizach. Prior to this patch, the inert attribute didn't cause node-only objects (like those with display:contents) to be ignored. This was because AccessibilityObject::defaultObjectInclusion only checked `effectiveInert` for elements with renderers, even though you only need an element to have style (not a renderer). This patch fixes this by adding a new AccessibilityObject::style() method which uses AccessibilityObject::element() to get Element::computedStyle() and checking effectiveInert on that, which works for both renderer and renderer-less objects. * LayoutTests/accessibility/node-only-inert-object-expected.txt: Added. * LayoutTests/accessibility/node-only-inert-object.html: Added. * LayoutTests/platform/ios/TestExpectations: Enable new test. * LayoutTests/platform/mac-wk1/TestExpectations: Skip new test. * Source/WebCore/accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::style const): Added. (WebCore::AccessibilityObject::defaultObjectInclusion const): * Source/WebCore/accessibility/AccessibilityObject.h: Canonical link: https://commits.webkit.org/251185@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295090 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
7 changed files
with
61 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @@ -0,0 +1,11 @@ | ||
| This test ensures that a node-only object (e.g. one with display:contents) that is inert is ignored. | ||
|
|
||
| PASS: accessibilityController.accessibleElementById('button') === null | ||
|
|
||
| Removing inert from #button | ||
| PASS: accessibilityController.accessibleElementById('button').role.includes('Button') === true | ||
|
|
||
| PASS successfullyParsed is true | ||
|
|
||
| TEST COMPLETE | ||
| Click me |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @@ -0,0 +1,31 @@ | ||
| <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | ||
| <html> | ||
| <head> | ||
| <script src="../resources/accessibility-helper.js"></script> | ||
| <script src="../resources/js-test.js"></script> | ||
| </head> | ||
| <body> | ||
|
|
||
| <button inert id="button" style="display:contents">Click me</button> | ||
|
|
||
| <script> | ||
| var testOutput = "This test ensures that a node-only object (e.g. one with display:contents) that is inert is ignored.\n\n"; | ||
|
|
||
| if (window.accessibilityController) { | ||
| window.jsTestIsAsync = true; | ||
|
|
||
| testOutput += expect("accessibilityController.accessibleElementById('button')", "null"); | ||
|
|
||
| testOutput += "\nRemoving inert from #button\n"; | ||
| document.getElementById("button").removeAttribute("inert"); | ||
| setTimeout(async function() { | ||
| await waitFor(() => accessibilityController.accessibleElementById("button")); | ||
| testOutput += expect("accessibilityController.accessibleElementById('button').role.includes('Button')", "true"); | ||
|
|
||
| debug(testOutput); | ||
| finishJSTest(); | ||
| }, 0); | ||
| } | ||
| </script> | ||
| </body> | ||
| </html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters