Confirmed users
58
edits
m (Adjust indentation) |
|||
Line 68: | Line 68: | ||
// The tag name of input field, which is enum of "input", "textarea", or "contenteditable" | // The tag name of input field, which is enum of "input", "textarea", or "contenteditable" | ||
DOMString name; | DOMString name; | ||
// The type of the input field, which is enum of text, number, password, url, search and email. | // The type of the input field, which is enum of text, number, password, url, search and email. | ||
DOMString type; | DOMString type; | ||
/* | |||
* The input mode string. | |||
* https://bugzilla.mozilla.org/show_bug.cgi?id=796544 | |||
* It can be one of the following values: | |||
* "none" | |||
* "verbatim" - no capitalization, no word suggestions | |||
* "latin" - word suggestions but no capitalization | |||
* "latin-prose" - word suggestions and capitalization at the start of sentences | |||
* "latin-name" - word suggestions and capitalize each word | |||
* "digit" - digits(0-9) only. | |||
*/ | |||
DOMString inputmode; | DOMString inputmode; | ||
/* | /* | ||
* The primary language for the input field. | * The primary language for the input field. | ||
Line 114: | Line 117: | ||
attribute SurroundingTextChangeEventHandler onsurroundingtextchange; | attribute SurroundingTextChangeEventHandler onsurroundingtextchange; | ||
// User moves the cursor, changes the selection, or alters the composing text length | |||
attribute EventHandler onselectionchange; | |||
// TODO: maybe the parameters could be simpler? | |||
Promise<boolean> sendKey(long keyCode, long charCode, long modifiers); | Promise<boolean> sendKey(long keyCode, long charCode, long modifiers); | ||
// Or Promise<boolean> sendKey(KeyboardEvent event) | |||
/* | |||
* Get the whole text content of the input field. | |||
*/ | |||
Promise<DOMString> getText(); | Promise<DOMString> getText(); | ||
/* | |||
* Commit text to current input field and replace text around cursor position. It will clear the current composition. | |||
* | |||
* @param text The string to be replaced with. | |||
* @param offset The offset from the cursor position where replacing starts. Defaults to 0. | |||
* @param length The length of text to replace. Defaults to 0. | |||
*/ | |||
Promise<boolean> commitText(DOMString text, [optional] long offset, [optional] long length); | Promise<boolean> commitText(DOMString text, [optional] long offset, [optional] long length); | ||