зеркало из https://github.com/mozilla/gecko-dev.git
Merge mozilla-central to inbound. a=merge CLOSED TREE
This commit is contained in:
Коммит
e36630f23c
|
@ -312,10 +312,6 @@ pref("browser.urlbar.timesBeforeHidingSuggestionsHint", 4);
|
|||
// suggestions.
|
||||
pref("browser.urlbar.maxCharsForSearchSuggestions", 20);
|
||||
|
||||
// Restrictions to current suggestions can also be applied (intersection).
|
||||
// Typed suggestion works only if history is set to true.
|
||||
pref("browser.urlbar.suggest.history.onlyTyped", false);
|
||||
|
||||
pref("browser.urlbar.formatting.enabled", true);
|
||||
pref("browser.urlbar.trimURLs", true);
|
||||
|
||||
|
@ -1172,7 +1168,6 @@ pref("services.sync.prefs.sync.browser.urlbar.matchBuckets", true);
|
|||
pref("services.sync.prefs.sync.browser.urlbar.maxRichResults", true);
|
||||
pref("services.sync.prefs.sync.browser.urlbar.suggest.bookmark", true);
|
||||
pref("services.sync.prefs.sync.browser.urlbar.suggest.history", true);
|
||||
pref("services.sync.prefs.sync.browser.urlbar.suggest.history.onlyTyped", true);
|
||||
pref("services.sync.prefs.sync.browser.urlbar.suggest.openpage", true);
|
||||
pref("services.sync.prefs.sync.browser.urlbar.suggest.searches", true);
|
||||
pref("services.sync.prefs.sync.dom.disable_open_during_load", true);
|
||||
|
|
|
@ -3,17 +3,15 @@
|
|||
|
||||
// Tests find bar auto-close behavior
|
||||
|
||||
var newTab;
|
||||
const TEST_PATH = getRootDirectory(gTestPath).replace("chrome://mochitests/content", "https://example.com");
|
||||
|
||||
add_task(async function findbar_test() {
|
||||
waitForExplicitFinish();
|
||||
newTab = BrowserTestUtils.addTab(gBrowser, "about:blank");
|
||||
let newTab = BrowserTestUtils.addTab(gBrowser, "about:blank");
|
||||
gBrowser.selectedTab = newTab;
|
||||
|
||||
let promise = ContentTask.spawn(newTab.linkedBrowser, null, async function() {
|
||||
await ContentTaskUtils.waitForEvent(this, "DOMContentLoaded", false);
|
||||
});
|
||||
BrowserTestUtils.loadURI(newTab.linkedBrowser, "http://example.com/browser/" +
|
||||
"browser/base/content/test/general/test_bug628179.html");
|
||||
let url = TEST_PATH + "test_bug628179.html";
|
||||
let promise = BrowserTestUtils.browserLoaded(newTab.linkedBrowser, false, url);
|
||||
BrowserTestUtils.loadURI(newTab.linkedBrowser, url);
|
||||
await promise;
|
||||
|
||||
await gFindBarPromise;
|
||||
|
@ -22,7 +20,7 @@ add_task(async function findbar_test() {
|
|||
await new ContentTask.spawn(newTab.linkedBrowser, null, async function() {
|
||||
let iframe = content.document.getElementById("iframe");
|
||||
let awaitLoad = ContentTaskUtils.waitForEvent(iframe, "load", false);
|
||||
iframe.src = "http://example.org/";
|
||||
iframe.src = "https://example.org/";
|
||||
await awaitLoad;
|
||||
});
|
||||
|
||||
|
@ -31,6 +29,5 @@ add_task(async function findbar_test() {
|
|||
|
||||
gFindBar.close();
|
||||
gBrowser.removeTab(newTab);
|
||||
finish();
|
||||
});
|
||||
|
||||
|
|
|
@ -34,9 +34,8 @@ add_task(async function init() {
|
|||
});
|
||||
|
||||
add_task(async function mainTest() {
|
||||
// Trigger an initial search. Use the "$" token to restrict matches to search
|
||||
// suggestions.
|
||||
await promiseAutocompleteResultPopup("$ test", window);
|
||||
// Trigger an initial search. Restrict matches to search suggestions.
|
||||
await promiseAutocompleteResultPopup(`${UrlbarTokenizer.RESTRICT.SEARCH} test`, window);
|
||||
await promiseSuggestionsPresent("Waiting for initial suggestions");
|
||||
|
||||
// Now synthesize typing a character. promiseAutocompleteResultPopup doesn't
|
||||
|
|
|
@ -2,16 +2,14 @@
|
|||
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
ChromeUtils.defineModuleGetter(this, "PlacesUtils",
|
||||
"resource://gre/modules/PlacesUtils.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "PlacesTestUtils",
|
||||
"resource://testing-common/PlacesTestUtils.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "Preferences",
|
||||
"resource://gre/modules/Preferences.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "HttpServer",
|
||||
"resource://testing-common/httpd.js");
|
||||
ChromeUtils.defineModuleGetter(this, "SearchTestUtils",
|
||||
"resource://testing-common/SearchTestUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
HttpServer: "resource://testing-common/httpd.js",
|
||||
PlacesUtils: "resource://gre/modules/PlacesUtils.jsm",
|
||||
PlacesTestUtils: "resource://testing-common/PlacesTestUtils.jsm",
|
||||
Preferences: "resource://gre/modules/Preferences.jsm",
|
||||
SearchTestUtils: "resource://testing-common/SearchTestUtils.jsm",
|
||||
UrlbarTokenizer: "resource:///modules/UrlbarTokenizer.jsm",
|
||||
});
|
||||
|
||||
SearchTestUtils.init(Assert, registerCleanupFunction);
|
||||
|
||||
|
|
|
@ -97,11 +97,6 @@ const PREF_URLBAR_DEFAULTS = new Map([
|
|||
// Results will include the user's history when this is true.
|
||||
["suggest.history", true],
|
||||
|
||||
// Results will include the user's history when this is true, but only those
|
||||
// URLs with the "typed" flag (which includes but isn't limited to URLs the
|
||||
// user has typed in the urlbar).
|
||||
["suggest.history.onlyTyped", false],
|
||||
|
||||
// Results will include switch-to-tab results when this is true.
|
||||
["suggest.openpage", true],
|
||||
|
||||
|
@ -131,12 +126,14 @@ const PREF_OTHER_DEFAULTS = new Map([
|
|||
["keyword.enabled", true],
|
||||
]);
|
||||
|
||||
const TYPES = [
|
||||
"history",
|
||||
"bookmark",
|
||||
"openpage",
|
||||
"searches",
|
||||
];
|
||||
// Maps preferences under browser.urlbar.suggest to behavior names, as defined
|
||||
// in mozIPlacesAutoComplete.
|
||||
const SUGGEST_PREF_TO_BEHAVIOR = {
|
||||
history: "history",
|
||||
bookmark: "bookmark",
|
||||
openpage: "openpage",
|
||||
searches: "search",
|
||||
};
|
||||
|
||||
const PREF_TYPES = new Map([
|
||||
["boolean", "Bool"],
|
||||
|
@ -211,8 +208,6 @@ class Preferences {
|
|||
// Some prefs may influence others.
|
||||
if (pref == "matchBuckets") {
|
||||
this._map.delete("matchBucketsSearch");
|
||||
} else if (pref == "suggest.history") {
|
||||
this._map.delete("suggest.history.onlyTyped");
|
||||
}
|
||||
if (pref == "autocomplete.enabled" || pref.startsWith("suggest.")) {
|
||||
this._map.delete("defaultBehavior");
|
||||
|
@ -293,16 +288,11 @@ class Preferences {
|
|||
}
|
||||
return this.get("matchBuckets");
|
||||
}
|
||||
case "suggest.history.onlyTyped": {
|
||||
// If history is not set, onlyTyped value should be ignored.
|
||||
return this.get("suggest.history") && this._readPref(pref);
|
||||
}
|
||||
case "defaultBehavior": {
|
||||
let val = 0;
|
||||
for (let type of [...TYPES, "history.onlyTyped"]) {
|
||||
let behavior = type == "history.onlyTyped" ? "TYPED" : type.toUpperCase();
|
||||
val |= this.get("suggest." + type) &&
|
||||
Ci.mozIPlacesAutoComplete["BEHAVIOR_" + behavior];
|
||||
for (let type of Object.keys(SUGGEST_PREF_TO_BEHAVIOR)) {
|
||||
let behavior = `BEHAVIOR_${SUGGEST_PREF_TO_BEHAVIOR[type].toUpperCase()}`;
|
||||
val |= this.get("suggest." + type) && Ci.mozIPlacesAutoComplete[behavior];
|
||||
}
|
||||
return val;
|
||||
}
|
||||
|
@ -313,8 +303,7 @@ class Preferences {
|
|||
// bookmarks are disabled, it defaults to open pages.
|
||||
let val = Ci.mozIPlacesAutoComplete.BEHAVIOR_RESTRICT;
|
||||
if (this.get("suggest.history")) {
|
||||
val |= Ci.mozIPlacesAutoComplete.BEHAVIOR_HISTORY |
|
||||
Ci.mozIPlacesAutoComplete.BEHAVIOR_TYPED;
|
||||
val |= Ci.mozIPlacesAutoComplete.BEHAVIOR_HISTORY;
|
||||
} else if (this.get("suggest.bookmark")) {
|
||||
val |= Ci.mozIPlacesAutoComplete.BEHAVIOR_BOOKMARK;
|
||||
} else {
|
||||
|
@ -352,22 +341,23 @@ class Preferences {
|
|||
this._linkingPrefs = true;
|
||||
try {
|
||||
let branch = Services.prefs.getBranch(PREF_URLBAR_BRANCH);
|
||||
const SUGGEST_PREFS = Object.keys(SUGGEST_PREF_TO_BEHAVIOR);
|
||||
if (changedPref.startsWith("suggest.")) {
|
||||
// A suggest pref changed, fix autocomplete.enabled.
|
||||
branch.setBoolPref("autocomplete.enabled",
|
||||
TYPES.some(type => this.get("suggest." + type)));
|
||||
SUGGEST_PREFS.some(type => this.get("suggest." + type)));
|
||||
} else if (this.get("autocomplete.enabled")) {
|
||||
// If autocomplete is enabled and all of the suggest.* prefs are
|
||||
// disabled, reset the suggest.* prefs to their default value.
|
||||
if (TYPES.every(type => !this.get("suggest." + type))) {
|
||||
for (let type of TYPES) {
|
||||
if (SUGGEST_PREFS.every(type => !this.get("suggest." + type))) {
|
||||
for (let type of SUGGEST_PREFS) {
|
||||
let def = PREF_URLBAR_DEFAULTS.get("suggest." + type);
|
||||
branch.setBoolPref("suggest." + type, def);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// If autocomplete is disabled, deactivate all suggest preferences.
|
||||
for (let type of TYPES) {
|
||||
for (let type of SUGGEST_PREFS) {
|
||||
branch.setBoolPref("suggest." + type, false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,10 +43,25 @@ var UrlbarTokenizer = {
|
|||
RESTRICT_BOOKMARK: 5,
|
||||
RESTRICT_TAG: 6,
|
||||
RESTRICT_OPENPAGE: 7,
|
||||
RESTRICT_TYPED: 8,
|
||||
RESTRICT_SEARCH: 9,
|
||||
RESTRICT_TITLE: 10,
|
||||
RESTRICT_URL: 11,
|
||||
RESTRICT_SEARCH: 8,
|
||||
RESTRICT_TITLE: 9,
|
||||
RESTRICT_URL: 10,
|
||||
},
|
||||
|
||||
// The special characters below can be typed into the urlbar to restrict
|
||||
// the search to a certain category, like history, bookmarks or open pages; or
|
||||
// to force a match on just the title or url.
|
||||
// These restriction characters can be typed alone, or at word boundaries,
|
||||
// provided their meaning cannot be confused, for example # could be present
|
||||
// in a valid url, and thus it should not be interpreted as a restriction.
|
||||
RESTRICT: {
|
||||
HISTORY: "^",
|
||||
BOOKMARK: "*",
|
||||
TAG: "+",
|
||||
OPENPAGE: "%",
|
||||
SEARCH: "?",
|
||||
TITLE: "#",
|
||||
URL: "$",
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -168,22 +183,11 @@ var UrlbarTokenizer = {
|
|||
},
|
||||
};
|
||||
|
||||
// The special characters below can be typed into the urlbar to restrict
|
||||
// the search to a certain category, like history, bookmarks or open pages; or
|
||||
// to force a match on just the title or url.
|
||||
// These restriction characters can be typed alone, or at word boundaries,
|
||||
// provided their meaning cannot be confused, for example # could be present
|
||||
// in a valid url, and thus it should not be interpreted as a restriction.
|
||||
UrlbarTokenizer.CHAR_TO_TYPE_MAP = new Map([
|
||||
["^", UrlbarTokenizer.TYPE.RESTRICT_HISTORY],
|
||||
["*", UrlbarTokenizer.TYPE.RESTRICT_BOOKMARK],
|
||||
["+", UrlbarTokenizer.TYPE.RESTRICT_TAG],
|
||||
["%", UrlbarTokenizer.TYPE.RESTRICT_OPENPAGE],
|
||||
["~", UrlbarTokenizer.TYPE.RESTRICT_TYPED],
|
||||
["$", UrlbarTokenizer.TYPE.RESTRICT_SEARCH],
|
||||
["#", UrlbarTokenizer.TYPE.RESTRICT_TITLE],
|
||||
["@", UrlbarTokenizer.TYPE.RESTRICT_URL],
|
||||
]);
|
||||
const CHAR_TO_TYPE_MAP = new Map(
|
||||
Object.entries(UrlbarTokenizer.RESTRICT).map(
|
||||
([type, char]) => [ char, UrlbarTokenizer.TYPE[`RESTRICT_${type}`] ]
|
||||
)
|
||||
);
|
||||
|
||||
/**
|
||||
* Given a search string, splits it into string tokens.
|
||||
|
@ -195,8 +199,8 @@ function splitString(searchString) {
|
|||
// The first step is splitting on unicode whitespaces.
|
||||
let tokens = searchString.trim().split(UrlbarTokenizer.REGEXP_SPACES);
|
||||
let accumulator = [];
|
||||
let hasRestrictionToken = tokens.some(t => UrlbarTokenizer.CHAR_TO_TYPE_MAP.has(t));
|
||||
let chars = Array.from(UrlbarTokenizer.CHAR_TO_TYPE_MAP.keys()).join("");
|
||||
let hasRestrictionToken = tokens.some(t => CHAR_TO_TYPE_MAP.has(t));
|
||||
let chars = Array.from(CHAR_TO_TYPE_MAP.keys()).join("");
|
||||
logger.debug("Restriction chars", chars);
|
||||
for (let token of tokens) {
|
||||
// It's possible we have to split a token, if there's no separate restriction
|
||||
|
@ -248,7 +252,7 @@ function filterTokens(tokens) {
|
|||
value: token,
|
||||
type: UrlbarTokenizer.TYPE.TEXT,
|
||||
};
|
||||
let restrictionType = UrlbarTokenizer.CHAR_TO_TYPE_MAP.get(token);
|
||||
let restrictionType = CHAR_TO_TYPE_MAP.get(token);
|
||||
if (tokens.length > 1 &&
|
||||
restrictionType &&
|
||||
foundRestriction.length == 0 ||
|
||||
|
|
|
@ -25,72 +25,80 @@ add_task(async function test_tokenizer() {
|
|||
],
|
||||
},
|
||||
{ desc: "separate restriction char at beginning",
|
||||
searchString: "* test",
|
||||
searchString: `${UrlbarTokenizer.RESTRICT.BOOKMARK} test`,
|
||||
expectedTokens: [
|
||||
{ value: "*", type: UrlbarTokenizer.TYPE.RESTRICT_BOOKMARK },
|
||||
{ value: UrlbarTokenizer.RESTRICT.BOOKMARK, type: UrlbarTokenizer.TYPE.RESTRICT_BOOKMARK },
|
||||
{ value: "test", type: UrlbarTokenizer.TYPE.POSSIBLE_ORIGIN },
|
||||
],
|
||||
},
|
||||
{ desc: "separate restriction char at end",
|
||||
searchString: "test *",
|
||||
searchString: `test ${UrlbarTokenizer.RESTRICT.BOOKMARK}`,
|
||||
expectedTokens: [
|
||||
{ value: "test", type: UrlbarTokenizer.TYPE.POSSIBLE_ORIGIN },
|
||||
{ value: "*", type: UrlbarTokenizer.TYPE.RESTRICT_BOOKMARK },
|
||||
{ value: UrlbarTokenizer.RESTRICT.BOOKMARK, type: UrlbarTokenizer.TYPE.RESTRICT_BOOKMARK },
|
||||
],
|
||||
},
|
||||
{ desc: "boundary restriction char at end",
|
||||
searchString: "test*",
|
||||
searchString: `test${UrlbarTokenizer.RESTRICT.BOOKMARK}`,
|
||||
expectedTokens: [
|
||||
{ value: "test", type: UrlbarTokenizer.TYPE.POSSIBLE_ORIGIN },
|
||||
{ value: "*", type: UrlbarTokenizer.TYPE.RESTRICT_BOOKMARK },
|
||||
{ value: UrlbarTokenizer.RESTRICT.BOOKMARK, type: UrlbarTokenizer.TYPE.RESTRICT_BOOKMARK },
|
||||
],
|
||||
},
|
||||
{ desc: "double boundary restriction char",
|
||||
searchString: "*test#",
|
||||
searchString: `${UrlbarTokenizer.RESTRICT.BOOKMARK}test${UrlbarTokenizer.RESTRICT.TITLE}`,
|
||||
expectedTokens: [
|
||||
{ value: "*", type: UrlbarTokenizer.TYPE.RESTRICT_BOOKMARK },
|
||||
{ value: "test#", type: UrlbarTokenizer.TYPE.TEXT },
|
||||
{ value: UrlbarTokenizer.RESTRICT.BOOKMARK, type: UrlbarTokenizer.TYPE.RESTRICT_BOOKMARK },
|
||||
{ value: `test${UrlbarTokenizer.RESTRICT.TITLE}`, type: UrlbarTokenizer.TYPE.TEXT },
|
||||
],
|
||||
},
|
||||
{ desc: "double non-combinable restriction char, single char string",
|
||||
searchString: "t*$",
|
||||
searchString: `t${UrlbarTokenizer.RESTRICT.BOOKMARK}${UrlbarTokenizer.RESTRICT.SEARCH}`,
|
||||
expectedTokens: [
|
||||
{ value: "t*", type: UrlbarTokenizer.TYPE.TEXT },
|
||||
{ value: "$", type: UrlbarTokenizer.TYPE.RESTRICT_SEARCH },
|
||||
{ value: `t${UrlbarTokenizer.RESTRICT.BOOKMARK}`, type: UrlbarTokenizer.TYPE.TEXT },
|
||||
{ value: UrlbarTokenizer.RESTRICT.SEARCH, type: UrlbarTokenizer.TYPE.RESTRICT_SEARCH },
|
||||
],
|
||||
},
|
||||
{ desc: "only boundary restriction chars",
|
||||
searchString: "*#",
|
||||
searchString: `${UrlbarTokenizer.RESTRICT.BOOKMARK}${UrlbarTokenizer.RESTRICT.TITLE}`,
|
||||
expectedTokens: [
|
||||
{ value: "*", type: UrlbarTokenizer.TYPE.RESTRICT_BOOKMARK },
|
||||
{ value: "#", type: UrlbarTokenizer.TYPE.RESTRICT_TITLE },
|
||||
{ value: UrlbarTokenizer.RESTRICT.BOOKMARK, type: UrlbarTokenizer.TYPE.RESTRICT_BOOKMARK },
|
||||
{ value: UrlbarTokenizer.RESTRICT.TITLE, type: UrlbarTokenizer.TYPE.RESTRICT_TITLE },
|
||||
],
|
||||
},
|
||||
{ desc: "only the boundary restriction char",
|
||||
searchString: "*",
|
||||
searchString: UrlbarTokenizer.RESTRICT.BOOKMARK,
|
||||
expectedTokens: [
|
||||
{ value: "*", type: UrlbarTokenizer.TYPE.TEXT },
|
||||
{ value: UrlbarTokenizer.RESTRICT.BOOKMARK, type: UrlbarTokenizer.TYPE.TEXT },
|
||||
],
|
||||
},
|
||||
{ desc: "boundary restriction char on path",
|
||||
// Some restriction chars may be # or ?, that are also valid path parts.
|
||||
// The next 2 tests will check we consider those as part of url paths.
|
||||
{ desc: "boundary # char on path",
|
||||
searchString: "test/#",
|
||||
expectedTokens: [
|
||||
{ value: "test/#", type: UrlbarTokenizer.TYPE.POSSIBLE_URL },
|
||||
],
|
||||
},
|
||||
{ desc: "boundary ? char on path",
|
||||
searchString: "test/?",
|
||||
expectedTokens: [
|
||||
{ value: "test/?", type: UrlbarTokenizer.TYPE.POSSIBLE_URL },
|
||||
],
|
||||
},
|
||||
{ desc: "multiple boundary restriction chars suffix",
|
||||
searchString: "test ^ ~",
|
||||
searchString: `test ${UrlbarTokenizer.RESTRICT.HISTORY} ${UrlbarTokenizer.RESTRICT.TAG}`,
|
||||
expectedTokens: [
|
||||
{ value: "test", type: UrlbarTokenizer.TYPE.POSSIBLE_ORIGIN },
|
||||
{ value: "^", type: UrlbarTokenizer.TYPE.RESTRICT_HISTORY },
|
||||
{ value: "~", type: UrlbarTokenizer.TYPE.TEXT },
|
||||
{ value: UrlbarTokenizer.RESTRICT.HISTORY, type: UrlbarTokenizer.TYPE.RESTRICT_HISTORY },
|
||||
{ value: UrlbarTokenizer.RESTRICT.TAG, type: UrlbarTokenizer.TYPE.TEXT },
|
||||
],
|
||||
},
|
||||
{ desc: "multiple boundary restriction chars prefix",
|
||||
searchString: "^ ~ test",
|
||||
searchString: `${UrlbarTokenizer.RESTRICT.HISTORY} ${UrlbarTokenizer.RESTRICT.TAG} test`,
|
||||
expectedTokens: [
|
||||
{ value: "^", type: UrlbarTokenizer.TYPE.RESTRICT_HISTORY },
|
||||
{ value: "~", type: UrlbarTokenizer.TYPE.TEXT },
|
||||
{ value: UrlbarTokenizer.RESTRICT.HISTORY, type: UrlbarTokenizer.TYPE.RESTRICT_HISTORY },
|
||||
{ value: UrlbarTokenizer.RESTRICT.TAG, type: UrlbarTokenizer.TYPE.TEXT },
|
||||
{ value: "test", type: UrlbarTokenizer.TYPE.POSSIBLE_ORIGIN },
|
||||
],
|
||||
},
|
||||
|
@ -101,9 +109,9 @@ add_task(async function test_tokenizer() {
|
|||
],
|
||||
},
|
||||
{ desc: "ipv4 in bookmarks",
|
||||
searchString: "* 192.168.1.1:8",
|
||||
searchString: `${UrlbarTokenizer.RESTRICT.BOOKMARK} 192.168.1.1:8`,
|
||||
expectedTokens: [
|
||||
{ value: "*", type: UrlbarTokenizer.TYPE.RESTRICT_BOOKMARK },
|
||||
{ value: UrlbarTokenizer.RESTRICT.BOOKMARK, type: UrlbarTokenizer.TYPE.RESTRICT_BOOKMARK },
|
||||
{ value: "192.168.1.1:8", type: UrlbarTokenizer.TYPE.POSSIBLE_ORIGIN },
|
||||
],
|
||||
},
|
||||
|
|
|
@ -33,6 +33,7 @@ class App extends PureComponent {
|
|||
networkRuntimes: PropTypes.arrayOf(Types.runtime).isRequired,
|
||||
selectedPage: PropTypes.string,
|
||||
usbRuntimes: PropTypes.arrayOf(Types.runtime).isRequired,
|
||||
wifiEnabled: PropTypes.bool.isRequired,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -43,6 +44,7 @@ class App extends PureComponent {
|
|||
networkEnabled,
|
||||
networkLocations,
|
||||
selectedPage,
|
||||
wifiEnabled,
|
||||
} = this.props;
|
||||
|
||||
if (!selectedPage) {
|
||||
|
@ -57,6 +59,7 @@ class App extends PureComponent {
|
|||
dispatch,
|
||||
networkEnabled,
|
||||
networkLocations,
|
||||
wifiEnabled,
|
||||
});
|
||||
default:
|
||||
// All pages except for the CONNECT page are RUNTIME pages.
|
||||
|
@ -105,6 +108,7 @@ const mapStateToProps = state => {
|
|||
networkRuntimes: state.runtimes.networkRuntimes,
|
||||
selectedPage: state.ui.selectedPage,
|
||||
usbRuntimes: state.runtimes.usbRuntimes,
|
||||
wifiEnabled: state.ui.wifiEnabled,
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -39,11 +39,13 @@ class ConnectPage extends PureComponent {
|
|||
getString: PropTypes.func.isRequired,
|
||||
networkEnabled: PropTypes.bool.isRequired,
|
||||
networkLocations: PropTypes.arrayOf(PropTypes.string).isRequired,
|
||||
wifiEnabled: PropTypes.bool.isRequired,
|
||||
};
|
||||
}
|
||||
|
||||
renderWifi() {
|
||||
const { getString } = this.props;
|
||||
const { getString, wifiEnabled } = this.props;
|
||||
|
||||
return Localized(
|
||||
{
|
||||
id: "about-debugging-connect-wifi",
|
||||
|
@ -52,8 +54,9 @@ class ConnectPage extends PureComponent {
|
|||
ConnectSection(
|
||||
{
|
||||
icon: WIFI_ICON_SRC,
|
||||
title: "Via WiFi (Recommended)",
|
||||
title: "Via WiFi",
|
||||
},
|
||||
wifiEnabled ?
|
||||
ConnectSteps({
|
||||
steps: [
|
||||
getString("about-debugging-connect-wifi-step-same-network"),
|
||||
|
@ -61,7 +64,19 @@ class ConnectPage extends PureComponent {
|
|||
getString("about-debugging-connect-wifi-step-open-options"),
|
||||
getString("about-debugging-connect-wifi-step-enable-debug"),
|
||||
],
|
||||
})
|
||||
}) :
|
||||
Localized(
|
||||
{
|
||||
id: "about-debugging-connect-wifi-disabled",
|
||||
$pref: PREFERENCES.WIFI_ENABLED,
|
||||
},
|
||||
dom.div(
|
||||
{
|
||||
className: "connect-page__disabled-section",
|
||||
},
|
||||
"about-debugging-connect-wifi-disabled"
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
|
@ -65,6 +65,8 @@ const PAGES = {
|
|||
const PREFERENCES = {
|
||||
// Temporary preference without any default value until network locations are enabled.
|
||||
NETWORK_ENABLED: "devtools.aboutdebugging.network",
|
||||
// Temporary preference without any default value until wifi is enabled.
|
||||
WIFI_ENABLED: "devtools.aboutdebugging.wifi",
|
||||
};
|
||||
|
||||
const RUNTIME_PREFERENCE = {
|
||||
|
|
|
@ -42,7 +42,8 @@ function getUiState() {
|
|||
const collapsibilities = getDebugTargetCollapsibilities();
|
||||
const locations = getNetworkLocations();
|
||||
const networkEnabled = Services.prefs.getBoolPref(PREFERENCES.NETWORK_ENABLED, false);
|
||||
return new UiState(locations, collapsibilities, networkEnabled);
|
||||
const wifiEnabled = Services.prefs.getBoolPref(PREFERENCES.WIFI_ENABLED, false);
|
||||
return new UiState(locations, collapsibilities, networkEnabled, wifiEnabled);
|
||||
}
|
||||
|
||||
exports.configureStore = configureStore;
|
||||
|
|
|
@ -12,13 +12,14 @@ const {
|
|||
} = require("../constants");
|
||||
|
||||
function UiState(locations = [], debugTargetCollapsibilities = {},
|
||||
networkEnabled = false) {
|
||||
networkEnabled = false, wifiEnabled = false) {
|
||||
return {
|
||||
adbAddonStatus: null,
|
||||
debugTargetCollapsibilities,
|
||||
networkEnabled,
|
||||
networkLocations: locations,
|
||||
selectedPage: null,
|
||||
wifiEnabled,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -41,7 +41,12 @@ about-debugging-connect-title = Connect a Device
|
|||
|
||||
# WiFi section of the Connect page
|
||||
about-debugging-connect-wifi
|
||||
.title = Via WiFi (Recommended)
|
||||
.title = Via WiFi
|
||||
|
||||
# Temporary text displayed when wifi support is turned off via preferences.
|
||||
# { $pref } is the name of the preference that enables wifi
|
||||
# Do not localize
|
||||
about-debugging-connect-wifi-disabled = WiFi debugging currently under development. You can enable it with the preference "{ $pref }".
|
||||
|
||||
# WiFi section step by step guide
|
||||
about-debugging-connect-wifi-step-same-network = Ensure that your browser and device are on the same network
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
This is the debugger.html project output.
|
||||
See https://github.com/devtools-html/debugger.html
|
||||
|
||||
Version 94
|
||||
Version 95
|
||||
|
||||
Comparison: https://github.com/devtools-html/debugger.html/compare/release-93...release-94
|
||||
Comparison: https://github.com/devtools-html/debugger.html/compare/release-94...release-95
|
||||
|
||||
Packages:
|
||||
- babel-plugin-transform-es2015-modules-commonjs @6.26.2
|
||||
|
|
|
@ -2353,7 +2353,9 @@ menuseparator {
|
|||
flex-shrink: 0;
|
||||
justify-content: flex-end;
|
||||
background-color: var(--theme-toolbar-background);
|
||||
padding: 0 13px;
|
||||
padding: 0;
|
||||
padding-inline-start: 1px;
|
||||
padding-inline-end: 4px;
|
||||
}
|
||||
|
||||
.search-bottom-bar .search-modifiers {
|
||||
|
@ -2371,6 +2373,23 @@ menuseparator {
|
|||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.search-bottom-bar .search-modifiers button.close-btn.big img {
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
}
|
||||
|
||||
.search-bottom-bar .search-modifiers .pipe-divider {
|
||||
height: 70%;
|
||||
border: 1px solid var(--grey-20);
|
||||
vertical-align: middle;
|
||||
margin-inline-start: 0.8em;
|
||||
margin-inline-end: 0.3em;
|
||||
}
|
||||
|
||||
.theme-dark .search-bottom-bar .search-modifiers .pipe-divider {
|
||||
border-color: var(--grey-70);
|
||||
}
|
||||
|
||||
.search-bottom-bar .search-modifiers button i {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
@ -2389,6 +2408,10 @@ menuseparator {
|
|||
background: var(--theme-toolbar-background-hover);
|
||||
}
|
||||
|
||||
.search-bottom-bar .search-modifiers button.close-btn:hover {
|
||||
background: var(--theme-selection-background);
|
||||
}
|
||||
|
||||
.search-bottom-bar .search-modifiers button.active svg {
|
||||
fill: var(--theme-selection-background);
|
||||
}
|
||||
|
@ -3875,6 +3898,93 @@ img.skipPausing {
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
|
||||
|
||||
.xhr-input-form {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.xhr-input {
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
border: 1px;
|
||||
background-color: var(--theme-sidebar-background);
|
||||
font-size: 12px;
|
||||
padding: 0.5em 1.6em;
|
||||
color: var(--theme-body-color);
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
.xhr-input::placeholder {
|
||||
font-style: italic;
|
||||
color: var(--theme-comment);
|
||||
}
|
||||
|
||||
.xhr-input:focus {
|
||||
cursor: text;
|
||||
}
|
||||
|
||||
.xhr-input-container {
|
||||
display: flex;
|
||||
border: 1px solid transparent;
|
||||
}
|
||||
|
||||
.xhr-input-container.focused {
|
||||
border: 1px solid var(--theme-highlight-blue);
|
||||
}
|
||||
|
||||
:root.theme-dark .xhr-input-container.focused {
|
||||
border: 1px solid var(--blue-50);
|
||||
}
|
||||
|
||||
.xhr-input-container.error {
|
||||
border: 1px solid red;
|
||||
}
|
||||
|
||||
.xhr-container {
|
||||
border-left: 4px solid transparent;
|
||||
width: 100%;
|
||||
color: var(--theme-body-color);
|
||||
padding: 0.25em 1em;
|
||||
background-color: var(--theme-body-background);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
min-height: var(--breakpoint-expression-height);
|
||||
}
|
||||
|
||||
:root.theme-light .xhr-container:hover {
|
||||
background-color: var(--theme-selection-background-hover);
|
||||
}
|
||||
|
||||
:root.theme-dark .xhr-container:hover {
|
||||
background-color: var(--theme-selection-background-hover);
|
||||
}
|
||||
|
||||
.xhr-checkbox {
|
||||
margin-left: 0px;
|
||||
}
|
||||
|
||||
.xhr-label {
|
||||
max-width: calc(100% - var(--breakpoint-expression-right-clear-space));
|
||||
display: inline-block;
|
||||
cursor: pointer;
|
||||
flex-grow: 1;
|
||||
text-overflow: ellipsis;
|
||||
padding-inline-end: 8px;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.xhr-container .close-btn {
|
||||
offset-inline-end: 12px;
|
||||
inset-inline-end: 12px;
|
||||
offset-inline-start: auto;
|
||||
inset-inline-start: auto;
|
||||
position: absolute;
|
||||
top: 8px;
|
||||
}
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
|
||||
|
||||
.object-node.default-property {
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -16,6 +16,12 @@ exports.toggleBreakpoint = toggleBreakpoint;
|
|||
exports.toggleBreakpointsAtLine = toggleBreakpointsAtLine;
|
||||
exports.addOrToggleDisabledBreakpoint = addOrToggleDisabledBreakpoint;
|
||||
exports.toggleDisabledBreakpoint = toggleDisabledBreakpoint;
|
||||
exports.enableXHRBreakpoint = enableXHRBreakpoint;
|
||||
exports.disableXHRBreakpoint = disableXHRBreakpoint;
|
||||
exports.updateXHRBreakpoint = updateXHRBreakpoint;
|
||||
exports.togglePauseOnAny = togglePauseOnAny;
|
||||
exports.setXHRBreakpoint = setXHRBreakpoint;
|
||||
exports.removeXHRBreakpoint = removeXHRBreakpoint;
|
||||
|
||||
var _devtoolsSourceMap = require("devtools/client/shared/source-map/index.js");
|
||||
|
||||
|
@ -410,6 +416,124 @@ function toggleDisabledBreakpoint(line, column) {
|
|||
};
|
||||
}
|
||||
|
||||
function enableXHRBreakpoint(index, bp) {
|
||||
return ({
|
||||
dispatch,
|
||||
getState,
|
||||
client
|
||||
}) => {
|
||||
const xhrBreakpoints = (0, _selectors.getXHRBreakpoints)(getState());
|
||||
const breakpoint = bp || xhrBreakpoints.get(index);
|
||||
const enabledBreakpoint = { ...breakpoint,
|
||||
disabled: false
|
||||
};
|
||||
return dispatch({
|
||||
type: "ENABLE_XHR_BREAKPOINT",
|
||||
breakpoint: enabledBreakpoint,
|
||||
index,
|
||||
[_promise.PROMISE]: client.setXHRBreakpoint(breakpoint.path, breakpoint.method)
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
function disableXHRBreakpoint(index, bp) {
|
||||
return ({
|
||||
dispatch,
|
||||
getState,
|
||||
client
|
||||
}) => {
|
||||
const xhrBreakpoints = (0, _selectors.getXHRBreakpoints)(getState());
|
||||
const breakpoint = bp || xhrBreakpoints.get(index);
|
||||
const disabledBreakpoint = { ...breakpoint,
|
||||
disabled: true
|
||||
};
|
||||
return dispatch({
|
||||
type: "DISABLE_XHR_BREAKPOINT",
|
||||
breakpoint: disabledBreakpoint,
|
||||
index,
|
||||
[_promise.PROMISE]: client.removeXHRBreakpoint(breakpoint.path, breakpoint.method)
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
function updateXHRBreakpoint(index, path, method) {
|
||||
return ({
|
||||
dispatch,
|
||||
getState,
|
||||
client
|
||||
}) => {
|
||||
const xhrBreakpoints = (0, _selectors.getXHRBreakpoints)(getState());
|
||||
const breakpoint = xhrBreakpoints.get(index);
|
||||
const updatedBreakpoint = { ...breakpoint,
|
||||
path,
|
||||
method,
|
||||
text: `URL contains "${path}"`
|
||||
};
|
||||
return dispatch({
|
||||
type: "UPDATE_XHR_BREAKPOINT",
|
||||
breakpoint: updatedBreakpoint,
|
||||
index,
|
||||
[_promise.PROMISE]: Promise.all([client.removeXHRBreakpoint(breakpoint.path, breakpoint.method), client.setXHRBreakpoint(path, method)])
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
function togglePauseOnAny() {
|
||||
return ({
|
||||
dispatch,
|
||||
getState
|
||||
}) => {
|
||||
const xhrBreakpoints = (0, _selectors.getXHRBreakpoints)(getState());
|
||||
const index = xhrBreakpoints.findIndex(({
|
||||
path
|
||||
}) => path.length === 0);
|
||||
|
||||
if (index < 0) {
|
||||
return dispatch(setXHRBreakpoint("", "ANY"));
|
||||
}
|
||||
|
||||
const bp = xhrBreakpoints.get(index);
|
||||
|
||||
if (bp.disabled) {
|
||||
return dispatch(enableXHRBreakpoint(index, bp));
|
||||
}
|
||||
|
||||
return dispatch(disableXHRBreakpoint(index, bp));
|
||||
};
|
||||
}
|
||||
|
||||
function setXHRBreakpoint(path, method) {
|
||||
return ({
|
||||
dispatch,
|
||||
getState,
|
||||
client
|
||||
}) => {
|
||||
const breakpoint = (0, _breakpoint.createXHRBreakpoint)(path, method);
|
||||
return dispatch({
|
||||
type: "SET_XHR_BREAKPOINT",
|
||||
breakpoint,
|
||||
[_promise.PROMISE]: client.setXHRBreakpoint(path, method)
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
function removeXHRBreakpoint(index) {
|
||||
return ({
|
||||
dispatch,
|
||||
getState,
|
||||
client
|
||||
}) => {
|
||||
const xhrBreakpoints = (0, _selectors.getXHRBreakpoints)(getState());
|
||||
const breakpoint = xhrBreakpoints.get(index);
|
||||
return dispatch({
|
||||
type: "REMOVE_XHR_BREAKPOINT",
|
||||
breakpoint,
|
||||
index,
|
||||
[_promise.PROMISE]: client.removeXHRBreakpoint(breakpoint.path, breakpoint.method)
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
exports.addBreakpoint = _addBreakpoint.addBreakpoint;
|
||||
exports.addHiddenBreakpoint = _addBreakpoint.addHiddenBreakpoint;
|
||||
exports.enableBreakpoint = _addBreakpoint.enableBreakpoint;
|
||||
|
|
|
@ -137,6 +137,14 @@ function getBreakpointByLocation(location) {
|
|||
return null;
|
||||
}
|
||||
|
||||
function setXHRBreakpoint(path, method) {
|
||||
return threadClient.setXHRBreakpoint(path, method);
|
||||
}
|
||||
|
||||
function removeXHRBreakpoint(path, method) {
|
||||
return threadClient.removeXHRBreakpoint(path, method);
|
||||
}
|
||||
|
||||
function setBreakpoint(location, condition, noSliding) {
|
||||
const sourceClient = threadClient.source({
|
||||
actor: location.sourceId
|
||||
|
@ -435,6 +443,8 @@ const clientCommands = {
|
|||
sourceContents,
|
||||
getBreakpointByLocation,
|
||||
setBreakpoint,
|
||||
setXHRBreakpoint,
|
||||
removeXHRBreakpoint,
|
||||
removeBreakpoint,
|
||||
setBreakpointCondition,
|
||||
evaluate,
|
||||
|
|
|
@ -15,6 +15,8 @@ var _dbg = require("../utils/dbg");
|
|||
|
||||
var _bootstrap = require("../utils/bootstrap");
|
||||
|
||||
var _breakpoints = require("../reducers/breakpoints");
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
||||
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
|
@ -31,12 +33,29 @@ function loadFromPrefs(actions) {
|
|||
}
|
||||
}
|
||||
|
||||
function syncXHRBreakpoints() {
|
||||
_prefs.asyncStore.xhrBreakpoints.then(bps => {
|
||||
bps.forEach(({
|
||||
path,
|
||||
method,
|
||||
disabled
|
||||
}) => {
|
||||
if (!disabled) {
|
||||
firefox.clientCommands.setXHRBreakpoint(path, method);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
async function loadInitialState() {
|
||||
const pendingBreakpoints = await _prefs.asyncStore.pendingBreakpoints;
|
||||
const tabs = await _prefs.asyncStore.tabs;
|
||||
const xhrBreakpoints = await _prefs.asyncStore.xhrBreakpoints;
|
||||
const breakpoints = (0, _breakpoints.initialBreakpointsState)(xhrBreakpoints);
|
||||
return {
|
||||
pendingBreakpoints,
|
||||
tabs
|
||||
tabs,
|
||||
breakpoints
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -62,6 +81,7 @@ async function onConnect(connection, {
|
|||
const workers = (0, _bootstrap.bootstrapWorkers)();
|
||||
await firefox.onConnect(connection, actions);
|
||||
await loadFromPrefs(actions);
|
||||
syncXHRBreakpoints();
|
||||
(0, _dbg.setupHelper)({
|
||||
store,
|
||||
actions,
|
||||
|
|
|
@ -14,6 +14,8 @@ var _react2 = _interopRequireDefault(_react);
|
|||
|
||||
var _reactRedux = require("devtools/client/shared/vendor/react-redux");
|
||||
|
||||
var _Button = require("../shared/Button/index");
|
||||
|
||||
var _Svg = require("devtools/client/debugger/new/dist/vendors").vendored["Svg"];
|
||||
|
||||
var _Svg2 = _interopRequireDefault(_Svg);
|
||||
|
@ -202,7 +204,9 @@ class SearchBar extends _react.Component {
|
|||
const {
|
||||
modifiers,
|
||||
toggleFileSearchModifier,
|
||||
query
|
||||
query,
|
||||
showClose = true,
|
||||
size = "big"
|
||||
} = this.props;
|
||||
const {
|
||||
doSearch
|
||||
|
@ -248,7 +252,12 @@ class SearchBar extends _react.Component {
|
|||
className: "whole-word-btn",
|
||||
svgName: "whole-word-match",
|
||||
tooltip: L10N.getStr("symbolSearch.searchModifier.wholeWord")
|
||||
}));
|
||||
}), showClose && _react2.default.createElement(_react2.default.Fragment, null, _react2.default.createElement("span", {
|
||||
className: "pipe-divider"
|
||||
}), _react2.default.createElement(_Button.CloseButton, {
|
||||
handleClick: this.closeSearch,
|
||||
buttonClass: size
|
||||
})));
|
||||
};
|
||||
|
||||
this.state = {
|
||||
|
@ -361,8 +370,8 @@ class SearchBar extends _react.Component {
|
|||
onHistoryScroll: this.onHistoryScroll,
|
||||
handleNext: e => this.traverseResults(e, false),
|
||||
handlePrev: e => this.traverseResults(e, true),
|
||||
handleClose: this.closeSearch,
|
||||
shouldFocus: this.state.inputFocused
|
||||
shouldFocus: this.state.inputFocused,
|
||||
showClose: false
|
||||
}), _react2.default.createElement("div", {
|
||||
className: "search-bottom-bar"
|
||||
}, this.renderSearchModifiers()));
|
||||
|
|
|
@ -0,0 +1,251 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _react = require("devtools/client/shared/vendor/react");
|
||||
|
||||
var _react2 = _interopRequireDefault(_react);
|
||||
|
||||
var _reactRedux = require("devtools/client/shared/vendor/react-redux");
|
||||
|
||||
var _classnames = require("devtools/client/debugger/new/dist/vendors").vendored["classnames"];
|
||||
|
||||
var _classnames2 = _interopRequireDefault(_classnames);
|
||||
|
||||
var _actions = require("../../actions/index");
|
||||
|
||||
var _actions2 = _interopRequireDefault(_actions);
|
||||
|
||||
var _Button = require("../shared/Button/index");
|
||||
|
||||
var _selectors = require("../../selectors/index");
|
||||
|
||||
var _ExceptionOption = require("./Breakpoints/ExceptionOption");
|
||||
|
||||
var _ExceptionOption2 = _interopRequireDefault(_ExceptionOption);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
|
||||
class XHRBreakpoints extends _react.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
this.handleNewSubmit = e => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
this.props.setXHRBreakpoint(this.state.inputValue, "ANY");
|
||||
this.hideInput();
|
||||
};
|
||||
|
||||
this.handleExistingSubmit = e => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
const {
|
||||
editIndex,
|
||||
inputValue,
|
||||
inputMethod
|
||||
} = this.state;
|
||||
const {
|
||||
xhrBreakpoints
|
||||
} = this.props;
|
||||
const {
|
||||
path,
|
||||
method
|
||||
} = xhrBreakpoints.get(editIndex);
|
||||
|
||||
if (path !== inputValue || method != inputMethod) {
|
||||
this.props.updateXHRBreakpoint(editIndex, inputValue, inputMethod);
|
||||
}
|
||||
|
||||
this.hideInput();
|
||||
};
|
||||
|
||||
this.handleChange = e => {
|
||||
const target = e.target;
|
||||
this.setState({
|
||||
inputValue: target.value
|
||||
});
|
||||
};
|
||||
|
||||
this.hideInput = () => {
|
||||
this.setState({
|
||||
focused: false,
|
||||
editing: false,
|
||||
editIndex: -1,
|
||||
inputValue: "",
|
||||
inputMethod: ""
|
||||
});
|
||||
this.props.onXHRAdded();
|
||||
};
|
||||
|
||||
this.onFocus = () => {
|
||||
this.setState({
|
||||
focused: true
|
||||
});
|
||||
};
|
||||
|
||||
this.editExpression = index => {
|
||||
const {
|
||||
xhrBreakpoints
|
||||
} = this.props;
|
||||
const {
|
||||
path,
|
||||
method
|
||||
} = xhrBreakpoints.get(index);
|
||||
this.setState({
|
||||
inputValue: path,
|
||||
inputMethod: method,
|
||||
editing: true,
|
||||
editIndex: index
|
||||
});
|
||||
};
|
||||
|
||||
this.handleCheckbox = index => {
|
||||
const {
|
||||
xhrBreakpoints,
|
||||
enableXHRBreakpoint,
|
||||
disableXHRBreakpoint
|
||||
} = this.props;
|
||||
const breakpoint = xhrBreakpoints.get(index);
|
||||
|
||||
if (breakpoint.disabled) {
|
||||
enableXHRBreakpoint(index);
|
||||
} else {
|
||||
disableXHRBreakpoint(index);
|
||||
}
|
||||
};
|
||||
|
||||
this.renderBreakpoint = ({
|
||||
path,
|
||||
text,
|
||||
disabled,
|
||||
method
|
||||
}, index) => {
|
||||
const {
|
||||
editIndex
|
||||
} = this.state;
|
||||
const {
|
||||
removeXHRBreakpoint
|
||||
} = this.props;
|
||||
|
||||
if (index === editIndex) {
|
||||
return this.renderXHRInput(this.handleExistingSubmit);
|
||||
} else if (!path) {
|
||||
return;
|
||||
}
|
||||
|
||||
return _react2.default.createElement("li", {
|
||||
className: "xhr-container",
|
||||
key: path,
|
||||
title: path,
|
||||
onDoubleClick: (items, options) => this.editExpression(index)
|
||||
}, _react2.default.createElement("input", {
|
||||
type: "checkbox",
|
||||
className: "xhr-checkbox",
|
||||
checked: !disabled,
|
||||
onChange: () => this.handleCheckbox(index),
|
||||
onClick: ev => ev.stopPropagation()
|
||||
}), _react2.default.createElement("div", {
|
||||
className: "xhr-label"
|
||||
}, text), _react2.default.createElement("div", {
|
||||
className: "xhr-container__close-btn"
|
||||
}, _react2.default.createElement(_Button.CloseButton, {
|
||||
handleClick: e => removeXHRBreakpoint(index)
|
||||
})));
|
||||
};
|
||||
|
||||
this.renderBreakpoints = () => {
|
||||
const {
|
||||
showInput,
|
||||
xhrBreakpoints
|
||||
} = this.props;
|
||||
return _react2.default.createElement("ul", {
|
||||
className: "pane expressions-list"
|
||||
}, xhrBreakpoints.map(this.renderBreakpoint), (showInput || !xhrBreakpoints.size) && this.renderXHRInput(this.handleNewSubmit));
|
||||
};
|
||||
|
||||
this.renderCheckpoint = () => {
|
||||
const {
|
||||
shouldPauseOnAny,
|
||||
togglePauseOnAny,
|
||||
xhrBreakpoints
|
||||
} = this.props;
|
||||
const isEmpty = xhrBreakpoints.size === 0;
|
||||
return _react2.default.createElement("div", {
|
||||
className: (0, _classnames2.default)("breakpoints-exceptions-options", {
|
||||
empty: isEmpty
|
||||
})
|
||||
}, _react2.default.createElement(_ExceptionOption2.default, {
|
||||
className: "breakpoints-exceptions",
|
||||
label: L10N.getStr("pauseOnAnyXHR"),
|
||||
isChecked: shouldPauseOnAny,
|
||||
onChange: () => togglePauseOnAny()
|
||||
}));
|
||||
};
|
||||
|
||||
this.state = {
|
||||
editing: false,
|
||||
inputValue: "",
|
||||
inputMethod: "",
|
||||
focused: false,
|
||||
editIndex: -1
|
||||
};
|
||||
}
|
||||
|
||||
renderXHRInput(onSubmit) {
|
||||
const {
|
||||
focused,
|
||||
inputValue
|
||||
} = this.state;
|
||||
const placeholder = L10N.getStr("xhrBreakpoints.placeholder");
|
||||
return _react2.default.createElement("li", {
|
||||
className: (0, _classnames2.default)("xhr-input-container", {
|
||||
focused
|
||||
}),
|
||||
key: "xhr-input"
|
||||
}, _react2.default.createElement("form", {
|
||||
className: "xhr-input-form",
|
||||
onSubmit: onSubmit
|
||||
}, _react2.default.createElement("input", {
|
||||
className: "xhr-input",
|
||||
type: "text",
|
||||
placeholder: placeholder,
|
||||
onChange: this.handleChange,
|
||||
onBlur: this.hideInput,
|
||||
onFocus: this.onFocus,
|
||||
autoFocus: true,
|
||||
value: inputValue
|
||||
}), _react2.default.createElement("input", {
|
||||
type: "submit",
|
||||
style: {
|
||||
display: "none"
|
||||
}
|
||||
})));
|
||||
}
|
||||
|
||||
render() {
|
||||
return _react2.default.createElement("div", null, this.renderCheckpoint(), this.renderBreakpoints());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const mapStateToProps = state => {
|
||||
return {
|
||||
xhrBreakpoints: (0, _selectors.getXHRBreakpoints)(state),
|
||||
shouldPauseOnAny: (0, _selectors.shouldPauseOnAnyXHR)(state)
|
||||
};
|
||||
};
|
||||
|
||||
exports.default = (0, _reactRedux.connect)(mapStateToProps, {
|
||||
setXHRBreakpoint: _actions2.default.setXHRBreakpoint,
|
||||
removeXHRBreakpoint: _actions2.default.removeXHRBreakpoint,
|
||||
enableXHRBreakpoint: _actions2.default.enableXHRBreakpoint,
|
||||
disableXHRBreakpoint: _actions2.default.disableXHRBreakpoint,
|
||||
updateXHRBreakpoint: _actions2.default.updateXHRBreakpoint,
|
||||
togglePauseOnAny: _actions2.default.togglePauseOnAny
|
||||
})(XHRBreakpoints);
|
|
@ -68,6 +68,10 @@ var _FrameworkComponent = require("./FrameworkComponent");
|
|||
|
||||
var _FrameworkComponent2 = _interopRequireDefault(_FrameworkComponent);
|
||||
|
||||
var _XHRBreakpoints = require("./XHRBreakpoints");
|
||||
|
||||
var _XHRBreakpoints2 = _interopRequireDefault(_XHRBreakpoints);
|
||||
|
||||
var _Scopes = require("./Scopes");
|
||||
|
||||
var _Scopes2 = _interopRequireDefault(_Scopes);
|
||||
|
@ -100,8 +104,15 @@ class SecondaryPanes extends _react.Component {
|
|||
});
|
||||
};
|
||||
|
||||
this.onXHRAdded = () => {
|
||||
this.setState({
|
||||
showXHRInput: false
|
||||
});
|
||||
};
|
||||
|
||||
this.state = {
|
||||
showExpressionsInput: false
|
||||
showExpressionsInput: false,
|
||||
showXHRInput: false
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -165,6 +176,20 @@ class SecondaryPanes extends _react.Component {
|
|||
return buttons;
|
||||
}
|
||||
|
||||
xhrBreakpointsHeaderButtons() {
|
||||
const buttons = [];
|
||||
buttons.push(debugBtn(evt => {
|
||||
if (_prefs.prefs.expressionsVisible) {
|
||||
evt.stopPropagation();
|
||||
}
|
||||
|
||||
this.setState({
|
||||
showXHRInput: true
|
||||
});
|
||||
}, "plus", "plus", L10N.getStr("xhrBreakpoints.placeholder")));
|
||||
return buttons;
|
||||
}
|
||||
|
||||
getScopeItem() {
|
||||
return {
|
||||
header: L10N.getStr("scopes.header"),
|
||||
|
@ -210,6 +235,20 @@ class SecondaryPanes extends _react.Component {
|
|||
};
|
||||
}
|
||||
|
||||
getXHRItem() {
|
||||
return {
|
||||
header: L10N.getStr("xhrBreakpoints.header"),
|
||||
className: "xhr-breakpoints-pane",
|
||||
buttons: this.xhrBreakpointsHeaderButtons(),
|
||||
component: _react2.default.createElement(_XHRBreakpoints2.default, {
|
||||
showInput: this.state.showXHRInput,
|
||||
onXHRAdded: this.onXHRAdded
|
||||
}),
|
||||
opened: true,
|
||||
onToggle: () => {}
|
||||
};
|
||||
}
|
||||
|
||||
getCallStackItem() {
|
||||
return {
|
||||
header: L10N.getStr("callStack.header"),
|
||||
|
@ -285,6 +324,10 @@ class SecondaryPanes extends _react.Component {
|
|||
}
|
||||
}
|
||||
|
||||
if (_prefs.features.xhrBreakpoints) {
|
||||
items.push(this.getXHRItem());
|
||||
}
|
||||
|
||||
if (_prefs.features.eventListeners) {
|
||||
items.push({
|
||||
header: L10N.getStr("eventListenersHeader"),
|
||||
|
|
|
@ -17,4 +17,5 @@ DevToolsModules(
|
|||
'Scopes.js',
|
||||
'UtilsBar.js',
|
||||
'Workers.js',
|
||||
'XHRBreakpoints.js',
|
||||
)
|
||||
|
|
|
@ -37,9 +37,10 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
|
|||
* Breakpoints reducer
|
||||
* @module reducers/breakpoints
|
||||
*/
|
||||
function initialBreakpointsState() {
|
||||
function initialBreakpointsState(xhrBreakpoints = []) {
|
||||
return (0, _makeRecord2.default)({
|
||||
breakpoints: I.Map(),
|
||||
xhrBreakpoints: I.List(xhrBreakpoints),
|
||||
breakpointsDisabled: false
|
||||
})();
|
||||
}
|
||||
|
@ -95,11 +96,83 @@ function update(state = initialBreakpointsState(), action) {
|
|||
{
|
||||
return initialBreakpointsState();
|
||||
}
|
||||
|
||||
case "SET_XHR_BREAKPOINT":
|
||||
{
|
||||
return addXHRBreakpoint(state, action);
|
||||
}
|
||||
|
||||
case "REMOVE_XHR_BREAKPOINT":
|
||||
{
|
||||
return removeXHRBreakpoint(state, action);
|
||||
}
|
||||
|
||||
case "UPDATE_XHR_BREAKPOINT":
|
||||
{
|
||||
return updateXHRBreakpoint(state, action);
|
||||
}
|
||||
|
||||
case "ENABLE_XHR_BREAKPOINT":
|
||||
{
|
||||
return updateXHRBreakpoint(state, action);
|
||||
}
|
||||
|
||||
case "DISABLE_XHR_BREAKPOINT":
|
||||
{
|
||||
return updateXHRBreakpoint(state, action);
|
||||
}
|
||||
}
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
function addXHRBreakpoint(state, action) {
|
||||
const {
|
||||
xhrBreakpoints
|
||||
} = state;
|
||||
const {
|
||||
breakpoint
|
||||
} = action;
|
||||
const {
|
||||
path,
|
||||
method
|
||||
} = breakpoint;
|
||||
const existingBreakpointIndex = state.xhrBreakpoints.findIndex(bp => bp.path === path && bp.method === method);
|
||||
|
||||
if (existingBreakpointIndex === -1) {
|
||||
return state.set("xhrBreakpoints", xhrBreakpoints.push(breakpoint));
|
||||
} else if (xhrBreakpoints.get(existingBreakpointIndex) !== breakpoint) {
|
||||
return state.set("xhrBreakpoints", xhrBreakpoints.set(existingBreakpointIndex, breakpoint));
|
||||
}
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
function removeXHRBreakpoint(state, action) {
|
||||
const {
|
||||
breakpoint: {
|
||||
path,
|
||||
method
|
||||
}
|
||||
} = action;
|
||||
const {
|
||||
xhrBreakpoints
|
||||
} = state;
|
||||
const index = xhrBreakpoints.findIndex(bp => bp.path === path && bp.method === method);
|
||||
return state.set("xhrBreakpoints", xhrBreakpoints.delete(index));
|
||||
}
|
||||
|
||||
function updateXHRBreakpoint(state, action) {
|
||||
const {
|
||||
breakpoint,
|
||||
index
|
||||
} = action;
|
||||
const {
|
||||
xhrBreakpoints
|
||||
} = state;
|
||||
return state.set("xhrBreakpoints", xhrBreakpoints.set(index, breakpoint));
|
||||
}
|
||||
|
||||
function addBreakpoint(state, action) {
|
||||
if (action.status === "start" && action.breakpoint) {
|
||||
const {
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.shouldPauseOnAnyXHR = undefined;
|
||||
exports.getXHRBreakpoints = getXHRBreakpoints;
|
||||
|
||||
var _reselect = require("devtools/client/debugger/new/dist/vendors").vendored["reselect"];
|
||||
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
|
||||
function getXHRBreakpoints(state) {
|
||||
return state.breakpoints.xhrBreakpoints;
|
||||
}
|
||||
|
||||
const shouldPauseOnAnyXHR = exports.shouldPauseOnAnyXHR = (0, _reselect.createSelector)(getXHRBreakpoints, xhrBreakpoints => {
|
||||
const emptyBp = xhrBreakpoints.find(({
|
||||
path
|
||||
}) => path.length === 0);
|
||||
|
||||
if (!emptyBp) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return !emptyBp.disabled;
|
||||
});
|
|
@ -3,7 +3,7 @@
|
|||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.getBreakpointSources = exports.getVisibleSelectedFrame = exports.getCallStackFrames = exports.isSelectedFrameVisible = exports.inComponent = exports.getVisibleBreakpoints = exports.getBreakpointsAtLine = exports.getBreakpointAtLocation = exports.getQuickOpenType = exports.getQuickOpenQuery = exports.getQuickOpenEnabled = exports.getEventListeners = undefined;
|
||||
exports.shouldPauseOnAnyXHR = exports.getXHRBreakpoints = exports.getBreakpointSources = exports.getVisibleSelectedFrame = exports.getCallStackFrames = exports.isSelectedFrameVisible = exports.inComponent = exports.getVisibleBreakpoints = exports.getBreakpointsAtLine = exports.getBreakpointAtLocation = exports.getQuickOpenType = exports.getQuickOpenQuery = exports.getQuickOpenEnabled = exports.getEventListeners = undefined;
|
||||
|
||||
var _expressions = require("../reducers/expressions");
|
||||
|
||||
|
@ -260,6 +260,21 @@ Object.defineProperty(exports, "getBreakpointSources", {
|
|||
}
|
||||
});
|
||||
|
||||
var _breakpoints2 = require("./breakpoints");
|
||||
|
||||
Object.defineProperty(exports, "getXHRBreakpoints", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _breakpoints2.getXHRBreakpoints;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "shouldPauseOnAnyXHR", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _breakpoints2.shouldPauseOnAnyXHR;
|
||||
}
|
||||
});
|
||||
|
||||
var _devtoolsReps = require("devtools/client/shared/components/reps/reps.js");
|
||||
|
||||
const {
|
||||
|
|
|
@ -9,6 +9,7 @@ DIRS += [
|
|||
|
||||
DevToolsModules(
|
||||
'breakpointAtLocation.js',
|
||||
'breakpoints.js',
|
||||
'breakpointSources.js',
|
||||
'getCallStackFrames.js',
|
||||
'inComponent.js',
|
||||
|
|
|
@ -148,12 +148,19 @@ function bootstrapApp(store) {
|
|||
}
|
||||
|
||||
let currentPendingBreakpoints;
|
||||
let currentXHRBreakpoints;
|
||||
|
||||
function updatePrefs(state) {
|
||||
const previousPendingBreakpoints = currentPendingBreakpoints;
|
||||
const previousXHRBreakpoints = currentXHRBreakpoints;
|
||||
currentPendingBreakpoints = selectors.getPendingBreakpoints(state);
|
||||
currentXHRBreakpoints = selectors.getXHRBreakpoints(state);
|
||||
|
||||
if (previousPendingBreakpoints && currentPendingBreakpoints !== previousPendingBreakpoints) {
|
||||
_prefs.asyncStore.pendingBreakpoints = currentPendingBreakpoints;
|
||||
}
|
||||
|
||||
if (currentXHRBreakpoints !== previousXHRBreakpoints) {
|
||||
_prefs.asyncStore.xhrBreakpoints = currentXHRBreakpoints.toJS();
|
||||
}
|
||||
}
|
|
@ -31,6 +31,7 @@ exports.assertPendingLocation = assertPendingLocation;
|
|||
exports.breakpointAtLocation = breakpointAtLocation;
|
||||
exports.breakpointExists = breakpointExists;
|
||||
exports.createBreakpoint = createBreakpoint;
|
||||
exports.createXHRBreakpoint = createXHRBreakpoint;
|
||||
exports.createPendingBreakpoint = createPendingBreakpoint;
|
||||
|
||||
var _selectors = require("../../selectors/index");
|
||||
|
@ -175,6 +176,19 @@ function createBreakpoint(location, overrides = {}) {
|
|||
return properties;
|
||||
}
|
||||
|
||||
function createXHRBreakpoint(path, method, overrides = {}) {
|
||||
const properties = {
|
||||
path,
|
||||
method,
|
||||
disabled: false,
|
||||
loading: false,
|
||||
text: `URL contains "${path}"`
|
||||
};
|
||||
return { ...properties,
|
||||
...overrides
|
||||
};
|
||||
}
|
||||
|
||||
function createPendingLocation(location) {
|
||||
const {
|
||||
sourceUrl,
|
||||
|
|
|
@ -68,6 +68,7 @@ if ((0, _devtoolsEnvironment.isDevelopment)()) {
|
|||
pref("devtools.debugger.features.autocomplete-expressions", false);
|
||||
pref("devtools.debugger.features.map-expression-bindings", true);
|
||||
pref("devtools.debugger.features.map-await-expression", true);
|
||||
pref("devtools.debugger.features.xhr-breakpoints", true);
|
||||
}
|
||||
|
||||
const prefs = exports.prefs = new _devtoolsModules.PrefsHelper("devtools", {
|
||||
|
@ -116,16 +117,19 @@ const features = exports.features = new _devtoolsModules.PrefsHelper("devtools.d
|
|||
autocompleteExpression: ["Bool", "autocomplete-expressions"],
|
||||
mapExpressionBindings: ["Bool", "map-expression-bindings"],
|
||||
mapAwaitExpression: ["Bool", "map-await-expression"],
|
||||
componentPane: ["Bool", "component-pane"]
|
||||
componentPane: ["Bool", "component-pane"],
|
||||
xhrBreakpoints: ["Bool", "xhr-breakpoints"]
|
||||
});
|
||||
const asyncStore = exports.asyncStore = (0, _asyncStoreHelper.asyncStoreHelper)("debugger", {
|
||||
pendingBreakpoints: ["pending-breakpoints", {}],
|
||||
tabs: ["tabs", []]
|
||||
tabs: ["tabs", []],
|
||||
xhrBreakpoints: ["xhr-breakpoints", []]
|
||||
});
|
||||
|
||||
if (prefs.debuggerPrefsSchemaVersion !== prefsSchemaVersion) {
|
||||
// clear pending Breakpoints
|
||||
prefs.pendingBreakpoints = {};
|
||||
prefs.tabs = [];
|
||||
prefs.xhrBreakpoints = [];
|
||||
prefs.debuggerPrefsSchemaVersion = prefsSchemaVersion;
|
||||
}
|
|
@ -589,6 +589,8 @@ support-files =
|
|||
examples/wasm-sourcemaps/fib.wasm
|
||||
examples/wasm-sourcemaps/fib.wasm.map
|
||||
examples/wasm-sourcemaps/utils.js
|
||||
examples/fetch.js
|
||||
examples/doc-xhr.html
|
||||
examples/sum/sum.js
|
||||
examples/sum/sum.min.js
|
||||
examples/sum/sum.min.js.map
|
||||
|
@ -624,7 +626,6 @@ support-files =
|
|||
examples/doc-pause-points.html
|
||||
examples/doc-return-values.html
|
||||
examples/doc-wasm-sourcemaps.html
|
||||
examples/doc_global-method-override.html
|
||||
examples/asm.js
|
||||
examples/async.js
|
||||
examples/bogus-map.js
|
||||
|
@ -655,6 +656,7 @@ support-files =
|
|||
[browser_dbg-async-stepping.js]
|
||||
[browser_dbg-sourcemapped-breakpoint-console.js]
|
||||
skip-if = (os == "win" && ccov) # Bug 1453549
|
||||
[browser_dbg-xhr-breakpoints.js]
|
||||
[browser_dbg-sourcemapped-scopes.js]
|
||||
skip-if = ccov || (verify && debug && (os == 'linux')) # Bug 1441545
|
||||
[browser_dbg-sourcemapped-stepping.js]
|
||||
|
@ -687,8 +689,6 @@ skip-if = (os == "win" && ccov) # Bug 1424154
|
|||
[browser_dbg-ember-quickstart.js]
|
||||
[browser_dbg-expressions.js]
|
||||
[browser_dbg-expressions-error.js]
|
||||
[browser_dbg_global-method-override.js]
|
||||
skip-if = e10s && debug
|
||||
[browser_dbg-iframes.js]
|
||||
[browser_dbg-inline-cache.js]
|
||||
[browser_dbg-keyboard-navigation.js]
|
||||
|
|
|
@ -0,0 +1,47 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
|
||||
|
||||
// Tests that a basic XHR breakpoint works for get and POST is ignored
|
||||
add_task(async function() {
|
||||
const dbg = await initDebugger("doc-xhr.html");
|
||||
await waitForSources(dbg, "fetch.js");
|
||||
await dbg.actions.setXHRBreakpoint("doc", "GET");
|
||||
invokeInTab("main", "doc-xhr.html");
|
||||
await waitForPaused(dbg);
|
||||
assertPausedLocation(dbg);
|
||||
resume(dbg);
|
||||
|
||||
await dbg.actions.removeXHRBreakpoint(0);
|
||||
invokeInTab("main", "doc-xhr.html");
|
||||
assertNotPaused(dbg);
|
||||
|
||||
await dbg.actions.setXHRBreakpoint("doc-xhr.html", "POST");
|
||||
invokeInTab("main", "doc");
|
||||
assertNotPaused(dbg);
|
||||
});
|
||||
|
||||
// Tests the "pause on any URL" checkbox works properly
|
||||
add_task(async function() {
|
||||
const dbg = await initDebugger("doc-xhr.html");
|
||||
await waitForSources(dbg, "fetch.js");
|
||||
|
||||
// Enable pause on any URL
|
||||
await dbg.actions.togglePauseOnAny();
|
||||
invokeInTab("main", "doc-xhr.html");
|
||||
await waitForPaused(dbg);
|
||||
await resume(dbg);
|
||||
|
||||
invokeInTab("main", "fetch.js");
|
||||
await waitForPaused(dbg);
|
||||
await resume(dbg);
|
||||
|
||||
invokeInTab("main", "README.md");
|
||||
await waitForPaused(dbg);
|
||||
await resume(dbg);
|
||||
|
||||
// Disable pause on any URL
|
||||
await dbg.actions.togglePauseOnAny();
|
||||
invokeInTab("main", "README.md");
|
||||
assertNotPaused(dbg);
|
||||
});
|
|
@ -1,18 +0,0 @@
|
|||
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
|
||||
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
/**
|
||||
* Tests that scripts that override properties of the global object, like
|
||||
* toString, don't break the debugger. The test page used to cause the debugger
|
||||
* to throw when trying to attach to the thread actor.
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
add_task(async function() {
|
||||
const dbg = await initDebugger("doc_global-method-override.html");
|
||||
ok(dbg, "Should have a debugger available.");
|
||||
is(dbg.toolbox.threadClient.state, "attached", "Debugger should be attached.");
|
||||
});
|
|
@ -0,0 +1,14 @@
|
|||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<title>Debugger test page</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<script src="fetch.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,16 +0,0 @@
|
|||
<!-- Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ -->
|
||||
<!doctype html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Debugger global method override test page</title>
|
||||
</head>
|
||||
<body>
|
||||
<script type="text/javascript">
|
||||
console.log( "Error: " + toString( { x: 0, y: 0 } ) );
|
||||
function toString(v) { return "[ " + v.x + ", " + v.y + " ]"; }
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,6 @@
|
|||
const doc = "doc-xhr.html";
|
||||
|
||||
|
||||
function main(url) {
|
||||
fetch(url).then(console.log);
|
||||
}
|
|
@ -506,6 +506,7 @@ original=original
|
|||
# LOCALIZATION NOTE (expressions.placeholder): Placeholder text for expression
|
||||
# input element
|
||||
expressions.placeholder=Add watch expression
|
||||
|
||||
# LOCALIZATION NOTE (expressions.errorMsg): Error text for expression
|
||||
# input element
|
||||
expressions.errorMsg=Invalid expression…
|
||||
|
@ -513,6 +514,15 @@ expressions.label=Add watch expression
|
|||
expressions.accesskey=e
|
||||
expressions.key=CmdOrCtrl+Shift+E
|
||||
|
||||
# LOCALIZATION NOTE (xhrBreakpoints.header): The pause on any XHR breakpoints headings
|
||||
xhrBreakpoints.header=XHR Breakpoints
|
||||
xhrBreakpoints.placeholder=Break when URL contains
|
||||
xhrBreakpoints.label=Add XHR breakpoint
|
||||
|
||||
# LOCALIZATION NOTE (pauseOnAnyXHR): The pause on any XHR checkbox description
|
||||
# when the debugger will pause on any XHR requests.
|
||||
pauseOnAnyXHR=Pause on any URL
|
||||
|
||||
# LOCALIZATION NOTE (sourceTabs.closeTab): Editor source tab context menu item
|
||||
# for closing the selected tab below the mouse.
|
||||
sourceTabs.closeTab=Close tab
|
||||
|
|
|
@ -38,11 +38,14 @@ class SourceEditor extends Component {
|
|||
|
||||
// Delay to CodeMirror initialization content to prevent UI freezing
|
||||
this.editorTimeout = setTimeout(() => {
|
||||
this.editorTimeout = null;
|
||||
this.editor.appendToLocalElement(this.refs.editorElement);
|
||||
|
||||
// CodeMirror's setMode() (syntax highlight) is the performance bottleneck when
|
||||
// processing large content, so we enable it asynchronously within the setTimeout
|
||||
// to avoid UI blocking. (rendering source code -> drawing syntax highlight)
|
||||
this.editorSetModeTimeout = setTimeout(() => {
|
||||
this.editorSetModeTimeout = null;
|
||||
this.editor.setMode(mode);
|
||||
});
|
||||
});
|
||||
|
@ -55,16 +58,26 @@ class SourceEditor extends Component {
|
|||
componentDidUpdate(prevProps) {
|
||||
const { mode, text } = this.props;
|
||||
|
||||
// Bail out if the editor has been destroyed in the meantime.
|
||||
if (this.editor.isDestroyed()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (prevProps.text !== text) {
|
||||
// Reset the existed 'mode' attribute in order to make setText() process faster
|
||||
// to prevent drawing unnecessary syntax highlight.
|
||||
this.editor.setMode(null);
|
||||
this.editor.setText(text);
|
||||
|
||||
if (this.editorSetModeTimeout) {
|
||||
clearTimeout(this.editorSetModeTimeout);
|
||||
}
|
||||
|
||||
// CodeMirror's setMode() (syntax highlight) is the performance bottleneck when
|
||||
// processing large content, so we enable it asynchronously within the setTimeout
|
||||
// to avoid UI blocking. (rendering source code -> drawing syntax highlight)
|
||||
this.editorSetModeTimeout = setTimeout(() => {
|
||||
this.editorSetModeTimeout = null;
|
||||
this.editor.setMode(mode);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ exports.PREFS = new PrefsHelper("devtools.performance", {
|
|||
"memory-sample-probability": ["Float", "memory.sample-probability"],
|
||||
"memory-max-log-length": ["Int", "memory.max-log-length"],
|
||||
"profiler-buffer-size": ["Int", "profiler.buffer-size"],
|
||||
"profiler-sample-frequency": ["Int", "profiler.sample-frequency-khz"],
|
||||
"profiler-sample-frequency": ["Int", "profiler.sample-frequency-hz"],
|
||||
// TODO: re-enable once we flame charts via bug 1148663.
|
||||
"enable-memory-flame": ["Bool", "ui.enable-memory-flame"],
|
||||
});
|
||||
|
|
|
@ -19,7 +19,7 @@ add_task(async function() {
|
|||
});
|
||||
|
||||
Services.prefs.setIntPref(PROFILER_BUFFER_SIZE_PREF, 1000);
|
||||
Services.prefs.setIntPref(PROFILER_SAMPLE_RATE_PREF, 2);
|
||||
Services.prefs.setIntPref(PROFILER_SAMPLE_RATE_PREF, 2000);
|
||||
|
||||
await startRecording(panel);
|
||||
const { entries, interval } = await toolbox.performance.getConfiguration();
|
||||
|
|
|
@ -7,7 +7,11 @@
|
|||
*/
|
||||
|
||||
const { SIMPLE_URL } = require("devtools/client/performance/test/helpers/urls");
|
||||
const { UI_ENABLE_MEMORY_PREF, UI_ENABLE_ALLOCATIONS_PREF } = require("devtools/client/performance/test/helpers/prefs");
|
||||
const {
|
||||
UI_ENABLE_MEMORY_PREF,
|
||||
UI_ENABLE_ALLOCATIONS_PREF,
|
||||
PROFILER_SAMPLE_RATE_PREF,
|
||||
} = require("devtools/client/performance/test/helpers/prefs");
|
||||
const { initPerformanceInNewTab, teardownToolboxAndRemoveTab } = require("devtools/client/performance/test/helpers/panel-utils");
|
||||
const { startRecording, stopRecording, waitForAllWidgetsRendered } = require("devtools/client/performance/test/helpers/actions");
|
||||
const { setSelectedRecording } = require("devtools/client/performance/test/helpers/recording-utils");
|
||||
|
@ -26,10 +30,18 @@ add_task(async function() {
|
|||
// Enable allocations to test the memory-calltree and memory-flamegraph.
|
||||
Services.prefs.setBoolPref(UI_ENABLE_ALLOCATIONS_PREF, true);
|
||||
|
||||
await startRecording(panel);
|
||||
await stopRecording(panel);
|
||||
// Because enabling the memory panel has a significant overhead, especially in
|
||||
// slow builds like ccov builds, let's reduce the overhead from the sampling.
|
||||
Services.prefs.setIntPref(PROFILER_SAMPLE_RATE_PREF, 100);
|
||||
|
||||
// Ållow widgets to be updated while hidden, to make testing easier.
|
||||
ok(true, "Starting recording...");
|
||||
await startRecording(panel);
|
||||
ok(true, "Recording started!");
|
||||
ok(true, "Stopping recording...");
|
||||
await stopRecording(panel);
|
||||
ok(true, "Recording stopped!");
|
||||
|
||||
// Allow widgets to be updated while hidden, to make testing easier.
|
||||
DetailsSubview.canUpdateWhileHidden = true;
|
||||
|
||||
// Cycle through all the views to initialize them. The waterfall is shown
|
||||
|
|
|
@ -81,6 +81,11 @@ const key = (id, win = window) => {
|
|||
// TODO: remove when we have flame charts via bug 1148663.
|
||||
Services.prefs.setBoolPref(PrefUtils.UI_ENABLE_MEMORY_FLAME_CHART, true);
|
||||
|
||||
// By default, reduce the default buffer size to reduce the overhead when
|
||||
// transfering the profile data. Hopefully this should help to reduce our
|
||||
// intermittents for the performance tests.
|
||||
Services.prefs.setIntPref(PrefUtils.PROFILER_BUFFER_SIZE_PREF, 100000);
|
||||
|
||||
registerCleanupFunction(() => {
|
||||
info("finish() was called, cleaning up...");
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ const { Preferences } = require("resource://gre/modules/Preferences.jsm");
|
|||
exports.MEMORY_SAMPLE_PROB_PREF = "devtools.performance.memory.sample-probability";
|
||||
exports.MEMORY_MAX_LOG_LEN_PREF = "devtools.performance.memory.max-log-length";
|
||||
exports.PROFILER_BUFFER_SIZE_PREF = "devtools.performance.profiler.buffer-size";
|
||||
exports.PROFILER_SAMPLE_RATE_PREF = "devtools.performance.profiler.sample-frequency-khz";
|
||||
exports.PROFILER_SAMPLE_RATE_PREF = "devtools.performance.profiler.sample-frequency-hz";
|
||||
|
||||
exports.UI_EXPERIMENTAL_PREF = "devtools.performance.ui.experimental";
|
||||
exports.UI_INVERT_CALL_TREE_PREF = "devtools.performance.ui.invert-call-tree";
|
||||
|
|
|
@ -63,3 +63,4 @@ pref("devtools.debugger.features.async-stepping", true);
|
|||
pref("devtools.debugger.features.skip-pausing", true);
|
||||
pref("devtools.debugger.features.autocomplete-expressions", false);
|
||||
pref("devtools.debugger.features.map-expression-bindings", true);
|
||||
pref("devtools.debugger.features.xhr-breakpoints", true);
|
||||
|
|
|
@ -116,7 +116,7 @@ pref("devtools.performance.memory.max-log-length", 125000);
|
|||
pref("devtools.performance.timeline.hidden-markers",
|
||||
"[\"Composite\",\"CompositeForwardTransaction\"]");
|
||||
pref("devtools.performance.profiler.buffer-size", 10000000);
|
||||
pref("devtools.performance.profiler.sample-frequency-khz", 1);
|
||||
pref("devtools.performance.profiler.sample-frequency-hz", 1000);
|
||||
pref("devtools.performance.ui.invert-call-tree", true);
|
||||
pref("devtools.performance.ui.invert-flame-graph", false);
|
||||
pref("devtools.performance.ui.flatten-tree-recursion", true);
|
||||
|
|
|
@ -1331,6 +1331,10 @@ Editor.prototype = {
|
|||
});
|
||||
},
|
||||
|
||||
isDestroyed: function() {
|
||||
return !editors.get(this);
|
||||
},
|
||||
|
||||
destroy: function() {
|
||||
this.container = null;
|
||||
this.config = null;
|
||||
|
|
|
@ -70,7 +70,7 @@ Object.assign({
|
|||
allocationsSampleProbability: options.allocationsSampleProbability || 0,
|
||||
allocationsMaxLogLength: options.allocationsMaxLogLength || 0,
|
||||
bufferSize: options.bufferSize || 0,
|
||||
sampleFrequency: options.sampleFrequency || 1,
|
||||
sampleFrequency: options.sampleFrequency || 1000,
|
||||
};
|
||||
|
||||
this._console = !!options.console;
|
||||
|
|
|
@ -25,7 +25,7 @@ var DEFAULT_PROFILER_OPTIONS = {
|
|||
// by the pref `devtools.performance.profiler.buffer-size`.
|
||||
entries: Math.pow(10, 7),
|
||||
// When using the DevTools Performance Tools, this will be overridden
|
||||
// by the pref `devtools.performance.profiler.sample-rate-khz`.
|
||||
// by the pref `devtools.performance.profiler.sample-frequency-hz`.
|
||||
interval: 1,
|
||||
features: ["js"],
|
||||
threadFilters: ["GeckoMain"],
|
||||
|
|
|
@ -12,7 +12,7 @@ function mapRecordingOptions(type, options) {
|
|||
if (type === "profiler") {
|
||||
return {
|
||||
entries: options.bufferSize,
|
||||
interval: options.sampleFrequency ? (1000 / (options.sampleFrequency * 1000))
|
||||
interval: options.sampleFrequency ? (1000 / options.sampleFrequency)
|
||||
: void 0,
|
||||
};
|
||||
}
|
||||
|
|
|
@ -74,14 +74,6 @@ public:
|
|||
const nsRect& aRect,
|
||||
const nsRect& aDirtyRect) = 0;
|
||||
|
||||
/**
|
||||
* Get the used color of the given widget when it's specified as auto.
|
||||
* It's currently only used for scrollbar-*-color properties.
|
||||
*/
|
||||
virtual nscolor GetWidgetAutoColor(mozilla::ComputedStyle* aStyle,
|
||||
WidgetType aWidgetType)
|
||||
{ return NS_RGB(0, 0, 0); }
|
||||
|
||||
/**
|
||||
* Create WebRender commands for the theme background.
|
||||
* @return true if the theme knows how to create WebRender commands for the
|
||||
|
|
|
@ -101,6 +101,7 @@ SERIALIZED_PREDEFINED_TYPES = [
|
|||
"OffsetPath",
|
||||
"Opacity",
|
||||
"Resize",
|
||||
"TextAlign",
|
||||
"TransformStyle",
|
||||
"background::BackgroundSize",
|
||||
"basic_shape::ClippingShape",
|
||||
|
|
|
@ -72,21 +72,17 @@ CSS_KEY(-webkit-inline-flex, _webkit_inline_flex)
|
|||
CSS_KEY(alias, alias)
|
||||
CSS_KEY(all, all)
|
||||
CSS_KEY(all-scroll, all_scroll)
|
||||
CSS_KEY(annotation, annotation)
|
||||
CSS_KEY(auto, auto)
|
||||
CSS_KEY(baseline, baseline)
|
||||
CSS_KEY(blink, blink)
|
||||
CSS_KEY(block, block)
|
||||
CSS_KEY(blur, blur)
|
||||
CSS_KEY(border-box, border_box)
|
||||
CSS_KEY(bottom, bottom)
|
||||
CSS_KEY(brightness, brightness)
|
||||
CSS_KEY(cell, cell)
|
||||
CSS_KEY(center, center)
|
||||
CSS_KEY(character-variant, character_variant)
|
||||
CSS_KEY(circle, circle)
|
||||
CSS_KEY(clip, clip)
|
||||
CSS_KEY(closest-corner, closest_corner)
|
||||
CSS_KEY(closest-side, closest_side)
|
||||
CSS_KEY(col-resize, col_resize)
|
||||
CSS_KEY(column, column)
|
||||
|
@ -99,7 +95,6 @@ CSS_KEY(context-menu, context_menu)
|
|||
CSS_KEY(context-stroke, context_stroke)
|
||||
CSS_KEY(contrast, contrast)
|
||||
CSS_KEY(copy, copy)
|
||||
CSS_KEY(cover, cover)
|
||||
CSS_KEY(crosshair, crosshair)
|
||||
CSS_KEY(dashed, dashed)
|
||||
CSS_KEY(dense, dense)
|
||||
|
@ -119,11 +114,8 @@ CSS_KEY(ellipsis, ellipsis)
|
|||
CSS_KEY(end, end)
|
||||
CSS_KEY(ew-resize, ew_resize)
|
||||
CSS_KEY(farthest-side, farthest_side)
|
||||
CSS_KEY(farthest-corner, farthest_corner)
|
||||
CSS_KEY(fill, fill)
|
||||
CSS_KEY(filled, filled)
|
||||
CSS_KEY(fill-box, fill_box)
|
||||
CSS_KEY(flat, flat)
|
||||
CSS_KEY(flex, flex)
|
||||
CSS_KEY(flex-end, flex_end)
|
||||
CSS_KEY(flex-start, flex_start)
|
||||
|
@ -156,7 +148,6 @@ CSS_KEY(linear, linear)
|
|||
CSS_KEY(list-item, list_item)
|
||||
CSS_KEY(mandatory, mandatory)
|
||||
CSS_KEY(manipulation, manipulation)
|
||||
CSS_KEY(margin-box, margin_box)
|
||||
CSS_KEY(match-parent, match_parent)
|
||||
CSS_KEY(matrix, matrix)
|
||||
CSS_KEY(matrix3d, matrix3d)
|
||||
|
@ -168,7 +159,6 @@ CSS_KEY(n-resize, n_resize)
|
|||
CSS_KEY(ne-resize, ne_resize)
|
||||
CSS_KEY(nesw-resize, nesw_resize)
|
||||
CSS_KEY(no-drop, no_drop)
|
||||
CSS_KEY(no-repeat, no_repeat)
|
||||
CSS_KEY(none, none)
|
||||
CSS_KEY(normal, normal)
|
||||
CSS_KEY(not-allowed, not_allowed)
|
||||
|
@ -177,7 +167,6 @@ CSS_KEY(nw-resize, nw_resize)
|
|||
CSS_KEY(nwse-resize, nwse_resize)
|
||||
CSS_KEY(opacity, opacity)
|
||||
CSS_KEY(open, open)
|
||||
CSS_KEY(ornaments, ornaments)
|
||||
CSS_KEY(outset, outset)
|
||||
CSS_KEY(over, over)
|
||||
CSS_KEY(overline, overline)
|
||||
|
@ -188,12 +177,9 @@ CSS_KEY(pan-y, pan_y)
|
|||
CSS_KEY(perspective, perspective)
|
||||
CSS_KEY(pointer, pointer)
|
||||
CSS_KEY(polygon, polygon)
|
||||
CSS_KEY(preserve-3d, preserve_3d)
|
||||
CSS_KEY(progress, progress)
|
||||
CSS_KEY(proximity, proximity)
|
||||
CSS_KEY(repeat, repeat)
|
||||
CSS_KEY(repeat-x, repeat_x)
|
||||
CSS_KEY(repeat-y, repeat_y)
|
||||
CSS_KEY(ridge, ridge)
|
||||
CSS_KEY(right, right)
|
||||
CSS_KEY(rotate, rotate)
|
||||
|
@ -238,15 +224,11 @@ CSS_KEY(step-end, step_end)
|
|||
CSS_KEY(step-start, step_start)
|
||||
CSS_KEY(stretch, stretch)
|
||||
CSS_KEY(strict, strict)
|
||||
CSS_KEY(stroke-box, stroke_box)
|
||||
CSS_KEY(style, style)
|
||||
CSS_KEY(styleset, styleset)
|
||||
CSS_KEY(stylistic, stylistic)
|
||||
CSS_KEY(sub, sub)
|
||||
CSS_KEY(subgrid, subgrid)
|
||||
CSS_KEY(super, super)
|
||||
CSS_KEY(sw-resize, sw_resize)
|
||||
CSS_KEY(swash, swash)
|
||||
CSS_KEY(table, table)
|
||||
CSS_KEY(table-caption, table_caption)
|
||||
CSS_KEY(table-cell, table_cell)
|
||||
|
@ -270,7 +252,6 @@ CSS_KEY(under, under)
|
|||
CSS_KEY(underline, underline)
|
||||
CSS_KEY(unsafe, unsafe)
|
||||
CSS_KEY(vertical-text, vertical_text)
|
||||
CSS_KEY(view-box, view_box)
|
||||
CSS_KEY(visible, visible)
|
||||
CSS_KEY(w-resize, w_resize)
|
||||
CSS_KEY(wait, wait)
|
||||
|
|
|
@ -1150,32 +1150,6 @@ nsComputedDOMStyle::SetValueFromComplexColor(nsROCSSPrimitiveValue* aValue,
|
|||
SetToRGBAColor(aValue, aColor.CalcColor(mComputedStyle));
|
||||
}
|
||||
|
||||
void
|
||||
nsComputedDOMStyle::SetValueForWidgetColor(nsROCSSPrimitiveValue* aValue,
|
||||
const StyleComplexColor& aColor,
|
||||
StyleAppearance aWidgetType)
|
||||
{
|
||||
if (!aColor.IsAuto()) {
|
||||
SetToRGBAColor(aValue, aColor.CalcColor(mComputedStyle));
|
||||
return;
|
||||
}
|
||||
nsPresContext* presContext = mPresShell->GetPresContext();
|
||||
MOZ_ASSERT(presContext);
|
||||
if (nsContentUtils::ShouldResistFingerprinting(presContext->GetDocShell())) {
|
||||
// Return transparent when resisting fingerprinting.
|
||||
SetToRGBAColor(aValue, NS_RGBA(0, 0, 0, 0));
|
||||
return;
|
||||
}
|
||||
if (nsITheme* theme = presContext->GetTheme()) {
|
||||
nscolor color = theme->GetWidgetAutoColor(mComputedStyle, aWidgetType);
|
||||
SetToRGBAColor(aValue, color);
|
||||
} else {
|
||||
// If we don't have theme, we don't know what value it should be,
|
||||
// just give it a transparent fallback.
|
||||
SetToRGBAColor(aValue, NS_RGBA(0, 0, 0, 0));
|
||||
}
|
||||
}
|
||||
|
||||
already_AddRefed<CSSValue>
|
||||
nsComputedDOMStyle::DoGetColor()
|
||||
{
|
||||
|
@ -2486,15 +2460,24 @@ already_AddRefed<CSSValue>
|
|||
nsComputedDOMStyle::DoGetScrollbarColor()
|
||||
{
|
||||
const nsStyleUI* ui = StyleUI();
|
||||
RefPtr<nsDOMCSSValueList> list = GetROCSSValueList(false);
|
||||
auto put = [this, &list](const StyleComplexColor& color,
|
||||
StyleAppearance type) {
|
||||
MOZ_ASSERT(ui->mScrollbarFaceColor.IsAuto() ==
|
||||
ui->mScrollbarTrackColor.IsAuto(),
|
||||
"Whether the two colors are auto should be identical");
|
||||
|
||||
if (ui->mScrollbarFaceColor.IsAuto()) {
|
||||
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
|
||||
SetValueForWidgetColor(val, color, type);
|
||||
val->SetIdent(eCSSKeyword_auto);
|
||||
return val.forget();
|
||||
}
|
||||
|
||||
RefPtr<nsDOMCSSValueList> list = GetROCSSValueList(false);
|
||||
auto put = [this, &list](const StyleComplexColor& color) {
|
||||
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
|
||||
SetValueFromComplexColor(val, color);
|
||||
list->AppendCSSValue(val.forget());
|
||||
};
|
||||
put(ui->mScrollbarFaceColor, StyleAppearance::ScrollbarthumbVertical);
|
||||
put(ui->mScrollbarTrackColor, StyleAppearance::ScrollbarVertical);
|
||||
put(ui->mScrollbarFaceColor);
|
||||
put(ui->mScrollbarTrackColor);
|
||||
return list.forget();
|
||||
}
|
||||
|
||||
|
@ -2708,15 +2691,6 @@ nsComputedDOMStyle::DoGetVerticalAlign()
|
|||
return val.forget();
|
||||
}
|
||||
|
||||
already_AddRefed<CSSValue>
|
||||
nsComputedDOMStyle::DoGetTextAlign()
|
||||
{
|
||||
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
|
||||
val->SetIdent(nsCSSProps::ValueToKeywordEnum(
|
||||
StyleText()->mTextAlign, nsCSSProps::kTextAlignKTable));
|
||||
return val.forget();
|
||||
}
|
||||
|
||||
already_AddRefed<CSSValue>
|
||||
nsComputedDOMStyle::DoGetTextDecoration()
|
||||
{
|
||||
|
|
|
@ -344,7 +344,6 @@ private:
|
|||
/* Text Properties */
|
||||
already_AddRefed<CSSValue> DoGetInitialLetter();
|
||||
already_AddRefed<CSSValue> DoGetLineHeight();
|
||||
already_AddRefed<CSSValue> DoGetTextAlign();
|
||||
already_AddRefed<CSSValue> DoGetTextDecoration();
|
||||
already_AddRefed<CSSValue> DoGetTextDecorationColor();
|
||||
already_AddRefed<CSSValue> DoGetTextDecorationLine();
|
||||
|
@ -459,9 +458,6 @@ private:
|
|||
void SetToRGBAColor(nsROCSSPrimitiveValue* aValue, nscolor aColor);
|
||||
void SetValueFromComplexColor(nsROCSSPrimitiveValue* aValue,
|
||||
const mozilla::StyleComplexColor& aColor);
|
||||
void SetValueForWidgetColor(nsROCSSPrimitiveValue* aValue,
|
||||
const mozilla::StyleComplexColor& aColor,
|
||||
mozilla::StyleAppearance aWidgetType);
|
||||
void SetValueToPositionCoord(const mozilla::Position::Coord& aCoord,
|
||||
nsROCSSPrimitiveValue* aValue);
|
||||
void SetValueToPosition(const mozilla::Position& aPosition,
|
||||
|
|
|
@ -1590,9 +1590,14 @@ function test_auto_color_transition(prop, options={}) {
|
|||
const test_color = "rgb(51, 102, 153)";
|
||||
div.style.setProperty("transition-property", "none", "");
|
||||
div.style.setProperty(prop, "auto", "");
|
||||
let used_value_of_auto = get_color(cs.getPropertyValue(prop));
|
||||
isnot(used_value_of_auto, test_color,
|
||||
msg_prefix + "ensure used auto value is different than our test color");
|
||||
if (prop == "scrollbar-color") {
|
||||
is(cs.getPropertyValue(prop), "auto",
|
||||
msg_prefix + "auto should not be resolved to rgb color");
|
||||
} else {
|
||||
let used_value_of_auto = get_color(cs.getPropertyValue(prop));
|
||||
isnot(used_value_of_auto, test_color,
|
||||
msg_prefix + "ensure used auto value is different than our test color");
|
||||
}
|
||||
|
||||
div.style.setProperty("transition-property", prop, "");
|
||||
div.style.setProperty(prop, set_color(test_color), "");
|
||||
|
|
|
@ -26,7 +26,7 @@ loading-label =
|
|||
.value = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "loading.label")}
|
||||
list-empty-installed =
|
||||
.value = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "listEmpty.installed.label")}
|
||||
list-empty-available-updates =
|
||||
list-empty-available-updates =
|
||||
.value ={ COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "listEmpty.availableUpdates.label")}
|
||||
list-empty-recent-updates =
|
||||
.value = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "listEmpty.recentUpdates.label")}
|
||||
|
@ -56,10 +56,10 @@ cmd-find-updates =
|
|||
cmd-enable-theme =
|
||||
.label = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "cmd.enableTheme.label")}
|
||||
.accesskey = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "cmd.enableTheme.accesskey")}
|
||||
cmd-disable-theme =
|
||||
cmd-disable-theme =
|
||||
.label = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "cmd.disableTheme.label")}
|
||||
.accesskey = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "cmd.disableTheme.accesskey")}
|
||||
cmd-install-addon =
|
||||
cmd-install-addon =
|
||||
.label = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "cmd.installAddon.label")}
|
||||
.accesskey = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "cmd.installAddon.accesskey")}
|
||||
cmd-contribute =
|
||||
|
@ -75,7 +75,7 @@ detail-last-updated =
|
|||
detail-contributions-description = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "detail.contributions.description")}
|
||||
detail-update-type =
|
||||
.value = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "detail.updateType")}
|
||||
detail-update-default =
|
||||
detail-update-default =
|
||||
.label = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "detail.updateDefault.label")}
|
||||
.tooltiptext = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "detail.updateDefault.tooltip")}
|
||||
detail-update-automatic =
|
||||
|
@ -84,9 +84,9 @@ detail-update-automatic =
|
|||
detail-update-manual =
|
||||
.label = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "detail.updateManual.label")}
|
||||
.tooltiptext = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "detail.updateManual.tooltip")}
|
||||
detail-home =
|
||||
detail-home =
|
||||
.label ={ COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "detail.home")}
|
||||
detail-repository =
|
||||
detail-repository =
|
||||
.label = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "detail.repository")}
|
||||
detail-check-for-updates =
|
||||
.label = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "detail.checkForUpdates.label")}
|
||||
|
@ -427,7 +427,7 @@ legacy-extensions =
|
|||
"&brandShortName;": TERM_REFERENCE("-brand-short-name")
|
||||
}
|
||||
),
|
||||
FTL.TextElement('<label data-l10n-name="legacy-learn-more">'),
|
||||
FTL.TextElement(' <label data-l10n-name="legacy-learn-more">'),
|
||||
COPY(
|
||||
"toolkit/chrome/mozapps/extensions/extensions.dtd",
|
||||
"legacyExtensions.learnMore"
|
||||
|
|
|
@ -554,6 +554,8 @@ namespace places {
|
|||
}
|
||||
|
||||
int32_t visitCount = aArguments->AsInt32(kArgIndexVisitCount);
|
||||
// Filtering on typed is no more used by Firefox, it is still being used by
|
||||
// comm-central clients.
|
||||
bool typed = aArguments->AsInt32(kArgIndexTyped) ? true : false;
|
||||
bool bookmark = aArguments->AsInt32(kArgIndexBookmark) ? true : false;
|
||||
nsDependentCString tags = getSharedUTF8String(aArguments, kArgIndexTags);
|
||||
|
|
|
@ -78,20 +78,6 @@ const QUERYINDEX_PLACEID = 8;
|
|||
const QUERYINDEX_SWITCHTAB = 9;
|
||||
const QUERYINDEX_FRECENCY = 10;
|
||||
|
||||
// The special characters below can be typed into the urlbar to either restrict
|
||||
// the search to visited history, bookmarked, tagged pages; or force a match on
|
||||
// just the title text or url.
|
||||
const TOKEN_TO_BEHAVIOR_MAP = new Map([
|
||||
["^", "history"],
|
||||
["*", "bookmark"],
|
||||
["+", "tag"],
|
||||
["%", "openpage"],
|
||||
["~", "typed"],
|
||||
["$", "searches"],
|
||||
["#", "title"],
|
||||
["@", "url"],
|
||||
]);
|
||||
|
||||
// If a URL starts with one of these prefixes, then we don't provide search
|
||||
// suggestions for it.
|
||||
const DISALLOWED_URLLIKE_PREFIXES = [
|
||||
|
@ -354,12 +340,22 @@ XPCOMUtils.defineLazyModuleGetters(this, {
|
|||
UrlbarPrefs: "resource:///modules/UrlbarPrefs.jsm",
|
||||
UrlbarProviderOpenTabs: "resource:///modules/UrlbarProviderOpenTabs.jsm",
|
||||
UrlbarProvidersManager: "resource:///modules/UrlbarProvidersManager.jsm",
|
||||
UrlbarTokenizer: "resource:///modules/UrlbarTokenizer.jsm",
|
||||
UrlbarUtils: "resource:///modules/UrlbarUtils.jsm",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyPreferenceGetter(this, "syncUsernamePref",
|
||||
"services.sync.username");
|
||||
|
||||
// The special characters below can be typed into the urlbar to either restrict
|
||||
// the search to visited history, bookmarked, tagged pages; or force a match on
|
||||
// just the title text or url.
|
||||
XPCOMUtils.defineLazyGetter(this, "TOKEN_TO_BEHAVIOR_MAP", () => new Map(
|
||||
Object.entries(UrlbarTokenizer.RESTRICT).map(
|
||||
([type, char]) => [char, type.toLowerCase()]
|
||||
)
|
||||
));
|
||||
|
||||
function setTimeout(callback, ms) {
|
||||
let timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
|
||||
timer.initWithCallback(callback, ms, timer.TYPE_ONE_SHOT);
|
||||
|
@ -646,11 +642,6 @@ Search.prototype = {
|
|||
type = type.toUpperCase();
|
||||
this._behavior |=
|
||||
Ci.mozIPlacesAutoComplete["BEHAVIOR_" + type];
|
||||
|
||||
// Setting the "typed" behavior should also set the "history" behavior.
|
||||
if (type == "TYPED") {
|
||||
this.setBehavior("history");
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -877,7 +868,7 @@ Search.prototype = {
|
|||
query = query.substr(0, UrlbarPrefs.get("maxCharsForSearchSuggestions"));
|
||||
// Avoid fetching suggestions if they are not required, private browsing
|
||||
// mode is enabled, or the query may expose sensitive information.
|
||||
if (this.hasBehavior("searches") &&
|
||||
if (this.hasBehavior("search") &&
|
||||
!this._inPrivateWindow &&
|
||||
!this._prohibitSearchSuggestionsFor(query)) {
|
||||
let engine;
|
||||
|
@ -2140,8 +2131,7 @@ Search.prototype = {
|
|||
get _suggestionPrefQuery() {
|
||||
if (!this.hasBehavior("restrict") && this.hasBehavior("history") &&
|
||||
this.hasBehavior("bookmark")) {
|
||||
return this.hasBehavior("typed") ? defaultQuery("AND h.typed = 1")
|
||||
: defaultQuery();
|
||||
return defaultQuery();
|
||||
}
|
||||
let conditions = [];
|
||||
if (this.hasBehavior("history")) {
|
||||
|
@ -2150,9 +2140,6 @@ Search.prototype = {
|
|||
// faster path, but it may not have up-to-date information yet.
|
||||
conditions.push("+h.visit_count > 0");
|
||||
}
|
||||
if (this.hasBehavior("typed")) {
|
||||
conditions.push("h.typed = 1");
|
||||
}
|
||||
if (this.hasBehavior("bookmark")) {
|
||||
conditions.push("bookmarked");
|
||||
}
|
||||
|
|
|
@ -82,6 +82,7 @@ interface mozIPlacesAutoComplete : nsISupports
|
|||
|
||||
/**
|
||||
* Search for typed pages.
|
||||
* No more supported by Firefox, it is still being used by comm-central clients.
|
||||
*/
|
||||
const long BEHAVIOR_TYPED = 1 << 5;
|
||||
|
||||
|
@ -105,7 +106,7 @@ interface mozIPlacesAutoComplete : nsISupports
|
|||
/**
|
||||
* Include search suggestions from the currently selected search provider.
|
||||
*/
|
||||
const long BEHAVIOR_SEARCHES = 1 << 9;
|
||||
const long BEHAVIOR_SEARCH = 1 << 9;
|
||||
|
||||
/**
|
||||
* Populate list of Preloaded Sites from JSON.
|
||||
|
|
|
@ -28,6 +28,7 @@ ChromeUtils.import("resource://testing-common/httpd.js");
|
|||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
UrlbarPrefs: "resource:///modules/UrlbarPrefs.jsm",
|
||||
UrlbarProviderOpenTabs: "resource:///modules/UrlbarProviderOpenTabs.jsm",
|
||||
UrlbarTokenizer: "resource:///modules/UrlbarTokenizer.jsm",
|
||||
});
|
||||
|
||||
const TITLE_SEARCH_ENGINE_SEPARATOR = " \u00B7\u2013\u00B7 ";
|
||||
|
@ -39,7 +40,6 @@ async function cleanup() {
|
|||
let suggestPrefs = [
|
||||
"history",
|
||||
"bookmark",
|
||||
"history.onlyTyped",
|
||||
"openpage",
|
||||
"searches",
|
||||
];
|
||||
|
|
|
@ -28,10 +28,10 @@ add_task(async function test_javascript_match() {
|
|||
matches: [ { uri: uri1, title: "Title with javascript:" } ],
|
||||
});
|
||||
|
||||
info("Match nothing with 'javascript:'");
|
||||
info("Match non-javascript with 'javascript:'");
|
||||
await check_autocomplete({
|
||||
search: "javascript:",
|
||||
matches: [],
|
||||
matches: [ { uri: uri1, title: "Title with javascript:" } ],
|
||||
});
|
||||
|
||||
info("Match nothing with '5 javascript:'");
|
||||
|
|
|
@ -19,9 +19,9 @@ add_task(async function test_javascript_match() {
|
|||
await PlacesTestUtils.addVisits([
|
||||
{ uri: uri1, title: "title" },
|
||||
{ uri: uri2, title: "title" },
|
||||
{ uri: uri3, title: "title", transition: TRANSITION_TYPED},
|
||||
{ uri: uri4, title: "title", transition: TRANSITION_TYPED },
|
||||
{ uri: uri6, title: "title", transition: TRANSITION_TYPED },
|
||||
{ uri: uri3, title: "title" },
|
||||
{ uri: uri4, title: "title" },
|
||||
{ uri: uri6, title: "title" },
|
||||
{ uri: uri7, title: "title" },
|
||||
]);
|
||||
|
||||
|
@ -43,31 +43,42 @@ add_task(async function test_javascript_match() {
|
|||
await check_autocomplete({
|
||||
search: "foo",
|
||||
searchParam: "enable-actions",
|
||||
matches: [ makeSearchMatch("foo", { heuristic: true }),
|
||||
{ uri: uri1, title: "title" },
|
||||
{ uri: uri2, title: "title", style: ["bookmark"] },
|
||||
{ uri: uri3, title: "title" },
|
||||
{ uri: uri4, title: "title", style: ["bookmark"] },
|
||||
{ uri: uri5, title: "title", style: ["bookmark"] },
|
||||
{ uri: uri6, title: "title", style: ["bookmark"] },
|
||||
makeSwitchToTabMatch("http://t.foo/6", { title: "title" }),
|
||||
],
|
||||
matches: [
|
||||
makeSearchMatch("foo", { heuristic: true }),
|
||||
{ uri: uri1, title: "title" },
|
||||
{ uri: uri2, title: "title", style: ["bookmark"] },
|
||||
{ uri: uri3, title: "title" },
|
||||
{ uri: uri4, title: "title", style: ["bookmark"] },
|
||||
{ uri: uri5, title: "title", style: ["bookmark"] },
|
||||
{ uri: uri6, title: "title", style: ["bookmark"] },
|
||||
makeSwitchToTabMatch("http://t.foo/6", { title: "title" }),
|
||||
],
|
||||
});
|
||||
|
||||
// Note the next few tests do *not* get a search result as enable-actions
|
||||
// isn't specified.
|
||||
info("Match only typed history");
|
||||
info("Match only history");
|
||||
await check_autocomplete({
|
||||
search: "foo ^ ~",
|
||||
matches: [ { uri: uri3, title: "title" },
|
||||
{ uri: uri4, title: "title" } ],
|
||||
search: `foo ${UrlbarTokenizer.RESTRICT.HISTORY}`,
|
||||
matches: [
|
||||
{ uri: uri1, title: "title" },
|
||||
{ uri: uri2, title: "title" },
|
||||
{ uri: uri3, title: "title" },
|
||||
{ uri: uri4, title: "title" },
|
||||
{ uri: uri7, title: "title" },
|
||||
],
|
||||
});
|
||||
|
||||
info("Drop-down empty search matches only typed history");
|
||||
info("Drop-down empty search matches history sorted by frecency desc");
|
||||
await check_autocomplete({
|
||||
search: "",
|
||||
matches: [ { uri: uri3, title: "title" },
|
||||
{ uri: uri4, title: "title" } ],
|
||||
matches: [
|
||||
{ uri: uri7, title: "title" },
|
||||
{ uri: uri4, title: "title" },
|
||||
{ uri: uri3, title: "title" },
|
||||
{ uri: uri2, title: "title" },
|
||||
{ uri: uri1, title: "title" },
|
||||
],
|
||||
});
|
||||
|
||||
info("Drop-down empty search matches only bookmarks");
|
||||
|
@ -75,10 +86,12 @@ add_task(async function test_javascript_match() {
|
|||
Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", true);
|
||||
await check_autocomplete({
|
||||
search: "",
|
||||
matches: [ { uri: uri2, title: "title", style: ["bookmark"] },
|
||||
{ uri: uri4, title: "title", style: ["bookmark"] },
|
||||
{ uri: uri5, title: "title", style: ["bookmark"] },
|
||||
{ uri: uri6, title: "title", style: ["bookmark"] } ],
|
||||
matches: [
|
||||
{ uri: uri2, title: "title", style: ["bookmark"] },
|
||||
{ uri: uri4, title: "title", style: ["bookmark"] },
|
||||
{ uri: uri5, title: "title", style: ["bookmark"] },
|
||||
{ uri: uri6, title: "title", style: ["bookmark"] },
|
||||
],
|
||||
});
|
||||
|
||||
info("Drop-down empty search matches only open tabs");
|
||||
|
@ -87,8 +100,8 @@ add_task(async function test_javascript_match() {
|
|||
search: "",
|
||||
searchParam: "enable-actions",
|
||||
matches: [
|
||||
makeSwitchToTabMatch("http://t.foo/6", { title: "title" }),
|
||||
],
|
||||
makeSwitchToTabMatch("http://t.foo/6", { title: "title" }),
|
||||
],
|
||||
});
|
||||
|
||||
Services.prefs.clearUserPref("browser.urlbar.suggest.history");
|
||||
|
|
|
@ -5,7 +5,6 @@ const ENGINE_NAME = "engine-suggestions.xml";
|
|||
const SERVER_PORT = 9000;
|
||||
const SUGGEST_PREF = "browser.urlbar.suggest.searches";
|
||||
const SUGGEST_ENABLED_PREF = "browser.search.suggest.enabled";
|
||||
const SUGGEST_RESTRICT_TOKEN = "$";
|
||||
|
||||
var suggestionsFn;
|
||||
var previousSuggestionsFn;
|
||||
|
@ -297,11 +296,12 @@ add_task(async function restrictToken() {
|
|||
|
||||
// Now do a restricted search to make sure only suggestions appear.
|
||||
await check_autocomplete({
|
||||
search: SUGGEST_RESTRICT_TOKEN + " hello",
|
||||
search: `${UrlbarTokenizer.RESTRICT.SEARCH} hello`,
|
||||
searchParam: "enable-actions",
|
||||
matches: [
|
||||
// TODO (bug 1177895) This is wrong.
|
||||
makeSearchMatch(SUGGEST_RESTRICT_TOKEN + " hello", { engineName: ENGINE_NAME, heuristic: true }),
|
||||
makeSearchMatch(`${UrlbarTokenizer.RESTRICT.SEARCH} hello`,
|
||||
{ engineName: ENGINE_NAME, heuristic: true }),
|
||||
{
|
||||
uri: makeActionURI(("searchengine"), {
|
||||
engineName: ENGINE_NAME,
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
|
||||
function setSuggestPrefsToFalse() {
|
||||
Services.prefs.setBoolPref("browser.urlbar.suggest.history", false);
|
||||
Services.prefs.setBoolPref("browser.urlbar.suggest.history.onlyTyped", false);
|
||||
Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", false);
|
||||
}
|
||||
|
||||
|
@ -49,7 +48,7 @@ add_task(async function test_special_searches() {
|
|||
// Test restricting searches
|
||||
info("History restrict");
|
||||
await check_autocomplete({
|
||||
search: "^",
|
||||
search: UrlbarTokenizer.RESTRICT.HISTORY,
|
||||
matches: [ { uri: uri1, title: "title" },
|
||||
{ uri: uri2, title: "foo.bar" },
|
||||
{ uri: uri3, title: "title" },
|
||||
|
@ -60,7 +59,7 @@ add_task(async function test_special_searches() {
|
|||
|
||||
info("Star restrict");
|
||||
await check_autocomplete({
|
||||
search: "*",
|
||||
search: UrlbarTokenizer.RESTRICT.BOOKMARK,
|
||||
matches: [ { uri: uri5, title: "title", style: [ "bookmark" ] },
|
||||
{ uri: uri6, title: "foo.bar", style: [ "bookmark" ] },
|
||||
{ uri: uri7, title: "title", style: [ "bookmark" ] },
|
||||
|
@ -73,7 +72,7 @@ add_task(async function test_special_searches() {
|
|||
|
||||
info("Tag restrict");
|
||||
await check_autocomplete({
|
||||
search: "+",
|
||||
search: UrlbarTokenizer.RESTRICT.TAG,
|
||||
matches: [ { uri: uri9, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] },
|
||||
{ uri: uri10, title: "foo.bar", tags: [ "foo.bar" ], style: [ "tag" ] },
|
||||
{ uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] },
|
||||
|
@ -83,7 +82,7 @@ add_task(async function test_special_searches() {
|
|||
// Test specials as any word position
|
||||
info("Special as first word");
|
||||
await check_autocomplete({
|
||||
search: "^ foo bar",
|
||||
search: `${UrlbarTokenizer.RESTRICT.HISTORY} foo bar`,
|
||||
matches: [ { uri: uri2, title: "foo.bar" },
|
||||
{ uri: uri3, title: "title" },
|
||||
{ uri: uri4, title: "foo.bar" },
|
||||
|
@ -93,7 +92,7 @@ add_task(async function test_special_searches() {
|
|||
|
||||
info("Special as middle word");
|
||||
await check_autocomplete({
|
||||
search: "foo ^ bar",
|
||||
search: `foo ${UrlbarTokenizer.RESTRICT.HISTORY} bar`,
|
||||
matches: [ { uri: uri2, title: "foo.bar" },
|
||||
{ uri: uri3, title: "title" },
|
||||
{ uri: uri4, title: "foo.bar" },
|
||||
|
@ -103,7 +102,7 @@ add_task(async function test_special_searches() {
|
|||
|
||||
info("Special as last word");
|
||||
await check_autocomplete({
|
||||
search: "foo bar ^",
|
||||
search: `foo bar ${UrlbarTokenizer.RESTRICT.HISTORY}`,
|
||||
matches: [ { uri: uri2, title: "foo.bar" },
|
||||
{ uri: uri3, title: "title" },
|
||||
{ uri: uri4, title: "foo.bar" },
|
||||
|
@ -112,9 +111,9 @@ add_task(async function test_special_searches() {
|
|||
});
|
||||
|
||||
// Test restricting and matching searches with a term
|
||||
info("foo ^ -> history");
|
||||
info(`foo ${UrlbarTokenizer.RESTRICT.HISTORY} -> history`);
|
||||
await check_autocomplete({
|
||||
search: "foo ^",
|
||||
search: `foo ${UrlbarTokenizer.RESTRICT.HISTORY}`,
|
||||
matches: [ { uri: uri2, title: "foo.bar" },
|
||||
{ uri: uri3, title: "title" },
|
||||
{ uri: uri4, title: "foo.bar" },
|
||||
|
@ -122,9 +121,9 @@ add_task(async function test_special_searches() {
|
|||
{ uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] } ],
|
||||
});
|
||||
|
||||
info("foo * -> is star");
|
||||
info(`foo ${UrlbarTokenizer.RESTRICT.BOOKMARK} -> is star`);
|
||||
await check_autocomplete({
|
||||
search: "foo *",
|
||||
search: `foo ${UrlbarTokenizer.RESTRICT.BOOKMARK}`,
|
||||
matches: [ { uri: uri6, title: "foo.bar", style: [ "bookmark" ] },
|
||||
{ uri: uri7, title: "title", style: [ "bookmark" ] },
|
||||
{ uri: uri8, title: "foo.bar", style: [ "bookmark" ] },
|
||||
|
@ -134,9 +133,9 @@ add_task(async function test_special_searches() {
|
|||
{ uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] } ],
|
||||
});
|
||||
|
||||
info("foo # -> in title");
|
||||
info(`foo ${UrlbarTokenizer.RESTRICT.TITLE} -> in title`);
|
||||
await check_autocomplete({
|
||||
search: "foo #",
|
||||
search: `foo ${UrlbarTokenizer.RESTRICT.TITLE}`,
|
||||
matches: [ { uri: uri2, title: "foo.bar" },
|
||||
{ uri: uri4, title: "foo.bar" },
|
||||
{ uri: uri6, title: "foo.bar", style: [ "bookmark" ] },
|
||||
|
@ -147,9 +146,9 @@ add_task(async function test_special_searches() {
|
|||
{ uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "tag" ] } ],
|
||||
});
|
||||
|
||||
info("foo @ -> in url");
|
||||
info(`foo ${UrlbarTokenizer.RESTRICT.URL} -> in url`);
|
||||
await check_autocomplete({
|
||||
search: "foo @",
|
||||
search: `foo ${UrlbarTokenizer.RESTRICT.URL}`,
|
||||
matches: [ { uri: uri3, title: "title" },
|
||||
{ uri: uri4, title: "foo.bar" },
|
||||
{ uri: uri7, title: "title", style: [ "bookmark" ] },
|
||||
|
@ -158,63 +157,49 @@ add_task(async function test_special_searches() {
|
|||
{ uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "tag" ] } ],
|
||||
});
|
||||
|
||||
info("foo + -> is tag");
|
||||
info(`foo ${UrlbarTokenizer.RESTRICT.TAG} -> is tag`);
|
||||
await check_autocomplete({
|
||||
search: "foo +",
|
||||
search: `foo ${UrlbarTokenizer.RESTRICT.TAG}`,
|
||||
matches: [ { uri: uri9, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] },
|
||||
{ uri: uri10, title: "foo.bar", tags: [ "foo.bar" ], style: [ "tag" ] },
|
||||
{ uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] },
|
||||
{ uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "tag" ] } ],
|
||||
});
|
||||
|
||||
info("foo ~ -> is typed");
|
||||
await check_autocomplete({
|
||||
search: "foo ~",
|
||||
matches: [ { uri: uri4, title: "foo.bar" },
|
||||
{ uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] } ],
|
||||
});
|
||||
|
||||
// Test various pairs of special searches
|
||||
info("foo ^ * -> history, is star");
|
||||
info(`foo ${UrlbarTokenizer.RESTRICT.HISTORY} ${UrlbarTokenizer.RESTRICT.BOOKMARK} -> history, is star`);
|
||||
await check_autocomplete({
|
||||
search: "foo ^ *",
|
||||
search: `foo ${UrlbarTokenizer.RESTRICT.HISTORY} ${UrlbarTokenizer.RESTRICT.BOOKMARK}`,
|
||||
matches: [ { uri: uri6, title: "foo.bar", style: [ "bookmark" ] },
|
||||
{ uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] } ],
|
||||
});
|
||||
|
||||
info("foo ^ # -> history, in title");
|
||||
info(`foo ${UrlbarTokenizer.RESTRICT.HISTORY} ${UrlbarTokenizer.RESTRICT.TITLE} -> history, in title`);
|
||||
await check_autocomplete({
|
||||
search: "foo ^ #",
|
||||
search: `foo ${UrlbarTokenizer.RESTRICT.HISTORY} ${UrlbarTokenizer.RESTRICT.TITLE}`,
|
||||
matches: [ { uri: uri2, title: "foo.bar" },
|
||||
{ uri: uri4, title: "foo.bar" },
|
||||
{ uri: uri6, title: "foo.bar" },
|
||||
{ uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] } ],
|
||||
});
|
||||
|
||||
info("foo ^ @ -> history, in url");
|
||||
info(`foo ${UrlbarTokenizer.RESTRICT.HISTORY} ${UrlbarTokenizer.RESTRICT.URL} -> history, in url`);
|
||||
await check_autocomplete({
|
||||
search: "foo ^ @",
|
||||
search: `foo ${UrlbarTokenizer.RESTRICT.HISTORY} ${UrlbarTokenizer.RESTRICT.URL}`,
|
||||
matches: [ { uri: uri3, title: "title" },
|
||||
{ uri: uri4, title: "foo.bar" },
|
||||
{ uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] } ],
|
||||
});
|
||||
|
||||
info("foo ^ + -> history, is tag");
|
||||
info(`foo ${UrlbarTokenizer.RESTRICT.HISTORY} ${UrlbarTokenizer.RESTRICT.TAG} -> history, is tag`);
|
||||
await check_autocomplete({
|
||||
search: "foo ^ +",
|
||||
search: `foo ${UrlbarTokenizer.RESTRICT.HISTORY} ${UrlbarTokenizer.RESTRICT.TAG}`,
|
||||
matches: [ { uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] } ],
|
||||
});
|
||||
|
||||
info("foo ^ ~ -> history, is typed");
|
||||
info(`foo ${UrlbarTokenizer.RESTRICT.BOOKMARK} ${UrlbarTokenizer.RESTRICT.TITLE} -> is star, in title`);
|
||||
await check_autocomplete({
|
||||
search: "foo ^ ~",
|
||||
matches: [ { uri: uri4, title: "foo.bar" },
|
||||
{ uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] } ],
|
||||
});
|
||||
|
||||
info("foo * # -> is star, in title");
|
||||
await check_autocomplete({
|
||||
search: "foo * #",
|
||||
search: `foo ${UrlbarTokenizer.RESTRICT.BOOKMARK} ${UrlbarTokenizer.RESTRICT.TITLE}`,
|
||||
matches: [ { uri: uri6, title: "foo.bar", style: [ "bookmark" ] },
|
||||
{ uri: uri8, title: "foo.bar", style: [ "bookmark" ] },
|
||||
{ uri: uri9, title: "title", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] },
|
||||
|
@ -223,75 +208,49 @@ add_task(async function test_special_searches() {
|
|||
{ uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] } ],
|
||||
});
|
||||
|
||||
info("foo * @ -> is star, in url");
|
||||
info(`foo ${UrlbarTokenizer.RESTRICT.BOOKMARK} ${UrlbarTokenizer.RESTRICT.URL} -> is star, in url`);
|
||||
await check_autocomplete({
|
||||
search: "foo * @",
|
||||
search: `foo ${UrlbarTokenizer.RESTRICT.BOOKMARK} ${UrlbarTokenizer.RESTRICT.URL}`,
|
||||
matches: [ { uri: uri7, title: "title", style: [ "bookmark" ] },
|
||||
{ uri: uri8, title: "foo.bar", style: [ "bookmark" ] },
|
||||
{ uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] },
|
||||
{ uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] } ],
|
||||
});
|
||||
|
||||
info("foo * + -> same as +");
|
||||
info(`foo ${UrlbarTokenizer.RESTRICT.BOOKMARK} ${UrlbarTokenizer.RESTRICT.TAG} -> same as ${UrlbarTokenizer.RESTRICT.TAG}`);
|
||||
await check_autocomplete({
|
||||
search: "foo * +",
|
||||
search: `foo ${UrlbarTokenizer.RESTRICT.BOOKMARK} ${UrlbarTokenizer.RESTRICT.TAG}`,
|
||||
matches: [ { uri: uri9, title: "title", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] },
|
||||
{ uri: uri10, title: "foo.bar", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] },
|
||||
{ uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] },
|
||||
{ uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] } ],
|
||||
});
|
||||
|
||||
info("foo * ~ -> is star, is typed");
|
||||
info(`foo ${UrlbarTokenizer.RESTRICT.TITLE} ${UrlbarTokenizer.RESTRICT.URL} -> in title, in url`);
|
||||
await check_autocomplete({
|
||||
search: "foo * ~",
|
||||
matches: [ { uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] } ],
|
||||
});
|
||||
|
||||
info("foo # @ -> in title, in url");
|
||||
await check_autocomplete({
|
||||
search: "foo # @",
|
||||
search: `foo ${UrlbarTokenizer.RESTRICT.TITLE} ${UrlbarTokenizer.RESTRICT.URL}`,
|
||||
matches: [ { uri: uri4, title: "foo.bar" },
|
||||
{ uri: uri8, title: "foo.bar", style: [ "bookmark" ] },
|
||||
{ uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] },
|
||||
{ uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "tag" ] } ],
|
||||
});
|
||||
|
||||
info("foo # + -> in title, is tag");
|
||||
info(`foo ${UrlbarTokenizer.RESTRICT.TITLE} ${UrlbarTokenizer.RESTRICT.TAG} -> in title, is tag`);
|
||||
await check_autocomplete({
|
||||
search: "foo # +",
|
||||
search: `foo ${UrlbarTokenizer.RESTRICT.TITLE} ${UrlbarTokenizer.RESTRICT.TAG}`,
|
||||
matches: [ { uri: uri9, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] },
|
||||
{ uri: uri10, title: "foo.bar", tags: [ "foo.bar" ], style: [ "tag" ] },
|
||||
{ uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] },
|
||||
{ uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "tag" ] } ],
|
||||
});
|
||||
|
||||
info("foo # ~ -> in title, is typed");
|
||||
info(`foo ${UrlbarTokenizer.RESTRICT.URL} ${UrlbarTokenizer.RESTRICT.TAG} -> in url, is tag`);
|
||||
await check_autocomplete({
|
||||
search: "foo # ~",
|
||||
matches: [ { uri: uri4, title: "foo.bar" },
|
||||
{ uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] } ],
|
||||
});
|
||||
|
||||
info("foo @ + -> in url, is tag");
|
||||
await check_autocomplete({
|
||||
search: "foo @ +",
|
||||
search: `foo ${UrlbarTokenizer.RESTRICT.URL} ${UrlbarTokenizer.RESTRICT.TAG}`,
|
||||
matches: [ { uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] },
|
||||
{ uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "tag" ] } ],
|
||||
});
|
||||
|
||||
info("foo @ ~ -> in url, is typed");
|
||||
await check_autocomplete({
|
||||
search: "foo @ ~",
|
||||
matches: [ { uri: uri4, title: "foo.bar" },
|
||||
{ uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] } ],
|
||||
});
|
||||
|
||||
info("foo + ~ -> is tag, is typed");
|
||||
await check_autocomplete({
|
||||
search: "foo + ~",
|
||||
matches: [ { uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] } ],
|
||||
});
|
||||
|
||||
// Disable autoFill for the next tests, see test_autoFill_default_behavior.js
|
||||
// for specific tests.
|
||||
Services.prefs.setBoolPref("browser.urlbar.autoFill", false);
|
||||
|
@ -327,17 +286,6 @@ add_task(async function test_special_searches() {
|
|||
{ uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] } ],
|
||||
});
|
||||
|
||||
info("foo -> default history, is star, is typed");
|
||||
setSuggestPrefsToFalse();
|
||||
Services.prefs.setBoolPref("browser.urlbar.suggest.history", true);
|
||||
Services.prefs.setBoolPref("browser.urlbar.suggest.history.onlyTyped", true);
|
||||
Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", true);
|
||||
await check_autocomplete({
|
||||
search: "foo",
|
||||
matches: [ { uri: uri4, title: "foo.bar" },
|
||||
{ uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] } ],
|
||||
});
|
||||
|
||||
info("foo -> is star");
|
||||
setSuggestPrefsToFalse();
|
||||
Services.prefs.setBoolPref("browser.urlbar.suggest.history", false);
|
||||
|
@ -353,21 +301,5 @@ add_task(async function test_special_searches() {
|
|||
{ uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] } ],
|
||||
});
|
||||
|
||||
info("foo -> is star, is typed");
|
||||
setSuggestPrefsToFalse();
|
||||
// only typed should be ignored
|
||||
Services.prefs.setBoolPref("browser.urlbar.suggest.history.onlyTyped", true);
|
||||
Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", true);
|
||||
await check_autocomplete({
|
||||
search: "foo",
|
||||
matches: [ { uri: uri6, title: "foo.bar", style: [ "bookmark" ] },
|
||||
{ uri: uri7, title: "title", style: [ "bookmark" ] },
|
||||
{ uri: uri8, title: "foo.bar", style: [ "bookmark" ] },
|
||||
{ uri: uri9, title: "title", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] },
|
||||
{ uri: uri10, title: "foo.bar", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] },
|
||||
{ uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] },
|
||||
{ uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] } ],
|
||||
});
|
||||
|
||||
await cleanup();
|
||||
});
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
addons-window =
|
||||
addons-window =
|
||||
.title = Add-ons Manager
|
||||
|
||||
search-header =
|
||||
|
@ -12,13 +12,13 @@ search-header =
|
|||
search-header-shortcut =
|
||||
.key = f
|
||||
|
||||
loading-label =
|
||||
loading-label =
|
||||
.value = Loading…
|
||||
|
||||
list-empty-installed =
|
||||
list-empty-installed =
|
||||
.value = You don’t have any add-ons of this type installed
|
||||
|
||||
list-empty-available-updates =
|
||||
list-empty-available-updates =
|
||||
.value = No updates found
|
||||
|
||||
list-empty-recent-updates =
|
||||
|
@ -27,7 +27,7 @@ list-empty-recent-updates =
|
|||
list-empty-find-updates =
|
||||
.label = Check For Updates
|
||||
|
||||
list-empty-button =
|
||||
list-empty-button =
|
||||
.label = Learn more about add-ons
|
||||
|
||||
install-addon-from-file =
|
||||
|
@ -36,7 +36,7 @@ install-addon-from-file =
|
|||
|
||||
help-button = Add-ons Support
|
||||
|
||||
preferences =
|
||||
preferences =
|
||||
{ PLATFORM() ->
|
||||
[windows] { -brand-short-name } Options
|
||||
*[other] { -brand-short-name } Preferences
|
||||
|
@ -48,7 +48,7 @@ tools-menu =
|
|||
show-unsigned-extensions-button =
|
||||
.label = Some extensions could not be verified
|
||||
|
||||
show-all-extensions-button =
|
||||
show-all-extensions-button =
|
||||
.label = Show all extensions
|
||||
|
||||
debug-addons =
|
||||
|
@ -59,17 +59,17 @@ cmd-show-details =
|
|||
.label = Show More Information
|
||||
.accesskey = S
|
||||
|
||||
cmd-find-updates =
|
||||
cmd-find-updates =
|
||||
.label = Find Updates
|
||||
.accesskey = F
|
||||
|
||||
cmd-preferences =
|
||||
.label =
|
||||
cmd-preferences =
|
||||
.label =
|
||||
{ PLATFORM() ->
|
||||
[windows] Options
|
||||
*[other] Preferences
|
||||
}
|
||||
.accesskey =
|
||||
.accesskey =
|
||||
{ PLATFORM() ->
|
||||
[windows] O
|
||||
*[other] P
|
||||
|
@ -94,12 +94,12 @@ cmd-contribute =
|
|||
|
||||
discover-title = What are Add-ons?
|
||||
|
||||
discover-description =
|
||||
discover-description =
|
||||
Add-ons are applications that let you personalize { -brand-short-name } with
|
||||
extra functionality or style. Try a time-saving sidebar, a weather notifier, or a themed look to make { -brand-short-name }
|
||||
your own.
|
||||
|
||||
discover-footer =
|
||||
discover-footer =
|
||||
When you’re connected to the internet, this pane will feature
|
||||
some of the best and most popular add-ons for you to try out.
|
||||
|
||||
|
@ -111,14 +111,14 @@ detail-last-updated =
|
|||
|
||||
detail-contributions-description = The developer of this add-on asks that you help support its continued development by making a small contribution.
|
||||
|
||||
detail-update-type =
|
||||
detail-update-type =
|
||||
.value = Automatic Updates
|
||||
|
||||
detail-update-default =
|
||||
detail-update-default =
|
||||
.label = Default
|
||||
.tooltiptext = Automatically install updates only if that’s the default
|
||||
|
||||
detail-update-automatic =
|
||||
detail-update-automatic =
|
||||
.label = On
|
||||
.tooltiptext = Automatically install updates
|
||||
|
||||
|
@ -126,13 +126,13 @@ detail-update-manual =
|
|||
.label = Off
|
||||
.tooltiptext = Don’t automatically install updates
|
||||
|
||||
detail-home =
|
||||
detail-home =
|
||||
.label = Homepage
|
||||
|
||||
detail-home-value =
|
||||
.value = { detail-home.label }
|
||||
|
||||
detail-repository =
|
||||
detail-repository =
|
||||
.label = Add-on Profile
|
||||
|
||||
detail-repository-value =
|
||||
|
@ -160,7 +160,7 @@ detail-show-preferences =
|
|||
*[other] Change this add-on’s preferences
|
||||
}
|
||||
|
||||
detail-rating =
|
||||
detail-rating =
|
||||
.value = Rating
|
||||
|
||||
addon-restart-now =
|
||||
|
@ -176,7 +176,7 @@ disabled-unsigned-description =
|
|||
disabled-unsigned-learn-more = Learn more about our efforts to help keep you safe online.
|
||||
|
||||
disabled-unsigned-devinfo =
|
||||
Developers interested in getting their add-ons verified can continue by reading our
|
||||
Developers interested in getting their add-ons verified can continue by reading our
|
||||
<label data-l10n-name="learn-more">manual</label>.
|
||||
|
||||
plugin-deprecation-description =
|
||||
|
@ -187,7 +187,5 @@ legacy-warning-show-legacy = Show legacy extensions
|
|||
legacy-extensions =
|
||||
.value = Legacy Extensions
|
||||
|
||||
legacy-extensions-description =
|
||||
These extensions do not meet current { -brand-short-name } standards so they have been deactivated.<label data-l10n-name="legacy-learn-more">Learn about the changes to add-ons</label>
|
||||
|
||||
|
||||
legacy-extensions-description =
|
||||
These extensions do not meet current { -brand-short-name } standards so they have been deactivated. <label data-l10n-name="legacy-learn-more">Learn about the changes to add-ons</label>
|
||||
|
|
|
@ -380,8 +380,6 @@ public:
|
|||
WidgetType aWidgetType,
|
||||
const nsRect& aRect,
|
||||
const nsRect& aDirtyRect) override;
|
||||
nscolor GetWidgetAutoColor(mozilla::ComputedStyle* aStyle,
|
||||
WidgetType aWidgetType) override;
|
||||
bool CreateWebRenderCommandsForWidget(mozilla::wr::DisplayListBuilder& aBuilder,
|
||||
mozilla::wr::IpcResourceUpdateQueue& aResources,
|
||||
const mozilla::layers::StackingContextHelper& aSc,
|
||||
|
|
|
@ -3994,31 +3994,6 @@ nsNativeThemeCocoa::CreateWebRenderCommandsForWidget(mozilla::wr::DisplayListBui
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
nscolor
|
||||
nsNativeThemeCocoa::GetWidgetAutoColor(mozilla::ComputedStyle* aStyle,
|
||||
WidgetType aWidgetType)
|
||||
{
|
||||
switch (aWidgetType) {
|
||||
case StyleAppearance::Scrollbar:
|
||||
case StyleAppearance::ScrollbarSmall:
|
||||
case StyleAppearance::ScrollbarVertical:
|
||||
case StyleAppearance::ScrollbarHorizontal:
|
||||
case StyleAppearance::ScrollbarbuttonUp:
|
||||
case StyleAppearance::ScrollbarbuttonDown:
|
||||
case StyleAppearance::ScrollbarbuttonLeft:
|
||||
case StyleAppearance::ScrollbarbuttonRight:
|
||||
return NS_RGB(0xFA, 0xFA, 0xFA);
|
||||
|
||||
case StyleAppearance::ScrollbarthumbVertical:
|
||||
case StyleAppearance::ScrollbarthumbHorizontal:
|
||||
return NS_RGB(0xC1, 0xC1, 0xC1);
|
||||
|
||||
default:
|
||||
return nsITheme::GetWidgetAutoColor(aStyle, aWidgetType);
|
||||
}
|
||||
}
|
||||
|
||||
LayoutDeviceIntMargin
|
||||
nsNativeThemeCocoa::DirectionAwareMargin(const LayoutDeviceIntMargin& aMargin,
|
||||
nsIFrame* aFrame)
|
||||
|
|
|
@ -2005,41 +2005,6 @@ RENDER_AGAIN:
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
static nscolor
|
||||
GetScrollbarFaceColorForAuto(ComputedStyle* aStyle)
|
||||
{
|
||||
return NS_RGB(205, 205, 205);
|
||||
}
|
||||
|
||||
static nscolor
|
||||
GetScrollbarTrackColorForAuto(ComputedStyle* aStyle)
|
||||
{
|
||||
return NS_RGB(240, 240, 240);
|
||||
}
|
||||
|
||||
nscolor
|
||||
nsNativeThemeWin::GetWidgetAutoColor(ComputedStyle* aStyle, WidgetType aWidgetType)
|
||||
{
|
||||
switch (aWidgetType) {
|
||||
case StyleAppearance::Scrollbar:
|
||||
case StyleAppearance::ScrollbarSmall:
|
||||
case StyleAppearance::ScrollbarVertical:
|
||||
case StyleAppearance::ScrollbarHorizontal:
|
||||
case StyleAppearance::ScrollbarbuttonUp:
|
||||
case StyleAppearance::ScrollbarbuttonDown:
|
||||
case StyleAppearance::ScrollbarbuttonLeft:
|
||||
case StyleAppearance::ScrollbarbuttonRight:
|
||||
return GetScrollbarTrackColorForAuto(aStyle);
|
||||
|
||||
case StyleAppearance::ScrollbarthumbVertical:
|
||||
case StyleAppearance::ScrollbarthumbHorizontal:
|
||||
return GetScrollbarFaceColorForAuto(aStyle);
|
||||
|
||||
default:
|
||||
return nsITheme::GetWidgetAutoColor(aStyle, aWidgetType);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
ScaleForFrameDPI(LayoutDeviceIntMargin* aMargin, nsIFrame* aFrame)
|
||||
{
|
||||
|
@ -4366,7 +4331,7 @@ nsNativeThemeWin::DrawCustomScrollbarPart(gfxContext* aContext,
|
|||
|
||||
const nsStyleUI* ui = aStyle->StyleUI();
|
||||
nscolor trackColor = ui->mScrollbarTrackColor.IsAuto()
|
||||
? GetScrollbarTrackColorForAuto(aStyle)
|
||||
? NS_RGB(240, 240, 240)
|
||||
: ui->mScrollbarTrackColor.CalcColor(aStyle);
|
||||
switch (aWidgetType) {
|
||||
case StyleAppearance::ScrollbarHorizontal:
|
||||
|
@ -4403,7 +4368,7 @@ nsNativeThemeWin::DrawCustomScrollbarPart(gfxContext* aContext,
|
|||
case StyleAppearance::ScrollbarthumbVertical:
|
||||
case StyleAppearance::ScrollbarthumbHorizontal: {
|
||||
nscolor faceColor = ui->mScrollbarFaceColor.IsAuto()
|
||||
? GetScrollbarFaceColorForAuto(aStyle)
|
||||
? NS_RGB(205, 205, 205)
|
||||
: ui->mScrollbarFaceColor.CalcColor(aStyle);
|
||||
faceColor = AdjustScrollbarFaceColor(faceColor, eventStates);
|
||||
ctx->SetColor(Color::FromABGR(faceColor));
|
||||
|
|
|
@ -37,9 +37,6 @@ public:
|
|||
const nsRect& aRect,
|
||||
const nsRect& aDirtyRect) override;
|
||||
|
||||
nscolor GetWidgetAutoColor(mozilla::ComputedStyle* aStyle,
|
||||
WidgetType aWidgetType) override;
|
||||
|
||||
MOZ_MUST_USE LayoutDeviceIntMargin GetWidgetBorder(nsDeviceContext* aContext,
|
||||
nsIFrame* aFrame,
|
||||
WidgetType aWidgetType) override;
|
||||
|
|
Загрузка…
Ссылка в новой задаче