Skip to content
Permalink
Browse files
[GTK] accessibility/meter-element.html is failing
https://bugs.webkit.org/show_bug.cgi?id=115633

Reviewed by Chris Fleizach.

Source/WebCore:

The meter's value description should be exposed in the same fashion
as (we should have been exposing) aria-valuetext, namely through the
"valuetext" AtkObject attribute. This exposure is now in place. Also
implement AccessibilityProgressIndicator::valueDescription() so that
the ports do not have to special-case meter in the platform wrappers.
Map the meter element to the correct role (ATK_ROLE_LEVEL_BAR), and
ignore a previously-included accessible object resulting from the
use of the title attribute on a meter. Finally, do not expose the
meter's title as the accessible name because the HTML spec suggests
authors can supply the numeric unit as the value of title.

No new test file as the failure was identified by meter-element.html.
Seven new test cases were added for additional coverage. Also updated
the ATK expectations for spinbutton-value.html to reflect that we are now
exposing the value of aria-valuetext.

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::helpText):
(WebCore::AccessibilityNodeObject::accessibilityDescriptionForChildren):
(WebCore::AccessibilityNodeObject::visibleText):
* accessibility/AccessibilityNodeObject.h:
* accessibility/AccessibilityProgressIndicator.cpp:
(WebCore::AccessibilityProgressIndicator::valueDescription):
* accessibility/AccessibilityProgressIndicator.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(webkitAccessibleGetAttributes):
(atkRole):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):

Tools:

Implement AccessibilityUIElement::valueDescription() and add mapping
from ATK_ROLE_LEVEL_BAR to AXProgressIndicator.

* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(WTR::AccessibilityUIElement::valueDescription):

LayoutTests:

Seven new test cases were added to meter-element.html for additional
coverage. Also updated the ATK expectations for spinbutton-value.html
to reflect that we are now exposing the value of aria-valuetext.

* accessibility/meter-element.html: New test cases added.
* platform/gtk/TestExpectations: Unskip the previously-failing test.
* platform/gtk/accessibility/meter-element-expected.txt: Updated.
* platform/gtk/accessibility/spinbutton-value-expected.txt: Updated.
* platform/mac/accessibility/meter-element-expected.txt: Updated.


Canonical link: https://commits.webkit.org/175968@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201087 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
joanmarie committed May 18, 2016
1 parent c8f55fb commit 3f88fdc1455f33c20e7db64490924113579cfe05
Showing 16 changed files with 338 additions and 19 deletions.
@@ -1,3 +1,20 @@
2016-05-18 Joanmarie Diggs <jdiggs@igalia.com>

[GTK] accessibility/meter-element.html is failing
https://bugs.webkit.org/show_bug.cgi?id=115633

Reviewed by Chris Fleizach.

Seven new test cases were added to meter-element.html for additional
coverage. Also updated the ATK expectations for spinbutton-value.html
to reflect that we are now exposing the value of aria-valuetext.

* accessibility/meter-element.html: New test cases added.
* platform/gtk/TestExpectations: Unskip the previously-failing test.
* platform/gtk/accessibility/meter-element-expected.txt: Updated.
* platform/gtk/accessibility/spinbutton-value-expected.txt: Updated.
* platform/mac/accessibility/meter-element-expected.txt: Updated.

2016-05-18 Ryan Haddad <ryanhaddad@apple.com>

Rebaseline inspector/debugger/command-line-api-exception.html after r201080
@@ -11,6 +11,16 @@
<meter id="meter5" min=0 max=10 value=2>2cm</meter>
<meter id="meter6" min=0 max=20 value=12 title="centimeters">12cm</meter>
<meter id="meter7" min=0 max=10 value=2 title="centimeters">2cm</meter>
<meter id="meter8" value=0.75><img aria-label="75 out of 100" src="graph75.png"></meter>
<meter id="meter9" value=0.75><img aria-label="75 out of 100" aria-labelledby="label" src="graph75.png"></meter>
<meter id="meter10" value=0.75><img aria-labelledby="label" src="graph75.png"></meter>
<span id="label" style="color:green;">75 percent</span>
<meter id="meter11" value=0.75><img aria-labelledby="label1 label2" src="graph75.png"></meter>
<span id="label1" style="color:green;">75</span>
<span id="label2" style="color:green;">(100 total)</span>
<meter id="meter12" value=0.75><span style="color:green;">75 (out of 100 total)</span></meter>
<meter id="meter13" value=0.75><div><p><span style="color:green;">75 (out of 100 total)</span></p></div></meter>
<meter id="meter14" value=0.60><div aria-label="7 of 10"><span style="color:green;">&#9632;&#9632;&#9632;&#9632;&#9632;&#9632;</span><span>&#9633;&#9633;&#9633;&#9633;</span></div></meter>
</div>

<div id="console"></div>
@@ -19,7 +29,7 @@
description("This tests that the meter element is accessible.");

if (window.testRunner && window.accessibilityController) {
for (var k = 1; k < 8; k++) {
for (var k = 1; k < 15; k++) {
var meter = accessibilityController.accessibleElementById("meter" + k);
debug("Meter" + k);
debug(meter.role);
@@ -2099,8 +2099,6 @@ webkit.org/b/115437 fast/regions/region-content-flown-into-region.html [ ImageOn

webkit.org/b/115437 fast/text/complex-initial-advance.html [ ImageOnlyFailure ]

webkit.org/b/115633 accessibility/meter-element.html [ Failure ]

webkit.org/b/116153 fast/css/text-overflow-ellipsis-full-truncate-rtl.html [ ImageOnlyFailure ]

webkit.org/b/116806 fast/css/text-overflow-ellipsis-behind-floats.html [ ImageOnlyFailure ]
@@ -1,12 +1,121 @@
CONSOLE MESSAGE: line 25: TypeError: undefined is not an object (evaluating 'meter.role')

This tests that the meter element is accessible.

On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".


Meter1
FAIL successfullyParsed should be true (of type boolean). Was undefined (of type undefined).
AXRole: AXProgressIndicator
AXTitle:
AXDescription:
AXValueDescription: 6 blocks used (out of 8 total)
AXValueSettable: false


Meter2
AXRole: AXProgressIndicator
AXTitle:
AXDescription:
AXValueDescription: 75%
AXValueSettable: false


Meter3
AXRole: AXProgressIndicator
AXTitle:
AXDescription:
AXValueDescription:
AXValueSettable: false


Meter4
AXRole: AXProgressIndicator
AXTitle:
AXDescription:
AXValueDescription: 12cm
AXValueSettable: false


Meter5
AXRole: AXProgressIndicator
AXTitle:
AXDescription:
AXValueDescription: 2cm
AXValueSettable: false


Meter6
AXRole: AXProgressIndicator
AXTitle:
AXDescription: centimeters
AXValueDescription: 12cm
AXValueSettable: false


Meter7
AXRole: AXProgressIndicator
AXTitle:
AXDescription: centimeters
AXValueDescription: 2cm
AXValueSettable: false


Meter8
AXRole: AXProgressIndicator
AXTitle:
AXDescription:
AXValueDescription: 75 out of 100
AXValueSettable: false


Meter9
AXRole: AXProgressIndicator
AXTitle:
AXDescription:
AXValueDescription: 75 percent
AXValueSettable: false


Meter10
AXRole: AXProgressIndicator
AXTitle:
AXDescription:
AXValueDescription: 75 percent
AXValueSettable: false


Meter11
AXRole: AXProgressIndicator
AXTitle:
AXDescription:
AXValueDescription: 75 (100 total)
AXValueSettable: false


Meter12
AXRole: AXProgressIndicator
AXTitle:
AXDescription:
AXValueDescription: 75 (out of 100 total)
AXValueSettable: false


Meter13
AXRole: AXProgressIndicator
AXTitle:
AXDescription:
AXValueDescription: 75 (out of 100 total)
AXValueSettable: false


Meter14
AXRole: AXProgressIndicator
AXTitle:
AXDescription:
AXValueDescription: 7 of 10
AXValueSettable: false


PASS successfullyParsed is true

TEST COMPLETE

@@ -8,7 +8,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
PASS endsWith(axSpin.intValue, '5') is true
PASS endsWith(axSpin.minValue, '1') is true
PASS endsWith(axSpin.maxValue, '9') is true
FAIL endsWith(axSpin.valueDescription, '5 of 9') should be true. Was false.
PASS endsWith(axSpin.valueDescription, '5 of 9') is true
PASS axSpin.title is axUntitled.title
PASS successfullyParsed is true

@@ -59,6 +59,62 @@ AXValueDescription: 2cm
AXValueSettable: false


Meter8
AXRole: AXProgressIndicator
AXTitle:
AXDescription:
AXValueDescription: 75 out of 100
AXValueSettable: false


Meter9
AXRole: AXProgressIndicator
AXTitle:
AXDescription:
AXValueDescription: 75 percent
AXValueSettable: false


Meter10
AXRole: AXProgressIndicator
AXTitle:
AXDescription:
AXValueDescription: 75 percent
AXValueSettable: false


Meter11
AXRole: AXProgressIndicator
AXTitle:
AXDescription:
AXValueDescription: 75 (100 total)
AXValueSettable: false


Meter12
AXRole: AXProgressIndicator
AXTitle:
AXDescription:
AXValueDescription: 75 (out of 100 total)
AXValueSettable: false


Meter13
AXRole: AXProgressIndicator
AXTitle:
AXDescription:
AXValueDescription: 75 (out of 100 total)
AXValueSettable: false


Meter14
AXRole: AXProgressIndicator
AXTitle:
AXDescription:
AXValueDescription: 7 of 10
AXValueSettable: false


PASS successfullyParsed is true

TEST COMPLETE
@@ -1,3 +1,42 @@
2016-05-18 Joanmarie Diggs <jdiggs@igalia.com>

[GTK] accessibility/meter-element.html is failing
https://bugs.webkit.org/show_bug.cgi?id=115633

Reviewed by Chris Fleizach.

The meter's value description should be exposed in the same fashion
as (we should have been exposing) aria-valuetext, namely through the
"valuetext" AtkObject attribute. This exposure is now in place. Also
implement AccessibilityProgressIndicator::valueDescription() so that
the ports do not have to special-case meter in the platform wrappers.
Map the meter element to the correct role (ATK_ROLE_LEVEL_BAR), and
ignore a previously-included accessible object resulting from the
use of the title attribute on a meter. Finally, do not expose the
meter's title as the accessible name because the HTML spec suggests
authors can supply the numeric unit as the value of title.

No new test file as the failure was identified by meter-element.html.
Seven new test cases were added for additional coverage. Also updated
the ATK expectations for spinbutton-value.html to reflect that we are now
exposing the value of aria-valuetext.

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::helpText):
(WebCore::AccessibilityNodeObject::accessibilityDescriptionForChildren):
(WebCore::AccessibilityNodeObject::visibleText):
* accessibility/AccessibilityNodeObject.h:
* accessibility/AccessibilityProgressIndicator.cpp:
(WebCore::AccessibilityProgressIndicator::valueDescription):
* accessibility/AccessibilityProgressIndicator.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(webkitAccessibleGetAttributes):
(atkRole):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):

2016-05-18 Antti Koivisto <antti@apple.com>

Allow RenderStyles marked unique in matched properties cache
@@ -1355,7 +1355,6 @@ void AccessibilityNodeObject::visibleText(Vector<AccessibilityText>& textOrder)
case RadioButtonRole:
case SwitchRole:
case TabRole:
case ProgressIndicatorRole:
useTextUnderElement = true;
break;
default:
@@ -1396,9 +1395,17 @@ void AccessibilityNodeObject::helpText(Vector<AccessibilityText>& textOrder) con
textOrder.append(AccessibilityText(summary, SummaryText));

// The title attribute should be used as help text unless it is already being used as descriptive text.
// However, when the title attribute is the only text alternative provided, it may be exposed as the
// descriptive text. This is problematic in the case of meters because the HTML spec suggests authors
// can expose units through this attribute. Therefore, if the element is a meter, change its source
// type to HelpText.
const AtomicString& title = getAttribute(titleAttr);
if (!title.isEmpty())
textOrder.append(AccessibilityText(title, TitleTagText));
if (!title.isEmpty()) {
if (!isMeter())
textOrder.append(AccessibilityText(title, TitleTagText));
else
textOrder.append(AccessibilityText(title, HelpText));
}
}

void AccessibilityNodeObject::accessibilityText(Vector<AccessibilityText>& textOrder)
@@ -1890,6 +1897,32 @@ static String accessibleNameForNode(Node* node, Node* labelledbyNode)
return String();
}

String AccessibilityNodeObject::accessibilityDescriptionForChildren() const
{
Node* node = this->node();
if (!node)
return String();

AXObjectCache* cache = axObjectCache();
if (!cache)
return String();

StringBuilder builder;
for (Node* child = node->firstChild(); child; child = child->nextSibling()) {
if (!is<Element>(child))
continue;

if (AccessibilityObject* axObject = cache->getOrCreate(child)) {
String description = axObject->ariaLabeledByAttribute();
if (description.isEmpty())
description = accessibleNameForNode(child);
appendNameToStringBuilder(builder, description);
}
}

return builder.toString();
}

String AccessibilityNodeObject::accessibilityDescriptionForElements(Vector<Element*> &elements) const
{
StringBuilder builder;
@@ -123,6 +123,7 @@ class AccessibilityNodeObject : public AccessibilityObject {

unsigned hierarchicalLevel() const override;
String textUnderElement(AccessibilityTextUnderElementMode = AccessibilityTextUnderElementMode()) const override;
String accessibilityDescriptionForChildren() const;
String accessibilityDescription() const override;
String helpText() const override;
String title() const override;

0 comments on commit 3f88fdc

Please sign in to comment.