Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. EditContext

EditContext

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Experimental:This is anexperimental technology
Check theBrowser compatibility table carefully before using this in production.

TheEditContext interface represents the text edit context of an element that was made editable by using theEditContext API.

TheEditContext API can be used to build rich text editors on the web that support advanced text input experiences, such asInput Method Editor (IME) composition, emoji picker, or any other platform-specific editing-related UI surfaces.

Constructor

EditContext()Experimental

Returns a newEditContext instance.

Instance properties

EditContext.textRead onlyExperimental

The editable content of the element.

EditContext.selectionStartRead onlyExperimental

The offset, within the editable text content, of the start of the current selection.

EditContext.selectionEndRead onlyExperimental

The offset, within the editable text content, of the end of the current selection.

EditContext.characterBoundsRangeStartRead onlyExperimental

The offset, within the editable text content, where the last IME composition started.

Instance methods

EditContext is based on theEventTarget interface, and includes its methods.

EditContext.attachedElements()Experimental

AnArray containing oneHTMLElement object which is the element that's associated with theEditContext object.

EditContext.characterBounds()Experimental

The list of bounding rectangles for the characters in theEditContext object.

EditContext.updateText()Experimental

Updates the internal text content of theEditContext object.

EditContext.updateSelection()Experimental

Updates the internal state of the selection within the editable text context.

EditContext.updateControlBounds()Experimental

Informs the operating system about the position and size of the editable text region.

EditContext.updateSelectionBounds()Experimental

Informs the operating system about the position and size of the selection within the editable text region.

EditContext.updateCharacterBounds()Experimental

Informs the operating system about the position and size of the characters in theEditContext object.

Events

textupdateExperimental

Fired when the user has made changes to the text or selection.

textformatupdateExperimental

Fired when composition using anInput Method Editor (IME) window is happening and the IME decides that certain parts of the text being composed should be formatted differently to indicate the composition state.

characterboundsupdateExperimental

Fired when the operating system needs to know the size and position of certain characters within the editable text region of theEditContext object, in order to display an IME window.

compositionstartExperimental

Fired when composition using an IME window is starting.

compositionendExperimental

Fired when composition using an IME window is ending.

Specifications

Specification
EditContext API
# dom-editcontext

Browser compatibility

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp