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: meter and progress elements are ignored when -webkit-appearance: …
…none is set https://bugs.webkit.org/show_bug.cgi?id=232569 rdar://problem/84885223 Reviewed by Chris Fleizach. `-webkit-appearance:none` and the unprefixed `appearance:none` on the `meter` and `progress` elements cause them to generate plain `RenderBlock`s instead of `RenderMeter` and `RenderProgress` renderers. This broke accessibility for these elements because we specifically required one of these renderer types to create an `AccessibilityProgressIndicator`. With this patch, that requirement has been relaxed. Now an `AccessibilityProgressIndicator` can be created with any `RenderObject` that is associated with an `HTMLProgressElement` or `HTMLMeterElement`, fixing this issue. `AccessibilityProgressIndicator` doesn't use any method specific to either `RenderMeter` or `RenderProgress`, so this strictness was unnecessary. New test added: accessibility/appearance-none-meter-and-progress-elements.html * LayoutTests/accessibility/appearance-none-meter-and-progress-elements-expected.txt: Added. * LayoutTests/accessibility/appearance-none-meter-and-progress-elements.html: Added. * LayoutTests/platform/win/TestExpectations: Skip new test. * Source/WebCore/accessibility/AXObjectCache.cpp: (WebCore::createFromRenderer): Refactor to remove unnecessary downcasting. * Source/WebCore/accessibility/AccessibilityProgressIndicator.cpp: (WebCore::AccessibilityProgressIndicator::AccessibilityProgressIndicator): (WebCore::AccessibilityProgressIndicator::create): (WebCore::AccessibilityProgressIndicator::valueDescription const): (WebCore::AccessibilityProgressIndicator::valueForRange const): (WebCore::AccessibilityProgressIndicator::maxValueForRange const): (WebCore::AccessibilityProgressIndicator::minValueForRange const): (WebCore::AccessibilityProgressIndicator::progressElement const): (WebCore::AccessibilityProgressIndicator::meterElement const): (WebCore::AccessibilityProgressIndicator::gaugeRegionValueDescription const): (WebCore::AccessibilityProgressIndicator::element const): Deleted -- this override was not necessary. * Source/WebCore/accessibility/AccessibilityProgressIndicator.h: Canonical link: https://commits.webkit.org/255836@main
- Loading branch information
Showing
6 changed files
with
108 additions
and
119 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
This test ensures that <meter> and <progress> elements with appearance:none are accessible. | ||
|
||
PASS: progress.role === 'AXRole: AXProgressIndicator' | ||
PASS: progress.intValue === 4 | ||
PASS: meter.role === 'AXRole: AXLevelIndicator' | ||
PASS: meter.valueDescription.includes('4 of 7') === true | ||
|
||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | ||
<html> | ||
<head> | ||
<script src="../resources/accessibility-helper.js"></script> | ||
<script src="../resources/js-test.js"></script> | ||
<style> | ||
meter, progress { | ||
appearance: none; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
|
||
<meter id="meter" min="0" max="7" value="4"> | ||
4 of 7 | ||
</meter> | ||
|
||
<progress id="progress" min="0" max="7" value="4"> | ||
4 of 7 | ||
</progress> | ||
|
||
<script> | ||
var testOutput = "This test ensures that <meter> and <progress> elements with appearance:none are accessible.\n\n"; | ||
|
||
if (window.accessibilityController) { | ||
var progress = accessibilityController.accessibleElementById("progress"); | ||
testOutput += expect("progress.role", "'AXRole: AXProgressIndicator'"); | ||
testOutput += expect("progress.intValue", "4"); | ||
|
||
var meter = accessibilityController.accessibleElementById("meter"); | ||
testOutput += expect("meter.role", "'AXRole: AXLevelIndicator'"); | ||
testOutput += expect("meter.valueDescription.includes('4 of 7')", "true"); | ||
|
||
debug(testOutput); | ||
} | ||
</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