mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Merge mozilla-central and b2g-inbound
This commit is contained in:
commit
a363946c09
@ -19,13 +19,13 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="d0d773c277a9105288ee35da2121f4ae62709be8"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="6f6df701391eccac1f38cb506b2fcf84e862323c"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3bb61a27cd2941b2ba9b616a11aaa44269210396"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>
|
||||
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="f0592d4814d738e3f8d840915ef799c13601bdef"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="ac3d46419118a5ac515940f748aaed3273d165d8"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="dbc46f0bc269791c52becbef22f84c63469ee8be"/>
|
||||
<!-- Stock Android things -->
|
||||
<project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/>
|
||||
<project name="platform/bionic" path="bionic" revision="c72b8f6359de7ed17c11ddc9dfdde3f615d188a9"/>
|
||||
|
@ -17,10 +17,10 @@
|
||||
</project>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="d0d773c277a9105288ee35da2121f4ae62709be8"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="6f6df701391eccac1f38cb506b2fcf84e862323c"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3bb61a27cd2941b2ba9b616a11aaa44269210396"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="ac3d46419118a5ac515940f748aaed3273d165d8"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="dbc46f0bc269791c52becbef22f84c63469ee8be"/>
|
||||
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
|
||||
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
|
||||
<!-- Stock Android things -->
|
||||
|
@ -15,7 +15,7 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="7945ca73e687be5edbc7b928dc7fe3a208242144">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="d0d773c277a9105288ee35da2121f4ae62709be8"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="6f6df701391eccac1f38cb506b2fcf84e862323c"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3bb61a27cd2941b2ba9b616a11aaa44269210396"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
@ -23,7 +23,7 @@
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
|
||||
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="ac3d46419118a5ac515940f748aaed3273d165d8"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="dbc46f0bc269791c52becbef22f84c63469ee8be"/>
|
||||
<!-- Stock Android things -->
|
||||
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="f92a936f2aa97526d4593386754bdbf02db07a12"/>
|
||||
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="6e47ff2790f5656b5b074407829ceecf3e6188c4"/>
|
||||
|
@ -19,13 +19,13 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="d0d773c277a9105288ee35da2121f4ae62709be8"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="6f6df701391eccac1f38cb506b2fcf84e862323c"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3bb61a27cd2941b2ba9b616a11aaa44269210396"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>
|
||||
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="f0592d4814d738e3f8d840915ef799c13601bdef"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="ac3d46419118a5ac515940f748aaed3273d165d8"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="dbc46f0bc269791c52becbef22f84c63469ee8be"/>
|
||||
<!-- Stock Android things -->
|
||||
<project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/>
|
||||
<project name="platform/bionic" path="bionic" revision="c72b8f6359de7ed17c11ddc9dfdde3f615d188a9"/>
|
||||
|
@ -17,10 +17,10 @@
|
||||
</project>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="d0d773c277a9105288ee35da2121f4ae62709be8"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="6f6df701391eccac1f38cb506b2fcf84e862323c"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3bb61a27cd2941b2ba9b616a11aaa44269210396"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="ac3d46419118a5ac515940f748aaed3273d165d8"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="dbc46f0bc269791c52becbef22f84c63469ee8be"/>
|
||||
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
|
||||
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
|
||||
<!-- Stock Android things -->
|
||||
|
@ -4,6 +4,6 @@
|
||||
"remote": "",
|
||||
"branch": ""
|
||||
},
|
||||
"revision": "87505dbb861f8c1e5437bcf92cc5a0040e6fdf3f",
|
||||
"revision": "220c395b5767fffd5348aea7b39795e96afca9b1",
|
||||
"repo_path": "/integration/gaia-central"
|
||||
}
|
||||
|
@ -17,12 +17,12 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="d0d773c277a9105288ee35da2121f4ae62709be8"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="6f6df701391eccac1f38cb506b2fcf84e862323c"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3bb61a27cd2941b2ba9b616a11aaa44269210396"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="ac3d46419118a5ac515940f748aaed3273d165d8"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="dbc46f0bc269791c52becbef22f84c63469ee8be"/>
|
||||
<!-- Stock Android things -->
|
||||
<project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/>
|
||||
<project name="platform/bionic" path="bionic" revision="d2eb6c7b6e1bc7643c17df2d9d9bcb1704d0b9ab"/>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="d0d773c277a9105288ee35da2121f4ae62709be8"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="6f6df701391eccac1f38cb506b2fcf84e862323c"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3bb61a27cd2941b2ba9b616a11aaa44269210396"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
|
@ -17,10 +17,10 @@
|
||||
</project>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="d0d773c277a9105288ee35da2121f4ae62709be8"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="6f6df701391eccac1f38cb506b2fcf84e862323c"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3bb61a27cd2941b2ba9b616a11aaa44269210396"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="ac3d46419118a5ac515940f748aaed3273d165d8"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="dbc46f0bc269791c52becbef22f84c63469ee8be"/>
|
||||
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
|
||||
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
|
||||
<!-- Stock Android things -->
|
||||
|
@ -17,12 +17,12 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="d0d773c277a9105288ee35da2121f4ae62709be8"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="6f6df701391eccac1f38cb506b2fcf84e862323c"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3bb61a27cd2941b2ba9b616a11aaa44269210396"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="ac3d46419118a5ac515940f748aaed3273d165d8"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="dbc46f0bc269791c52becbef22f84c63469ee8be"/>
|
||||
<project name="gonk-patches" path="patches" remote="b2g" revision="223a2421006e8f5da33f516f6891c87cae86b0f6"/>
|
||||
<!-- Stock Android things -->
|
||||
<project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/>
|
||||
|
@ -452,6 +452,11 @@ MozInputContext.prototype = {
|
||||
return;
|
||||
}
|
||||
|
||||
// Update context first before resolving promise to avoid race condition
|
||||
if (json.selectioninfo) {
|
||||
this.updateSelectionContext(json.selectioninfo);
|
||||
}
|
||||
|
||||
switch (msg.name) {
|
||||
case "Keyboard:SendKey:Result:OK":
|
||||
resolver.resolve();
|
||||
|
@ -224,6 +224,7 @@ let FormAssistant = {
|
||||
_documentEncoder: null,
|
||||
_editor: null,
|
||||
_editing: false,
|
||||
_selectionPrivate: null,
|
||||
|
||||
get focusedElement() {
|
||||
if (this._focusedElement && Cu.isDeadWrapper(this._focusedElement))
|
||||
@ -244,8 +245,6 @@ let FormAssistant = {
|
||||
return;
|
||||
|
||||
if (this.focusedElement) {
|
||||
this.focusedElement.removeEventListener('mousedown', this);
|
||||
this.focusedElement.removeEventListener('mouseup', this);
|
||||
this.focusedElement.removeEventListener('compositionend', this);
|
||||
if (this._observer) {
|
||||
this._observer.disconnect();
|
||||
@ -254,6 +253,10 @@ let FormAssistant = {
|
||||
if (!element) {
|
||||
this.focusedElement.blur();
|
||||
}
|
||||
if (this._selectionPrivate) {
|
||||
this._selectionPrivate.removeSelectionListener(this);
|
||||
this._selectionPrivate = null;
|
||||
}
|
||||
}
|
||||
|
||||
this._documentEncoder = null;
|
||||
@ -269,8 +272,6 @@ let FormAssistant = {
|
||||
}
|
||||
|
||||
if (element) {
|
||||
element.addEventListener('mousedown', this);
|
||||
element.addEventListener('mouseup', this);
|
||||
element.addEventListener('compositionend', this);
|
||||
if (isContentEditable(element)) {
|
||||
this._documentEncoder = getDocumentEncoder(element);
|
||||
@ -280,6 +281,12 @@ let FormAssistant = {
|
||||
// Add a nsIEditorObserver to monitor the text content of the focused
|
||||
// element.
|
||||
this._editor.addEditorObserver(this);
|
||||
|
||||
let selection = this._editor.selection;
|
||||
if (selection) {
|
||||
this._selectionPrivate = selection.QueryInterface(Ci.nsISelectionPrivate);
|
||||
this._selectionPrivate.addSelectionListener(this);
|
||||
}
|
||||
}
|
||||
|
||||
// If our focusedElement is removed from DOM we want to handle it properly
|
||||
@ -305,6 +312,10 @@ let FormAssistant = {
|
||||
this.focusedElement = element;
|
||||
},
|
||||
|
||||
notifySelectionChanged: function(aDocument, aSelection, aReason) {
|
||||
this.updateSelection();
|
||||
},
|
||||
|
||||
get documentEncoder() {
|
||||
return this._documentEncoder;
|
||||
},
|
||||
@ -376,32 +387,6 @@ let FormAssistant = {
|
||||
}
|
||||
break;
|
||||
|
||||
case 'mousedown':
|
||||
if (!this.focusedElement) {
|
||||
break;
|
||||
}
|
||||
|
||||
// We only listen for this event on the currently focused element.
|
||||
// When the mouse goes down, note the cursor/selection position
|
||||
this.updateSelection();
|
||||
break;
|
||||
|
||||
case 'mouseup':
|
||||
if (!this.focusedElement) {
|
||||
break;
|
||||
}
|
||||
|
||||
// We only listen for this event on the currently focused element.
|
||||
// When the mouse goes up, see if the cursor has moved (or the
|
||||
// selection changed) since the mouse went down. If it has, we
|
||||
// need to tell the keyboard about it
|
||||
range = getSelectionRange(this.focusedElement);
|
||||
if (range[0] !== this.selectionStart ||
|
||||
range[1] !== this.selectionEnd) {
|
||||
this.updateSelection();
|
||||
}
|
||||
break;
|
||||
|
||||
case "resize":
|
||||
if (!this.isKeyboardOpened)
|
||||
return;
|
||||
@ -423,25 +408,12 @@ let FormAssistant = {
|
||||
}
|
||||
break;
|
||||
|
||||
case "input":
|
||||
if (this.focusedElement) {
|
||||
// When the text content changes, notify the keyboard
|
||||
this.updateSelection();
|
||||
}
|
||||
break;
|
||||
|
||||
case "keydown":
|
||||
if (!this.focusedElement) {
|
||||
break;
|
||||
}
|
||||
|
||||
CompositionManager.endComposition('');
|
||||
|
||||
// We use 'setTimeout' to wait until the input element accomplishes the
|
||||
// change in selection range.
|
||||
content.setTimeout(function() {
|
||||
this.updateSelection();
|
||||
}.bind(this), 0);
|
||||
break;
|
||||
|
||||
case "keyup":
|
||||
@ -450,7 +422,6 @@ let FormAssistant = {
|
||||
}
|
||||
|
||||
CompositionManager.endComposition('');
|
||||
|
||||
break;
|
||||
|
||||
case "compositionend":
|
||||
@ -526,7 +497,8 @@ let FormAssistant = {
|
||||
|
||||
if (json.requestId && doKeypress) {
|
||||
sendAsyncMessage("Forms:SendKey:Result:OK", {
|
||||
requestId: json.requestId
|
||||
requestId: json.requestId,
|
||||
selectioninfo: this.getSelectionInfo()
|
||||
});
|
||||
}
|
||||
else if (json.requestId && !doKeypress) {
|
||||
@ -584,8 +556,6 @@ let FormAssistant = {
|
||||
break;
|
||||
}
|
||||
|
||||
this.updateSelection();
|
||||
|
||||
if (json.requestId) {
|
||||
sendAsyncMessage("Forms:SetSelectionRange:Result:OK", {
|
||||
requestId: json.requestId,
|
||||
@ -652,6 +622,7 @@ let FormAssistant = {
|
||||
json.clauses);
|
||||
sendAsyncMessage("Forms:SetComposition:Result:OK", {
|
||||
requestId: json.requestId,
|
||||
selectioninfo: this.getSelectionInfo()
|
||||
});
|
||||
break;
|
||||
}
|
||||
@ -660,6 +631,7 @@ let FormAssistant = {
|
||||
CompositionManager.endComposition(json.text);
|
||||
sendAsyncMessage("Forms:EndComposition:Result:OK", {
|
||||
requestId: json.requestId,
|
||||
selectioninfo: this.getSelectionInfo()
|
||||
});
|
||||
break;
|
||||
}
|
||||
@ -758,15 +730,29 @@ let FormAssistant = {
|
||||
};
|
||||
},
|
||||
|
||||
_selectionTimeout: null,
|
||||
|
||||
// Notify when the selection range changes
|
||||
updateSelection: function fa_updateSelection() {
|
||||
if (!this.focusedElement) {
|
||||
return;
|
||||
}
|
||||
let selectionInfo = this.getSelectionInfo();
|
||||
if (selectionInfo.changed) {
|
||||
sendAsyncMessage("Forms:SelectionChange", this.getSelectionInfo());
|
||||
// A call to setSelectionRange on input field causes 2 selection changes
|
||||
// one to [0,0] and one to actual value. Both are sent in same tick.
|
||||
// Prevent firing two events in that scenario, always only use the last 1.
|
||||
//
|
||||
// It is also a workaround for Bug 1053048, which prevents
|
||||
// getSelectionInfo() accessing selectionStart or selectionEnd in the
|
||||
// callback function of nsISelectionListener::NotifySelectionChanged().
|
||||
if (this._selectionTimeout) {
|
||||
content.clearTimeout(this._selectionTimeout);
|
||||
}
|
||||
this._selectionTimeout = content.setTimeout(function() {
|
||||
if (!this.focusedElement) {
|
||||
return;
|
||||
}
|
||||
let selectionInfo = this.getSelectionInfo();
|
||||
if (selectionInfo.changed) {
|
||||
sendAsyncMessage("Forms:SelectionChange", selectionInfo);
|
||||
}
|
||||
}.bind(this), 0);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -15,6 +15,7 @@ support-files =
|
||||
[test_bug953044.html]
|
||||
[test_bug960946.html]
|
||||
[test_bug978918.html]
|
||||
[test_bug1026997.html]
|
||||
[test_bug1043828.html]
|
||||
[test_delete_focused_element.html]
|
||||
[test_sendkey_cancel.html]
|
||||
|
101
dom/inputmethod/mochitest/test_bug1026997.html
Normal file
101
dom/inputmethod/mochitest/test_bug1026997.html
Normal file
@ -0,0 +1,101 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1026997
|
||||
-->
|
||||
<head>
|
||||
<title>SelectionChange on InputMethod API.</title>
|
||||
<script type="application/javascript;version=1.7" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript;version=1.7" src="inputmethod_common.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1026997">Mozilla Bug 1026997</a>
|
||||
<p id="display"></p>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="application/javascript;version=1.7">
|
||||
|
||||
inputmethod_setup(function() {
|
||||
runTest();
|
||||
});
|
||||
|
||||
// The frame script running in file_test_app.html.
|
||||
function appFrameScript() {
|
||||
let input = content.document.getElementById('test-input');
|
||||
|
||||
input.focus();
|
||||
|
||||
function next(start, end) {
|
||||
input.setSelectionRange(start, end);
|
||||
}
|
||||
|
||||
addMessageListener("test:KeyBoard:nextSelection", function(event) {
|
||||
let json = event.json;
|
||||
next(json[0], json[1]);
|
||||
});
|
||||
}
|
||||
|
||||
function runTest() {
|
||||
let actions = [
|
||||
[0, 4],
|
||||
[1, 1],
|
||||
[3, 3],
|
||||
[2, 3]
|
||||
];
|
||||
|
||||
let counter = 0;
|
||||
let mm = null;
|
||||
let ic = null;
|
||||
|
||||
let im = navigator.mozInputMethod;
|
||||
im.oninputcontextchange = function() {
|
||||
ok(true, 'inputcontextchange event was fired.');
|
||||
im.oninputcontextchange = null;
|
||||
|
||||
ic = im.inputcontext;
|
||||
if (!ic) {
|
||||
ok(false, 'Should have a non-null inputcontext.');
|
||||
inputmethod_cleanup();
|
||||
return;
|
||||
}
|
||||
|
||||
ic.onselectionchange = function() {
|
||||
is(ic.selectionStart, actions[counter][0], "start");
|
||||
is(ic.selectionEnd, actions[counter][1], "end");
|
||||
|
||||
if (++counter === actions.length) {
|
||||
inputmethod_cleanup();
|
||||
return;
|
||||
}
|
||||
|
||||
next();
|
||||
};
|
||||
|
||||
next();
|
||||
};
|
||||
|
||||
// Set current page as an input method.
|
||||
SpecialPowers.wrap(im).setActive(true);
|
||||
|
||||
// Create an app frame to recieve keyboard inputs.
|
||||
let app = document.createElement('iframe');
|
||||
app.src = 'file_test_app.html';
|
||||
app.setAttribute('mozbrowser', true);
|
||||
document.body.appendChild(app);
|
||||
app.addEventListener('mozbrowserloadend', function() {
|
||||
mm = SpecialPowers.getBrowserFrameMessageManager(app);
|
||||
mm.loadFrameScript('data:,(' + appFrameScript.toString() + ')();', false);
|
||||
next();
|
||||
});
|
||||
|
||||
function next() {
|
||||
if (ic && mm) {
|
||||
mm.sendAsyncMessage('test:KeyBoard:nextSelection', actions[counter]);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -236,9 +236,16 @@ SystemMessageInternal.prototype = {
|
||||
|
||||
debug("Broadcasting " + aType + " " + JSON.stringify(aMessage) +
|
||||
'; extra = ' + JSON.stringify(aExtra));
|
||||
|
||||
let shouldDispatchFunc = this._getMessageConfigurator(aType).shouldDispatch;
|
||||
|
||||
// Find pages that registered an handler for this type.
|
||||
this._pages.forEach(function(aPage) {
|
||||
if (aPage.type == aType) {
|
||||
if (aPage.type !== aType) {
|
||||
return;
|
||||
}
|
||||
|
||||
let doDispatch = () => {
|
||||
let result = this._sendMessageCommon(aType,
|
||||
aMessage,
|
||||
messageID,
|
||||
@ -258,7 +265,22 @@ SystemMessageInternal.prototype = {
|
||||
this._queueMessage(aPage, aMessage, messageID);
|
||||
|
||||
this._openAppPage(aPage, aMessage, aExtra, result);
|
||||
};
|
||||
|
||||
if ('function' !== typeof shouldDispatchFunc) {
|
||||
// If the configurator has no 'shouldDispatch' defined,
|
||||
// always dispatch this message.
|
||||
doDispatch();
|
||||
return;
|
||||
}
|
||||
|
||||
shouldDispatchFunc(aPage.manifestURL, aPage.pageURL, aType, aMessage, aExtra)
|
||||
.then(aShouldDispatch => {
|
||||
if (aShouldDispatch) {
|
||||
doDispatch();
|
||||
}
|
||||
});
|
||||
|
||||
}, this);
|
||||
},
|
||||
|
||||
|
@ -56,7 +56,7 @@ interface nsISystemMessagesWrapper: nsISupports
|
||||
* Implements an interface to allow specific message types to
|
||||
* configure some behaviors
|
||||
*/
|
||||
[scriptable, uuid(a0e970f6-faa9-4605-89d6-fafae8b10a80)]
|
||||
[scriptable, uuid(31b78730-21c6-11e4-8c21-0800200c9a66)]
|
||||
interface nsISystemMessagesConfigurator: nsISupports
|
||||
{
|
||||
/*
|
||||
@ -64,4 +64,13 @@ interface nsISystemMessagesConfigurator: nsISupports
|
||||
* that the app will be brought to the front always.
|
||||
*/
|
||||
readonly attribute boolean mustShowRunningApp;
|
||||
|
||||
/*
|
||||
* A broadcast filter for a specific message type.
|
||||
*
|
||||
* @return Promise which resolves with |true| or |false| to indicate if
|
||||
* we want to dispatch this message.
|
||||
*/
|
||||
jsval shouldDispatch(in DOMString manifestURL, in DOMString pageURL,
|
||||
in DOMString type, in jsval message, [optional] in jsval extra);
|
||||
};
|
||||
|
@ -331,7 +331,13 @@ bool ASessionDescription::parseNTPRange(
|
||||
|
||||
*npt2 = strtof(s, &end);
|
||||
|
||||
if (end == s || *end != '\0') {
|
||||
if (end == s) {
|
||||
// No end time available. It means to play until the end of the clip.
|
||||
return true;
|
||||
}
|
||||
|
||||
if (*end != '\0') {
|
||||
// Malformed format in NTP description.
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user