mozilla

Revision 35113 of compositionstart

  • Revision slug: DOM/DOM_event_reference/compositionstart
  • Revision title: compositionstart
  • Revision id: 35113
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment checkpoint; 119 words added, 25 words removed

Revision Content

The DOM compositionstart event is fired when indirect input of text begins, such as when the user starts using an IME to input text. It's represented by the {{ domxref("CompositionEvent") }} interface.

Properties

 

Specification

DOM Level3 Events

Type

compositionstart

Interface

CompositionEvent

Sync/Async

Sync

Bubbles

Yes

Target

Element

Cancelable

Yes, but Gecko doesn't allow to cancel compositionstart, see Notes.

Default action

Launches the text composition system, but Gecko fires compositionstart when the system starts composition actually.

Browser compatibility

{{ CompatibilityTable() }}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support {{ CompatUnknown() }} {{ CompatGeckoDesktop("9.0") }} {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }}
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support {{ CompatUnknown() }} {{ CompatGeckoMobile("9.0") }} {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }}

Gecko notes

Spec of DOM Level3 Events said compositionstart is cancelable, however, Gecko doesn't allow to cancel compositionstart event.

Gecko fires this event when IME starts composition and some platforms don't have API for cancelling the composition forcibly. Gecko cannot know whether a keyboard event will start composition or not until IME actually starts composition.

Therefore, Gecko cannot support preventDefault() of compositionstart.

Revision Source

<p>The DOM <code>compositionstart</code> event is fired when indirect input of text begins, such as when the user starts using an IME to input text. It's represented by the {{ domxref("CompositionEvent") }} interface.</p>
<h2>Properties</h2>
<p> </p>
<h2>Specification</h2>
<p><a class="external" href="http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#event-type-compositionstart" title="http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#event-type-compositionstart">DOM Level3 Events</a></p>
<h2>Type</h2>
<p><code>compositionstart</code></p>
<h2>Interface</h2>
<p><a href="/en/DOM/CompositionEvent" title="en/DOM/CompositionEvent">CompositionEvent</a></p>
<h2>Sync/Async</h2>
<p>Sync</p>
<h2>Bubbles</h2>
<p>Yes</p>
<h2>Target</h2>
<p>Element</p>
<h2>Cancelable</h2>
<p>Yes, but Gecko doesn't allow to cancel <code>compositionstart</code>, see Notes.</p>
<h2>Default action</h2>
<p>Launches the text composition system, but Gecko fires <code>compositionstart</code> when the system starts composition actually.</p>
<h2>Browser compatibility</h2>
<p>{{ CompatibilityTable() }}</p>
<div id="compat-desktop"> <table class="compat-table"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari</th> </tr> <tr> <td>Basic support</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatGeckoDesktop("9.0") }}</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatUnknown() }}</td> </tr> </tbody> </table>
</div>
<div id="compat-mobile"> <table class="compat-table"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatGeckoMobile("9.0") }}</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatUnknown() }}</td> </tr> </tbody> </table>
</div>
<h3>Gecko notes</h3>
<p>Spec of DOM Level3 Events said <code>compositionstart</code> is cancelable, however, Gecko doesn't allow to cancel <code>compositionstart</code> event.</p>
<p>Gecko fires this event when IME starts composition and some platforms don't have API for cancelling the composition forcibly. Gecko cannot know whether a keyboard event will start composition or not until IME actually starts composition.</p>
<p>Therefore, Gecko cannot support <code>preventDefault()</code> of <code>compositionstart</code>.</p>
Revert to this revision