Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(198)

Side by Side Diff: content/browser/accessibility/browser_accessibility_com_win.cc

Issue 2867073003: Name calculation should not include nameFrom:author descendants. (Closed)
Patch Set: Single quote Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2017 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/accessibility/browser_accessibility_com_win.h" 5 #include "content/browser/accessibility/browser_accessibility_com_win.h"
6 6
7 #include <UIAutomationClient.h> 7 #include <UIAutomationClient.h>
8 #include <UIAutomationCoreApi.h> 8 #include <UIAutomationCoreApi.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 5267 matching lines...) Expand 10 before | Expand all | Expand 10 after
5278 break; 5278 break;
5279 case ui::AX_ROLE_CONTENT_INFO: 5279 case ui::AX_ROLE_CONTENT_INFO:
5280 ia_role = ROLE_SYSTEM_TEXT; 5280 ia_role = ROLE_SYSTEM_TEXT;
5281 ia2_role = IA2_ROLE_PARAGRAPH; 5281 ia2_role = IA2_ROLE_PARAGRAPH;
5282 break; 5282 break;
5283 case ui::AX_ROLE_DATE: 5283 case ui::AX_ROLE_DATE:
5284 case ui::AX_ROLE_DATE_TIME: 5284 case ui::AX_ROLE_DATE_TIME:
5285 ia_role = ROLE_SYSTEM_DROPLIST; 5285 ia_role = ROLE_SYSTEM_DROPLIST;
5286 ia2_role = IA2_ROLE_DATE_EDITOR; 5286 ia2_role = IA2_ROLE_DATE_EDITOR;
5287 break; 5287 break;
5288 case ui::AX_ROLE_DIV:
5289 role_name = L"div";
5290 ia_role = ROLE_SYSTEM_GROUPING;
5291 ia2_role = IA2_ROLE_SECTION;
5292 break;
5293 case ui::AX_ROLE_DEFINITION: 5288 case ui::AX_ROLE_DEFINITION:
5294 role_name = html_tag; 5289 role_name = html_tag;
5295 ia2_role = IA2_ROLE_PARAGRAPH; 5290 ia2_role = IA2_ROLE_PARAGRAPH;
5296 ia_state |= STATE_SYSTEM_READONLY; 5291 ia_state |= STATE_SYSTEM_READONLY;
5297 break; 5292 break;
5298 case ui::AX_ROLE_DESCRIPTION_LIST_DETAIL: 5293 case ui::AX_ROLE_DESCRIPTION_LIST_DETAIL:
5299 role_name = html_tag; 5294 role_name = html_tag;
5300 ia_role = ROLE_SYSTEM_TEXT; 5295 ia_role = ROLE_SYSTEM_TEXT;
5301 ia2_role = IA2_ROLE_PARAGRAPH; 5296 ia2_role = IA2_ROLE_PARAGRAPH;
5302 break; 5297 break;
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
5348 ia_role = ROLE_SYSTEM_GROUPING; 5343 ia_role = ROLE_SYSTEM_GROUPING;
5349 break; 5344 break;
5350 case ui::AX_ROLE_FORM: 5345 case ui::AX_ROLE_FORM:
5351 role_name = L"form"; 5346 role_name = L"form";
5352 ia2_role = IA2_ROLE_FORM; 5347 ia2_role = IA2_ROLE_FORM;
5353 break; 5348 break;
5354 case ui::AX_ROLE_FOOTER: 5349 case ui::AX_ROLE_FOOTER:
5355 ia_role = ROLE_SYSTEM_GROUPING; 5350 ia_role = ROLE_SYSTEM_GROUPING;
5356 ia2_role = IA2_ROLE_FOOTER; 5351 ia2_role = IA2_ROLE_FOOTER;
5357 break; 5352 break;
5353 case ui::AX_ROLE_GENERIC_CONTAINER:
5354 ia_role = ROLE_SYSTEM_GROUPING;
5355 ia2_role = IA2_ROLE_SECTION;
5356 role_name = html_tag.empty() ? L"div" : html_tag;
5357 break;
5358 case ui::AX_ROLE_GRID: 5358 case ui::AX_ROLE_GRID:
5359 ia_role = ROLE_SYSTEM_TABLE; 5359 ia_role = ROLE_SYSTEM_TABLE;
5360 // TODO(aleventhal) this changed between ARIA 1.0 and 1.1, 5360 // TODO(aleventhal) this changed between ARIA 1.0 and 1.1,
5361 // need to determine whether grids/treegrids should really be readonly 5361 // need to determine whether grids/treegrids should really be readonly
5362 // or editable by default 5362 // or editable by default
5363 // ia_state |= STATE_SYSTEM_READONLY; 5363 // ia_state |= STATE_SYSTEM_READONLY;
5364 break; 5364 break;
5365 case ui::AX_ROLE_GROUP: { 5365 case ui::AX_ROLE_GROUP:
5366 base::string16 aria_role = 5366 ia_role = ROLE_SYSTEM_GROUPING;
5367 owner()->GetString16Attribute(ui::AX_ATTR_ROLE);
5368 if (aria_role == L"group" || html_tag == L"fieldset") {
5369 ia_role = ROLE_SYSTEM_GROUPING;
5370 } else if (html_tag == L"li") {
5371 ia_role = ROLE_SYSTEM_LISTITEM;
5372 ia_state |= STATE_SYSTEM_READONLY;
5373 } else {
5374 if (html_tag.empty())
5375 role_name = L"div";
5376 else
5377 role_name = html_tag;
5378 ia2_role = IA2_ROLE_SECTION;
5379 }
5380 break; 5367 break;
5381 }
5382 case ui::AX_ROLE_HEADING: 5368 case ui::AX_ROLE_HEADING:
5383 role_name = html_tag; 5369 role_name = html_tag;
5384 if (html_tag.empty()) 5370 if (html_tag.empty())
5385 ia_role = ROLE_SYSTEM_GROUPING; 5371 ia_role = ROLE_SYSTEM_GROUPING;
5386 ia2_role = IA2_ROLE_HEADING; 5372 ia2_role = IA2_ROLE_HEADING;
5387 break; 5373 break;
5388 case ui::AX_ROLE_IFRAME: 5374 case ui::AX_ROLE_IFRAME:
5389 ia_role = ROLE_SYSTEM_DOCUMENT; 5375 ia_role = ROLE_SYSTEM_DOCUMENT;
5390 ia2_role = IA2_ROLE_INTERNAL_FRAME; 5376 ia2_role = IA2_ROLE_INTERNAL_FRAME;
5391 ia_state = STATE_SYSTEM_READONLY; 5377 ia_state = STATE_SYSTEM_READONLY;
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
5722 5708
5723 BrowserAccessibilityComWin* ToBrowserAccessibilityComWin( 5709 BrowserAccessibilityComWin* ToBrowserAccessibilityComWin(
5724 BrowserAccessibility* obj) { 5710 BrowserAccessibility* obj) {
5725 if (!obj || !obj->IsNative()) 5711 if (!obj || !obj->IsNative())
5726 return nullptr; 5712 return nullptr;
5727 auto* result = static_cast<BrowserAccessibilityWin*>(obj)->GetCOM(); 5713 auto* result = static_cast<BrowserAccessibilityWin*>(obj)->GetCOM();
5728 return result; 5714 return result;
5729 } 5715 }
5730 5716
5731 } // namespace content 5717 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698