Bug 1001325 - Create valid WebIDL object for MozInputContext. r=fabrice

This commit is contained in:
Yuan Xulei 2014-07-03 18:10:13 +08:00
parent 5796eaac19
commit 47b81b8325

View File

@ -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",