Changeset 93226 in webkit
- Timestamp:
- Aug 17, 2011 11:28:02 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r93221 r93226 1 2011-08-17 Sam White <samuel.white@rochester.edu> 2 3 AccessibilityObject levels are inconsistent 4 https://bugs.webkit.org/show_bug.cgi?id=66180 5 6 This test ensures that all AccessibilityObjects that return a level value return consistent results. 7 For example, a level of 0 should only be returned by a level function when it is called on an 8 AccessibilityObject of the wrong type. It's especially important that we enforce this consistency 9 using layout tests because these level values are not defined by the W3C but are still used by 10 popular screen readers such as VoiceOver. 11 12 Reviewed by Chris Fleizach. 13 14 * platform/mac/accessibility/element-level-expected.txt: Added. 15 * platform/mac/accessibility/element-level.html: Added. 16 1 17 2011-08-17 Ryosuke Niwa <rniwa@webkit.org> 2 18 -
trunk/Source/WebCore/ChangeLog
r93221 r93226 1 2011-08-17 Sam White <samuel.white@rochester.edu> 2 3 AccessibilityObject levels are inconsistent 4 https://bugs.webkit.org/show_bug.cgi?id=66180 5 6 Updated accessibilityTable to return level values consistent with other accessibilityObjects that 7 return level values. This means a value of 0 is now only returned when tableLevel() is called on a 8 non-table element. 9 10 Reviewed by Chris Fleizach. 11 12 Test: platform/mac/accessibility/element-level.html 13 14 * accessibility/AccessibilityTable.cpp: 15 (WebCore::AccessibilityTable::tableLevel): 16 * accessibility/mac/AccessibilityObjectWrapper.mm: 17 (-[AccessibilityObjectWrapper accessibilityAttributeValue:]): 18 1 19 2011-08-17 Ryosuke Niwa <rniwa@webkit.org> 2 20 -
trunk/Source/WebCore/accessibility/AccessibilityTable.cpp
r92000 r93226 451 451 { 452 452 int level = 0; 453 for (AccessibilityObject* obj = parentObject(); obj; obj = obj->parentObject()) {453 for (AccessibilityObject* obj = static_cast<AccessibilityObject*>(const_cast<AccessibilityTable*>(this)); obj; obj = obj->parentObject()) { 454 454 if (obj->isAccessibilityTable()) 455 455 ++level; -
trunk/Source/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm
r93021 r93226 2199 2199 if ([attributeName isEqualToString:NSAccessibilityBlockQuoteLevelAttribute]) 2200 2200 return [NSNumber numberWithInt:m_object->blockquoteLevel()]; 2201 if ([attributeName isEqualToString:@"AXTableLevel"]) 2202 return [NSNumber numberWithInt:m_object->tableLevel()]; 2201 2203 } else { 2202 if ([attributeName isEqualToString:NSAccessibilityBlockQuoteLevelAttribute]) { 2203 AccessibilityObject* parent = m_object->parentObjectUnignored(); 2204 if (!parent) 2205 return [NSNumber numberWithInt:0]; 2206 return [parent->wrapper() accessibilityAttributeValue:NSAccessibilityBlockQuoteLevelAttribute]; 2207 } 2204 AccessibilityObject* parent = m_object->parentObjectUnignored(); 2205 if (!parent) 2206 return [NSNumber numberWithInt:0]; 2207 2208 if ([attributeName isEqualToString:NSAccessibilityBlockQuoteLevelAttribute]) 2209 return [parent->wrapper() accessibilityAttributeValue:NSAccessibilityBlockQuoteLevelAttribute]; 2210 if ([attributeName isEqualToString:@"AXTableLevel"]) 2211 return [parent->wrapper() accessibilityAttributeValue:@"AXTableLevel"]; 2208 2212 } 2209 2213 -
trunk/Tools/ChangeLog
r93224 r93226 1 2011-08-17 Sam White <samuel.white@rochester.edu> 2 3 AccessibilityObject levels are inconsistent 4 https://bugs.webkit.org/show_bug.cgi?id=66180 5 6 Added the ability to get numeric attribute values using numberAttributeValue. This 7 function complements the existing stringAttributeValue and boolAttributeValue functions. 8 The addition of numberAttributeValue was necessary because the stringAttributeValue 9 function does a type check and will only return strings. This limitation made it 10 impossible to get values for attributes that returned an NSNumber. 11 12 Reviewed by Chris Fleizach. 13 14 * DumpRenderTree/AccessibilityUIElement.cpp: 15 (numberAttributeValueCallback): 16 (AccessibilityUIElement::getJSClass): 17 * DumpRenderTree/AccessibilityUIElement.h: 18 * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp: 19 (AccessibilityUIElement::numberAttributeValue): 20 * DumpRenderTree/mac/AccessibilityUIElementMac.mm: 21 (AccessibilityUIElement::numberAttributeValue): 22 * DumpRenderTree/win/AccessibilityUIElementWin.cpp: 23 (AccessibilityUIElement::numberAttributeValue): 24 1 25 2011-08-17 Adam Roben <aroben@apple.com> 2 26 -
trunk/Tools/DumpRenderTree/AccessibilityUIElement.cpp
r92571 r93226 370 370 JSRetainPtr<JSStringRef> stringAttributeValue(Adopt, toAXElement(thisObject)->stringAttributeValue(attribute)); 371 371 JSValueRef result = JSValueMakeString(context, stringAttributeValue.get()); 372 if (attribute) 373 JSStringRelease(attribute); 374 return result; 375 } 376 377 static JSValueRef numberAttributeValueCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) 378 { 379 JSStringRef attribute = 0; 380 if (argumentCount == 1) 381 attribute = JSValueToStringCopy(context, arguments[0], exception); 382 double val = toAXElement(thisObject)->numberAttributeValue(attribute); 383 JSValueRef result = JSValueMakeNumber(context, val); 372 384 if (attribute) 373 385 JSStringRelease(attribute); … … 1009 1021 { "setSelectedTextRange", setSelectedTextRangeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1010 1022 { "stringAttributeValue", stringAttributeValueCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1023 { "numberAttributeValue", numberAttributeValueCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1011 1024 { "boolAttributeValue", boolAttributeValueCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1012 1025 { "isAttributeSupported", isAttributeSupportedCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, -
trunk/Tools/DumpRenderTree/AccessibilityUIElement.h
r92571 r93226 105 105 // Attributes - platform-independent implementations 106 106 JSStringRef stringAttributeValue(JSStringRef attribute); 107 double numberAttributeValue(JSStringRef attribute); 107 108 bool boolAttributeValue(JSStringRef attribute); 108 109 bool isAttributeSupported(JSStringRef attribute); -
trunk/Tools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp
r92571 r93226 615 615 } 616 616 617 double AccessibilityUIElement::numberAttributeValue(JSStringRef attribute) 618 { 619 // FIXME: implement 620 return 0.0f; 621 } 622 617 623 bool AccessibilityUIElement::boolAttributeValue(JSStringRef attribute) 618 624 { -
trunk/Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm
r92571 r93226 481 481 } 482 482 483 double AccessibilityUIElement::numberAttributeValue(JSStringRef attribute) 484 { 485 BEGIN_AX_OBJC_EXCEPTIONS 486 id value = [m_element accessibilityAttributeValue:[NSString stringWithJSStringRef:attribute]]; 487 if ([value isKindOfClass:[NSNumber class]]) 488 return [value doubleValue]; 489 END_AX_OBJC_EXCEPTIONS 490 491 return 0; 492 } 493 483 494 bool AccessibilityUIElement::boolAttributeValue(JSStringRef attribute) 484 495 { -
trunk/Tools/DumpRenderTree/win/AccessibilityUIElementWin.cpp
r92571 r93226 514 514 } 515 515 516 double AccessibilityUIElement::numberAttributeValue(JSStringRef attribute) 517 { 518 // FIXME: implement 519 return 0; 520 } 521 516 522 bool AccessibilityUIElement::boolAttributeValue(JSStringRef attribute) 517 523 {
Note: See TracChangeset
for help on using the changeset viewer.