mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-04-02 20:42:49 +00:00
Bug 924896 - [AccessFu] Exposing the type attribute for entries such as search, url, tel, etc. r=eeejay
--- accessible/src/jsat/OutputGenerator.jsm | 17 +++++++++++- .../tests/mochitest/jsat/test_utterance_order.html | 27 ++++++++++++++++++++ .../en-US/chrome/accessibility/AccessFu.properties | 6 ++++ 3 files changed, 49 insertions(+), 1 deletions(-)
This commit is contained in:
parent
cdfd3810bd
commit
8fbad16a3b
@ -204,6 +204,19 @@ this.OutputGenerator = {
|
|||||||
landmark);
|
landmark);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds an entry type attribute to the description if available.
|
||||||
|
* @param {Array} aDesc Description array.
|
||||||
|
* @param {nsIAccessible} aAccessible current accessible object.
|
||||||
|
*/
|
||||||
|
_addType: function _addType(aDesc, aAccessible) {
|
||||||
|
let typeName = Utils.getAttributes(aAccessible)['text-input-type'];
|
||||||
|
if (!typeName) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
aDesc.push(gStringBundle.GetStringFromName('textInputType_' + typeName));
|
||||||
|
},
|
||||||
|
|
||||||
get outputOrder() {
|
get outputOrder() {
|
||||||
if (!this._utteranceOrder) {
|
if (!this._utteranceOrder) {
|
||||||
this._utteranceOrder = new PrefCache('accessibility.accessfu.utterance');
|
this._utteranceOrder = new PrefCache('accessibility.accessfu.utterance');
|
||||||
@ -306,8 +319,10 @@ this.OutputGenerator = {
|
|||||||
if (aFlags & INCLUDE_DESC) {
|
if (aFlags & INCLUDE_DESC) {
|
||||||
let desc = this._getLocalizedStates(aStates);
|
let desc = this._getLocalizedStates(aStates);
|
||||||
let roleStr = this._getLocalizedRole(aRoleStr);
|
let roleStr = this._getLocalizedRole(aRoleStr);
|
||||||
if (roleStr)
|
if (roleStr) {
|
||||||
|
this._addType(desc, aAccessible);
|
||||||
desc.push(roleStr);
|
desc.push(roleStr);
|
||||||
|
}
|
||||||
output.push(desc.join(' '));
|
output.push(desc.join(' '));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,6 +83,29 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=753984
|
|||||||
"Column 1 Row 1", "Fruits and vegetables",
|
"Column 1 Row 1", "Fruits and vegetables",
|
||||||
"table with 1 column and 1 row"
|
"table with 1 column and 1 row"
|
||||||
]]
|
]]
|
||||||
|
}, {
|
||||||
|
accOrElmOrID: "email",
|
||||||
|
expected: [
|
||||||
|
["e-mail entry", "test@example.com"],
|
||||||
|
["test@example.com", "e-mail entry"]
|
||||||
|
]
|
||||||
|
}, {
|
||||||
|
accOrElmOrID: "search",
|
||||||
|
expected: [
|
||||||
|
["search entry", "This is a search"],
|
||||||
|
["This is a search", "search entry"]
|
||||||
|
]
|
||||||
|
}, {
|
||||||
|
accOrElmOrID: "tel",
|
||||||
|
expected: [
|
||||||
|
["telephone entry", "555-5555"], ["555-5555", "telephone entry"]
|
||||||
|
]
|
||||||
|
}, {
|
||||||
|
accOrElmOrID: "url",
|
||||||
|
expected: [
|
||||||
|
["URL entry", "http://example.com"],
|
||||||
|
["http://example.com", "URL entry"]
|
||||||
|
]
|
||||||
}, {
|
}, {
|
||||||
// Test pivot to list from li_one.
|
// Test pivot to list from li_one.
|
||||||
accOrElmOrID: "list",
|
accOrElmOrID: "list",
|
||||||
@ -276,6 +299,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=753984
|
|||||||
<label id="label4">Points:
|
<label id="label4">Points:
|
||||||
<input id="input4" type="range" name="points" min="1" max="10" value="3">
|
<input id="input4" type="range" name="points" min="1" max="10" value="3">
|
||||||
</label>
|
</label>
|
||||||
|
<input id="email" type="email" value="test@example.com" />
|
||||||
|
<input id="search" type="search" value="This is a search" />
|
||||||
|
<input id="tel" type="tel" value="555-5555" />
|
||||||
|
<input id="url" type="url" value="http://example.com" />
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -72,6 +72,12 @@ definition = definition
|
|||||||
# More sophisticated roles which are not actual numeric roles
|
# More sophisticated roles which are not actual numeric roles
|
||||||
textarea = text area
|
textarea = text area
|
||||||
|
|
||||||
|
# Text input types
|
||||||
|
textInputType_email = e-mail
|
||||||
|
textInputType_search = search
|
||||||
|
textInputType_tel = telephone
|
||||||
|
textInputType_url = URL
|
||||||
|
|
||||||
# More sophisticated object descriptions
|
# More sophisticated object descriptions
|
||||||
headingLevel = heading level %S
|
headingLevel = heading level %S
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user