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

Side by Side Diff: Source/modules/accessibility/AXARIAGridCell.cpp

Issue 869253002: Aria table row and column headers are not exposed in accessibility (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 11 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 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 AXARIAGridCell::~AXARIAGridCell() 44 AXARIAGridCell::~AXARIAGridCell()
45 { 45 {
46 } 46 }
47 47
48 PassRefPtr<AXARIAGridCell> AXARIAGridCell::create(RenderObject* renderer, AXObje ctCacheImpl* axObjectCache) 48 PassRefPtr<AXARIAGridCell> AXARIAGridCell::create(RenderObject* renderer, AXObje ctCacheImpl* axObjectCache)
49 { 49 {
50 return adoptRef(new AXARIAGridCell(renderer, axObjectCache)); 50 return adoptRef(new AXARIAGridCell(renderer, axObjectCache));
51 } 51 }
52 52
53 bool AXARIAGridCell::isAriaColumnHeader() const
54 {
55 const AtomicString& role = getAttribute(HTMLNames::roleAttr);
56 return equalIgnoringCase(role, "columnheader");
57 }
58
59 bool AXARIAGridCell::isAriaRowHeader() const
60 {
61 const AtomicString& role = getAttribute(HTMLNames::roleAttr);
62 return equalIgnoringCase(role, "rowheader");
63 }
64
53 AXObject* AXARIAGridCell::parentTable() const 65 AXObject* AXARIAGridCell::parentTable() const
54 { 66 {
55 AXObject* parent = parentObjectUnignored(); 67 AXObject* parent = parentObjectUnignored();
56 if (!parent) 68 if (!parent)
57 return 0; 69 return 0;
58 70
59 if (parent->isAXTable()) 71 if (parent->isAXTable())
60 return parent; 72 return parent;
61 73
62 // It could happen that we hadn't reached the parent table yet (in 74 // It could happen that we hadn't reached the parent table yet (in
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 if (siblings[k].get() == this) { 126 if (siblings[k].get() == this) {
115 columnRange.first = k; 127 columnRange.first = k;
116 break; 128 break;
117 } 129 }
118 } 130 }
119 131
120 // as far as I can tell, grid cells cannot span columns 132 // as far as I can tell, grid cells cannot span columns
121 columnRange.second = 1; 133 columnRange.second = 1;
122 } 134 }
123 135
136 AccessibilityRole AXARIAGridCell::scanToDecideHeaderRole()
137 {
138 if (isAriaRowHeader())
139 return RowHeaderRole;
140
141 if (isAriaColumnHeader())
142 return ColumnHeaderRole;
143
144 return CellRole;
145 }
146
124 } // namespace blink 147 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698