Bug 796544 - Pass the inputmode attribute value to mozKeyboard. r=cpeterson

This commit is contained in:
David Flanagan 2012-10-12 14:51:13 -07:00
Родитель 995765df19
Коммит 6a13d90e9a
1 изменённых файлов: 9 добавлений и 4 удалений

Просмотреть файл

@ -259,12 +259,17 @@ function getJSON(element) {
}
}
// If Gecko knows about the inputmode attribute, use that value.
// Otherwise, query the attribute explicitly, but be sure to convert
// to lowercase
let inputmode = element.inputmode || element.getAttribute('inputmode');
// Gecko supports the inputmode attribute on text fields (but not textareas).
// But it doesn't recognize "verbatim" and other modes that we're interested
// in in Gaia, and the inputmode property returns "auto" for any value
// that gecko does not support. So we must query the inputmode attribute
// with getAttribute() rather than just using the inputmode property here.
// See https://bugzilla.mozilla.org/show_bug.cgi?id=746142
let inputmode = element.getAttribute('inputmode');
if (inputmode) {
inputmode = inputmode.toLowerCase();
} else {
inputmode = '';
}
return {