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

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: Fixing nits 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
« no previous file with comments | « Source/modules/accessibility/AXNodeObject.h ('k') | Source/modules/accessibility/AXObject.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() + 1;
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 if (parentObject()) {
1286 const auto& siblings = parentObject()->children();
1287 return siblings.size();
1288 }
1289 }
1290
1291 return 0;
1292 }
1293
1268 String AXNodeObject::ariaInvalidValue() const 1294 String AXNodeObject::ariaInvalidValue() const
1269 { 1295 {
1270 if (invalidState() == InvalidStateOther) 1296 if (invalidState() == InvalidStateOther)
1271 return getAttribute(aria_invalidAttr); 1297 return getAttribute(aria_invalidAttr);
1272 1298
1273 return String(); 1299 return String();
1274 } 1300 }
1275 1301
1276 String AXNodeObject::valueDescription() const 1302 String AXNodeObject::valueDescription() const
1277 { 1303 {
(...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after
2162 ariaLabeledByElements(elements); 2188 ariaLabeledByElements(elements);
2163 2189
2164 for (const auto& element : elements) { 2190 for (const auto& element : elements) {
2165 RefPtr<AXObject> axElement = axObjectCache()->getOrCreate(element); 2191 RefPtr<AXObject> axElement = axObjectCache()->getOrCreate(element);
2166 textOrder.append(AccessibilityText(ariaLabeledBy, AlternativeText, a xElement)); 2192 textOrder.append(AccessibilityText(ariaLabeledBy, AlternativeText, a xElement));
2167 } 2193 }
2168 } 2194 }
2169 } 2195 }
2170 2196
2171 } // namespace blink 2197 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/accessibility/AXNodeObject.h ('k') | Source/modules/accessibility/AXObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698