Changeset 200369 in webkit
- Timestamp:
- May 3, 2016 8:23:23 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r200367 r200369 1 2016-05-03 Joanmarie Diggs <jdiggs@igalia.com> 2 3 [ATK] accessibility/content-editable-as-textarea.html fails 4 https://bugs.webkit.org/show_bug.cgi?id=155353 5 6 Reviewed by Darin Adler. 7 8 Updated the test identified in the bug to listen for the appropriate 9 notification for ATK and created platform-specific expectations. 10 11 In addition, set-selected-text-range-contenteditable.html was timing out 12 due to the use of shouldBecomeEqual() with an assertion that is wrong for 13 ATK. Modifying the test so that it verifies the result appropriate for 14 each platform eliminates the timeout. 15 16 * accessibility/content-editable-as-textarea.html: Updated. 17 * accessibility/set-selected-text-range-contenteditable.html: Updated. 18 * platform/gtk/TestExpectations: Unskipped the failing tests. 19 * platform/gtk/accessibility/content-editable-as-textarea-expected.txt: Added. 20 * platform/gtk/accessibility/set-selected-text-range-contenteditable-expected.txt: Added. 21 1 22 2016-05-03 Joseph Pecoraro <pecoraro@apple.com> 2 23 -
trunk/LayoutTests/accessibility/content-editable-as-textarea.html
r168042 r200369 20 20 var notification = 0; 21 21 var textArea = 0; 22 var notificationType = "AXValueChanged"; 22 23 function callback(notification) { 23 if (notification == "AXValueChanged") {24 if (notification == notificationType) { 24 25 textArea.removeNotificationListener(); 25 26 debug("Updated value: " + textArea.stringValue); … … 31 32 if (window.accessibilityController) { 32 33 window.jsTestIsAsync = true; 34 35 // In ATK, value-changed notifications are made for widgets which implement 36 // the AtkValue interface (sliders, progress bars, etc.). 37 if (accessibilityController.platformName == "atk") 38 notificationType = "AXTextChanged"; 33 39 34 40 textArea = accessibilityController.accessibleElementById("content"); -
trunk/LayoutTests/accessibility/set-selected-text-range-contenteditable.html
r198768 r200369 45 45 debug("\nSet range: {-1, 0}"); 46 46 content.setSelectedTextRange(-1, 0); 47 shouldBecomeEqual("content.selectedTextRange", "'{0, 0}'", function() { 47 48 // In ATK, -1 is used as an alias for the final offset. 49 expectations = accessibilityController.platformName == "atk" ? "'{16, 0}'" : "'{0, 0}'"; 50 51 shouldBecomeEqual("content.selectedTextRange", expectations, function() { 48 52 debug("\nSet range: {7, 3}"); 49 53 content.setSelectedTextRange(7, 3); -
trunk/LayoutTests/platform/gtk/TestExpectations
r200366 r200369 88 88 webkit.org/b/98348 accessibility/radio-button-group-members.html [ Skip ] 89 89 webkit.org/b/141074 accessibility/auto-filled-value.html [ Skip ] 90 webkit.org/b/133148 accessibility/content-editable-as-textarea.html [ Skip ]91 webkit.org/b/133148 accessibility/set-selected-text-range-contenteditable.html [ Skip ]92 90 webkit.org/b/156045 accessibility/attachment-element.html [ Skip ] 93 91 -
trunk/Source/WebCore/ChangeLog
r200368 r200369 1 2016-05-03 Joanmarie Diggs <jdiggs@igalia.com> 2 3 [ATK] accessibility/content-editable-as-textarea.html fails 4 https://bugs.webkit.org/show_bug.cgi?id=155353 5 6 Reviewed by Darin Adler. 7 8 The test was timing out because it expected an AXValueChanged notification. 9 In ATK, AXValueChanged notifications are made for widgets which implement 10 the AtkValue interface (sliders, progress bars, etc.). We should be listening 11 for AXTextChanged instead. 12 13 In addition, for contenteditable elements, we should emit the notification on 14 the element itself. Because we were handling the notification in the same way 15 as native text controls (where the notification we receive from WebCore is for 16 StaticTextRole children), we were attempting to emit the notification from 17 the parent of the contenteditable. 18 19 Lastly, ATK's AccessibilityUIElement support had a number of unimplemented 20 methods that are being used as part of the previously-failing test. Those 21 methods are now implemented so that the ATK results are much more similar 22 to those on the Mac. 23 24 No new tests needed. The previously-failing test now passes. 25 26 * accessibility/AccessibilityNodeObject.cpp: 27 (WebCore::AccessibilityNodeObject::childrenChanged): 28 * accessibility/AccessibilityObject.cpp: 29 (WebCore::AccessibilityObject::isNonNativeTextControl): 30 * accessibility/AccessibilityObject.h: 31 * accessibility/AccessibilityRenderObject.cpp: 32 (WebCore::AccessibilityRenderObject::textChanged): 33 * accessibility/atk/AXObjectCacheAtk.cpp: 34 (WebCore::AXObjectCache::nodeTextChangePlatformNotification): 35 1 36 2016-05-02 Sergio Villar Senin <svillar@igalia.com> 2 37 -
trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp
r200318 r200369 160 160 161 161 // If this element is an ARIA text control, notify the AT of changes. 162 if ( (parent->isARIATextControl() || parent->hasContentEditableAttributeSet()) && !parent->isNativeTextControl())162 if (parent->isNonNativeTextControl()) 163 163 cache->postNotification(parent, parent->document(), AXObjectCache::AXValueChanged); 164 164 } -
trunk/Source/WebCore/accessibility/AccessibilityObject.cpp
r200222 r200369 391 391 { 392 392 return ariaRoleAttribute() == TextAreaRole || ariaRoleAttribute() == TextFieldRole || ariaRoleAttribute() == SearchFieldRole; 393 } 394 395 bool AccessibilityObject::isNonNativeTextControl() const 396 { 397 return (isARIATextControl() || hasContentEditableAttributeSet()) && !isNativeTextControl(); 393 398 } 394 399 -
trunk/Source/WebCore/accessibility/AccessibilityObject.h
r200222 r200369 535 535 bool isTextControl() const; 536 536 bool isARIATextControl() const; 537 bool isNonNativeTextControl() const; 537 538 bool isTabList() const { return roleValue() == TabListRole; } 538 539 bool isTabItem() const { return roleValue() == TabRole; } -
trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
r200290 r200369 2922 2922 cache->postNotification(renderParent, AXObjectCache::AXLiveRegionChanged); 2923 2923 2924 if ( (parent->isARIATextControl() || parent->hasContentEditableAttributeSet()) && !parent->isNativeTextControl())2924 if (parent->isNonNativeTextControl()) 2925 2925 cache->postNotification(renderParent, AXObjectCache::AXValueChanged); 2926 2926 } -
trunk/Source/WebCore/accessibility/atk/AXObjectCacheAtk.cpp
r186279 r200369 250 250 return; 251 251 252 AccessibilityObject* parentObject = object-> parentObjectUnignored();252 AccessibilityObject* parentObject = object->isNonNativeTextControl() ? object : object->parentObjectUnignored(); 253 253 if (!parentObject) 254 254 return; -
trunk/Tools/ChangeLog
r200346 r200369 1 2016-05-03 Joanmarie Diggs <jdiggs@igalia.com> 2 3 [ATK] accessibility/content-editable-as-textarea.html fails 4 https://bugs.webkit.org/show_bug.cgi?id=155353 5 6 Reviewed by Darin Adler. 7 8 The test was timing out because it expected an AXValueChanged notification. 9 In ATK, AXValueChanged notifications are made for widgets which implement 10 the AtkValue interface (sliders, progress bars, etc.). We should be listening 11 for AXTextChanged instead. AtkText's text-insert and text-remove have been 12 added to the AccessibilityNotificationHandler. 13 14 Also, ATK's AccessibilityUIElement support had a number of unimplemented 15 methods that are being used as part of the previously-failing test. Those 16 methods are now implemented so that the ATK results are much more similar 17 to those on the Mac. 18 19 * WebKitTestRunner/InjectedBundle/atk/AccessibilityNotificationHandlerAtk.cpp: 20 (WTR::AccessibilityNotificationHandler::connectAccessibilityCallbacks): 21 * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp: 22 (WTR::AccessibilityUIElement::stringAttributeValue): 23 (WTR::AccessibilityUIElement::rangeForLine): 24 (WTR::AccessibilityUIElement::boundsForRange): 25 (WTR::AccessibilityUIElement::attributedStringForRange): 26 1 27 2016-05-02 Brady Eidson <beidson@apple.com> 2 28 -
trunk/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityNotificationHandlerAtk.cpp
r185502 r200369 92 92 JSRetainPtr<JSStringRef> jsSignalValue(Adopt, JSStringCreateWithUTF8CString(signalValue.get())); 93 93 extraArgs.append(JSValueMakeString(jsContext, jsSignalValue.get())); 94 } 94 } else if (!g_strcmp0(signalQuery.signal_name, "text-insert") || !g_strcmp0(signalQuery.signal_name, "text-remove")) 95 notificationName = "AXTextChanged"; 95 96 96 97 if (!jsContext) … … 219 220 "ATK:AtkSelection:selection-changed", 220 221 "ATK:AtkText:text-caret-moved", 222 "ATK:AtkText:text-insert", 223 "ATK:AtkText:text-remove", 221 224 0 222 225 }; -
trunk/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp
r200245 r200369 187 187 } 188 188 189 String getAtkAttributeSetAsString(AtkObject* accessible, AtkAttributeType type) 190 { 191 AtkAttributeSet* attributeSet = getAttributeSet(accessible, type); 189 String attributeSetToString(AtkAttributeSet* attributeSet, String separator=", ") 190 { 192 191 if (!attributeSet) 193 192 return String(); … … 199 198 builder.append(attributeData.get()); 200 199 if (attributes->next) 201 builder.append( ", ");200 builder.append(separator); 202 201 } 203 202 atk_attribute_set_free(attributeSet); 204 203 205 204 return builder.toString(); 205 } 206 207 String getAtkAttributeSetAsString(AtkObject* accessible, AtkAttributeType type, String separator=", ") 208 { 209 return attributeSetToString(getAttributeSet(accessible, type), separator); 206 210 } 207 211 … … 503 507 } 504 508 509 String selectedText(AtkObject* accessible) 510 { 511 if (!ATK_IS_TEXT(accessible)) 512 return String(); 513 514 AtkText* text = ATK_TEXT(accessible); 515 516 gint start, end; 517 g_free(atk_text_get_selection(text, 0, &start, &end)); 518 519 return atk_text_get_text(text, start, end); 520 } 521 505 522 String attributesOfElement(AccessibilityUIElement* element) 506 523 { … … 915 932 String atkAttributeName = coreAttributeToAtkAttribute(attribute); 916 933 917 // Try object attributes first. 934 // The value of AXSelectedText is not exposed through any AtkAttribute. 935 if (atkAttributeName == "AXSelectedText") { 936 String string = selectedText(m_element.get()); 937 return JSStringCreateWithUTF8CString(string.utf8().data()); 938 } 939 940 // Try object attributes before text attributes. 918 941 String attributeValue = getAttributeSetValueForId(ATK_OBJECT(m_element.get()), ObjectAttributeType, atkAttributeName); 919 942 … … 1453 1476 JSRetainPtr<JSStringRef> AccessibilityUIElement::rangeForLine(int line) 1454 1477 { 1478 if (!ATK_IS_TEXT(m_element.get())) 1479 return JSStringCreateWithCharacters(0, 0); 1480 1481 AtkText* text = ATK_TEXT(m_element.get()); 1482 gint startOffset = 0, endOffset = 0; 1483 for (int i = 0; i <= line; ++i) 1484 atk_text_get_string_at_offset(text, endOffset, ATK_TEXT_GRANULARITY_LINE, &startOffset, &endOffset); 1485 1486 GUniquePtr<gchar> range(g_strdup_printf("{%d, %d}", startOffset, endOffset - startOffset)); 1487 return JSStringCreateWithUTF8CString(range.get()); 1488 } 1489 1490 JSRetainPtr<JSStringRef> AccessibilityUIElement::rangeForPosition(int x, int y) 1491 { 1455 1492 // FIXME: implement 1456 1493 return JSStringCreateWithCharacters(0, 0); 1457 1494 } 1458 1495 1459 JSRetainPtr<JSStringRef> AccessibilityUIElement::rangeForPosition(int x, int y)1460 {1461 // FIXME: implement1462 return JSStringCreateWithCharacters(0, 0);1463 }1464 1465 1496 JSRetainPtr<JSStringRef> AccessibilityUIElement::boundsForRange(unsigned location, unsigned length) 1466 1497 { 1467 // FIXME: implement 1468 return JSStringCreateWithCharacters(0, 0); 1498 if (!ATK_IS_TEXT(m_element.get())) 1499 return JSStringCreateWithCharacters(0, 0); 1500 1501 AtkTextRectangle rect; 1502 atk_text_get_range_extents(ATK_TEXT(m_element.get()), location, location + length, ATK_XY_WINDOW, &rect); 1503 1504 GUniquePtr<gchar> bounds(g_strdup_printf("{%d, %d, %d, %d}", rect.x, rect.y, rect.width, rect.height)); 1505 return JSStringCreateWithUTF8CString(bounds.get()); 1469 1506 } 1470 1507 … … 1480 1517 JSRetainPtr<JSStringRef> AccessibilityUIElement::attributedStringForRange(unsigned location, unsigned length) 1481 1518 { 1482 // FIXME: implement 1483 return JSStringCreateWithCharacters(0, 0); 1519 if (!ATK_IS_TEXT(m_element.get())) 1520 return JSStringCreateWithCharacters(0, 0); 1521 1522 StringBuilder builder; 1523 1524 // The default text attributes apply to the entire element. 1525 builder.append("\n\tDefault text attributes:\n\t\t"); 1526 builder.append(attributeSetToString(getAttributeSet(m_element.get(), TextAttributeType), "\n\t\t")); 1527 1528 // The attribute run provides attributes specific to the range of text at the specified offset. 1529 AtkAttributeSet* attributeSet; 1530 AtkText* text = ATK_TEXT(m_element.get()); 1531 gint start = 0, end = 0; 1532 for (int i = location; i < location + length; i = end) { 1533 AtkAttributeSet* attributeSet = atk_text_get_run_attributes(text, i, &start, &end); 1534 GUniquePtr<gchar> substring(replaceCharactersForResults(atk_text_get_text(text, start, end))); 1535 builder.append(String::format("\n\tRange attributes for '%s':\n\t\t", substring.get())); 1536 builder.append(attributeSetToString(attributeSet, "\n\t\t")); 1537 } 1538 1539 atk_attribute_set_free(attributeSet); 1540 1541 return JSStringCreateWithUTF8CString(builder.toString().utf8().data()); 1484 1542 } 1485 1543
Note: See TracChangeset
for help on using the changeset viewer.