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

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

Issue 2539503003: ARIA 1.1: implementation for aria-col-* and aria-row-*. (Closed)
Patch Set: Created 4 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 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after
1103 1103
1104 size_t vectorSize = lineBreaksVector.size(); 1104 size_t vectorSize = lineBreaksVector.size();
1105 WebVector<int> lineBreaksWebVector(vectorSize); 1105 WebVector<int> lineBreaksWebVector(vectorSize);
1106 for (size_t i = 0; i < vectorSize; i++) 1106 for (size_t i = 0; i < vectorSize; i++)
1107 lineBreaksWebVector[i] = lineBreaksVector[i]; 1107 lineBreaksWebVector[i] = lineBreaksVector[i];
1108 result.swap(lineBreaksWebVector); 1108 result.swap(lineBreaksWebVector);
1109 1109
1110 return true; 1110 return true;
1111 } 1111 }
1112 1112
1113 int WebAXObject::ariaColumnCount() const
1114 {
1115 if (isDetached())
1116 return 0;
1117
1118 if (!m_private->isAXTable())
1119 return 0;
1120
1121 return toAXTable(m_private.get())->ariaColumnCount();
1122 }
1123
1124 unsigned WebAXObject::ariaColumnIndex() const
1125 {
1126 if (isDetached())
1127 return 0;
1128
1129 if (!m_private->isTableCell())
1130 return 0;
1131
1132 return toAXTableCell(m_private.get())->ariaColumnIndex();
1133 }
1134
1135 int WebAXObject::ariaRowCount() const
1136 {
1137 if (isDetached())
1138 return 0;
1139
1140 if (!m_private->isAXTable())
1141 return 0;
1142
1143 return toAXTable(m_private.get())->ariaRowCount();
1144 }
1145
1146 unsigned WebAXObject::ariaRowIndex() const
1147 {
1148 if (isDetached())
1149 return 0;
1150
1151 if (m_private->isTableCell())
1152 return toAXTableCell(m_private.get())->ariaRowIndex();
1153
1154 if (m_private->isTableRow())
1155 return toAXTableRow(m_private.get())->ariaRowIndex();
1156
1157 return 0;
1158 }
1159
1113 unsigned WebAXObject::columnCount() const { 1160 unsigned WebAXObject::columnCount() const {
1114 if (isDetached()) 1161 if (isDetached())
1115 return false; 1162 return false;
1116 1163
1117 if (!m_private->isAXTable()) 1164 if (!m_private->isAXTable())
1118 return 0; 1165 return 0;
1119 1166
1120 return toAXTable(m_private.get())->columnCount(); 1167 return toAXTable(m_private.get())->columnCount();
1121 } 1168 }
1122 1169
1123 unsigned WebAXObject::rowCount() const { 1170 unsigned WebAXObject::rowCount() const
1171 {
1124 if (isDetached()) 1172 if (isDetached())
1125 return false; 1173 return 0;
1126 1174
1127 if (!m_private->isAXTable()) 1175 if (!m_private->isAXTable())
1128 return 0; 1176 return 0;
1129 1177
1130 return toAXTable(m_private.get())->rowCount(); 1178 return toAXTable(m_private.get())->rowCount();
1131 } 1179 }
1132 1180
1133 WebAXObject WebAXObject::cellForColumnAndRow(unsigned column, 1181 WebAXObject WebAXObject::cellForColumnAndRow(unsigned column,
1134 unsigned row) const { 1182 unsigned row) const {
1135 if (isDetached()) 1183 if (isDetached())
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
1470 WebAXObject& WebAXObject::operator=(AXObject* object) { 1518 WebAXObject& WebAXObject::operator=(AXObject* object) {
1471 m_private = object; 1519 m_private = object;
1472 return *this; 1520 return *this;
1473 } 1521 }
1474 1522
1475 WebAXObject::operator AXObject*() const { 1523 WebAXObject::operator AXObject*() const {
1476 return m_private.get(); 1524 return m_private.get();
1477 } 1525 }
1478 1526
1479 } // namespace blink 1527 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698