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

Side by Side Diff: Source/modules/accessibility/AXNodeObject.cpp

Issue 1071483002: Implement aria properties setsize and posinset. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Comments incorporated Created 5 years, 8 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) 2012, Google Inc. All rights reserved. 2 * Copyright (C) 2012, 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 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 1247 matching lines...) Expand 10 before | Expand all | Expand 10 after
1258 WillBeHeapVector<RefPtrWillBeMember<HTMLFormControlElement>> 1258 WillBeHeapVector<RefPtrWillBeMember<HTMLFormControlElement>>
1259 invalidControls; 1259 invalidControls;
1260 bool isInvalid = !element->checkValidity( 1260 bool isInvalid = !element->checkValidity(
1261 &invalidControls, CheckValidityDispatchNoEvent); 1261 &invalidControls, CheckValidityDispatchNoEvent);
1262 return isInvalid ? InvalidStateTrue : InvalidStateFalse; 1262 return isInvalid ? InvalidStateTrue : InvalidStateFalse;
1263 } 1263 }
1264 1264
1265 return InvalidStateUndefined; 1265 return InvalidStateUndefined;
1266 } 1266 }
1267 1267
1268 int AXNodeObject::posInSet() const
1269 {
1270 if (supportsSetSizeAndPosInSet()) {
1271 if (hasAttribute(aria_posinsetAttr))
1272 return getAttribute(aria_posinsetAttr).toInt();
1273 return AXObject::indexInParent();
1274 }
1275
1276 return 0;
1277 }
1278
1279 int AXNodeObject::setSize() const
1280 {
1281 if (supportsSetSizeAndPosInSet()) {
1282 if (hasAttribute(aria_setsizeAttr))
1283 return getAttribute(aria_setsizeAttr).toInt();
1284
1285 const auto& siblings = parentObject()->children();
1286 return siblings.size();
1287 }
1288
1289 return 0;
1290 }
1291
1268 String AXNodeObject::ariaInvalidValue() const 1292 String AXNodeObject::ariaInvalidValue() const
1269 { 1293 {
1270 if (invalidState() == InvalidStateOther) 1294 if (invalidState() == InvalidStateOther)
1271 return getAttribute(aria_invalidAttr); 1295 return getAttribute(aria_invalidAttr);
1272 1296
1273 return String(); 1297 return String();
1274 } 1298 }
1275 1299
1276 String AXNodeObject::valueDescription() const 1300 String AXNodeObject::valueDescription() const
1277 { 1301 {
(...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after
2162 ariaLabeledByElements(elements); 2186 ariaLabeledByElements(elements);
2163 2187
2164 for (const auto& element : elements) { 2188 for (const auto& element : elements) {
2165 RefPtr<AXObject> axElement = axObjectCache()->getOrCreate(element); 2189 RefPtr<AXObject> axElement = axObjectCache()->getOrCreate(element);
2166 textOrder.append(AccessibilityText(ariaLabeledBy, AlternativeText, a xElement)); 2190 textOrder.append(AccessibilityText(ariaLabeledBy, AlternativeText, a xElement));
2167 } 2191 }
2168 } 2192 }
2169 } 2193 }
2170 2194
2171 } // namespace blink 2195 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698