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

Side by Side Diff: third_party/WebKit/Source/modules/accessibility/AXTableCell.cpp

Issue 2894103002: Int and Float properties for Accessibility Object Model phase 1 (Closed)
Patch Set: Update webexposed/ Created 3 years, 6 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) 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2008 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 97
98 bool AXTableCell::IsTableCell() const { 98 bool AXTableCell::IsTableCell() const {
99 AXObjectImpl* parent = ParentObjectUnignored(); 99 AXObjectImpl* parent = ParentObjectUnignored();
100 if (!parent || !parent->IsTableRow()) 100 if (!parent || !parent->IsTableRow())
101 return false; 101 return false;
102 102
103 return true; 103 return true;
104 } 104 }
105 105
106 unsigned AXTableCell::AriaColumnIndex() const { 106 unsigned AXTableCell::AriaColumnIndex() const {
107 const AtomicString& col_index = GetAttribute(aria_colindexAttr); 107 uint32_t col_index;
108 if (col_index.ToInt() >= 1) 108 if (HasAOMPropertyOrARIAAttribute(AOMUIntProperty::kColIndex, col_index) &&
109 return col_index.ToInt(); 109 col_index >= 1) {
110 return col_index;
111 }
110 112
111 AXObjectImpl* parent = ParentObjectUnignored(); 113 AXObjectImpl* parent = ParentObjectUnignored();
112 if (!parent || !parent->IsTableRow()) 114 if (!parent || !parent->IsTableRow())
113 return 0; 115 return 0;
114 116
115 return aria_col_index_from_row_; 117 return aria_col_index_from_row_;
116 } 118 }
117 119
118 unsigned AXTableCell::AriaRowIndex() const { 120 unsigned AXTableCell::AriaRowIndex() const {
119 const AtomicString& row_index = GetAttribute(aria_rowindexAttr); 121 uint32_t row_index;
120 if (row_index.ToInt() >= 1) 122 if (HasAOMPropertyOrARIAAttribute(AOMUIntProperty::kRowIndex, row_index) &&
121 return row_index.ToInt(); 123 row_index >= 1) {
124 return row_index;
125 }
122 126
123 AXObjectImpl* parent = ParentObjectUnignored(); 127 AXObjectImpl* parent = ParentObjectUnignored();
124 if (!parent || !parent->IsTableRow()) 128 if (!parent || !parent->IsTableRow())
125 return 0; 129 return 0;
126 130
127 return ToAXTableRow(parent)->AriaRowIndex(); 131 return ToAXTableRow(parent)->AriaRowIndex();
128 } 132 }
129 133
130 static AccessibilityRole DecideRoleFromSibling(LayoutTableCell* sibling_cell) { 134 static AccessibilityRole DecideRoleFromSibling(LayoutTableCell* sibling_cell) {
131 if (!sibling_cell) 135 if (!sibling_cell)
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 if (EqualIgnoringASCIICase(aria_sort, "ascending")) 236 if (EqualIgnoringASCIICase(aria_sort, "ascending"))
233 return kSortDirectionAscending; 237 return kSortDirectionAscending;
234 if (EqualIgnoringASCIICase(aria_sort, "descending")) 238 if (EqualIgnoringASCIICase(aria_sort, "descending"))
235 return kSortDirectionDescending; 239 return kSortDirectionDescending;
236 if (EqualIgnoringASCIICase(aria_sort, "other")) 240 if (EqualIgnoringASCIICase(aria_sort, "other"))
237 return kSortDirectionOther; 241 return kSortDirectionOther;
238 return kSortDirectionUndefined; 242 return kSortDirectionUndefined;
239 } 243 }
240 244
241 } // namespace blink 245 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698