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

Side by Side Diff: Source/web/WebAXObject.cpp

Issue 797223002: Provides an API to cope with table headers in Accessibility (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years 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 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 1151 matching lines...) Expand 10 before | Expand all | Expand 10 after
1162 return 0; 1162 return 0;
1163 1163
1164 if (!m_private->isTableCell()) 1164 if (!m_private->isTableCell())
1165 return 0; 1165 return 0;
1166 1166
1167 pair<unsigned, unsigned> rowRange; 1167 pair<unsigned, unsigned> rowRange;
1168 toAXTableCell(m_private.get())->rowIndexRange(rowRange); 1168 toAXTableCell(m_private.get())->rowIndexRange(rowRange);
1169 return rowRange.second; 1169 return rowRange.second;
1170 } 1170 }
1171 1171
1172 void WebAXObject::tableHeaders(WebVector<WebAXObject>& headerElements, bool rowH eaders) const
1173 {
1174 if (isDetached())
1175 return;
1176
1177 if (!m_private->isAXTable())
1178 return;
1179
1180 AXObject::AccessibilityChildrenVector headers;
1181 if (rowHeaders)
1182 toAXTable(m_private.get())->rowHeaders(headers);
1183 else
1184 toAXTable(m_private.get())->columnHeaders(headers);
1185
1186 size_t headerCount = headers.size();
1187 WebVector<WebAXObject> result(headerCount);
1188
1189 for (size_t i = 0; i < headerCount; i++)
1190 result[i] = WebAXObject(headers[i]);
1191
1192 headerElements.swap(result);
1193 }
1194
1172 void WebAXObject::loadInlineTextBoxes() const 1195 void WebAXObject::loadInlineTextBoxes() const
1173 { 1196 {
1174 if (isDetached()) 1197 if (isDetached())
1175 return; 1198 return;
1176 1199
1177 m_private->loadInlineTextBoxes(); 1200 m_private->loadInlineTextBoxes();
1178 } 1201 }
1179 1202
1180 WebAXTextDirection WebAXObject::textDirection() const 1203 WebAXTextDirection WebAXObject::textDirection() const
1181 { 1204 {
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
1246 m_private = object; 1269 m_private = object;
1247 return *this; 1270 return *this;
1248 } 1271 }
1249 1272
1250 WebAXObject::operator WTF::PassRefPtr<AXObject>() const 1273 WebAXObject::operator WTF::PassRefPtr<AXObject>() const
1251 { 1274 {
1252 return m_private.get(); 1275 return m_private.get();
1253 } 1276 }
1254 1277
1255 } // namespace blink 1278 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698