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

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: Address feedback 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 if (isDetached())
1115 return 0;
1116
1117 if (!m_private->isAXTable())
1118 return 0;
1119
1120 return toAXTable(m_private.get())->ariaColumnCount();
1121 }
1122
1123 unsigned WebAXObject::ariaColumnIndex() const {
1124 if (isDetached())
1125 return 0;
1126
1127 if (!m_private->isTableCell())
1128 return 0;
1129
1130 return toAXTableCell(m_private.get())->ariaColumnIndex();
1131 }
1132
1133 int WebAXObject::ariaRowCount() const {
1134 if (isDetached())
1135 return 0;
1136
1137 if (!m_private->isAXTable())
1138 return 0;
1139
1140 return toAXTable(m_private.get())->ariaRowCount();
1141 }
1142
1143 unsigned WebAXObject::ariaRowIndex() const {
1144 if (isDetached())
1145 return 0;
1146
1147 if (m_private->isTableCell())
1148 return toAXTableCell(m_private.get())->ariaRowIndex();
1149
1150 if (m_private->isTableRow())
1151 return toAXTableRow(m_private.get())->ariaRowIndex();
1152
1153 return 0;
1154 }
1155
1113 unsigned WebAXObject::columnCount() const { 1156 unsigned WebAXObject::columnCount() const {
1114 if (isDetached()) 1157 if (isDetached())
1115 return false; 1158 return false;
1116 1159
1117 if (!m_private->isAXTable()) 1160 if (!m_private->isAXTable())
1118 return 0; 1161 return 0;
1119 1162
1120 return toAXTable(m_private.get())->columnCount(); 1163 return toAXTable(m_private.get())->columnCount();
1121 } 1164 }
1122 1165
1123 unsigned WebAXObject::rowCount() const { 1166 unsigned WebAXObject::rowCount() const {
1124 if (isDetached()) 1167 if (isDetached())
1125 return false; 1168 return 0;
1126 1169
1127 if (!m_private->isAXTable()) 1170 if (!m_private->isAXTable())
1128 return 0; 1171 return 0;
1129 1172
1130 return toAXTable(m_private.get())->rowCount(); 1173 return toAXTable(m_private.get())->rowCount();
1131 } 1174 }
1132 1175
1133 WebAXObject WebAXObject::cellForColumnAndRow(unsigned column, 1176 WebAXObject WebAXObject::cellForColumnAndRow(unsigned column,
1134 unsigned row) const { 1177 unsigned row) const {
1135 if (isDetached()) 1178 if (isDetached())
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
1470 WebAXObject& WebAXObject::operator=(AXObject* object) { 1513 WebAXObject& WebAXObject::operator=(AXObject* object) {
1471 m_private = object; 1514 m_private = object;
1472 return *this; 1515 return *this;
1473 } 1516 }
1474 1517
1475 WebAXObject::operator AXObject*() const { 1518 WebAXObject::operator AXObject*() const {
1476 return m_private.get(); 1519 return m_private.get();
1477 } 1520 }
1478 1521
1479 } // namespace blink 1522 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698