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

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: Addressing Comments 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 1154 matching lines...) Expand 10 before | Expand all | Expand 10 after
1165 WillBeHeapVector<RefPtrWillBeMember<HTMLFormControlElement>> 1165 WillBeHeapVector<RefPtrWillBeMember<HTMLFormControlElement>>
1166 invalidControls; 1166 invalidControls;
1167 bool isInvalid = !element->checkValidity( 1167 bool isInvalid = !element->checkValidity(
1168 &invalidControls, CheckValidityDispatchNoEvent); 1168 &invalidControls, CheckValidityDispatchNoEvent);
1169 return isInvalid ? InvalidStateTrue : InvalidStateFalse; 1169 return isInvalid ? InvalidStateTrue : InvalidStateFalse;
1170 } 1170 }
1171 1171
1172 return InvalidStateUndefined; 1172 return InvalidStateUndefined;
1173 } 1173 }
1174 1174
1175 int AXNodeObject::posInSet() const
1176 {
1177 if (supportssetSizePosInSet()) {
dmazzoni 2015/04/09 15:15:37 nit: how about supportsSetSizeAndPosInSet
1178 if (hasAttribute(aria_posinsetAttr))
1179 return getAttribute(aria_posinsetAttr).toInt();
1180 return node()->nodeIndex();
shreeramk 2015/04/09 13:50:15 And this to get index? Is this correct API to get
dmazzoni 2015/04/09 15:15:37 Yes
1181 }
1182
1183 return 0;
1184 }
1185
1186 int AXNodeObject::setSize() const
1187 {
1188 if (supportssetSizePosInSet()) {
1189 if (hasAttribute(aria_setsizeAttr))
1190 return getAttribute(aria_setsizeAttr).toInt();
1191 return node()->parentNode()->countChildren();
shreeramk 2015/04/09 13:50:15 Is this correct API to get the child count of pare
dmazzoni 2015/04/09 15:15:37 Yes, but please check that parentNode() is not nul
1192 }
1193
1194 return 0;
1195 }
1196
1175 String AXNodeObject::ariaInvalidValue() const 1197 String AXNodeObject::ariaInvalidValue() const
1176 { 1198 {
1177 if (invalidState() == InvalidStateOther) 1199 if (invalidState() == InvalidStateOther)
1178 return getAttribute(aria_invalidAttr); 1200 return getAttribute(aria_invalidAttr);
1179 1201
1180 return String(); 1202 return String();
1181 } 1203 }
1182 1204
1183 String AXNodeObject::valueDescription() const 1205 String AXNodeObject::valueDescription() const
1184 { 1206 {
(...skipping 897 matching lines...) Expand 10 before | Expand all | Expand 10 after
2082 float range = maxValueForRange() - minValueForRange(); 2104 float range = maxValueForRange() - minValueForRange();
2083 float value = valueForRange(); 2105 float value = valueForRange();
2084 2106
2085 value += range * (percentChange / 100); 2107 value += range * (percentChange / 100);
2086 setValue(String::number(value)); 2108 setValue(String::number(value));
2087 2109
2088 axObjectCache()->postNotification(node(), AXObjectCacheImpl::AXValueChanged) ; 2110 axObjectCache()->postNotification(node(), AXObjectCacheImpl::AXValueChanged) ;
2089 } 2111 }
2090 2112
2091 } // namespace blink 2113 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698