Skip to content

Commit

Permalink
Merge autoland to mozilla-central a=merge
Browse files Browse the repository at this point in the history
  • Loading branch information
aiakab committed Aug 7, 2018
2 parents 1d7e92c + 3c600b5 commit cf3d94e
Show file tree
Hide file tree
Showing 32 changed files with 290 additions and 278 deletions.
1 change: 1 addition & 0 deletions browser/base/content/browser.css
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,7 @@ hbox.urlbar-input-box {
html|input.urlbar-scheme {
position: absolute;
height: 100%;
left: 0;
visibility: hidden;
direction: ltr;
pointer-events: none;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ add_task(async function startup() {
max: 650,
},
"extensions.getAddons.cache.enabled": {
min: 8,
min: 7,
max: 55,
},
};
Expand Down
15 changes: 14 additions & 1 deletion browser/components/nsBrowserGlue.js
Original file line number Diff line number Diff line change
Expand Up @@ -1805,7 +1805,7 @@ BrowserGlue.prototype = {
_migrateUI: function BG__migrateUI() {
// Use an increasing number to keep track of the current migration state.
// Completely unrelated to the current Firefox release number.
const UI_VERSION = 72;
const UI_VERSION = 73;
const BROWSER_DOCURL = AppConstants.BROWSER_CHROME_URL;

let currentUIVersion;
Expand Down Expand Up @@ -2142,6 +2142,19 @@ BrowserGlue.prototype = {
Services.prefs.setIntPref(pref, Services.prefs.getIntPref(pref, 1) * 1000);
}

if (currentUIVersion < 73) {
// Remove blocklist JSON local dumps in profile.
OS.File.removeDir(OS.Path.join(OS.Constants.Path.profileDir, "blocklists"),
{ ignoreAbsent: true });
OS.File.removeDir(OS.Path.join(OS.Constants.Path.profileDir, "blocklists-preview"),
{ ignoreAbsent: true });
for (const filename of ["addons.json", "plugins.json", "gfx.json"]) {
// Some old versions used to dump without subfolders. Clean them while we are at it.
const path = OS.Path.join(OS.Constants.Path.profileDir, `blocklists-${filename}`);
OS.File.remove(path, { ignoreAbsent: true });
}
}

// Update the migration version.
Services.prefs.setIntPref("browser.migration.version", UI_VERSION);
},
Expand Down
1 change: 0 additions & 1 deletion browser/extensions/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

DIRS += [
'aushelper',
'followonsearch',
'formautofill',
'onboarding',
'pdfjs',
Expand Down
79 changes: 66 additions & 13 deletions browser/modules/BrowserUsageTelemetry.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,13 @@ var EXPORTED_SYMBOLS = [
];

ChromeUtils.import("resource://gre/modules/Services.jsm");
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");

ChromeUtils.defineModuleGetter(this, "PrivateBrowsingUtils",
"resource://gre/modules/PrivateBrowsingUtils.jsm");

XPCOMUtils.defineLazyGlobalGetters(this, ["URLSearchParams"]);

// The upper bound for the count of the visited unique domain names.
const MAX_UNIQUE_VISITED_DOMAINS = 100;

Expand Down Expand Up @@ -88,7 +91,6 @@ const URLBAR_SELECTED_RESULT_METHODS = {

const MINIMUM_TAB_COUNT_INTERVAL_MS = 5 * 60 * 1000; // 5 minutes, in ms


function getOpenTabsAndWinsCounts() {
let tabCount = 0;
let winCount = 0;
Expand Down Expand Up @@ -159,14 +161,20 @@ let URICountListener = {
return;
}

// Don't include URI and domain counts when in private mode.
let shouldCountURI = !PrivateBrowsingUtils.isWindowPrivate(browser.ownerGlobal) ||
Services.prefs.getBoolPref("browser.engagement.total_uri_count.pbm", false);

// Track URI loads, even if they're not http(s).
let uriSpec = null;
try {
uriSpec = uri.spec;
} catch (e) {
// If we have troubles parsing the spec, still count this as
// an unfiltered URI.
Services.telemetry.scalarAdd(UNFILTERED_URI_COUNT_SCALAR_NAME, 1);
if (shouldCountURI) {
Services.telemetry.scalarAdd(UNFILTERED_URI_COUNT_SCALAR_NAME, 1);
}
return;
}

Expand All @@ -188,12 +196,42 @@ let URICountListener = {
// The URI wasn't from a restored tab. Count it among the unfiltered URIs.
// If this is an http(s) URI, this also gets counted by the "total_uri_count"
// probe.
Services.telemetry.scalarAdd(UNFILTERED_URI_COUNT_SCALAR_NAME, 1);
if (shouldCountURI) {
Services.telemetry.scalarAdd(UNFILTERED_URI_COUNT_SCALAR_NAME, 1);
}

if (!this.isHttpURI(uri)) {
return;
}

let parseURLResult = Services.search.parseSubmissionURL(uriSpec);
if (parseURLResult.engine) {
this._recordSearchTelemetry(uriSpec, parseURLResult);
} else if (this._urlsQueuedForParsing) {
if (Services.search.isInitialized) {
this._urlsQueuedForParsing = null;
} else {
this._urlsQueuedForParsing.push(uriSpec);
if (this._urlsQueuedForParsing.length == 1) {
Services.search.init(rv => {
if (Components.isSuccessCode(rv)) {
for (let url of this._urlsQueuedForParsing) {
let innerParseURLResult = Services.search.parseSubmissionURL(url);
if (innerParseURLResult.engine) {
this._recordSearchTelemetry(url, innerParseURLResult);
}
}
}
this._urlsQueuedForParsing = null;
});
}
}
}

if (!shouldCountURI) {
return;
}

// Update the URI counts.
Services.telemetry.scalarAdd(TOTAL_URI_COUNT_SCALAR_NAME, 1);

Expand Down Expand Up @@ -226,6 +264,31 @@ let URICountListener = {
this._domainSet.clear();
},

_urlsQueuedForParsing: [],

_recordSearchTelemetry(url, parseURLResult) {
switch (parseURLResult.engine.identifier) {
case "google":
case "google-2018":
let type;
let queries = new URLSearchParams(url.split("?")[1]);
let code = queries.get("client");
if (code) {
// Detecting follow-on searches for sap is a little tricky.
// There are a few parameters that only show up
// with follow-ons, so we look for those. (oq/ved/ei)
type = queries.has("oq") || queries.has("ved") || queries.has("ei") ? "sap-follow-on" : "sap";
} else {
type = "organic";
}
let payload = `google.in-content.${type}:${code || "none"}`;

let histogram = Services.telemetry.getKeyedHistogramById("SEARCH_COUNTS");
histogram.add(payload);
break;
}
},

QueryInterface: ChromeUtils.generateQI([Ci.nsIWebProgressListener,
Ci.nsISupportsWeakReference]),
};
Expand Down Expand Up @@ -614,11 +677,6 @@ let BrowserUsageTelemetry = {
win.addEventListener("unload", this);
win.addEventListener("TabOpen", this, true);

// Don't include URI and domain counts when in private mode.
if (PrivateBrowsingUtils.isWindowPrivate(win) &&
!Services.prefs.getBoolPref("browser.engagement.total_uri_count.pbm", false)) {
return;
}
win.gBrowser.tabContainer.addEventListener(TAB_RESTORING_TOPIC, this);
win.gBrowser.addTabsProgressListener(URICountListener);
},
Expand All @@ -630,11 +688,6 @@ let BrowserUsageTelemetry = {
win.removeEventListener("unload", this);
win.removeEventListener("TabOpen", this, true);

// Don't include URI and domain counts when in private mode.
if (PrivateBrowsingUtils.isWindowPrivate(win.defaultView) &&
!Services.prefs.getBoolPref("browser.engagement.total_uri_count.pbm", false)) {
return;
}
win.defaultView.gBrowser.tabContainer.removeEventListener(TAB_RESTORING_TOPIC, this);
win.defaultView.gBrowser.removeTabsProgressListener(URICountListener);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class AnimationListContainer extends PureComponent {
setAnimationsCurrentTime: PropTypes.func.isRequired,
setHighlightedNode: PropTypes.func.isRequired,
setSelectedNode: PropTypes.func.isRequired,
sidebarWidth: PropTypes.number.isRequired,
simulateAnimation: PropTypes.func.isRequired,
timeScale: PropTypes.object.isRequired,
};
Expand All @@ -55,8 +56,17 @@ class AnimationListContainer extends PureComponent {
this.updateState(this.props);
}

componentWillReceiveProps(nextProps) {
this.updateState(nextProps);
componentDidUpdate(prevProps) {
const {
timeScale,
sidebarWidth
} = this.props;

if (timeScale.getDuration() !== prevProps.timeScale.getDuration() ||
timeScale.zeroPositionTime !== prevProps.timeScale.zeroPositionTime ||
sidebarWidth !== prevProps.sidebarWidth) {
this.updateState(this.props);
}
}

updateState(props) {
Expand All @@ -79,25 +89,16 @@ class AnimationListContainer extends PureComponent {
// Need to display first graduation since position will be shifted.
if (needToShift) {
const label = timeScale.formatTime(timeScale.distanceToRelativeTime(0));
ticks.push({ position: 0, label });
ticks.push({ position: 0, label, width: shiftWidth });
}

for (let i = 0; i <= tickCount; i++) {
const position = ((i * intervalWidth) + shiftWidth) * 100 / width;
const distance = timeScale.distanceToRelativeTime(position);
let label = isAllDurationInfinity && i === tickCount
? getStr("player.infiniteTimeLabel")
: timeScale.formatTime(distance);
// As result of shifting the label, first shifted label might overlap
// to the most left label. So display empyt label in this case.
// And prevent to skip displaying zero position label.
if (i === 0 &&
needToShift &&
shiftWidth < intervalWidth &&
Math.abs(distance) >= 0.001) {
label = "";
}
ticks.push({ position, label });
const label = isAllDurationInfinity && i === tickCount
? getStr("player.infiniteTimeLabel")
: timeScale.formatTime(distance);
ticks.push({ position, label, width: intervalWidth });
}

this.setState({ ticks });
Expand Down
5 changes: 4 additions & 1 deletion devtools/client/inspector/animation/components/TickLabels.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ class TickLabels extends PureComponent {
dom.div(
{
className: "tick-label",
style: { marginInlineStart: `${ tick.position }%` },
style: {
marginInlineStart: `${ tick.position }%`,
maxWidth: `${ tick.width }px`
},
},
tick.label
)
Expand Down
3 changes: 3 additions & 0 deletions devtools/client/themes/animation.css
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,9 @@ select.playback-rate-selector.devtools-button:not(:empty):not(:disabled):not(.ch
border-inline-start: var(--tick-line-style);
height: 100%;
position: absolute;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

.animated-property-list-container .tick-label:last-child {
Expand Down
1 change: 1 addition & 0 deletions devtools/client/webconsole/components/FilterBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ class FilterBar extends Component {
return (
dom.div({
className: "webconsole-filteringbar-wrapper",
"aria-live": "off",
ref: node => {
this.wrapperNode = node;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const TEST_URI = `data:text/html;charset=utf-8,<script>
window.logStuff = function () {
console.log("simple " + "text message");
function wrapper() {
console.log(new Error("error object"));
console.trace();
}
wrapper();
Expand Down Expand Up @@ -100,6 +101,17 @@ add_task(async function() {
ok(TRACE_FORMAT.test(lines[1]), "Stacktrace line has the right format:\n" + lines[1]);
ok(TRACE_FORMAT.test(lines[2]), "Stacktrace line has the right format:\n" + lines[2]);

info("Test copy menu item for the error message");
message = await waitFor(() => findMessage(hud, "Error:"));
clipboardText = await copyMessageContent(hud, message);
ok(true, "Clipboard text was found and saved");
lines = clipboardText.split("\n");
is(lines[0], `Error: "error object"`, "Error object first line has expected text");
ok(lines[1].startsWith(`\twrapper data:text/html`),
"Error stacktrace first line starts with expected value");
ok(lines[2].startsWith(`\tlogStuff data:text/html`),
"Error stacktrace second line starts with expected value");

observer.destroy();
Services.prefs.clearUserPref(PREF_MESSAGE_TIMESTAMP);
});
Expand Down
11 changes: 7 additions & 4 deletions dom/base/nsDocument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6245,13 +6245,13 @@ nsIDocument::SetTitle(const nsAString& aTitle, ErrorResult& aRv)
}
#endif

// Batch updates so that mutation events don't change "the title
// element" under us
mozAutoDocUpdate updateBatch(this, true);

Maybe<mozAutoDocUpdate> updateBatch;
nsCOMPtr<Element> title = GetTitleElement();
if (rootElement->IsSVGElement(nsGkAtoms::svg)) {
if (!title) {
// Batch updates so that mutation events don't change "the title
// element" under us
updateBatch.emplace(this, true);
RefPtr<mozilla::dom::NodeInfo> titleInfo =
mNodeInfoManager->GetNodeInfo(nsGkAtoms::title, nullptr,
kNameSpaceID_SVG,
Expand All @@ -6265,6 +6265,9 @@ nsIDocument::SetTitle(const nsAString& aTitle, ErrorResult& aRv)
}
} else if (rootElement->IsHTMLElement()) {
if (!title) {
// Batch updates so that mutation events don't change "the title
// element" under us
updateBatch.emplace(this, true);
Element* head = GetHeadElement();
if (!head) {
return;
Expand Down
1 change: 1 addition & 0 deletions dom/events/test/mochitest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ support-files = bug1017086_inner.html
[test_bug1017086_enable.html]
support-files = bug1017086_inner.html
[test_bug1079236.html]
[test_bug1127588.html]
[test_bug1145910.html]
[test_bug1150308.html]
skip-if = true # bug 1421545
Expand Down
Loading

0 comments on commit cf3d94e

Please sign in to comment.