RESOLVED FIXED 179497
AX: AOM: Implement number type properties
https://bugs.webkit.org/show_bug.cgi?id=179497
Summary AX: AOM: Implement number type properties
Nan Wang
Reported 2017-11-09 11:33:17 PST
AOM Phase 1: Implement number type properties Spec: https://wicg.github.io/aom/spec/ <rdar://problem/35077947>
Attachments
patch (76.65 KB, patch)
2017-11-17 18:54 PST, Nan Wang
no flags
patch (79.30 KB, patch)
2017-11-17 21:22 PST, Nan Wang
no flags
patch (84.01 KB, patch)
2017-11-18 12:57 PST, Nan Wang
no flags
patch (84.02 KB, patch)
2017-11-18 13:20 PST, Nan Wang
cfleizach: review+
Nan Wang
Comment 1 2017-11-17 18:54:36 PST
Nan Wang
Comment 2 2017-11-17 21:22:35 PST
Created attachment 327302 [details] patch Fix GTK build
chris fleizach
Comment 3 2017-11-17 23:46:39 PST
Comment on attachment 327302 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=327302&action=review > Source/WebCore/accessibility/AccessibleNode.cpp:203 > +void AccessibleNode::setProperty(bool shouldRemove, PropertyValueVariant&& value, AXPropertyName propertyName) can we remove the first argument and just check if value.has_value inside the method? It seems more natural to have the PropertyName be the first argument, and the value be the second? > Source/WebCore/accessibility/AccessibleNode.cpp:279 > + return element.attributeWithoutSynchronization(ariaAttributeMap().get(propertyName)).toInt(); toUnsigned() > Source/WebCore/accessibility/AccessibleNode.h:39 > +typedef Variant<std::nullptr_t, String, bool, int, unsigned, double> PropertyValueVariant; should this be float instead of double?
Nan Wang
Comment 4 2017-11-18 12:54:52 PST
Comment on attachment 327302 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=327302&action=review >> Source/WebCore/accessibility/AccessibleNode.cpp:203 >> +void AccessibleNode::setProperty(bool shouldRemove, PropertyValueVariant&& value, AXPropertyName propertyName) > > can we remove the first argument and just check if value.has_value inside the method? > > It seems more natural to have the PropertyName be the first argument, and the value be the second? Ok I added a template function to cover the optional values template<typename T> void setOptionalProperty(AXPropertyName, std::optional<T>); And also setStringProperty() >> Source/WebCore/accessibility/AccessibleNode.cpp:279 >> + return element.attributeWithoutSynchronization(ariaAttributeMap().get(propertyName)).toInt(); > > toUnsigned() There's no toUnsigned() on AtomicString, so I cast it to String and use toUInt() >> Source/WebCore/accessibility/AccessibleNode.h:39 >> +typedef Variant<std::nullptr_t, String, bool, int, unsigned, double> PropertyValueVariant; > > should this be float instead of double? This is to match the JS API interface: attribute double?
Nan Wang
Comment 5 2017-11-18 12:57:37 PST
Created attachment 327318 [details] patch Update from review and use auto if possible
chris fleizach
Comment 6 2017-11-18 13:00:18 PST
Comment on attachment 327318 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=327318&action=review > Source/WebCore/accessibility/AccessibilityObject.cpp:2183 > +float AccessibilityObject::floatValueForProperty(AXPropertyName propertyKey) const this is dealing with floatValues not double though
Nan Wang
Comment 7 2017-11-18 13:08:19 PST
(In reply to chris fleizach from comment #6) > Comment on attachment 327318 [details] > patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=327318&action=review > > > Source/WebCore/accessibility/AccessibilityObject.cpp:2183 > > +float AccessibilityObject::floatValueForProperty(AXPropertyName propertyKey) const > > this is dealing with floatValues not double though I can change this to double too?
Nan Wang
Comment 8 2017-11-18 13:20:29 PST
Created attachment 327320 [details] patch update
chris fleizach
Comment 9 2017-11-18 22:03:23 PST
Comment on attachment 327320 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=327320&action=review > Source/WebCore/accessibility/AccessibleNode.cpp:290 > + const String& value = element.attributeWithoutSynchronization(ariaAttributeMap().get(propertyName)); extra space after = > Source/WebCore/accessibility/AccessibleNode.cpp:304 > + return element.attributeWithoutSynchronization(ariaAttributeMap().get(propertyName)).toFloat(); toDouble() ?
Nan Wang
Comment 10 2017-11-18 22:58:03 PST
(In reply to chris fleizach from comment #9) > Comment on attachment 327320 [details] > patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=327320&action=review > > > Source/WebCore/accessibility/AccessibleNode.cpp:290 > > + const String& value = element.attributeWithoutSynchronization(ariaAttributeMap().get(propertyName)); > > extra space after = > > > Source/WebCore/accessibility/AccessibleNode.cpp:304 > > + return element.attributeWithoutSynchronization(ariaAttributeMap().get(propertyName)).toFloat(); > > toDouble() ? Ok, updated
Nan Wang
Comment 11 2017-11-18 23:00:01 PST
Ryosuke Niwa
Comment 12 2017-11-20 16:38:57 PST
Comment on attachment 327320 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=327320&action=review > Source/WebCore/accessibility/AccessibilityObject.cpp:2171 > + if (Element* element = this->element()) Use auto in these cases. > Source/WebCore/accessibility/AccessibilityObject.cpp:2178 > + if (Element* element = this->element()) Ditto. > Source/WebCore/accessibility/AccessibilityObject.cpp:2185 > + if (Element* element = this->element()) Ditto.
Note You need to log in before you can comment on or make changes to this bug.