Commit b5eeb2d5 authored by CJ DiMeglio's avatar CJ DiMeglio Committed by Commit Bot

Gives positioning information for overflow menu.

This CL gives the MenuItem role to each othe overflow menu entries. This
makes it so that positioning information will be readback by ChromeVox.

Bug: 836997
Change-Id: I8e4fad3f9b31d579728c306516e09d887c1390f4
Reviewed-on: https://chromium-review.googlesource.com/c/1392283Reviewed-by: default avatarTommy Steimel <steimel@chromium.org>
Reviewed-by: default avatarAaron Leventhal <aleventhal@chromium.org>
Commit-Queue: CJ DiMeglio <lethalantidote@chromium.org>
Cr-Commit-Position: refs/heads/master@{#634398}
parent 86ddef65
...@@ -60,7 +60,6 @@ AXObject* AccessibilityMediaControl::Create( ...@@ -60,7 +60,6 @@ AXObject* AccessibilityMediaControl::Create(
case kMediaSliderThumb: case kMediaSliderThumb:
case kMediaTimelineContainer: case kMediaTimelineContainer:
case kMediaOverflowList:
return MakeGarbageCollected<AccessibilityMediaControl>(layout_object, return MakeGarbageCollected<AccessibilityMediaControl>(layout_object,
ax_object_cache); ax_object_cache);
// Removed as a part of the a11y tree rewrite https://crbug/836549. // Removed as a part of the a11y tree rewrite https://crbug/836549.
...@@ -103,7 +102,6 @@ String AccessibilityMediaControl::TextAlternative( ...@@ -103,7 +102,6 @@ String AccessibilityMediaControl::TextAlternative(
switch (ControlType()) { switch (ControlType()) {
case kMediaSliderThumb: case kMediaSliderThumb:
case kMediaTimelineContainer: case kMediaTimelineContainer:
case kMediaOverflowList:
return QueryString(WebLocalizedString::kAXMediaDefault); return QueryString(WebLocalizedString::kAXMediaDefault);
case kMediaSlider: case kMediaSlider:
// Removed as a part of the a11y tree rewrite https://crbug/836549. // Removed as a part of the a11y tree rewrite https://crbug/836549.
...@@ -123,7 +121,6 @@ String AccessibilityMediaControl::Description( ...@@ -123,7 +121,6 @@ String AccessibilityMediaControl::Description(
switch (ControlType()) { switch (ControlType()) {
case kMediaSliderThumb: case kMediaSliderThumb:
case kMediaTimelineContainer: case kMediaTimelineContainer:
case kMediaOverflowList:
return QueryString(WebLocalizedString::kAXMediaDefault); return QueryString(WebLocalizedString::kAXMediaDefault);
case kMediaSlider: case kMediaSlider:
// Removed as a part of the a11y tree rewrite https://crbug/836549. // Removed as a part of the a11y tree rewrite https://crbug/836549.
...@@ -149,7 +146,6 @@ bool AccessibilityMediaControl::ComputeAccessibilityIsIgnored( ...@@ -149,7 +146,6 @@ bool AccessibilityMediaControl::ComputeAccessibilityIsIgnored(
ax::mojom::Role AccessibilityMediaControl::RoleValue() const { ax::mojom::Role AccessibilityMediaControl::RoleValue() const {
switch (ControlType()) { switch (ControlType()) {
case kMediaTimelineContainer: case kMediaTimelineContainer:
case kMediaOverflowList:
return ax::mojom::Role::kGroup; return ax::mojom::Role::kGroup;
case kMediaSliderThumb: case kMediaSliderThumb:
......
...@@ -12,7 +12,6 @@ enum MediaControlElementType { ...@@ -12,7 +12,6 @@ enum MediaControlElementType {
kMediaSlider, kMediaSlider,
kMediaSliderThumb, kMediaSliderThumb,
kMediaTimelineContainer, kMediaTimelineContainer,
kMediaOverflowList,
kMediaIgnore kMediaIgnore
}; };
......
...@@ -64,6 +64,7 @@ HTMLElement* MediaControlInputElement::CreateOverflowElement( ...@@ -64,6 +64,7 @@ HTMLElement* MediaControlInputElement::CreateOverflowElement(
HTMLLabelElement* element = HTMLLabelElement::Create(GetDocument()); HTMLLabelElement* element = HTMLLabelElement::Create(GetDocument());
element->SetShadowPseudoId( element->SetShadowPseudoId(
AtomicString("-internal-media-controls-overflow-menu-list-item")); AtomicString("-internal-media-controls-overflow-menu-list-item"));
element->setAttribute(html_names::kRoleAttr, "menuitem");
// Appending a button to a label element ensures that clicks on the label // Appending a button to a label element ensures that clicks on the label
// are passed down to the button, performing the action we'd expect. // are passed down to the button, performing the action we'd expect.
element->ParserAppendChild(button); element->ParserAppendChild(button);
......
...@@ -18,9 +18,10 @@ namespace blink { ...@@ -18,9 +18,10 @@ namespace blink {
MediaControlOverflowMenuListElement::MediaControlOverflowMenuListElement( MediaControlOverflowMenuListElement::MediaControlOverflowMenuListElement(
MediaControlsImpl& media_controls) MediaControlsImpl& media_controls)
: MediaControlPopupMenuElement(media_controls, kMediaOverflowList) { : MediaControlPopupMenuElement(media_controls) {
SetShadowPseudoId( SetShadowPseudoId(
AtomicString("-internal-media-controls-overflow-menu-list")); AtomicString("-internal-media-controls-overflow-menu-list"));
setAttribute(html_names::kRoleAttr, "menu");
CloseOverflowMenu(); CloseOverflowMenu();
} }
......
...@@ -171,9 +171,8 @@ void MediaControlPopupMenuElement::Trace(blink::Visitor* visitor) { ...@@ -171,9 +171,8 @@ void MediaControlPopupMenuElement::Trace(blink::Visitor* visitor) {
} }
MediaControlPopupMenuElement::MediaControlPopupMenuElement( MediaControlPopupMenuElement::MediaControlPopupMenuElement(
MediaControlsImpl& media_controls, MediaControlsImpl& media_controls)
MediaControlElementType type) : MediaControlDivElement(media_controls, kMediaIgnore) {
: MediaControlDivElement(media_controls, type) {
SetIsWanted(false); SetIsWanted(false);
} }
......
...@@ -39,7 +39,7 @@ class MediaControlPopupMenuElement : public MediaControlDivElement { ...@@ -39,7 +39,7 @@ class MediaControlPopupMenuElement : public MediaControlDivElement {
bool SupportsFocus() const override { return true; } bool SupportsFocus() const override { return true; }
protected: protected:
MediaControlPopupMenuElement(MediaControlsImpl&, MediaControlElementType); MediaControlPopupMenuElement(MediaControlsImpl&);
void SetPosition(); void SetPosition();
......
...@@ -51,7 +51,7 @@ bool HasDuplicateLabel(TextTrack* current_track) { ...@@ -51,7 +51,7 @@ bool HasDuplicateLabel(TextTrack* current_track) {
MediaControlTextTrackListElement::MediaControlTextTrackListElement( MediaControlTextTrackListElement::MediaControlTextTrackListElement(
MediaControlsImpl& media_controls) MediaControlsImpl& media_controls)
: MediaControlPopupMenuElement(media_controls, kMediaIgnore) { : MediaControlPopupMenuElement(media_controls) {
setAttribute(html_names::kRoleAttr, "menu"); setAttribute(html_names::kRoleAttr, "menu");
setAttribute(html_names::kAriaLabelAttr, setAttribute(html_names::kAriaLabelAttr,
WTF::AtomicString(GetLocale().QueryString( WTF::AtomicString(GetLocale().QueryString(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment