Changeset 140803 in webkit
- Timestamp:
- Jan 25, 2013 2:10:47 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r140799 r140803 1 2013-01-25 Kent Tamura <tkent@chromium.org> 2 3 INPUT_MULTIPLE_FIELDS_UI: Inconsistent value of aria-valuetext attribute 4 https://bugs.webkit.org/show_bug.cgi?id=107897 5 6 Reviewed by Kentaro Hara. 7 8 Fix existing tests to show aria-valuenow attribute values. 9 10 * fast/forms/resources/multiple-fields-ax-aria-attributes.js: Added. 11 * fast/forms/date-multiple-fields/date-multiple-fields-ax-aria-attributes-expected.txt: 12 * fast/forms/date-multiple-fields/date-multiple-fields-ax-aria-attributes.html: 13 Use multiple-fields-ax-aria-attributes.js. 14 Add tests for initial empty-value state. 15 * fast/forms/month-multiple-fields/month-multiple-fields-ax-aria-attributes-expected.txt: 16 * fast/forms/month-multiple-fields/month-multiple-fields-ax-aria-attributes.html: 17 Use multiple-fields-ax-aria-attributes.js. 18 * fast/forms/time-multiple-fields/time-multiple-fields-ax-aria-attributes-expected.txt: 19 * fast/forms/time-multiple-fields/time-multiple-fields-ax-aria-attributes.html: 20 Use multiple-fields-ax-aria-attributes.js. 21 1 22 2013-01-25 Keishi Hattori <keishi@webkit.org> 2 23 -
trunk/LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-ax-aria-attributes-expected.txt
r130884 r140803 4 4 5 5 6 Initial empty state 7 PASS focusedElementDescription() is "AXHelp: Month, AXValueDescription: blank, intValue:0, range:1-12" 8 PASS focusedElementDescription() is "AXHelp: Day, AXValueDescription: blank, intValue:0, range:1-31" 9 PASS focusedElementDescription() is "AXHelp: Year, AXValueDescription: blank, intValue:0, range:1-275760" 6 10 Non-empty value 7 PASS focused FieldValueDescription() is "AXHelp: Month, AXValueDescription: 10, 1,12"8 PASS focused FieldValueDescription() is "AXHelp: Day, AXValueDescription: 09, 1,31"9 PASS focused FieldValueDescription() is "AXHelp: Year, AXValueDescription: 2012, 1,275760"11 PASS focusedElementDescription() is "AXHelp: Month, AXValueDescription: 10, intValue:10, range:1-12" 12 PASS focusedElementDescription() is "AXHelp: Day, AXValueDescription: 09, intValue:9, range:1-31" 13 PASS focusedElementDescription() is "AXHelp: Year, AXValueDescription: 2012, intValue:2012, range:1-275760" 10 14 Empty value 11 PASS focused FieldValueDescription() is "AXHelp: Year, AXValueDescription: blank, 1,275760"12 PASS focused FieldValueDescription() is "AXHelp: Day, AXValueDescription: blank, 1,31"13 PASS focused FieldValueDescription() is "AXHelp: Month, AXValueDescription: blank, 1,12"15 PASS focusedElementDescription() is "AXHelp: Year, AXValueDescription: blank, intValue:0, range:1-275760" 16 PASS focusedElementDescription() is "AXHelp: Day, AXValueDescription: blank, intValue:0, range:1-31" 17 PASS focusedElementDescription() is "AXHelp: Month, AXValueDescription: blank, intValue:0, range:1-12" 14 18 15 19 PASS successfullyParsed is true -
trunk/LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-ax-aria-attributes.html
r130884 r140803 3 3 <head> 4 4 <script src="../../../fast/js/resources/js-test-pre.js"></script> 5 <script src="../resources/multiple-fields-ax-aria-attributes.js"></script> 5 6 </head> 6 7 <body> 7 <input id="test" type="date" value="2012-10-09">8 <input id="test" type="date"> 8 9 <script> 9 10 description('This test checks aria-help attribute of fields in multiple fields date input UI.'); 10 11 function focusedFieldValueDescription()12 {13 var element = accessibilityController.focusedElement;14 return element.helpText + ', ' + element.valueDescription + ', ' + element.minValue + ', ' + element.maxValue;15 }16 11 17 12 var testInput = document.getElementById('test'); … … 20 15 debug('Please run inside DRT or WTR.'); 21 16 else { 17 testInput.focus(); 18 debug('Initial empty state'); 19 checkFocusedElementAXAttributes('AXHelp: Month, AXValueDescription: blank, intValue:0, range:1-12'); 20 eventSender.keyDown('\t'); 21 checkFocusedElementAXAttributes('AXHelp: Day, AXValueDescription: blank, intValue:0, range:1-31'); 22 eventSender.keyDown('\t'); 23 checkFocusedElementAXAttributes('AXHelp: Year, AXValueDescription: blank, intValue:0, range:1-275760'); 24 25 eventSender.keyDown('\t', ['shiftKey']); 26 eventSender.keyDown('\t', ['shiftKey']); 22 27 debug('Non-empty value'); 23 testInput. focus();24 shouldBeEqualToString('focusedFieldValueDescription()', 'AXHelp: Month, AXValueDescription: 10, 1,12');28 testInput.value = "2012-10-09"; 29 checkFocusedElementAXAttributes('AXHelp: Month, AXValueDescription: 10, intValue:10, range:1-12'); 25 30 eventSender.keyDown('\t'); 26 shouldBeEqualToString('focusedFieldValueDescription()', 'AXHelp: Day, AXValueDescription: 09, 1,31');31 checkFocusedElementAXAttributes('AXHelp: Day, AXValueDescription: 09, intValue:9, range:1-31'); 27 32 eventSender.keyDown('\t'); 28 shouldBeEqualToString('focusedFieldValueDescription()', 'AXHelp: Year, AXValueDescription: 2012, 1,275760');33 checkFocusedElementAXAttributes('AXHelp: Year, AXValueDescription: 2012, intValue:2012, range:1-275760'); 29 34 30 35 debug('Empty value'); 31 36 eventSender.keyDown('\b'); 32 shouldBeEqualToString('focusedFieldValueDescription()', 'AXHelp: Year, AXValueDescription: blank, 1,275760');37 checkFocusedElementAXAttributes('AXHelp: Year, AXValueDescription: blank, intValue:0, range:1-275760'); 33 38 eventSender.keyDown('\t', ['shiftKey']); 34 39 eventSender.keyDown('\b'); 35 shouldBeEqualToString('focusedFieldValueDescription()', 'AXHelp: Day, AXValueDescription: blank, 1,31');40 checkFocusedElementAXAttributes('AXHelp: Day, AXValueDescription: blank, intValue:0, range:1-31'); 36 41 eventSender.keyDown('\t', ['shiftKey']); 37 42 eventSender.keyDown('\b'); 38 shouldBeEqualToString('focusedFieldValueDescription()', 'AXHelp: Month, AXValueDescription: blank, 1,12');43 checkFocusedElementAXAttributes('AXHelp: Month, AXValueDescription: blank, intValue:0, range:1-12'); 39 44 40 45 debug(''); -
trunk/LayoutTests/fast/forms/month-multiple-fields/month-multiple-fields-ax-aria-attributes-expected.txt
r136202 r140803 5 5 6 6 Non-empty value 7 PASS focused FieldValueDescription() is "AXHelp: Month, AXValueDescription: October, 1,12"8 PASS focused FieldValueDescription() is "AXHelp: Year, AXValueDescription: 2012, 1,275760"7 PASS focusedElementDescription() is "AXHelp: Month, AXValueDescription: October, intValue:10, range:1-12" 8 PASS focusedElementDescription() is "AXHelp: Year, AXValueDescription: 2012, intValue:2012, range:1-275760" 9 9 Empty value 10 PASS focused FieldValueDescription() is "AXHelp: Year, AXValueDescription: blank, 1,275760"11 PASS focused FieldValueDescription() is "AXHelp: Month, AXValueDescription: blank, 1,12"10 PASS focusedElementDescription() is "AXHelp: Year, AXValueDescription: blank, intValue:0, range:1-275760" 11 PASS focusedElementDescription() is "AXHelp: Month, AXValueDescription: blank, intValue:0, range:1-12" 12 12 13 13 PASS successfullyParsed is true -
trunk/LayoutTests/fast/forms/month-multiple-fields/month-multiple-fields-ax-aria-attributes.html
r136202 r140803 3 3 <head> 4 4 <script src="../../../fast/js/resources/js-test-pre.js"></script> 5 <script src="../resources/multiple-fields-ax-aria-attributes.js"></script> 5 6 </head> 6 7 <body> … … 8 9 <script> 9 10 description('This test checks aria-help attribute of fields in multiple fields week input UI.'); 10 11 function focusedFieldValueDescription()12 {13 var element = accessibilityController.focusedElement;14 return element.helpText + ', ' + element.valueDescription + ', ' + element.minValue + ', ' + element.maxValue;15 }16 11 17 12 var testInput = document.getElementById('test'); … … 22 17 debug('Non-empty value'); 23 18 testInput.focus(); 24 shouldBeEqualToString('focusedFieldValueDescription()', 'AXHelp: Month, AXValueDescription: October, 1,12');19 checkFocusedElementAXAttributes('AXHelp: Month, AXValueDescription: October, intValue:10, range:1-12'); 25 20 eventSender.keyDown('\t'); 26 shouldBeEqualToString('focusedFieldValueDescription()', 'AXHelp: Year, AXValueDescription: 2012, 1,275760');21 checkFocusedElementAXAttributes('AXHelp: Year, AXValueDescription: 2012, intValue:2012, range:1-275760'); 27 22 28 23 debug('Empty value'); 29 24 eventSender.keyDown('\b'); 30 shouldBeEqualToString('focusedFieldValueDescription()', 'AXHelp: Year, AXValueDescription: blank, 1,275760');25 checkFocusedElementAXAttributes('AXHelp: Year, AXValueDescription: blank, intValue:0, range:1-275760'); 31 26 eventSender.keyDown('\t', ['shiftKey']); 32 27 eventSender.keyDown('\b'); 33 shouldBeEqualToString('focusedFieldValueDescription()', 'AXHelp: Month, AXValueDescription: blank, 1,12');28 checkFocusedElementAXAttributes('AXHelp: Month, AXValueDescription: blank, intValue:0, range:1-12'); 34 29 35 30 debug(''); -
trunk/LayoutTests/fast/forms/time-multiple-fields/time-multiple-fields-ax-aria-attributes-expected.txt
r128404 r140803 5 5 6 6 Non-empty value 7 PASS focused FieldValueDescription() is "AXHelp: Hours, AXValueDescription: 12, 1,12"8 PASS focused FieldValueDescription() is "AXHelp: Minutes, AXValueDescription: 34, 0,59"9 PASS focused FieldValueDescription() is "AXHelp: Seconds, AXValueDescription: 56, 0,59"10 PASS focused FieldValueDescription() is "AXHelp: Milliseconds, AXValueDescription: 789, 0,999"11 PASS focused FieldValueDescription() is "AXHelp: AM/PM, AXValueDescription: PM, 1,2"7 PASS focusedElementDescription() is "AXHelp: Hours, AXValueDescription: 12, intValue:12, range:1-12" 8 PASS focusedElementDescription() is "AXHelp: Minutes, AXValueDescription: 34, intValue:34, range:0-59" 9 PASS focusedElementDescription() is "AXHelp: Seconds, AXValueDescription: 56, intValue:56, range:0-59" 10 PASS focusedElementDescription() is "AXHelp: Milliseconds, AXValueDescription: 789, intValue:789, range:0-999" 11 PASS focusedElementDescription() is "AXHelp: AM/PM, AXValueDescription: PM, intValue:2, range:1-2" 12 12 Empty value 13 PASS focused FieldValueDescription() is "AXHelp: AM/PM, AXValueDescription: blank, 1,2"14 PASS focused FieldValueDescription() is "AXHelp: Milliseconds, AXValueDescription: blank, 0,999"15 PASS focused FieldValueDescription() is "AXHelp: Seconds, AXValueDescription: blank, 0,59"16 PASS focused FieldValueDescription() is "AXHelp: Minutes, AXValueDescription: blank, 0,59"17 PASS focused FieldValueDescription() is "AXHelp: Hours, AXValueDescription: blank, 1,12"13 PASS focusedElementDescription() is "AXHelp: AM/PM, AXValueDescription: blank, intValue:0, range:1-2" 14 PASS focusedElementDescription() is "AXHelp: Milliseconds, AXValueDescription: blank, intValue:0, range:0-999" 15 PASS focusedElementDescription() is "AXHelp: Seconds, AXValueDescription: blank, intValue:0, range:0-59" 16 PASS focusedElementDescription() is "AXHelp: Minutes, AXValueDescription: blank, intValue:0, range:0-59" 17 PASS focusedElementDescription() is "AXHelp: Hours, AXValueDescription: blank, intValue:0, range:1-12" 18 18 19 19 PASS successfullyParsed is true -
trunk/LayoutTests/fast/forms/time-multiple-fields/time-multiple-fields-ax-aria-attributes.html
r128404 r140803 3 3 <head> 4 4 <script src="../../../fast/js/resources/js-test-pre.js"></script> 5 <script src="../resources/multiple-fields-ax-aria-attributes.js"></script> 5 6 </head> 6 7 <body> … … 15 16 return; 16 17 } 17 }18 19 function focusedFieldValueDescription()20 {21 if (!window.accessibilityController)22 return;23 var element = accessibilityController.focusedElement24 return element.helpText + ", " + element.valueDescription + ", " + element.minValue + ", " + element.maxValue;25 18 } 26 19 … … 39 32 debug('Non-empty value'); 40 33 testInput.focus(); 41 shouldBeEqualToString('focusedFieldValueDescription()', 'AXHelp: Hours, AXValueDescription: 12, 1,12');34 checkFocusedElementAXAttributes('AXHelp: Hours, AXValueDescription: 12, intValue:12, range:1-12'); 42 35 keyDown('\t'); 43 shouldBeEqualToString('focusedFieldValueDescription()', 'AXHelp: Minutes, AXValueDescription: 34, 0,59');36 checkFocusedElementAXAttributes('AXHelp: Minutes, AXValueDescription: 34, intValue:34, range:0-59'); 44 37 keyDown('\t'); 45 shouldBeEqualToString('focusedFieldValueDescription()', 'AXHelp: Seconds, AXValueDescription: 56, 0,59');38 checkFocusedElementAXAttributes('AXHelp: Seconds, AXValueDescription: 56, intValue:56, range:0-59'); 46 39 keyDown('\t'); 47 shouldBeEqualToString('focusedFieldValueDescription()', 'AXHelp: Milliseconds, AXValueDescription: 789, 0,999');40 checkFocusedElementAXAttributes('AXHelp: Milliseconds, AXValueDescription: 789, intValue:789, range:0-999'); 48 41 keyDown('\t'); 49 shouldBeEqualToString('focusedFieldValueDescription()', 'AXHelp: AM/PM, AXValueDescription: PM, 1,2');42 checkFocusedElementAXAttributes('AXHelp: AM/PM, AXValueDescription: PM, intValue:2, range:1-2'); 50 43 51 44 debug('Empty value'); 52 45 keyDown('\b'); 53 shouldBeEqualToString('focusedFieldValueDescription()', 'AXHelp: AM/PM, AXValueDescription: blank, 1,2');46 checkFocusedElementAXAttributes('AXHelp: AM/PM, AXValueDescription: blank, intValue:0, range:1-2'); 54 47 keyDown('\t', ['shiftKey']); 55 48 keyDown('\b'); 56 shouldBeEqualToString('focusedFieldValueDescription()', 'AXHelp: Milliseconds, AXValueDescription: blank, 0,999');49 checkFocusedElementAXAttributes('AXHelp: Milliseconds, AXValueDescription: blank, intValue:0, range:0-999'); 57 50 keyDown('\t', ['shiftKey']); 58 51 keyDown('\b'); 59 shouldBeEqualToString('focusedFieldValueDescription()', 'AXHelp: Seconds, AXValueDescription: blank, 0,59');52 checkFocusedElementAXAttributes('AXHelp: Seconds, AXValueDescription: blank, intValue:0, range:0-59'); 60 53 keyDown('\t', ['shiftKey']); 61 54 keyDown('\b'); 62 shouldBeEqualToString('focusedFieldValueDescription()', 'AXHelp: Minutes, AXValueDescription: blank, 0,59');55 checkFocusedElementAXAttributes('AXHelp: Minutes, AXValueDescription: blank, intValue:0, range:0-59'); 63 56 keyDown('\t', ['shiftKey']); 64 57 keyDown('\b'); 65 shouldBeEqualToString('focusedFieldValueDescription()', 'AXHelp: Hours, AXValueDescription: blank, 1,12');58 checkFocusedElementAXAttributes('AXHelp: Hours, AXValueDescription: blank, intValue:0, range:1-12'); 66 59 67 60 debug(''); -
trunk/Source/WebCore/ChangeLog
r140800 r140803 1 2013-01-25 Kent Tamura <tkent@chromium.org> 2 3 INPUT_MULTIPLE_FIELDS_UI: Inconsistent value of aria-valuetext attribute 4 https://bugs.webkit.org/show_bug.cgi?id=107897 5 6 Reviewed by Kentaro Hara. 7 8 aria-valuetext and aria-valuenow attributes had inconsistent values in 9 a case of initial empty state and a case that a user clears a field. 10 11 - aria-valuetext attribute should have "blank" message in the initial 12 empty state. 13 - aria-valuenow attribute should be removed in the cleared empty state. 14 15 Also, we have a bug that aira-valuenow had a symbolic value such as "AM" 16 "January". It should always have a numeric value according to the 17 specification. 18 http://www.w3.org/TR/wai-aria/states_and_properties#aria-valuenow 19 20 No new tests. Updates fast/forms/*-multiple-fields/*-multiple-fields-ax-aria-attributes.html. 21 22 * html/shadow/DateTimeFieldElement.cpp: 23 (WebCore::DateTimeFieldElement::DateTimeFieldElement): 24 Set "blank" message to aria-valuetext attribute. 25 (WebCore::DateTimeFieldElement::updateVisibleValue): 26 aria-valuenow attribute should be a numeric value. Apply String::number 27 to the return value of valueForARIAValueNow. 28 Remove aria-valuenow attribute if nothing is selected. 29 (WebCore::DateTimeFieldElement::valueForARIAValueNow): 30 Added. 31 * html/shadow/DateTimeFieldElement.h: 32 (DateTimeFieldElement): Declare valueForARIAValueNow. 33 34 * html/shadow/DateTimeSymbolicFieldElement.cpp: 35 (WebCore::DateTimeSymbolicFieldElement::valueForARIAValueNow): 36 Added. Returns 1 + internal selection index. 37 For example, the function returns 1 for January. 38 * html/shadow/DateTimeSymbolicFieldElement.h: 39 (DateTimeSymbolicFieldElement): Declare valueForARIAValueNow. 40 1 41 2013-01-24 Hans Wennborg <hans@chromium.org> 2 42 -
trunk/Source/WebCore/html/shadow/DateTimeFieldElement.cpp
r140791 r140803 51 51 // On accessibility, DateTimeFieldElement acts like spin button. 52 52 setAttribute(roleAttr, "spinbutton"); 53 setAttribute(aria_valuetextAttr, AXDateTimeFieldEmptyValueText()); 53 54 } 54 55 … … 207 208 208 209 textNode->replaceWholeText(newVisibleValue, ASSERT_NO_EXCEPTION); 209 setAttribute(aria_valuetextAttr, hasValue() ? newVisibleValue : AXDateTimeFieldEmptyValueText()); 210 setAttribute(aria_valuenowAttr, newVisibleValue); 210 if (hasValue()) { 211 setAttribute(aria_valuetextAttr, newVisibleValue); 212 setAttribute(aria_valuenowAttr, String::number(valueForARIAValueNow())); 213 } else { 214 setAttribute(aria_valuetextAttr, AXDateTimeFieldEmptyValueText()); 215 removeAttribute(aria_valuenowAttr); 216 } 211 217 212 218 if (eventBehavior == DispatchEvent && m_fieldOwner) … … 214 220 } 215 221 222 int DateTimeFieldElement::valueForARIAValueNow() const 223 { 224 return valueAsInteger(); 225 } 226 216 227 } // namespace WebCore 217 228 -
trunk/Source/WebCore/html/shadow/DateTimeFieldElement.h
r140791 r140803 88 88 void updateVisibleValue(EventBehavior); 89 89 virtual int valueAsInteger() const = 0; 90 virtual int valueForARIAValueNow() const; 90 91 91 92 private: -
trunk/Source/WebCore/html/shadow/DateTimeSymbolicFieldElement.cpp
r140791 r140803 145 145 } 146 146 147 int DateTimeSymbolicFieldElement::valueForARIAValueNow() const 148 { 149 // Synchronize with minimum/maximum adjustment in initialize(). 150 return m_selectedIndex + 1; 151 } 152 147 153 String DateTimeSymbolicFieldElement::visibleEmptyValue() const 148 154 { -
trunk/Source/WebCore/html/shadow/DateTimeSymbolicFieldElement.h
r140791 r140803 59 59 virtual void stepUp() OVERRIDE FINAL; 60 60 virtual String value() const OVERRIDE FINAL; 61 virtual int valueForARIAValueNow() const OVERRIDE FINAL; 61 62 virtual String visibleValue() const OVERRIDE FINAL; 62 63
Note: See TracChangeset
for help on using the changeset viewer.