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

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

Issue 2907133002: Move WebAXObject.cpp to core/ (WIP) (Closed)
Patch Set: 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 99
100 AXObjectImpl* AXTableRow::ParentTable() const { 100 AXObjectImpl* AXTableRow::ParentTable() const {
101 AXObjectImpl* parent = ParentObjectUnignored(); 101 AXObjectImpl* parent = ParentObjectUnignored();
102 if (!parent || !parent->IsAXTable()) 102 if (!parent || !parent->IsAXTable())
103 return 0; 103 return 0;
104 104
105 return parent; 105 return parent;
106 } 106 }
107 107
108 AXObjectImpl* AXTableRow::HeaderObject() { 108 AXObjectImpl* AXTableRow::HeaderObject() {
109 AXObjectVector headers; 109 AXObjectImplVector headers;
110 HeaderObjectsForRow(headers); 110 HeaderObjectsForRow(headers);
111 if (!headers.size()) 111 if (!headers.size())
112 return 0; 112 return 0;
113 113
114 return headers[0].Get(); 114 return headers[0].Get();
115 } 115 }
116 116
117 unsigned AXTableRow::AriaColumnIndex() const { 117 unsigned AXTableRow::AriaColumnIndex() const {
118 uint32_t col_index; 118 uint32_t col_index;
119 if (HasAOMPropertyOrARIAAttribute(AOMUIntProperty::kColIndex, col_index) && 119 if (HasAOMPropertyOrARIAAttribute(AOMUIntProperty::kColIndex, col_index) &&
120 col_index >= 1) { 120 col_index >= 1) {
121 return col_index; 121 return col_index;
122 } 122 }
123 123
124 return 0; 124 return 0;
125 } 125 }
126 126
127 unsigned AXTableRow::AriaRowIndex() const { 127 unsigned AXTableRow::AriaRowIndex() const {
128 uint32_t row_index; 128 uint32_t row_index;
129 if (HasAOMPropertyOrARIAAttribute(AOMUIntProperty::kRowIndex, row_index) && 129 if (HasAOMPropertyOrARIAAttribute(AOMUIntProperty::kRowIndex, row_index) &&
130 row_index >= 1) { 130 row_index >= 1) {
131 return row_index; 131 return row_index;
132 } 132 }
133 133
134 return 0; 134 return 0;
135 } 135 }
136 136
137 void AXTableRow::HeaderObjectsForRow(AXObjectVector& headers) { 137 void AXTableRow::HeaderObjectsForRow(AXObjectImplVector& headers) {
138 if (!layout_object_ || !layout_object_->IsTableRow()) 138 if (!layout_object_ || !layout_object_->IsTableRow())
139 return; 139 return;
140 140
141 for (const auto& cell : Children()) { 141 for (const auto& cell : Children()) {
142 if (!cell->IsTableCell()) 142 if (!cell->IsTableCell())
143 continue; 143 continue;
144 144
145 if (ToAXTableCell(cell.Get())->ScanToDecideHeaderRole() == kRowHeaderRole) 145 if (ToAXTableCell(cell.Get())->ScanToDecideHeaderRole() == kRowHeaderRole)
146 headers.push_back(cell); 146 headers.push_back(cell);
147 } 147 }
148 } 148 }
149 149
150 } // namespace blink 150 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698