diff --git a/dom/inputmethod/MozKeyboard.js b/dom/inputmethod/MozKeyboard.js index 6b584279b76..7bec21534a5 100644 --- a/dom/inputmethod/MozKeyboard.js +++ b/dom/inputmethod/MozKeyboard.js @@ -104,6 +104,7 @@ function MozInputMethod() { } MozInputMethod.prototype = { _inputcontext: null, + _wrappedInputContext: null, _layouts: {}, _window: null, _isSystem: false, @@ -211,7 +212,7 @@ MozInputMethod.prototype = { if (!WindowMap.isActive(this._window)) { return null; } - return this._inputcontext; + return this._wrappedInputContext; }, set oninputcontextchange(handler) { @@ -226,6 +227,7 @@ MozInputMethod.prototype = { if (this._inputcontext) { this._inputcontext.destroy(); this._inputcontext = null; + this._wrappedInputContext = null; this._mgmt._supportsSwitching = false; } @@ -236,6 +238,10 @@ MozInputMethod.prototype = { this._inputcontext = new MozInputContext(data); this._inputcontext.init(this._window); + // inputcontext will be exposed as a WebIDL object. Create its + // content-side object explicitly to avoid Bug 1001325. + this._wrappedInputContext = + this._window.MozInputContext._create(this._window, this._inputcontext); } let event = new this._window.Event("inputcontextchange",