Indeterminate not working on native checkboxes
<rdar://problem/26842619>
<rdar://problem/26864598>
Created attachment 281571 [details] patch
Comment on attachment 281571 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=281571&action=review > LayoutTests/accessibility/checkbox-mixed-value.html:27 > + debug(element.stringValue + "\n"); Please use (at least*) AccessibilityUIElement::isIndeterminate(). On my platform, exposure of this property is not through string value, but through state. * "at least" because I think that is sufficient -- unless you want to not just verify not indeterminate, but also not checked.
Comment on attachment 281571 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=281571&action=review >> LayoutTests/accessibility/checkbox-mixed-value.html:27 >> + debug(element.stringValue + "\n"); > > Please use (at least*) AccessibilityUIElement::isIndeterminate(). On my platform, exposure of this property is not through string value, but through state. > > * "at least" because I think that is sufficient -- unless you want to not just verify not indeterminate, but also not checked. In this case we want to test that value ends up producing a 2 instead of 0. Maybe I should just move this to the Mac platform in that case? What do you think
(In reply to comment #5) > Comment on attachment 281571 [details] > patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=281571&action=review > > >> LayoutTests/accessibility/checkbox-mixed-value.html:27 > >> + debug(element.stringValue + "\n"); > > > > Please use (at least*) AccessibilityUIElement::isIndeterminate(). On my platform, exposure of this property is not through string value, but through state. > > > > * "at least" because I think that is sufficient -- unless you want to not just verify not indeterminate, but also not checked. > > In this case we want to test that value ends up producing a 2 instead of 0. > Maybe I should just move this to the Mac platform in that case? What do you > think I think the test belongs cross-platform if possible. Here's your platform's method: bool AccessibilityUIElement::isIndeterminate() const { BOOL result = NO; BEGIN_AX_OBJC_EXCEPTIONS id value = [m_element accessibilityAttributeValue:NSAccessibilityValueAttribute]; if ([value isKindOfClass:[NSNumber class]]) result = [value intValue] == 2; END_AX_OBJC_EXCEPTIONS return result; } Does that not verify that the value ends up producing a 2 instead of 0?
(In reply to comment #6) > (In reply to comment #5) > > Comment on attachment 281571 [details] > > patch > > > > View in context: > > https://bugs.webkit.org/attachment.cgi?id=281571&action=review > > > > >> LayoutTests/accessibility/checkbox-mixed-value.html:27 > > >> + debug(element.stringValue + "\n"); > > > > > > Please use (at least*) AccessibilityUIElement::isIndeterminate(). On my platform, exposure of this property is not through string value, but through state. > > > > > > * "at least" because I think that is sufficient -- unless you want to not just verify not indeterminate, but also not checked. > > > > In this case we want to test that value ends up producing a 2 instead of 0. > > Maybe I should just move this to the Mac platform in that case? What do you > > think > > I think the test belongs cross-platform if possible. Here's your platform's > method: > > bool AccessibilityUIElement::isIndeterminate() const > { > BOOL result = NO; > BEGIN_AX_OBJC_EXCEPTIONS > id value = [m_element > accessibilityAttributeValue:NSAccessibilityValueAttribute]; > if ([value isKindOfClass:[NSNumber class]]) > result = [value intValue] == 2; > END_AX_OBJC_EXCEPTIONS > return result; > } > > Does that not verify that the value ends up producing a 2 instead of 0? Good point. That should do it
BTW, from a quick glance at window's DRT (are they still using that?), AccessibilityUIElement::isIndeterminate() is not implemented. If they are still using DRT, skipping for Windows is probably going to be needed.
Created attachment 281598 [details] patch
Comment on attachment 281598 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=281598&action=review > LayoutTests/accessibility/checkbox-mixed-value.html:27 > + debug("Indeterminate status: " + element.isIndeterminate + "\n"); Thanks!
Comment on attachment 281598 [details] patch Clearing flags on attachment: 281598 Committed r202194: <http://trac.webkit.org/changeset/202194>
All reviewed patches have been landed. Closing bug.