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

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: incorporate 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
« 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 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 (supportsSetSizeAndPosInSet()) {
1178 if (hasAttribute(aria_posinsetAttr))
1179 return getAttribute(aria_posinsetAttr).toInt();
1180 return node()->nodeIndex();
dmazzoni 2015/04/10 17:35:21 Do a null check here. (The reason this can be nul
1181 }
1182
1183 return 0;
1184 }
1185
1186 int AXNodeObject::setSize() const
1187 {
1188 if (supportsSetSizeAndPosInSet()) {
1189 if (hasAttribute(aria_setsizeAttr))
1190 return getAttribute(aria_setsizeAttr).toInt();
1191 if (node()->parentNode())
1192 return node()->parentNode()->countChildren();
dmazzoni 2015/04/10 17:35:21 I just realized that this isn't going to do the ri
shreeramk 2015/04/13 03:49:59 Yes it doesn't exist currently. From blink we can
1193 }
1194
1195 return 0;
1196 }
1197
1175 String AXNodeObject::ariaInvalidValue() const 1198 String AXNodeObject::ariaInvalidValue() const
1176 { 1199 {
1177 if (invalidState() == InvalidStateOther) 1200 if (invalidState() == InvalidStateOther)
1178 return getAttribute(aria_invalidAttr); 1201 return getAttribute(aria_invalidAttr);
1179 1202
1180 return String(); 1203 return String();
1181 } 1204 }
1182 1205
1183 String AXNodeObject::valueDescription() const 1206 String AXNodeObject::valueDescription() const
1184 { 1207 {
(...skipping 897 matching lines...) Expand 10 before | Expand all | Expand 10 after
2082 float range = maxValueForRange() - minValueForRange(); 2105 float range = maxValueForRange() - minValueForRange();
2083 float value = valueForRange(); 2106 float value = valueForRange();
2084 2107
2085 value += range * (percentChange / 100); 2108 value += range * (percentChange / 100);
2086 setValue(String::number(value)); 2109 setValue(String::number(value));
2087 2110
2088 axObjectCache()->postNotification(node(), AXObjectCacheImpl::AXValueChanged) ; 2111 axObjectCache()->postNotification(node(), AXObjectCacheImpl::AXValueChanged) ;
2089 } 2112 }
2090 2113
2091 } // namespace blink 2114 } // 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