Confirmed users
58
edits
m (→Proposed API) |
m (→Proposed API) |
||
Line 288: | Line 288: | ||
* @param length The range length. Defaults to the end of the text. | * @param length The range length. Defaults to the end of the text. | ||
*/ | */ | ||
Promise<DOMString> getText( | Promise<DOMString> getText(optional start, optional length); | ||
// The start and stop position of the selection. | // The start and stop position of the selection. | ||
Line 328: | Line 328: | ||
* @param length The length of text to replace. Defaults to 0. | * @param length The length of text to replace. Defaults to 0. | ||
*/ | */ | ||
<strike>Promise<boolean> replaceSurroundingText(DOMString text, | <strike>Promise<boolean> replaceSurroundingText(DOMString text, optional long offset, optional long length);</strike> | ||
Promise<void> replaceSurroundingText(DOMString text, | Promise<void> replaceSurroundingText(DOMString text, optional long offset, optional long length); | ||
/* | /* | ||
Line 356: | Line 356: | ||
* Alternative: sendKey(KeyboardEvent event), but we will likely waste memory for creating the KeyboardEvent object. | * Alternative: sendKey(KeyboardEvent event), but we will likely waste memory for creating the KeyboardEvent object. | ||
*/ | */ | ||
<strike>Promise<boolean> sendKey(long keyCode, long charCode, | <strike>Promise<boolean> sendKey(long keyCode, long charCode, optional long modifiers);</strike> | ||
Promise<void> sendKey(long keyCode, long charCode, | Promise<void> sendKey(long keyCode, long charCode, optional long modifiers); | ||
/* | /* | ||
Line 380: | Line 380: | ||
* To finish composition and commit text to current input field, an IME should call |endComposition|. | * To finish composition and commit text to current input field, an IME should call |endComposition|. | ||
*/ | */ | ||
<strike>Promise<boolean> setComposition(DOMString text, | <strike>Promise<boolean> setComposition(DOMString text, optional long cursor);</strike> | ||
Promise<void> setComposition(DOMString text, | Promise<void> setComposition(DOMString text, optional long cursor); | ||
/* | /* | ||
Line 393: | Line 393: | ||
* |replaceSurroundingText|, |deleteSurroundingText|, user moving the cursor, changing the focus, etc. | * |replaceSurroundingText|, |deleteSurroundingText|, user moving the cursor, changing the focus, etc. | ||
*/ | */ | ||
<strike>Promise<boolean> endComposition( | <strike>Promise<boolean> endComposition(optional DOMString text);</strike> | ||
Promise<void> endComposition(DOMString text); | Promise<void> endComposition(DOMString text); | ||
}; | }; |