Diff
Modified: trunk/LayoutTests/ChangeLog (218632 => 218633)
--- trunk/LayoutTests/ChangeLog 2017-06-21 15:56:06 UTC (rev 218632)
+++ trunk/LayoutTests/ChangeLog 2017-06-21 15:58:53 UTC (rev 218633)
@@ -1,3 +1,13 @@
+2017-06-21 Chris Fleizach <[email protected]>
+
+ AX: Cannot call setValue() on contenteditable or ARIA text controls
+ https://bugs.webkit.org/show_bug.cgi?id=173520
+
+ Reviewed by Ryosuke Niwa.
+
+ * accessibility/set-value-editable-types-expected.txt: Added.
+ * accessibility/set-value-editable-types.html: Added.
+
2017-06-20 Zan Dobersek <[email protected]>
[GCrypt] Implement CryptoKeyEC SPKI imports
Added: trunk/LayoutTests/accessibility/set-value-editable-types-expected.txt (0 => 218633)
--- trunk/LayoutTests/accessibility/set-value-editable-types-expected.txt (rev 0)
+++ trunk/LayoutTests/accessibility/set-value-editable-types-expected.txt 2017-06-21 15:58:53 UTC (rev 218633)
@@ -0,0 +1,15 @@
+This tests that you can set the value of a contenteditable element.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+
+Contenteditable
+Role: AXRole: AXTextArea
+Value: AXValue: current1
+Writable: true
+Updated value: AXValue: new value
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/accessibility/set-value-editable-types.html (0 => 218633)
--- trunk/LayoutTests/accessibility/set-value-editable-types.html (rev 0)
+++ trunk/LayoutTests/accessibility/set-value-editable-types.html 2017-06-21 15:58:53 UTC (rev 218633)
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html>
+<body id="body">
+<script src=""
+<div id="content">
+
+<div contenteditable="true" id="contenteditable">current1</div>
+
+</div>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+ description("This tests that you can set the value of a contenteditable element.");
+
+ if (window.accessibilityController) {
+ jsTestIsAsync = true;
+ function testElement(idValue, completion) {
+ var axElement = accessibilityController.accessibleElementById(idValue);
+ debug("Role: " + axElement.role);
+ debug("Value: " + axElement.stringValue);
+
+ var writable = axElement.isAttributeSettable("AXValue");
+ debug("Writable: " + writable);
+
+ axElement.setValue("new value");
+
+ // setting attributes can be done after a dispatch.
+ window.setTimeout(function() {
+ debug("Updated value: " + axElement.stringValue);
+ completion();
+ }, 10);
+ }
+
+ debug("\nContenteditable");
+ testElement("contenteditable", function() {
+ document.getElementById("content").style.visibility = "hidden";
+ finishJSTest();
+ });
+ } else {
+ testFailed("Could not load accessibility controller");
+ }
+
+</script>
+
+<script src=""
+</body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (218632 => 218633)
--- trunk/Source/WebCore/ChangeLog 2017-06-21 15:56:06 UTC (rev 218632)
+++ trunk/Source/WebCore/ChangeLog 2017-06-21 15:58:53 UTC (rev 218633)
@@ -1,3 +1,17 @@
+2017-06-21 Chris Fleizach <[email protected]>
+
+ AX: Cannot call setValue() on contenteditable or ARIA text controls
+ https://bugs.webkit.org/show_bug.cgi?id=173520
+
+ Reviewed by Ryosuke Niwa.
+
+ Add support for changing the value of a contenteditable and any other aria text control in setValue().
+
+ Test: accessibility/set-value-editable-types.html
+
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::AccessibilityRenderObject::setValue):
+
2017-06-20 Zan Dobersek <[email protected]>
[GCrypt] Implement CryptoKeyEC SPKI imports
Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (218632 => 218633)
--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp 2017-06-21 15:56:06 UTC (rev 218632)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp 2017-06-21 15:58:53 UTC (rev 218633)
@@ -1743,16 +1743,15 @@
if (!m_renderer || !is<Element>(m_renderer->node()))
return;
Element& element = downcast<Element>(*m_renderer->node());
-
- if (!is<RenderBoxModelObject>(*m_renderer))
- return;
- RenderBoxModelObject& renderer = downcast<RenderBoxModelObject>(*m_renderer);
-
+ RenderObject& renderer = *m_renderer;
+
// FIXME: Do we want to do anything here for ARIA textboxes?
if (renderer.isTextField() && is<HTMLInputElement>(element))
downcast<HTMLInputElement>(element).setValue(string);
else if (renderer.isTextArea() && is<HTMLTextAreaElement>(element))
downcast<HTMLTextAreaElement>(element).setValue(string);
+ else if (is<HTMLElement>(element) && contentEditableAttributeIsEnabled(&element))
+ downcast<HTMLElement>(element).setInnerText(string);
}
bool AccessibilityRenderObject::supportsARIAOwns() const
Modified: trunk/Tools/ChangeLog (218632 => 218633)
--- trunk/Tools/ChangeLog 2017-06-21 15:56:06 UTC (rev 218632)
+++ trunk/Tools/ChangeLog 2017-06-21 15:58:53 UTC (rev 218633)
@@ -1,3 +1,19 @@
+2017-06-21 Chris Fleizach <[email protected]>
+
+ AX: Cannot call setValue() on contenteditable or ARIA text controls
+ https://bugs.webkit.org/show_bug.cgi?id=173520
+
+ Reviewed by Ryosuke Niwa.
+
+ Add setValue() method to WKTR (already existed in DRT).
+
+ * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp:
+ (WTR::AccessibilityUIElement::setValue):
+ * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
+ * WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl:
+ * WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
+ (WTR::AccessibilityUIElement::setValue):
+
2017-06-21 Zan Dobersek <[email protected]>
List libtasn1 packages in GTK+ and WPE install-dependencies scripts
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp (218632 => 218633)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp 2017-06-21 15:56:06 UTC (rev 218632)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp 2017-06-21 15:58:53 UTC (rev 218633)
@@ -89,6 +89,7 @@
RefPtr<AccessibilityTextMarkerRange> AccessibilityUIElement::selectedTextMarkerRange() { return nullptr; }
void AccessibilityUIElement::resetSelectedTextMarkerRange() { }
void AccessibilityUIElement::setBoolAttributeValue(JSStringRef, bool) { }
+void AccessibilityUIElement::setValue(JSStringRef) { }
#endif
#if !PLATFORM(COCOA) || !HAVE(ACCESSIBILITY)
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h (218632 => 218633)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h 2017-06-21 15:56:06 UTC (rev 218632)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h 2017-06-21 15:58:53 UTC (rev 218633)
@@ -110,6 +110,7 @@
bool isPressActionSupported();
bool isIncrementActionSupported();
bool isDecrementActionSupported();
+ void setValue(JSStringRef);
JSRetainPtr<JSStringRef> role();
JSRetainPtr<JSStringRef> subrole();
JSRetainPtr<JSStringRef> roleDescription();
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl (218632 => 218633)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl 2017-06-21 15:56:06 UTC (rev 218632)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl 2017-06-21 15:58:53 UTC (rev 218633)
@@ -69,6 +69,7 @@
boolean isPressActionSupported();
boolean isIncrementActionSupported();
boolean isDecrementActionSupported();
+ void setValue(DOMString value);
readonly attribute DOMString stringValue;
readonly attribute long intValue;
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm (218632 => 218633)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm 2017-06-21 15:56:06 UTC (rev 218632)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm 2017-06-21 15:58:53 UTC (rev 218633)
@@ -589,7 +589,14 @@
[m_element _accessibilitySetTestValue:@(value) forAttribute:[NSString stringWithJSStringRef:attribute]];
END_AX_OBJC_EXCEPTIONS
}
-
+
+void AccessibilityUIElement::setValue(JSStringRef value)
+{
+ BEGIN_AX_OBJC_EXCEPTIONS
+ [m_element accessibilitySetValue:[NSString stringWithJSStringRef:value] forAttribute:NSAccessibilityValueAttribute];
+ END_AX_OBJC_EXCEPTIONS
+}
+
bool AccessibilityUIElement::isAttributeSettable(JSStringRef attribute)
{
BEGIN_AX_OBJC_EXCEPTIONS