Commit 06340adb authored by Daniel Clark's avatar Daniel Clark Committed by Commit Bot

Change LocalizedControlType of <mark> to 'highlight'

Per https://w3c.github.io/html-aam/#el-mark, update the
LocalizedControlType of <mark> from "text" to "highlight".

Bug: 996459
Change-Id: I5f435988e16663df295cd195f3de6d97aab0dd70
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1762581
Commit-Queue: Dan Clark <daniec@microsoft.com>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Reviewed-by: default avatarAaron Leventhal <aleventhal@chromium.org>
Reviewed-by: default avatarKen Rockot <rockot@google.com>
Reviewed-by: default avatarKevin Babbitt <kbabbitt@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#699887}
parent f5f80329
...@@ -1897,6 +1897,9 @@ base::string16 BrowserAccessibility::GetLocalizedStringForRoleDescription() ...@@ -1897,6 +1897,9 @@ base::string16 BrowserAccessibility::GetLocalizedStringForRoleDescription()
case ax::mojom::Role::kHeaderAsNonLandmark: case ax::mojom::Role::kHeaderAsNonLandmark:
return content_client->GetLocalizedString(IDS_AX_ROLE_HEADER); return content_client->GetLocalizedString(IDS_AX_ROLE_HEADER);
case ax::mojom::Role::kMark:
return content_client->GetLocalizedString(IDS_AX_ROLE_MARK);
case ax::mojom::Role::kMeter: case ax::mojom::Role::kMeter:
return content_client->GetLocalizedString(IDS_AX_ROLE_METER); return content_client->GetLocalizedString(IDS_AX_ROLE_METER);
......
...@@ -720,6 +720,7 @@ IN_PROC_BROWSER_TEST_F(CrossPlatformAccessibilityBrowserTest, ...@@ -720,6 +720,7 @@ IN_PROC_BROWSER_TEST_F(CrossPlatformAccessibilityBrowserTest,
"<input type='tel'>" "<input type='tel'>"
"<input type='url'>" "<input type='url'>"
"<input type='week'>" "<input type='week'>"
"<mark></mark>"
"<meter></meter>" "<meter></meter>"
"<output></output>" "<output></output>"
"<time></time>" "<time></time>"
...@@ -730,7 +731,7 @@ IN_PROC_BROWSER_TEST_F(CrossPlatformAccessibilityBrowserTest, ...@@ -730,7 +731,7 @@ IN_PROC_BROWSER_TEST_F(CrossPlatformAccessibilityBrowserTest,
BrowserAccessibility* root = GetManager()->GetRoot(); BrowserAccessibility* root = GetManager()->GetRoot();
ASSERT_NE(nullptr, root); ASSERT_NE(nullptr, root);
ASSERT_EQ(18u, root->PlatformChildCount()); ASSERT_EQ(19u, root->PlatformChildCount());
auto TestLocalizedRoleDescription = auto TestLocalizedRoleDescription =
[root](int child_index, [root](int child_index,
...@@ -758,10 +759,11 @@ IN_PROC_BROWSER_TEST_F(CrossPlatformAccessibilityBrowserTest, ...@@ -758,10 +759,11 @@ IN_PROC_BROWSER_TEST_F(CrossPlatformAccessibilityBrowserTest,
TestLocalizedRoleDescription(11, base::ASCIIToUTF16("telephone")); TestLocalizedRoleDescription(11, base::ASCIIToUTF16("telephone"));
TestLocalizedRoleDescription(12, base::ASCIIToUTF16("url")); TestLocalizedRoleDescription(12, base::ASCIIToUTF16("url"));
TestLocalizedRoleDescription(13, base::ASCIIToUTF16("week picker")); TestLocalizedRoleDescription(13, base::ASCIIToUTF16("week picker"));
TestLocalizedRoleDescription(14, base::ASCIIToUTF16("meter")); TestLocalizedRoleDescription(14, base::ASCIIToUTF16("highlight"));
TestLocalizedRoleDescription(15, base::ASCIIToUTF16("output")); TestLocalizedRoleDescription(15, base::ASCIIToUTF16("meter"));
TestLocalizedRoleDescription(16, base::ASCIIToUTF16("time")); TestLocalizedRoleDescription(16, base::ASCIIToUTF16("output"));
TestLocalizedRoleDescription(17, base::ASCIIToUTF16("content information")); TestLocalizedRoleDescription(17, base::ASCIIToUTF16("time"));
TestLocalizedRoleDescription(18, base::ASCIIToUTF16("content information"));
} }
IN_PROC_BROWSER_TEST_F(CrossPlatformAccessibilityBrowserTest, IN_PROC_BROWSER_TEST_F(CrossPlatformAccessibilityBrowserTest,
...@@ -803,17 +805,16 @@ IN_PROC_BROWSER_TEST_F(CrossPlatformAccessibilityBrowserTest, ...@@ -803,17 +805,16 @@ IN_PROC_BROWSER_TEST_F(CrossPlatformAccessibilityBrowserTest,
ax::mojom::Role::kStaticText); ax::mojom::Role::kStaticText);
BrowserAccessibility* mark_node = para_node->PlatformGetChild(1); BrowserAccessibility* mark_node = para_node->PlatformGetChild(1);
TestGetStyleNameAttributeAsLocalizedString( TestGetStyleNameAttributeAsLocalizedString(mark_node, ax::mojom::Role::kMark,
mark_node, ax::mojom::Role::kMark, base::ASCIIToUTF16("highlight"));
base::ASCIIToUTF16("highlighted content"));
// Android doesn't always have a child in this case. // Android doesn't always have a child in this case.
if (mark_node->PlatformChildCount() > 0u) { if (mark_node->PlatformChildCount() > 0u) {
BrowserAccessibility* mark_text_node = mark_node->PlatformGetChild(0); BrowserAccessibility* mark_text_node = mark_node->PlatformGetChild(0);
ASSERT_EQ(0u, mark_text_node->PlatformChildCount()); ASSERT_EQ(0u, mark_text_node->PlatformChildCount());
TestGetStyleNameAttributeAsLocalizedString( TestGetStyleNameAttributeAsLocalizedString(mark_text_node,
mark_text_node, ax::mojom::Role::kStaticText, ax::mojom::Role::kStaticText,
base::ASCIIToUTF16("highlighted content")); base::ASCIIToUTF16("highlight"));
} }
} }
......
AXWebArea AXRoleDescription='HTML content' AXWebArea AXRoleDescription='HTML content'
++AXGroup AXRoleDescription='group' ++AXGroup AXRoleDescription='group'
++++AXStaticText AXRoleDescription='text' AXValue='This test is to check ' ++++AXStaticText AXRoleDescription='text' AXValue='This test is to check '
++++AXGroup AXRoleDescription='highlighted content' ++++AXGroup AXRoleDescription='highlight'
++++++AXStaticText AXRoleDescription='text' AXValue='mark tag' ++++++AXStaticText AXRoleDescription='text' AXValue='mark tag'
++++AXStaticText AXRoleDescription='text' AXValue='.' ++++AXStaticText AXRoleDescription='text' AXValue='.'
document document
++group ++group
++++description Name='This test is to check ' ++++description Name='This test is to check '
++++description ++++description LocalizedControlType='highlight'
++++++description Name='mark tag' ++++++description Name='mark tag'
++++description Name='.' ++++description Name='.'
ROLE_SYSTEM_DOCUMENT READONLY FOCUSABLE ROLE_SYSTEM_DOCUMENT READONLY FOCUSABLE
++IA2_ROLE_PARAGRAPH ++IA2_ROLE_PARAGRAPH
++++ROLE_SYSTEM_STATICTEXT name='This test is to check ' ++++ROLE_SYSTEM_STATICTEXT name='This test is to check '
++++IA2_ROLE_TEXT_FRAME ++++IA2_ROLE_TEXT_FRAME localized_extended_role='highlight'
++++++ROLE_SYSTEM_STATICTEXT name='mark tag' ++++++ROLE_SYSTEM_STATICTEXT name='mark tag'
++++ROLE_SYSTEM_STATICTEXT name='.' ++++ROLE_SYSTEM_STATICTEXT name='.'
<!-- <!--
@MAC-ALLOW:AXRole* @MAC-ALLOW:AXRole*
@UIA-WIN-ALLOW:LocalizedControlType='highlight'
@WIN-ALLOW:localized_extended_role='highlight'
--> -->
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
......
...@@ -477,8 +477,9 @@ below: ...@@ -477,8 +477,9 @@ below:
<message name="IDS_AX_ROLE_MAIN_CONTENT" desc="Accessibility role description for main content of the document."> <message name="IDS_AX_ROLE_MAIN_CONTENT" desc="Accessibility role description for main content of the document.">
main main
</message> </message>
<!-- https://w3c.github.io/html-aam/#el-mark -->
<message name="IDS_AX_ROLE_MARK" desc="Accessibility role description for highlighted content."> <message name="IDS_AX_ROLE_MARK" desc="Accessibility role description for highlighted content.">
highlighted content highlight
</message> </message>
<message name="IDS_AX_ROLE_MATH" desc="Accessibility role description for math"> <message name="IDS_AX_ROLE_MATH" desc="Accessibility role description for math">
math math
......
...@@ -638,6 +638,9 @@ base::string16 TestAXNodeWrapper::GetLocalizedStringForRoleDescription() const { ...@@ -638,6 +638,9 @@ base::string16 TestAXNodeWrapper::GetLocalizedStringForRoleDescription() const {
case ax::mojom::Role::kHeaderAsNonLandmark: case ax::mojom::Role::kHeaderAsNonLandmark:
return base::ASCIIToUTF16("header"); return base::ASCIIToUTF16("header");
case ax::mojom::Role::kMark:
return base::ASCIIToUTF16("highlight");
case ax::mojom::Role::kMeter: case ax::mojom::Role::kMeter:
return base::ASCIIToUTF16("meter"); return base::ASCIIToUTF16("meter");
......
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