Changeset 201087 in webkit
- Timestamp:
- May 18, 2016 11:57:33 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r201083 r201087 1 2016-05-18 Joanmarie Diggs <jdiggs@igalia.com> 2 3 [GTK] accessibility/meter-element.html is failing 4 https://bugs.webkit.org/show_bug.cgi?id=115633 5 6 Reviewed by Chris Fleizach. 7 8 Seven new test cases were added to meter-element.html for additional 9 coverage. Also updated the ATK expectations for spinbutton-value.html 10 to reflect that we are now exposing the value of aria-valuetext. 11 12 * accessibility/meter-element.html: New test cases added. 13 * platform/gtk/TestExpectations: Unskip the previously-failing test. 14 * platform/gtk/accessibility/meter-element-expected.txt: Updated. 15 * platform/gtk/accessibility/spinbutton-value-expected.txt: Updated. 16 * platform/mac/accessibility/meter-element-expected.txt: Updated. 17 1 18 2016-05-18 Ryan Haddad <ryanhaddad@apple.com> 2 19 -
trunk/LayoutTests/accessibility/meter-element.html
r155653 r201087 12 12 <meter id="meter6" min=0 max=20 value=12 title="centimeters">12cm</meter> 13 13 <meter id="meter7" min=0 max=10 value=2 title="centimeters">2cm</meter> 14 <meter id="meter8" value=0.75><img aria-label="75 out of 100" src="graph75.png"></meter> 15 <meter id="meter9" value=0.75><img aria-label="75 out of 100" aria-labelledby="label" src="graph75.png"></meter> 16 <meter id="meter10" value=0.75><img aria-labelledby="label" src="graph75.png"></meter> 17 <span id="label" style="color:green;">75 percent</span> 18 <meter id="meter11" value=0.75><img aria-labelledby="label1 label2" src="graph75.png"></meter> 19 <span id="label1" style="color:green;">75</span> 20 <span id="label2" style="color:green;">(100 total)</span> 21 <meter id="meter12" value=0.75><span style="color:green;">75 (out of 100 total)</span></meter> 22 <meter id="meter13" value=0.75><div><p><span style="color:green;">75 (out of 100 total)</span></p></div></meter> 23 <meter id="meter14" value=0.60><div aria-label="7 of 10"><span style="color:green;">■■■■■■</span><span>□□□□</span></div></meter> 14 24 </div> 15 25 … … 20 30 21 31 if (window.testRunner && window.accessibilityController) { 22 for (var k = 1; k < 8; k++) {32 for (var k = 1; k < 15; k++) { 23 33 var meter = accessibilityController.accessibleElementById("meter" + k); 24 34 debug("Meter" + k); -
trunk/LayoutTests/platform/gtk/TestExpectations
r201072 r201087 2100 2100 webkit.org/b/115437 fast/text/complex-initial-advance.html [ ImageOnlyFailure ] 2101 2101 2102 webkit.org/b/115633 accessibility/meter-element.html [ Failure ]2103 2104 2102 webkit.org/b/116153 fast/css/text-overflow-ellipsis-full-truncate-rtl.html [ ImageOnlyFailure ] 2105 2103 -
trunk/LayoutTests/platform/gtk/accessibility/meter-element-expected.txt
r189467 r201087 1 CONSOLE MESSAGE: line 25: TypeError: undefined is not an object (evaluating 'meter.role')2 3 1 This tests that the meter element is accessible. 4 2 … … 7 5 8 6 Meter1 9 FAIL successfullyParsed should be true (of type boolean). Was undefined (of type undefined). 7 AXRole: AXProgressIndicator 8 AXTitle: 9 AXDescription: 10 AXValueDescription: 6 blocks used (out of 8 total) 11 AXValueSettable: false 12 13 14 Meter2 15 AXRole: AXProgressIndicator 16 AXTitle: 17 AXDescription: 18 AXValueDescription: 75% 19 AXValueSettable: false 20 21 22 Meter3 23 AXRole: AXProgressIndicator 24 AXTitle: 25 AXDescription: 26 AXValueDescription: 27 AXValueSettable: false 28 29 30 Meter4 31 AXRole: AXProgressIndicator 32 AXTitle: 33 AXDescription: 34 AXValueDescription: 12cm 35 AXValueSettable: false 36 37 38 Meter5 39 AXRole: AXProgressIndicator 40 AXTitle: 41 AXDescription: 42 AXValueDescription: 2cm 43 AXValueSettable: false 44 45 46 Meter6 47 AXRole: AXProgressIndicator 48 AXTitle: 49 AXDescription: centimeters 50 AXValueDescription: 12cm 51 AXValueSettable: false 52 53 54 Meter7 55 AXRole: AXProgressIndicator 56 AXTitle: 57 AXDescription: centimeters 58 AXValueDescription: 2cm 59 AXValueSettable: false 60 61 62 Meter8 63 AXRole: AXProgressIndicator 64 AXTitle: 65 AXDescription: 66 AXValueDescription: 75 out of 100 67 AXValueSettable: false 68 69 70 Meter9 71 AXRole: AXProgressIndicator 72 AXTitle: 73 AXDescription: 74 AXValueDescription: 75 percent 75 AXValueSettable: false 76 77 78 Meter10 79 AXRole: AXProgressIndicator 80 AXTitle: 81 AXDescription: 82 AXValueDescription: 75 percent 83 AXValueSettable: false 84 85 86 Meter11 87 AXRole: AXProgressIndicator 88 AXTitle: 89 AXDescription: 90 AXValueDescription: 75 (100 total) 91 AXValueSettable: false 92 93 94 Meter12 95 AXRole: AXProgressIndicator 96 AXTitle: 97 AXDescription: 98 AXValueDescription: 75 (out of 100 total) 99 AXValueSettable: false 100 101 102 Meter13 103 AXRole: AXProgressIndicator 104 AXTitle: 105 AXDescription: 106 AXValueDescription: 75 (out of 100 total) 107 AXValueSettable: false 108 109 110 Meter14 111 AXRole: AXProgressIndicator 112 AXTitle: 113 AXDescription: 114 AXValueDescription: 7 of 10 115 AXValueSettable: false 116 117 118 PASS successfullyParsed is true 10 119 11 120 TEST COMPLETE -
trunk/LayoutTests/platform/gtk/accessibility/spinbutton-value-expected.txt
r189467 r201087 9 9 PASS endsWith(axSpin.minValue, '1') is true 10 10 PASS endsWith(axSpin.maxValue, '9') is true 11 FAIL endsWith(axSpin.valueDescription, '5 of 9') should be true. Was false. 11 PASS endsWith(axSpin.valueDescription, '5 of 9') is true 12 12 PASS axSpin.title is axUntitled.title 13 13 PASS successfullyParsed is true -
trunk/LayoutTests/platform/mac/accessibility/meter-element-expected.txt
r155653 r201087 60 60 61 61 62 Meter8 63 AXRole: AXProgressIndicator 64 AXTitle: 65 AXDescription: 66 AXValueDescription: 75 out of 100 67 AXValueSettable: false 68 69 70 Meter9 71 AXRole: AXProgressIndicator 72 AXTitle: 73 AXDescription: 74 AXValueDescription: 75 percent 75 AXValueSettable: false 76 77 78 Meter10 79 AXRole: AXProgressIndicator 80 AXTitle: 81 AXDescription: 82 AXValueDescription: 75 percent 83 AXValueSettable: false 84 85 86 Meter11 87 AXRole: AXProgressIndicator 88 AXTitle: 89 AXDescription: 90 AXValueDescription: 75 (100 total) 91 AXValueSettable: false 92 93 94 Meter12 95 AXRole: AXProgressIndicator 96 AXTitle: 97 AXDescription: 98 AXValueDescription: 75 (out of 100 total) 99 AXValueSettable: false 100 101 102 Meter13 103 AXRole: AXProgressIndicator 104 AXTitle: 105 AXDescription: 106 AXValueDescription: 75 (out of 100 total) 107 AXValueSettable: false 108 109 110 Meter14 111 AXRole: AXProgressIndicator 112 AXTitle: 113 AXDescription: 114 AXValueDescription: 7 of 10 115 AXValueSettable: false 116 117 62 118 PASS successfullyParsed is true 63 119 -
trunk/Source/WebCore/ChangeLog
r201086 r201087 1 2016-05-18 Joanmarie Diggs <jdiggs@igalia.com> 2 3 [GTK] accessibility/meter-element.html is failing 4 https://bugs.webkit.org/show_bug.cgi?id=115633 5 6 Reviewed by Chris Fleizach. 7 8 The meter's value description should be exposed in the same fashion 9 as (we should have been exposing) aria-valuetext, namely through the 10 "valuetext" AtkObject attribute. This exposure is now in place. Also 11 implement AccessibilityProgressIndicator::valueDescription() so that 12 the ports do not have to special-case meter in the platform wrappers. 13 Map the meter element to the correct role (ATK_ROLE_LEVEL_BAR), and 14 ignore a previously-included accessible object resulting from the 15 use of the title attribute on a meter. Finally, do not expose the 16 meter's title as the accessible name because the HTML spec suggests 17 authors can supply the numeric unit as the value of title. 18 19 No new test file as the failure was identified by meter-element.html. 20 Seven new test cases were added for additional coverage. Also updated 21 the ATK expectations for spinbutton-value.html to reflect that we are now 22 exposing the value of aria-valuetext. 23 24 * accessibility/AccessibilityNodeObject.cpp: 25 (WebCore::AccessibilityNodeObject::helpText): 26 (WebCore::AccessibilityNodeObject::accessibilityDescriptionForChildren): 27 (WebCore::AccessibilityNodeObject::visibleText): 28 * accessibility/AccessibilityNodeObject.h: 29 * accessibility/AccessibilityProgressIndicator.cpp: 30 (WebCore::AccessibilityProgressIndicator::valueDescription): 31 * accessibility/AccessibilityProgressIndicator.h: 32 * accessibility/AccessibilityRenderObject.cpp: 33 (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored): 34 * accessibility/atk/WebKitAccessibleWrapperAtk.cpp: 35 (webkitAccessibleGetAttributes): 36 (atkRole): 37 * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: 38 (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): 39 1 40 2016-05-18 Antti Koivisto <antti@apple.com> 2 41 -
trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp
r200677 r201087 1356 1356 case SwitchRole: 1357 1357 case TabRole: 1358 case ProgressIndicatorRole:1359 1358 useTextUnderElement = true; 1360 1359 break; … … 1397 1396 1398 1397 // The title attribute should be used as help text unless it is already being used as descriptive text. 1398 // However, when the title attribute is the only text alternative provided, it may be exposed as the 1399 // descriptive text. This is problematic in the case of meters because the HTML spec suggests authors 1400 // can expose units through this attribute. Therefore, if the element is a meter, change its source 1401 // type to HelpText. 1399 1402 const AtomicString& title = getAttribute(titleAttr); 1400 if (!title.isEmpty()) 1401 textOrder.append(AccessibilityText(title, TitleTagText)); 1403 if (!title.isEmpty()) { 1404 if (!isMeter()) 1405 textOrder.append(AccessibilityText(title, TitleTagText)); 1406 else 1407 textOrder.append(AccessibilityText(title, HelpText)); 1408 } 1402 1409 } 1403 1410 … … 1891 1898 } 1892 1899 1900 String AccessibilityNodeObject::accessibilityDescriptionForChildren() const 1901 { 1902 Node* node = this->node(); 1903 if (!node) 1904 return String(); 1905 1906 AXObjectCache* cache = axObjectCache(); 1907 if (!cache) 1908 return String(); 1909 1910 StringBuilder builder; 1911 for (Node* child = node->firstChild(); child; child = child->nextSibling()) { 1912 if (!is<Element>(child)) 1913 continue; 1914 1915 if (AccessibilityObject* axObject = cache->getOrCreate(child)) { 1916 String description = axObject->ariaLabeledByAttribute(); 1917 if (description.isEmpty()) 1918 description = accessibleNameForNode(child); 1919 appendNameToStringBuilder(builder, description); 1920 } 1921 } 1922 1923 return builder.toString(); 1924 } 1925 1893 1926 String AccessibilityNodeObject::accessibilityDescriptionForElements(Vector<Element*> &elements) const 1894 1927 { -
trunk/Source/WebCore/accessibility/AccessibilityNodeObject.h
r200677 r201087 124 124 unsigned hierarchicalLevel() const override; 125 125 String textUnderElement(AccessibilityTextUnderElementMode = AccessibilityTextUnderElementMode()) const override; 126 String accessibilityDescriptionForChildren() const; 126 127 String accessibilityDescription() const override; 127 128 String helpText() const override; -
trunk/Source/WebCore/accessibility/AccessibilityProgressIndicator.cpp
r177733 r201087 22 22 #include "AccessibilityProgressIndicator.h" 23 23 24 #include "AXObjectCache.h" 24 25 #include "FloatConversion.h" 25 26 #include "HTMLMeterElement.h" … … 61 62 } 62 63 64 String AccessibilityProgressIndicator::valueDescription() const 65 { 66 // If the author has explicitly provided a value through aria-valuetext, use it. 67 String description = AccessibilityRenderObject::valueDescription(); 68 if (!description.isEmpty()) 69 return description; 70 71 #if ENABLE(METER_ELEMENT) 72 if (!m_renderer->isMeter()) 73 return String(); 74 75 HTMLMeterElement* meter = meterElement(); 76 if (!meter) 77 return String(); 78 79 // The HTML spec encourages authors to include a textual representation of the meter's state in 80 // the element's contents. We'll fall back on that if there is not a more accessible alternative. 81 AccessibilityObject* axMeter = axObjectCache()->getOrCreate(meter); 82 if (is<AccessibilityNodeObject>(axMeter)) { 83 description = downcast<AccessibilityNodeObject>(axMeter)->accessibilityDescriptionForChildren(); 84 if (!description.isEmpty()) 85 return description; 86 } 87 88 return meter->textContent(); 89 #endif 90 91 return String(); 92 } 93 63 94 float AccessibilityProgressIndicator::valueForRange() const 64 95 { -
trunk/Source/WebCore/accessibility/AccessibilityProgressIndicator.h
r197563 r201087 47 47 bool isProgressIndicator() const override { return true; } 48 48 49 String valueDescription() const override; 49 50 float valueForRange() const override; 50 51 float maxValueForRange() const override; -
trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
r201067 r201087 1348 1348 return false; 1349 1349 1350 #if ENABLE(METER_ELEMENT) 1351 // The render tree of meter includes a RenderBlock (meter) and a RenderMeter (div). 1352 // We expose the latter and thus should ignore the former. However, if the author 1353 // includes a title attribute on the element, hasAttributesRequiredForInclusion() 1354 // will return true, potentially resulting in a redundant accessible object. 1355 if (is<HTMLMeterElement>(node)) 1356 return true; 1357 #endif 1358 1350 1359 // Using the presence of an accessible name to decide an element's visibility is not 1351 1360 // as definitive as previous checks, so this should remain as one of the last. -
trunk/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp
r201072 r201087 421 421 attributeSet = addToAtkAttributeSet(attributeSet, "readonly", isReadOnly.utf8().data()); 422 422 423 String valueDescription = coreObject->valueDescription(); 424 if (!valueDescription.isEmpty()) 425 attributeSet = addToAtkAttributeSet(attributeSet, "valuetext", valueDescription.utf8().data()); 426 423 427 // According to the W3C Core Accessibility API Mappings 1.1, section 5.4.1 General Rules: 424 428 // "User agents must expose the WAI-ARIA role string if the API supports a mechanism to do so." … … 515 519 return ATK_ROLE_PROGRESS_BAR; // Is this right? 516 520 case ProgressIndicatorRole: 517 // return ATK_ROLE_SPIN_BUTTON; // Some confusion about this role in AccessibilityRenderObject.cpp 518 return ATK_ROLE_PROGRESS_BAR; 521 return coreObject->isMeter() ? ATK_ROLE_LEVEL_BAR : ATK_ROLE_PROGRESS_BAR; 519 522 case WindowRole: 520 523 return ATK_ROLE_WINDOW; -
trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
r200563 r201087 3151 3151 } 3152 3152 3153 if ([attributeName isEqualToString:NSAccessibilityValueDescriptionAttribute]) { 3154 if (m_object->isMeter()) 3155 return [self baseAccessibilityTitle]; 3156 3153 if ([attributeName isEqualToString:NSAccessibilityValueDescriptionAttribute]) 3157 3154 return m_object->valueDescription(); 3158 }3159 3155 3160 3156 if ([attributeName isEqualToString:NSAccessibilityOrientationAttribute]) { -
trunk/Tools/ChangeLog
r201081 r201087 1 2016-05-18 Joanmarie Diggs <jdiggs@igalia.com> 2 3 [GTK] accessibility/meter-element.html is failing 4 https://bugs.webkit.org/show_bug.cgi?id=115633 5 6 Reviewed by Chris Fleizach. 7 8 Implement AccessibilityUIElement::valueDescription() and add mapping 9 from ATK_ROLE_LEVEL_BAR to AXProgressIndicator. 10 11 * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp: 12 (WTR::AccessibilityUIElement::valueDescription): 13 1 14 2016-05-18 Brady Eidson <beidson@apple.com> 2 15 -
trunk/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp
r201072 r201087 383 383 case ATK_ROLE_LABEL: 384 384 return "AXLabel"; 385 case ATK_ROLE_LEVEL_BAR: 386 return "AXProgressIndicator"; 385 387 case ATK_ROLE_LINK: 386 388 return "AXLink"; … … 1406 1408 JSRetainPtr<JSStringRef> AccessibilityUIElement::valueDescription() 1407 1409 { 1408 // FIXME: implement 1409 return JSStringCreateWithCharacters(0, 0); 1410 String valueText = getAttributeSetValueForId(ATK_OBJECT(m_element.get()), ObjectAttributeType, "valuetext"); 1411 GUniquePtr<gchar> valueDescription(g_strdup_printf("AXValueDescription: %s", valueText.utf8().data())); 1412 return JSStringCreateWithUTF8CString(valueDescription.get()); 1410 1413 } 1411 1414
Note: See TracChangeset
for help on using the changeset viewer.