WebAPI/KeboardIME: Difference between revisions

Jump to navigation Jump to search
m
Adjust indentation
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
    * The input mode string.
      * It can be one of the following values:
    * https://bugzilla.mozilla.org/show_bug.cgi?id=796544
      * "none"
    * It can be one of the following values:
      * "verbatim"    - no capitalization, no word suggestions
    * "none"
      * "latin"      - word suggestions but no capitalization
    * "verbatim"    - no capitalization, no word suggestions
      * "latin-prose" - word suggestions and capitalization at the start of sentences
    * "latin"      - word suggestions but no capitalization
      * "latin-name"  - word suggestions and capitalize each word
    * "latin-prose" - word suggestions and capitalization at the start of sentences
      * "digit"      - digits(0-9) only.
    * "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
    // User moves the cursor, changes the selection, or alters the composing text length
    attribute EventHandler onselectionchange;
    attribute EventHandler onselectionchange;
   
   
    // TODO: maybe the parameters could be simpler?
    // 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)
    // Or Promise<boolean> sendKey(KeyboardEvent event)
   
   
    /*
    /*
    *  Get the whole text content of the input field.
      *  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.
      * 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 text The string to be replaced with.
    * @param offset The offset from the cursor position where replacing starts. Defaults to 0.
      * @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.
      * @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);
   
   
Confirmed users
58

edits

Navigation menu