mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Merge fx-team to m-c.
This commit is contained in:
commit
f4b675ef9c
@ -6950,6 +6950,12 @@ var TabContextMenu = {
|
||||
for (let menuItem of menuItems)
|
||||
menuItem.disabled = disabled;
|
||||
|
||||
#ifdef NIGHTLY_BUILD
|
||||
menuItems = aPopupMenu.getElementsByAttribute("tbattr", "tabbrowser-remote");
|
||||
for (let menuItem of menuItems)
|
||||
menuItem.hidden = !gMultiProcessBrowser;
|
||||
#endif
|
||||
|
||||
disabled = gBrowser.visibleTabs.length == 1;
|
||||
menuItems = aPopupMenu.getElementsByAttribute("tbattr", "tabbrowser-multiple-visible");
|
||||
for (let menuItem of menuItems)
|
||||
|
@ -101,6 +101,10 @@
|
||||
accesskey="&moveToNewWindow.accesskey;"
|
||||
tbattr="tabbrowser-multiple"
|
||||
oncommand="gBrowser.replaceTabWithWindow(TabContextMenu.contextTab);"/>
|
||||
<menuitem id="context_openNonRemoteWindow" label="Open in new non-e10s window"
|
||||
tbattr="tabbrowser-remote"
|
||||
hidden="true"
|
||||
oncommand="gBrowser.openNonRemoteWindow(TabContextMenu.contextTab);"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="context_reloadAllTabs" label="&reloadAllTabs.label;" accesskey="&reloadAllTabs.accesskey;"
|
||||
tbattr="tabbrowser-multiple-visible"
|
||||
|
@ -2520,6 +2520,17 @@
|
||||
</body>
|
||||
</method>
|
||||
|
||||
<!-- Opens a given tab to a non-remote window. -->
|
||||
<method name="openNonRemoteWindow">
|
||||
<parameter name="aTab"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
let url = aTab.linkedBrowser.currentURI.spec;
|
||||
return window.openDialog("chrome://browser/content/", "_blank", "chrome,all,dialog=no,non-remote", url);
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
<method name="moveTabTo">
|
||||
<parameter name="aTab"/>
|
||||
<parameter name="aIndex"/>
|
||||
|
@ -63,19 +63,6 @@ final public class InputMethods {
|
||||
return METHOD_HTC_TOUCH_INPUT.equals(inputMethod);
|
||||
}
|
||||
|
||||
@RobocopTarget
|
||||
public static boolean shouldDisableUrlBarUpdate(Context context) {
|
||||
String inputMethod = getCurrentInputMethod(context);
|
||||
// HTC Touch Input does not react well to restarting during input (bug 909940)
|
||||
return METHOD_HTC_TOUCH_INPUT.equals(inputMethod);
|
||||
}
|
||||
|
||||
public static boolean shouldDelayUrlBarUpdate(Context context) {
|
||||
String inputMethod = getCurrentInputMethod(context);
|
||||
return METHOD_SAMSUNG.equals(inputMethod) ||
|
||||
METHOD_SWIFTKEY.equals(inputMethod);
|
||||
}
|
||||
|
||||
public static boolean isGestureKeyboard(Context context) {
|
||||
// SwiftKey is a gesture keyboard, but it doesn't seem to need any special-casing
|
||||
// to do AwesomeBar auto-spacing.
|
||||
|
@ -58,8 +58,6 @@ public class ToolbarEditText extends CustomEditText
|
||||
|
||||
// Type of the URL bar go/search button
|
||||
private TextType mToolbarTextType;
|
||||
// Type of the keyboard go/search button (cannot be EMPTY)
|
||||
private TextType mKeyboardTextType;
|
||||
|
||||
private OnCommitListener mCommitListener;
|
||||
private OnDismissListener mDismissListener;
|
||||
@ -72,14 +70,11 @@ public class ToolbarEditText extends CustomEditText
|
||||
// The user typed part of the autocomplete result
|
||||
private String mAutoCompletePrefix = null;
|
||||
|
||||
private boolean mDelayRestartInput;
|
||||
|
||||
public ToolbarEditText(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
mContext = context;
|
||||
|
||||
mToolbarTextType = TextType.EMPTY;
|
||||
mKeyboardTextType = TextType.URL;
|
||||
}
|
||||
|
||||
void setOnCommitListener(OnCommitListener listener) {
|
||||
@ -158,23 +153,6 @@ public class ToolbarEditText extends CustomEditText
|
||||
mAutoCompletePrefix = null;
|
||||
}
|
||||
|
||||
private void updateKeyboardInputType() {
|
||||
// If the user enters a space, then we know they are entering
|
||||
// search terms, not a URL. We can then switch to text mode so,
|
||||
// 1) the IME auto-inserts spaces between words
|
||||
// 2) the IME doesn't reset input keyboard to Latin keyboard.
|
||||
final String text = getText().toString();
|
||||
final int currentInputType = getInputType();
|
||||
|
||||
final int newInputType = StringUtils.isSearchQuery(text, false)
|
||||
? (currentInputType & ~InputType.TYPE_TEXT_VARIATION_URI) // Text mode
|
||||
: (currentInputType | InputType.TYPE_TEXT_VARIATION_URI); // URL mode
|
||||
|
||||
if (newInputType != currentInputType) {
|
||||
setRawInputType(newInputType);
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean hasCompositionString(Editable content) {
|
||||
Object[] spans = content.getSpans(0, content.length(), Object.class);
|
||||
|
||||
@ -193,9 +171,6 @@ public class ToolbarEditText extends CustomEditText
|
||||
private void setTextType(TextType textType) {
|
||||
mToolbarTextType = textType;
|
||||
|
||||
if (textType != TextType.EMPTY) {
|
||||
mKeyboardTextType = textType;
|
||||
}
|
||||
if (mTextTypeListener != null) {
|
||||
mTextTypeListener.onTextTypeChange(this, textType);
|
||||
}
|
||||
@ -207,58 +182,13 @@ public class ToolbarEditText extends CustomEditText
|
||||
return;
|
||||
}
|
||||
|
||||
if (InputMethods.shouldDisableUrlBarUpdate(mContext)) {
|
||||
// Set button type to match the previous keyboard type
|
||||
setTextType(mKeyboardTextType);
|
||||
return;
|
||||
}
|
||||
|
||||
final int actionBits = getImeOptions() & EditorInfo.IME_MASK_ACTION;
|
||||
|
||||
final int imeAction;
|
||||
if (StringUtils.isSearchQuery(text, actionBits == EditorInfo.IME_ACTION_SEARCH)) {
|
||||
imeAction = EditorInfo.IME_ACTION_SEARCH;
|
||||
final TextType newType;
|
||||
if (StringUtils.isSearchQuery(text, mToolbarTextType == TextType.SEARCH_QUERY)) {
|
||||
newType = TextType.SEARCH_QUERY;
|
||||
} else {
|
||||
imeAction = EditorInfo.IME_ACTION_GO;
|
||||
newType = TextType.URL;
|
||||
}
|
||||
|
||||
InputMethodManager imm = InputMethods.getInputMethodManager(mContext);
|
||||
if (imm == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
boolean restartInput = false;
|
||||
if (actionBits != imeAction) {
|
||||
int optionBits = getImeOptions() & ~EditorInfo.IME_MASK_ACTION;
|
||||
setImeOptions(optionBits | imeAction);
|
||||
|
||||
mDelayRestartInput = (imeAction == EditorInfo.IME_ACTION_GO) &&
|
||||
(InputMethods.shouldDelayUrlBarUpdate(mContext));
|
||||
|
||||
if (!mDelayRestartInput) {
|
||||
restartInput = true;
|
||||
}
|
||||
} else if (mDelayRestartInput) {
|
||||
// Only call delayed restartInput when actionBits == imeAction
|
||||
// so if there are two restarts in a row, the first restarts will
|
||||
// be discarded and the second restart will be properly delayed
|
||||
mDelayRestartInput = false;
|
||||
restartInput = true;
|
||||
}
|
||||
|
||||
if (!restartInput) {
|
||||
// If the text content was previously empty, the toolbar text type
|
||||
// is empty as well. Since the keyboard text type cannot be empty,
|
||||
// the two text types are now inconsistent. Reset the toolbar text
|
||||
// type here to the keyboard text type to ensure consistency.
|
||||
setTextType(mKeyboardTextType);
|
||||
return;
|
||||
}
|
||||
updateKeyboardInputType();
|
||||
imm.restartInput(ToolbarEditText.this);
|
||||
|
||||
setTextType(imeAction == EditorInfo.IME_ACTION_GO ?
|
||||
TextType.URL : TextType.SEARCH_QUERY);
|
||||
setTextType(newType);
|
||||
}
|
||||
|
||||
private class TextChangeListener implements TextWatcher {
|
||||
@ -301,11 +231,7 @@ public class ToolbarEditText extends CustomEditText
|
||||
}
|
||||
}
|
||||
|
||||
// If the edit text has a composition string, don't call updateGoButton().
|
||||
// That method resets IME and composition state will be broken.
|
||||
if (!hasCompositionString(s) || InputMethods.isGestureKeyboard(mContext)) {
|
||||
updateTextTypeFromText(text);
|
||||
}
|
||||
updateTextTypeFromText(text);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -463,11 +463,15 @@ Entry.prototype = {
|
||||
|
||||
// Add media:content to enclosures
|
||||
if (bagHasKey(this.fields, "mediacontent"))
|
||||
this._mediacontentToEnclosures();
|
||||
this._mediaToEnclosures("mediacontent");
|
||||
|
||||
// Add media:thumbnail to enclosures
|
||||
if (bagHasKey(this.fields, "mediathumbnail"))
|
||||
this._mediaToEnclosures("mediathumbnail");
|
||||
|
||||
// Add media:content in media:group to enclosures
|
||||
if (bagHasKey(this.fields, "mediagroup"))
|
||||
this._mediagroupToEnclosures();
|
||||
this._mediaToEnclosures("mediagroup", "mediacontent");
|
||||
},
|
||||
|
||||
__enclosure_map: null,
|
||||
@ -539,38 +543,15 @@ Entry.prototype = {
|
||||
this._addToEnclosures(enc);
|
||||
},
|
||||
|
||||
_mediacontentToEnclosures: function Entry_mediacontentToEnclosures() {
|
||||
var mediacontent = this.fields.getPropertyAsInterface("mediacontent", Ci.nsIArray);
|
||||
_mediaToEnclosures: function Entry_mediaToEnclosures(mediaType, contentType) {
|
||||
var content = this.fields.getPropertyAsInterface(mediaType, Ci.nsIArray);
|
||||
|
||||
for (var i = 0; i < mediacontent.length; ++i) {
|
||||
var contentElement = mediacontent.queryElementAt(i, Ci.nsIWritablePropertyBag2);
|
||||
if (contentType)
|
||||
content = content.getPropertyAsInterface(contentType, Ci.nsIArray);
|
||||
|
||||
// media:content don't require url, but if it's not there, we should
|
||||
// skip it.
|
||||
if (!bagHasKey(contentElement, "url"))
|
||||
continue;
|
||||
|
||||
var enc = Cc[BAG_CONTRACTID].createInstance(Ci.nsIWritablePropertyBag2);
|
||||
|
||||
// copy media:content bits over to equivalent enclosure bits
|
||||
enc.setPropertyAsAString("url", contentElement.getPropertyAsAString("url"));
|
||||
if (bagHasKey(contentElement, "type")) {
|
||||
enc.setPropertyAsAString("type", contentElement.getPropertyAsAString("type"));
|
||||
}
|
||||
if (bagHasKey(contentElement, "fileSize")) {
|
||||
enc.setPropertyAsAString("length", contentElement.getPropertyAsAString("fileSize"));
|
||||
}
|
||||
|
||||
this._addToEnclosures(enc);
|
||||
}
|
||||
},
|
||||
|
||||
_mediagroupToEnclosures: function Entry_mediagroupToEnclosures() {
|
||||
var group = this.fields.getPropertyAsInterface("mediagroup", Ci.nsIPropertyBag2);
|
||||
|
||||
var content = group.getPropertyAsInterface("mediacontent", Ci.nsIArray);
|
||||
for (var i = 0; i < content.length; ++i) {
|
||||
var contentElement = content.queryElementAt(i, Ci.nsIWritablePropertyBag2);
|
||||
|
||||
// media:content don't require url, but if it's not there, we should
|
||||
// skip it.
|
||||
if (!bagHasKey(contentElement, "url"))
|
||||
@ -582,7 +563,12 @@ Entry.prototype = {
|
||||
enc.setPropertyAsAString("url", contentElement.getPropertyAsAString("url"));
|
||||
if (bagHasKey(contentElement, "type")) {
|
||||
enc.setPropertyAsAString("type", contentElement.getPropertyAsAString("type"));
|
||||
} else if (mediaType == "mediathumbnail") {
|
||||
// thumbnails won't have a type, but default to image types
|
||||
enc.setPropertyAsAString("type", "image/*");
|
||||
enc.setPropertyAsBool("thumbnail", true);
|
||||
}
|
||||
|
||||
if (bagHasKey(contentElement, "fileSize")) {
|
||||
enc.setPropertyAsAString("length", contentElement.getPropertyAsAString("fileSize"));
|
||||
}
|
||||
@ -1137,6 +1123,7 @@ function FeedProcessor() {
|
||||
"enclosure": new ElementInfo("enclosure", null, null, false),
|
||||
"media:content": new ElementInfo("mediacontent", null, null, true),
|
||||
"media:group": new ElementInfo("mediagroup", null, null, false),
|
||||
"media:thumbnail": new ElementInfo("mediathumbnail", null, null, true),
|
||||
"guid": new ElementInfo("guid", null, rssGuid, false)
|
||||
},
|
||||
|
||||
@ -1149,7 +1136,8 @@ function FeedProcessor() {
|
||||
},
|
||||
|
||||
"IN_MEDIAGROUP": {
|
||||
"media:content": new ElementInfo("mediacontent", null, null, true)
|
||||
"media:content": new ElementInfo("mediacontent", null, null, true),
|
||||
"media:thumbnail": new ElementInfo("mediathumbnail", null, null, true)
|
||||
},
|
||||
|
||||
/********* RSS1 **********/
|
||||
|
@ -9,7 +9,8 @@ Expect: var enc = feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntr
|
||||
<channel>
|
||||
<item>
|
||||
|
||||
<media:content fileSize="24986239" type="video/mpeg" url="http://dallas.example.com/joebob_050689.mpeg" />
|
||||
<media:content fileSize="24986239" type="video/mpeg" url="http://dallas.example.com/joebob_050689.mpeg" />
|
||||
<media:thumbnail url="http://dallas.example.com/joebob_050689.jpg" width="75" height="50"/>
|
||||
<author>jbb@dallas.example.com (Joe Bob Briggs)</author>
|
||||
<comments>http://example.org</comments>
|
||||
<title>test</title>
|
||||
|
@ -6,8 +6,9 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
let devtools_ = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}).devtools;
|
||||
let { createExtraActors, appendExtraActors } = devtools_.require("devtools/server/actors/common");
|
||||
const Services = require("Services");
|
||||
const { ActorPool, appendExtraActors, createExtraActors } = require("devtools/server/actors/common");
|
||||
const { DebuggerServer } = require("devtools/server/main");
|
||||
|
||||
/* Root actor for the remote debugging protocol. */
|
||||
|
||||
@ -338,3 +339,5 @@ RootActor.prototype.requestTypes = {
|
||||
"echo": RootActor.prototype.onEcho,
|
||||
"protocolDescription": RootActor.prototype.onProtocolDescription
|
||||
};
|
||||
|
||||
exports.RootActor = RootActor;
|
||||
|
@ -9,6 +9,7 @@
|
||||
let { Ci, Cu } = require("chrome");
|
||||
let Services = require("Services");
|
||||
let { createExtraActors, appendExtraActors } = require("devtools/server/actors/common");
|
||||
let { RootActor } = require("devtools/server/actors/root");
|
||||
let { AddonThreadActor, ThreadActor } = require("devtools/server/actors/script");
|
||||
let DevToolsUtils = require("devtools/toolkit/DevToolsUtils");
|
||||
|
||||
|
@ -219,7 +219,6 @@ var DebuggerServer = {
|
||||
|
||||
this.xpcInspector = Cc["@mozilla.org/jsinspector;1"].getService(Ci.nsIJSInspector);
|
||||
this.initTransport(aAllowConnectionCallback);
|
||||
this.addActors("resource://gre/modules/devtools/server/actors/root.js");
|
||||
|
||||
this._initialized = true;
|
||||
},
|
||||
|
@ -34,6 +34,7 @@ tryImport("resource://gre/modules/devtools/dbg-client.jsm");
|
||||
tryImport("resource://gre/modules/devtools/Loader.jsm");
|
||||
tryImport("resource://gre/modules/devtools/Console.jsm");
|
||||
|
||||
let { RootActor } = devtools.require("devtools/server/actors/root");
|
||||
let { BreakpointStore, LongStringActor, ThreadActor } = devtools.require("devtools/server/actors/script");
|
||||
|
||||
function testExceptionHook(ex) {
|
||||
@ -183,7 +184,6 @@ function attachTestTabAndResume(aClient, aTitle, aCallback) {
|
||||
*/
|
||||
function initTestDebuggerServer()
|
||||
{
|
||||
DebuggerServer.addActors("resource://gre/modules/devtools/server/actors/root.js");
|
||||
DebuggerServer.registerModule("devtools/server/actors/script");
|
||||
DebuggerServer.addActors("resource://test/testactors.js");
|
||||
// Allow incoming connections.
|
||||
@ -192,7 +192,6 @@ function initTestDebuggerServer()
|
||||
|
||||
function initTestTracerServer()
|
||||
{
|
||||
DebuggerServer.addActors("resource://gre/modules/devtools/server/actors/root.js");
|
||||
DebuggerServer.registerModule("devtools/server/actors/script");
|
||||
DebuggerServer.addActors("resource://test/testactors.js");
|
||||
DebuggerServer.registerModule("devtools/server/actors/tracer");
|
||||
|
@ -37,7 +37,7 @@ function newConnection(aPrefix)
|
||||
var conn;
|
||||
DebuggerServer.createRootActor = function (aConn) {
|
||||
conn = aConn;
|
||||
return new DebuggerServer.RootActor(aConn, {});
|
||||
return new RootActor(aConn, {});
|
||||
};
|
||||
|
||||
var transport = DebuggerServer.connectPipe(aPrefix);
|
||||
|
@ -3,6 +3,8 @@
|
||||
|
||||
const Cu = Components.utils;
|
||||
const devtools = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}).devtools;
|
||||
const { ActorPool, appendExtraActors, createExtraActors } = require("devtools/server/actors/common");
|
||||
const { RootActor } = devtools.require("devtools/server/actors/root");
|
||||
const { ThreadActor } = devtools.require("devtools/server/actors/script");
|
||||
|
||||
var gTestGlobals = [];
|
||||
|
Loading…
Reference in New Issue
Block a user