Merge mozilla-central to b2g-inbound

This commit is contained in:
Carsten "Tomcat" Book 2015-01-05 12:38:56 +01:00
commit dd9bd56199
40 changed files with 536 additions and 146 deletions

View File

@ -1439,6 +1439,7 @@ pref("devtools.timeline.enabled", true);
#else
pref("devtools.timeline.enabled", false);
#endif
pref("devtools.timeline.hiddenMarkers", "[]");
// Enable perftools via build command
#ifdef MOZ_DEVTOOLS_PERFTOOLS

View File

@ -96,7 +96,8 @@ FirefoxProfileMigrator.prototype._getResourcesInternal = function(sourceProfileD
let places = getFileResource(types.HISTORY, ["places.sqlite"]);
let cookies = getFileResource(types.COOKIES, ["cookies.sqlite"]);
let passwords = getFileResource(types.PASSWORDS,
["signons.sqlite", "logins.json", "key3.db"]);
["signons.sqlite", "logins.json", "key3.db",
"signedInUser.json"]);
let formData = getFileResource(types.FORMDATA, ["formhistory.sqlite"]);
let bookmarksBackups = getFileResource(types.OTHERDATA,
[PlacesBackups.profileRelativeFolderPath]);

View File

@ -616,14 +616,19 @@ AbstractCanvasGraph.prototype = {
/**
* Updates this graph to reflect the new dimensions of the parent node.
*
* @param boolean options.force
* Force redrawing everything
*/
refresh: function() {
refresh: function(options={}) {
let bounds = this._parent.getBoundingClientRect();
let newWidth = this.fixedWidth || bounds.width;
let newHeight = this.fixedHeight || bounds.height;
// Prevent redrawing everything if the graph's width & height won't change.
if (this._width == newWidth * this._pixelRatio &&
// Prevent redrawing everything if the graph's width & height won't change,
// except if force=true.
if (!options.force &&
this._width == newWidth * this._pixelRatio &&
this._height == newHeight * this._pixelRatio) {
this.emit("refresh-cancelled");
return;

View File

@ -6,6 +6,7 @@ support-files =
[browser_timeline_aaa_run_first_leaktest.js]
[browser_timeline_blueprint.js]
[browser_timeline_filters.js]
[browser_timeline_overview-initial-selection-01.js]
[browser_timeline_overview-initial-selection-02.js]
[browser_timeline_overview-update.js]

View File

@ -0,0 +1,93 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Tests markers filtering mechanism.
*/
add_task(function*() {
let { target, panel } = yield initTimelinePanel(SIMPLE_URL);
let { $, $$, TimelineController, TimelineView } = panel.panelWin;
yield TimelineController.toggleRecording();
ok(true, "Recording has started.");
yield waitUntil(() => {
// Wait until we get 3 different markers.
let markers = TimelineController.getMarkers();
return markers.some(m => m.name == "Styles") &&
markers.some(m => m.name == "Reflow") &&
markers.some(m => m.name == "Paint");
});
yield TimelineController.toggleRecording();
let overview = TimelineView.markersOverview;
let waterfall = TimelineView.waterfall;
// Select everything
overview.setSelection({ start: 0, end: overview.width })
$("#filter-button").click();
yield waitUntil(() => !waterfall._outstandingMarkers.length);
let menuItem1 = $("menuitem[marker-type=Styles]");
let menuItem2 = $("menuitem[marker-type=Reflow]");
let menuItem3 = $("menuitem[marker-type=Paint]");
let originalHeight = overview.fixedHeight;
ok($(".waterfall-marker-bar[type=Styles]"), "Found at least one 'Styles' marker (1)");
ok($(".waterfall-marker-bar[type=Reflow]"), "Found at least one 'Reflow' marker (1)");
ok($(".waterfall-marker-bar[type=Paint]"), "Found at least one 'Paint' marker (1)");
let heightBefore = overview.fixedHeight;
EventUtils.synthesizeMouseAtCenter(menuItem1, {type: "mouseup"}, panel.panelWin);
yield once(menuItem1, "command");
yield waitUntil(() => !waterfall._outstandingMarkers.length);
// A row is 11px. See markers-overview.js
is(overview.fixedHeight, heightBefore - 11, "Overview is smaller");
ok(!$(".waterfall-marker-bar[type=Styles]"), "No 'Styles' marker (2)");
ok($(".waterfall-marker-bar[type=Reflow]"), "Found at least one 'Reflow' marker (2)");
ok($(".waterfall-marker-bar[type=Paint]"), "Found at least one 'Paint' marker (2)");
heightBefore = overview.fixedHeight;
EventUtils.synthesizeMouseAtCenter(menuItem2, {type: "mouseup"}, panel.panelWin);
yield once(menuItem2, "command");
yield waitUntil(() => !waterfall._outstandingMarkers.length);
is(overview.fixedHeight, heightBefore - 11, "Overview is smaller");
ok(!$(".waterfall-marker-bar[type=Styles]"), "No 'Styles' marker (3)");
ok(!$(".waterfall-marker-bar[type=Reflow]"), "No 'Reflow' marker (3)");
ok($(".waterfall-marker-bar[type=Paint]"), "Found at least one 'Paint' marker (3)");
heightBefore = overview.fixedHeight;
EventUtils.synthesizeMouseAtCenter(menuItem3, {type: "mouseup"}, panel.panelWin);
yield once(menuItem3, "command");
yield waitUntil(() => !waterfall._outstandingMarkers.length);
is(overview.fixedHeight, heightBefore - 11, "Overview is smaller");
ok(!$(".waterfall-marker-bar[type=Styles]"), "No 'Styles' marker (4)");
ok(!$(".waterfall-marker-bar[type=Reflow]"), "No 'Reflow' marker (4)");
ok(!$(".waterfall-marker-bar[type=Paint]"), "No 'Paint' marker (4)");
for (let item of [menuItem1, menuItem2, menuItem3]) {
EventUtils.synthesizeMouseAtCenter(item, {type: "mouseup"}, panel.panelWin);
yield once(item, "command");
}
yield waitUntil(() => !waterfall._outstandingMarkers.length);
ok($(".waterfall-marker-bar[type=Styles]"), "Found at least one 'Styles' marker (5)");
ok($(".waterfall-marker-bar[type=Reflow]"), "Found at least one 'Reflow' marker (5)");
ok($(".waterfall-marker-bar[type=Paint]"), "Found at least one 'Paint' marker (5)");
is(overview.fixedHeight, originalHeight, "Overview restored");
$(".waterfall-marker-bar[type=Styles]");
});

View File

@ -104,4 +104,45 @@ function waitUntil(predicate, interval = 10) {
waitUntil(predicate).then(() => deferred.resolve(true));
}, interval);
return deferred.promise;
}
/**
* Wait until next tick.
*/
function nextTick() {
let def = promise.defer();
executeSoon(() => def.resolve())
return def.promise;
}
/**
* Wait for eventName on target.
* @param {Object} target An observable object that either supports on/off or
* addEventListener/removeEventListener
* @param {String} eventName
* @param {Boolean} useCapture Optional, for addEventListener/removeEventListener
* @return A promise that resolves when the event has been handled
*/
function once(target, eventName, useCapture=false) {
info("Waiting for event: '" + eventName + "' on " + target + ".");
let deferred = promise.defer();
for (let [add, remove] of [
["addEventListener", "removeEventListener"],
["addListener", "removeListener"],
["on", "off"]
]) {
if ((add in target) && (remove in target)) {
target[add](eventName, function onEvent(...aArgs) {
info("Got event: '" + eventName + "' on " + target + ".");
target[remove](eventName, onEvent, useCapture);
deferred.resolve.apply(deferred, aArgs);
}, useCapture);
break;
}
}
return deferred.promise;
}

View File

@ -7,6 +7,7 @@ const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
Cu.import("resource://gre/modules/Task.jsm");
Cu.import("resource://gre/modules/devtools/Loader.jsm");
Cu.import("resource:///modules/devtools/ViewHelpers.jsm");
devtools.lazyRequireGetter(this, "promise");
devtools.lazyRequireGetter(this, "EventEmitter",
@ -20,6 +21,8 @@ devtools.lazyRequireGetter(this, "Waterfall",
"devtools/timeline/waterfall", true);
devtools.lazyRequireGetter(this, "MarkerDetails",
"devtools/timeline/marker-details", true);
devtools.lazyRequireGetter(this, "TIMELINE_BLUEPRINT",
"devtools/timeline/global", true);
devtools.lazyImporter(this, "CanvasGraphUtils",
"resource:///modules/devtools/Graphs.jsm");
@ -30,6 +33,14 @@ devtools.lazyImporter(this, "PluralForm",
const OVERVIEW_UPDATE_INTERVAL = 200;
const OVERVIEW_INITIAL_SELECTION_RATIO = 0.15;
/**
* Preference for devtools.timeline.hiddenMarkers.
* Stores which markers should be hidden.
*/
const Prefs = new ViewHelpers.Prefs("devtools.timeline", {
hiddenMarkers: ["Json", "hiddenMarkers"]
});
// The panel's window global is an EventEmitter firing the following events:
const EVENTS = {
// When a recording is started or stopped, via the `stopwatch` button.
@ -277,8 +288,9 @@ let TimelineView = {
* Initialization function, called when the tool is started.
*/
initialize: Task.async(function*() {
this.markersOverview = new MarkersOverview($("#markers-overview"));
this.waterfall = new Waterfall($("#timeline-waterfall"), $("#timeline-pane"));
let blueprint = this._getFilteredBluePrint();
this.markersOverview = new MarkersOverview($("#markers-overview"), blueprint);
this.waterfall = new Waterfall($("#timeline-waterfall"), $("#timeline-pane"), blueprint);
this.markerDetails = new MarkerDetails($("#timeline-waterfall-details"), $("#timeline-waterfall-container > splitter"));
this._onSelecting = this._onSelecting.bind(this);
@ -292,7 +304,10 @@ let TimelineView = {
this.waterfall.on("unselected", this._onMarkerSelected);
yield this.markersOverview.ready();
yield this.waterfall.recalculateBounds();
this._buildFilterPopup();
}),
/**
@ -465,7 +480,101 @@ let TimelineView = {
_onRefresh: function() {
this.waterfall.recalculateBounds();
this.updateWaterfall();
}
},
/**
* Rebuild a blueprint without hidden markers.
*/
_getFilteredBluePrint: function() {
let hiddenMarkers = Prefs.hiddenMarkers;
let filteredBlueprint = Cu.cloneInto(TIMELINE_BLUEPRINT, {});
let maybeRemovedGroups = new Set();
let removedGroups = new Set();
// 1. Remove hidden markers from the blueprint.
for (let hiddenMarkerName of hiddenMarkers) {
maybeRemovedGroups.add(filteredBlueprint[hiddenMarkerName].group);
delete filteredBlueprint[hiddenMarkerName];
}
// 2. Get a list of all the groups that will be removed.
for (let removedGroup of maybeRemovedGroups) {
let markerNames = Object.keys(filteredBlueprint);
let allGroupsRemoved = markerNames.every(e => filteredBlueprint[e].group != removedGroup);
if (allGroupsRemoved) {
removedGroups.add(removedGroup);
}
}
// 3. Offset groups.
for (let removedGroup of removedGroups) {
for (let [, markerDetails] of Iterator(filteredBlueprint)) {
if (markerDetails.group > removedGroup) {
markerDetails.group--;
}
}
}
return filteredBlueprint;
},
/**
* When the list of hidden markers changes, update waterfall
* and overview.
*/
_onHiddenMarkersChanged: function(e) {
let menuItems = $$("#timelineFilterPopup menuitem[marker-type]:not([checked])");
let hiddenMarkers = Array.map(menuItems, e => e.getAttribute("marker-type"));
Prefs.hiddenMarkers = hiddenMarkers;
let blueprint = this._getFilteredBluePrint();
this.waterfall.setBlueprint(blueprint);
this.updateWaterfall();
this.markersOverview.setBlueprint(blueprint);
this.markersOverview.refresh({ force: true });
},
/**
* Creates the filter popup.
*/
_buildFilterPopup: function() {
let popup = $("#timelineFilterPopup");
let button = $("#filter-button");
popup.addEventListener("popupshowing", () => button.setAttribute("open", "true"));
popup.addEventListener("popuphiding", () => button.removeAttribute("open"));
this._onHiddenMarkersChanged = this._onHiddenMarkersChanged.bind(this);
for (let [markerName, markerDetails] of Iterator(TIMELINE_BLUEPRINT)) {
let menuitem = document.createElement("menuitem");
menuitem.setAttribute("closemenu", "none");
menuitem.setAttribute("type", "checkbox");
menuitem.setAttribute("marker-type", markerName);
menuitem.setAttribute("label", markerDetails.label);
menuitem.setAttribute("flex", "1");
menuitem.setAttribute("align", "center");
menuitem.addEventListener("command", this._onHiddenMarkersChanged);
if (Prefs.hiddenMarkers.indexOf(markerName) == -1) {
menuitem.setAttribute("checked", "true");
}
// Style used by pseudo element ::before in timeline.css.in
let bulletStyle = `--bullet-bg: ${markerDetails.fill};`
bulletStyle += `--bullet-border: ${markerDetails.stroke}`;
menuitem.setAttribute("style", bulletStyle);
popup.appendChild(menuitem);
}
},
};
/**

View File

@ -17,6 +17,10 @@
<script src="chrome://browser/content/devtools/theme-switching.js"/>
<script type="application/javascript" src="timeline.js"/>
<popupset id="timelinePopupset">
<menupopup id="timelineFilterPopup" position="after_start"/>
</popupset>
<vbox class="theme-body" flex="1">
<toolbar id="timeline-toolbar"
class="devtools-toolbar">
@ -27,6 +31,10 @@
class="devtools-toolbarbutton"
oncommand="TimelineController.toggleRecording()"
tooltiptext="&timelineUI.recordButton.tooltip;"/>
<toolbarbutton id="filter-button"
popup="timelineFilterPopup"
class="devtools-toolbarbutton"
tooltiptext="&timelineUI.filterButton.tooltip;"/>
<checkbox id="memory-checkbox"
label="&timelineUI.memoryCheckbox.label;"
oncommand="TimelineController.updateMemoryRecording()"

View File

@ -16,13 +16,11 @@ Cu.import("resource:///modules/devtools/ViewHelpers.jsm");
loader.lazyRequireGetter(this, "L10N",
"devtools/timeline/global", true);
loader.lazyRequireGetter(this, "TIMELINE_BLUEPRINT",
"devtools/timeline/global", true);
const HTML_NS = "http://www.w3.org/1999/xhtml";
const OVERVIEW_HEADER_HEIGHT = 14; // px
const OVERVIEW_BODY_HEIGHT = 55; // 11px * 5 groups
const OVERVIEW_ROW_HEIGHT = 11; // row height
const OVERVIEW_BACKGROUND_COLOR = "#fff";
const OVERVIEW_CLIPHEAD_LINE_COLOR = "#666";
@ -50,13 +48,16 @@ const OVERVIEW_GROUP_ALTERNATING_BACKGROUND = "rgba(0,0,0,0.05)";
*
* @param nsIDOMNode parent
* The parent node holding the overview.
* @param Object blueprint
* List of names and colors defining markers.
*/
function MarkersOverview(parent, ...args) {
function MarkersOverview(parent, blueprint, ...args) {
AbstractCanvasGraph.apply(this, [parent, "markers-overview", ...args]);
this.once("ready", () => {
// Set the list of names, properties and colors used to paint this overview.
this.setBlueprint(TIMELINE_BLUEPRINT);
// Set the list of names, properties and colors used to paint this overview.
this.setBlueprint(blueprint);
this.once("ready", () => {
// Populate this overview with some dummy initial data.
this.setData({ interval: { startTime: 0, endTime: 1000 }, markers: [] });
});
@ -68,14 +69,14 @@ MarkersOverview.prototype = Heritage.extend(AbstractCanvasGraph.prototype, {
selectionBackgroundColor: OVERVIEW_SELECTION_BACKGROUND_COLOR,
selectionStripesColor: OVERVIEW_SELECTION_STRIPES_COLOR,
headerHeight: OVERVIEW_HEADER_HEIGHT,
bodyHeight: OVERVIEW_BODY_HEIGHT,
rowHeight: OVERVIEW_ROW_HEIGHT,
groupPadding: OVERVIEW_GROUP_VERTICAL_PADDING,
/**
* Compute the height of the overview.
*/
get fixedHeight() {
return this.headerHeight + this.bodyHeight;
return this.headerHeight + this.rowHeight * (this._lastGroup + 1);
},
/**
@ -119,14 +120,17 @@ MarkersOverview.prototype = Heritage.extend(AbstractCanvasGraph.prototype, {
// draw all markers sharing the same style at once.
for (let marker of markers) {
this._paintBatches.get(marker.name).batch.push(marker);
let markerType = this._paintBatches.get(marker.name);
if (markerType) {
markerType.batch.push(marker);
}
}
// Calculate each group's height, and the time-based scaling.
let totalGroups = this._lastGroup + 1;
let headerHeight = this.headerHeight * this._pixelRatio;
let groupHeight = this.bodyHeight * this._pixelRatio / totalGroups;
let groupHeight = this.rowHeight * this._pixelRatio;
let groupPadding = this.groupPadding * this._pixelRatio;
let totalTime = (endTime - startTime) || 0;

View File

@ -12,8 +12,6 @@ const {Ci, Cu} = require("chrome");
loader.lazyRequireGetter(this, "L10N",
"devtools/timeline/global", true);
loader.lazyRequireGetter(this, "TIMELINE_BLUEPRINT",
"devtools/timeline/global", true);
loader.lazyImporter(this, "setNamedTimeout",
"resource:///modules/devtools/ViewHelpers.jsm");
@ -50,8 +48,10 @@ const WATERFALL_ROWCOUNT_ONPAGEUPDOWN = 10;
* The parent node holding the waterfall.
* @param nsIDOMNode container
* The container node that key events should be bound to.
* @param Object blueprint
* List of names and colors defining markers.
*/
function Waterfall(parent, container) {
function Waterfall(parent, container, blueprint) {
EventEmitter.decorate(this);
this._parent = parent;
@ -75,7 +75,7 @@ function Waterfall(parent, container) {
// Lazy require is a bit slow, and these are hot objects.
this._l10n = L10N;
this._blueprint = TIMELINE_BLUEPRINT;
this._blueprint = blueprint
this._setNamedTimeout = setNamedTimeout;
this._clearNamedTimeout = clearNamedTimeout;
@ -120,6 +120,14 @@ Waterfall.prototype = {
this.selectRow(this._selectedRowIdx);
},
/**
* List of names and colors used to paint markers.
* @see TIMELINE_BLUEPRINT in timeline/widgets/global.js
*/
setBlueprint: function(blueprint) {
this._blueprint = blueprint;
},
/**
* Keybindings.
*/
@ -251,6 +259,10 @@ Waterfall.prototype = {
if (!isMarkerInRange(marker, startTime, endTime)) {
continue;
}
if (!(marker.name in this._blueprint)) {
continue;
}
// Only build and display a finite number of markers initially, to
// preserve a snappy UI. After a certain delay, continue building the
// outstanding markers while there's (hopefully) no user interaction.

View File

@ -19,15 +19,19 @@
- as a label to signal that a recording is in progress. -->
<!ENTITY timelineUI.recordLabel "Recording…">
<!-- LOCALIZATION NOTE (timelineUI.timelineUI.memoryCheckbox.label): This string
<!-- LOCALIZATION NOTE (timelineUI.memoryCheckbox.label): This string
- is displayed next to a checkbox determining whether or not memory
- measurements are enabled. -->
<!ENTITY timelineUI.memoryCheckbox.label "Memory">
<!-- LOCALIZATION NOTE (timelineUI.timelineUI.memoryCheckbox.tooltip): This string
<!-- LOCALIZATION NOTE (timelineUI.memoryCheckbox.tooltip): This string
- is displayed next to the memory checkbox -->
<!ENTITY timelineUI.memoryCheckbox.tooltip "Enable memory measurements">
<!-- LOCALIZATION NOTE (timelineUI.filterButton.tooltip): This string
- is displayed next to the filter button-->
<!ENTITY timelineUI.filterButton.tooltip "Select what data to display">
<!-- LOCALIZATION NOTE (timelineUI.emptyNotice1/2): This is the label shown
- in the timeline view when empty. -->
<!ENTITY timelineUI.emptyNotice1 "Click on the">

View File

@ -274,6 +274,7 @@ browser.jar:
* skin/classic/browser/devtools/profiler.css (devtools/profiler.css)
* skin/classic/browser/devtools/performance.css (devtools/performance.css)
* skin/classic/browser/devtools/timeline.css (devtools/timeline.css)
skin/classic/browser/devtools/timeline-filter.svg (../shared/devtools/images/timeline-filter.svg)
* skin/classic/browser/devtools/scratchpad.css (devtools/scratchpad.css)
* skin/classic/browser/devtools/shadereditor.css (devtools/shadereditor.css)
* skin/classic/browser/devtools/splitview.css (../shared/devtools/splitview.css)

View File

@ -405,6 +405,7 @@ browser.jar:
* skin/classic/browser/devtools/profiler.css (devtools/profiler.css)
* skin/classic/browser/devtools/performance.css (devtools/performance.css)
* skin/classic/browser/devtools/timeline.css (devtools/timeline.css)
skin/classic/browser/devtools/timeline-filter.svg (../shared/devtools/images/timeline-filter.svg)
* skin/classic/browser/devtools/scratchpad.css (devtools/scratchpad.css)
* skin/classic/browser/devtools/shadereditor.css (devtools/shadereditor.css)
* skin/classic/browser/devtools/splitview.css (../shared/devtools/splitview.css)

View File

@ -1,7 +1,5 @@
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" x="0px" y="0px" viewBox="0 0 100 100" enable-background="new 0 0 100 100">
<g fill="#424E5A">
<circle cx="50" cy="50" r="44" style="stroke: #424E5A; stroke-width: 11; fill: transparent;"/>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" fill="#424E5A">
<circle cx="50" cy="50" r="44" stroke="#424E5A" stroke-width="11" fill="none"/>
<circle cx="50" cy="24.6" r="6.4"/>
<rect x="45" y="39.9" width="10.1" height="41.8"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 348 B

After

Width:  |  Height:  |  Size: 258 B

View File

@ -0,0 +1,37 @@
<?xml version="1.0"?>
<!-- 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/. -->
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
x="0px" y="0px"
width="16" height="16"
viewBox="0 0 16 16"
enable-background="new 0 0 16 16"
xml:space="preserve">
<style>
use:not(:target) {
display: none;
}
use {
fill: #EDF0F1;
}
use[id$="-disabled"] {
fill-opacity: 0.5;
}
use[id$="-open"] {
fill: #3BACE5;
}
</style>
<defs style="display:none">
<path id="filter-shape"
d="M 2,2 v 3 l 5,4 v 6 h 2 v -6 l 5,-4 v -3 L 14,2 z"/>
</defs>
<use id="filter" xlink:href="#filter-shape"/>
<use id="filter-disabled" xlink:href="#filter-shape"/>
<use id="filter-open" xlink:href="#filter-shape"/>
</svg>

After

Width:  |  Height:  |  Size: 941 B

View File

@ -5,6 +5,7 @@
#record-button {
list-style-image: url(profiler-stopwatch.svg);
min-width: 24px;
}
#record-button[checked] {
@ -15,6 +16,35 @@
visibility: hidden;
}
#memory-checkbox .checkbox-label {
line-height: 100%;
}
#filter-button {
list-style-image: url(timeline-filter.svg#filter);
min-width: 24px;
}
#filter-button[disabled] {
list-style-image: url(timeline-filter.svg#filter-disabled);
}
#filter-button[open] {
list-style-image: url(timeline-filter.svg#filter-open);
}
#timelineFilterPopup > menuitem:before {
content: "";
display: block;
width: 8px;
height: 8px;
margin: 0 8px;
border: 1px solid;
border-radius: 1px;
background-color: var(--bullet-bg);
border-color: var(--bullet-border);
}
.notice-container {
font-size: 120%;
padding-bottom: 35vh;
@ -194,7 +224,6 @@
.marker-details-bullet {
width: 8px;
height: 8px;
margin: 0 8px;
border: 1px solid;
border-radius: 1px;
}

View File

@ -161,25 +161,25 @@
}
/* Button States */
.theme-dark .devtools-toolbarbutton:hover,
.theme-dark #toolbox-buttons .devtools-toolbarbutton[text-as-image]:hover,
.theme-dark .devtools-toolbarbutton[label]:not([text-as-image]):not([type=menu-button]):hover {
.theme-dark .devtools-toolbarbutton:not([disabled]):hover,
.theme-dark #toolbox-buttons .devtools-toolbarbutton:not([disabled])[text-as-image]:hover,
.theme-dark .devtools-toolbarbutton:not([disabled])[label]:not([text-as-image]):not([type=menu-button]):hover {
background: rgba(0, 0, 0, .3); /* Splitters */
}
.theme-light .devtools-toolbarbutton:hover,
.theme-light #toolbox-buttons .devtools-toolbarbutton[text-as-image]:hover,
.theme-light .devtools-toolbarbutton[label]:not([text-as-image]):not([type=menu-button]):hover {
.theme-light .devtools-toolbarbutton:not([disabled]):hover,
.theme-light #toolbox-buttons .devtools-toolbarbutton:not([disabled])[text-as-image]:hover,
.theme-light .devtools-toolbarbutton:not([disabled])[label]:not([text-as-image]):not([type=menu-button]):hover {
background: rgba(170, 170, 170, .3); /* Splitters */
}
.theme-dark .devtools-toolbarbutton:hover:active,
.theme-dark #toolbox-buttons .devtools-toolbarbutton[text-as-image]:hover:active,
.theme-dark .devtools-toolbarbutton[label]:not([text-as-image]):not([type=menu-button]):hover:active {
.theme-dark .devtools-toolbarbutton:not([disabled]):hover:active,
.theme-dark #toolbox-buttons .devtools-toolbarbutton:not([disabled])[text-as-image]:hover:active,
.theme-dark .devtools-toolbarbutton:not([disabled])[label]:not([text-as-image]):not([type=menu-button]):hover:active {
background: rgba(0, 0, 0, .4); /* Splitters */
}
.theme-light .devtools-toolbarbutton:hover:active,
.theme-light #toolbox-buttons .devtools-toolbarbutton[text-as-image]:hover:active,
.theme-light .devtools-toolbarbutton[label]:not([text-as-image]):not([type=menu-button]):hover:active {
.theme-light .devtools-toolbarbutton:not([disabled]):hover:active,
.theme-light #toolbox-buttons .devtools-toolbarbutton:not([disabled])[text-as-image]:hover:active,
.theme-light .devtools-toolbarbutton:not([disabled])[label]:not([text-as-image]):not([type=menu-button]):hover:active {
background: rgba(170, 170, 170, .4); /* Splitters */
}

View File

@ -312,6 +312,7 @@ browser.jar:
* skin/classic/browser/devtools/profiler.css (devtools/profiler.css)
* skin/classic/browser/devtools/performance.css (devtools/performance.css)
* skin/classic/browser/devtools/timeline.css (devtools/timeline.css)
skin/classic/browser/devtools/timeline-filter.svg (../shared/devtools/images/timeline-filter.svg)
* skin/classic/browser/devtools/scratchpad.css (devtools/scratchpad.css)
* skin/classic/browser/devtools/shadereditor.css (devtools/shadereditor.css)
skin/classic/browser/devtools/storage.css (../shared/devtools/storage.css)
@ -771,6 +772,7 @@ browser.jar:
* skin/classic/aero/browser/devtools/profiler.css (devtools/profiler.css)
* skin/classic/aero/browser/devtools/performance.css (devtools/performance.css)
* skin/classic/aero/browser/devtools/timeline.css (devtools/timeline.css)
skin/classic/aero/browser/devtools/timeline-filter.svg (../shared/devtools/images/timeline-filter.svg)
* skin/classic/aero/browser/devtools/scratchpad.css (devtools/scratchpad.css)
* skin/classic/aero/browser/devtools/shadereditor.css (devtools/shadereditor.css)
* skin/classic/aero/browser/devtools/splitview.css (../shared/devtools/splitview.css)

View File

@ -31,7 +31,7 @@
#include "nsContentUtils.h"
#include "mozilla/Preferences.h"
#include "xpcpublic.h"
#include "nsCrossSiteListenerProxy.h"
#include "nsCORSListenerProxy.h"
#include "nsWrapperCacheInlines.h"
#include "mozilla/Attributes.h"
#include "nsError.h"

View File

@ -10,7 +10,7 @@
#include "HTMLLinkElement.h"
#include "nsContentPolicyUtils.h"
#include "nsContentUtils.h"
#include "nsCrossSiteListenerProxy.h"
#include "nsCORSListenerProxy.h"
#include "nsIChannel.h"
#include "nsIContentPolicy.h"
#include "nsIContentSecurityPolicy.h"

View File

@ -20,7 +20,7 @@
#include "nsIContentPolicy.h"
#include "nsIContentSecurityPolicy.h"
#include "nsContentPolicyUtils.h"
#include "nsCrossSiteListenerProxy.h"
#include "nsCORSListenerProxy.h"
#include "nsISupportsPriority.h"
#include "nsICachingChannel.h"
#include "nsIWebContentHandlerRegistrar.h"

View File

@ -61,7 +61,6 @@ EXPORTS += [
'nsContentTypeParser.h',
'nsContentUtils.h',
'nsCopySupport.h',
'nsCrossSiteListenerProxy.h',
'nsDeprecatedOperationList.h',
'nsDocElementCreatedNotificationRunner.h',
'nsDocumentWarningList.h',
@ -245,7 +244,6 @@ UNIFIED_SOURCES += [
'nsContentPolicy.cpp',
'nsContentSink.cpp',
'nsCopySupport.cpp',
'nsCrossSiteListenerProxy.cpp',
'nsDataDocumentContentPolicy.cpp',
'nsDocument.cpp',
'nsDocumentEncoder.cpp',

View File

@ -2334,86 +2334,104 @@ DOMGCSliceCallback(JSRuntime *aRt, JS::GCProgress aProgress, const JS::GCDescrip
{
NS_ASSERTION(NS_IsMainThread(), "GCs must run on the main thread");
if (aProgress == JS::GC_CYCLE_END) {
PRTime delta = GetCollectionTimeDelta();
switch (aProgress) {
case JS::GC_CYCLE_BEGIN: {
// Prevent cycle collections and shrinking during incremental GC.
sCCLockedOut = true;
if (sPostGCEventsToConsole) {
NS_NAMED_LITERAL_STRING(kFmt, "GC(T+%.1f) ");
nsString prefix, gcstats;
gcstats.Adopt(aDesc.formatMessage(aRt));
prefix.Adopt(nsTextFormatter::smprintf(kFmt.get(),
nsJSContext::KillShrinkGCBuffersTimer();
break;
}
case JS::GC_CYCLE_END: {
PRTime delta = GetCollectionTimeDelta();
if (sPostGCEventsToConsole) {
NS_NAMED_LITERAL_STRING(kFmt, "GC(T+%.1f) ");
nsString prefix, gcstats;
gcstats.Adopt(aDesc.formatMessage(aRt));
prefix.Adopt(nsTextFormatter::smprintf(kFmt.get(),
double(delta) / PR_USEC_PER_SEC));
nsString msg = prefix + gcstats;
nsCOMPtr<nsIConsoleService> cs = do_GetService(NS_CONSOLESERVICE_CONTRACTID);
if (cs) {
cs->LogStringMessage(msg.get());
nsString msg = prefix + gcstats;
nsCOMPtr<nsIConsoleService> cs = do_GetService(NS_CONSOLESERVICE_CONTRACTID);
if (cs) {
cs->LogStringMessage(msg.get());
}
}
}
if (sPostGCEventsToObserver) {
nsString json;
json.Adopt(aDesc.formatJSON(aRt, PR_Now()));
nsRefPtr<NotifyGCEndRunnable> notify = new NotifyGCEndRunnable(json);
NS_DispatchToMainThread(notify);
}
}
// Prevent cycle collections and shrinking during incremental GC.
if (aProgress == JS::GC_CYCLE_BEGIN) {
sCCLockedOut = true;
nsJSContext::KillShrinkGCBuffersTimer();
} else if (aProgress == JS::GC_CYCLE_END) {
sCCLockedOut = false;
}
// The GC has more work to do, so schedule another GC slice.
if (aProgress == JS::GC_SLICE_END) {
nsJSContext::KillInterSliceGCTimer();
if (!sShuttingDown) {
CallCreateInstance("@mozilla.org/timer;1", &sInterSliceGCTimer);
sInterSliceGCTimer->InitWithFuncCallback(InterSliceGCTimerFired,
nullptr,
NS_INTERSLICE_GC_DELAY,
nsITimer::TYPE_ONE_SHOT);
}
}
if (aProgress == JS::GC_CYCLE_END) {
// May need to kill the inter-slice GC timer
nsJSContext::KillInterSliceGCTimer();
sCCollectedWaitingForGC = 0;
sCCollectedZonesWaitingForGC = 0;
sLikelyShortLivingObjectsNeedingGC = 0;
sCleanupsSinceLastGC = 0;
sNeedsFullCC = true;
sHasRunGC = true;
nsJSContext::MaybePokeCC();
if (aDesc.isCompartment_) {
if (!sFullGCTimer && !sShuttingDown) {
CallCreateInstance("@mozilla.org/timer;1", &sFullGCTimer);
sFullGCTimer->InitWithFuncCallback(FullGCTimerFired,
nullptr,
NS_FULL_GC_DELAY,
nsITimer::TYPE_ONE_SHOT);
if (sPostGCEventsToObserver) {
nsString json;
json.Adopt(aDesc.formatJSON(aRt, PR_Now()));
nsRefPtr<NotifyGCEndRunnable> notify = new NotifyGCEndRunnable(json);
NS_DispatchToMainThread(notify);
}
} else {
nsJSContext::KillFullGCTimer();
// Avoid shrinking during heavy activity, which is suggested by
// compartment GC.
nsJSContext::PokeShrinkGCBuffers();
sCCLockedOut = false;
// May need to kill the inter-slice GC timer
nsJSContext::KillInterSliceGCTimer();
sCCollectedWaitingForGC = 0;
sCCollectedZonesWaitingForGC = 0;
sLikelyShortLivingObjectsNeedingGC = 0;
sCleanupsSinceLastGC = 0;
sNeedsFullCC = true;
sHasRunGC = true;
nsJSContext::MaybePokeCC();
if (aDesc.isCompartment_) {
if (!sFullGCTimer && !sShuttingDown) {
CallCreateInstance("@mozilla.org/timer;1", &sFullGCTimer);
sFullGCTimer->InitWithFuncCallback(FullGCTimerFired,
nullptr,
NS_FULL_GC_DELAY,
nsITimer::TYPE_ONE_SHOT);
}
} else {
nsJSContext::KillFullGCTimer();
// Avoid shrinking during heavy activity, which is suggested by
// compartment GC.
nsJSContext::PokeShrinkGCBuffers();
}
if (ShouldTriggerCC(nsCycleCollector_suspectedCount())) {
nsCycleCollector_dispatchDeferredDeletion();
}
break;
}
case JS::GC_SLICE_BEGIN:
break;
case JS::GC_SLICE_END:
// The GC has more work to do, so schedule another GC slice.
nsJSContext::KillInterSliceGCTimer();
if (!sShuttingDown) {
CallCreateInstance("@mozilla.org/timer;1", &sInterSliceGCTimer);
sInterSliceGCTimer->InitWithFuncCallback(InterSliceGCTimerFired,
nullptr,
NS_INTERSLICE_GC_DELAY,
nsITimer::TYPE_ONE_SHOT);
}
if (ShouldTriggerCC(nsCycleCollector_suspectedCount())) {
nsCycleCollector_dispatchDeferredDeletion();
}
break;
default:
MOZ_CRASH("Unexpected GCProgress value");
}
if ((aProgress == JS::GC_SLICE_END || aProgress == JS::GC_CYCLE_END) &&
ShouldTriggerCC(nsCycleCollector_suspectedCount())) {
nsCycleCollector_dispatchDeferredDeletion();
}
if (sPrevGCSliceCallback)
if (sPrevGCSliceCallback) {
(*sPrevGCSliceCallback)(aRt, aProgress, aDesc);
}
}
void

View File

@ -43,7 +43,7 @@
#include "prlog.h"
#include "nsCRT.h"
#include "nsContentCreatorFunctions.h"
#include "nsCrossSiteListenerProxy.h"
#include "nsCORSListenerProxy.h"
#include "nsSandboxFlags.h"
#include "nsContentTypeParser.h"
#include "nsINetworkPredictor.h"

View File

@ -23,7 +23,7 @@
#include "nsNetUtil.h"
#include "nsAutoPtr.h"
#include "nsStreamUtils.h"
#include "nsCrossSiteListenerProxy.h"
#include "nsCORSListenerProxy.h"
#include <algorithm>
using mozilla::net::ReferrerPolicy;

View File

@ -46,7 +46,7 @@
#include "nsIContentPolicy.h"
#include "nsContentPolicyUtils.h"
#include "nsError.h"
#include "nsCrossSiteListenerProxy.h"
#include "nsCORSListenerProxy.h"
#include "nsIHTMLDocument.h"
#include "nsIStorageStream.h"
#include "nsIPromptFactory.h"

View File

@ -52,7 +52,7 @@
#include "nsIContentPolicy.h"
#include "nsContentPolicyUtils.h"
#include "nsCrossSiteListenerProxy.h"
#include "nsCORSListenerProxy.h"
#include "nsCycleCollectionParticipant.h"
#include "nsICachingChannel.h"
#include "nsLayoutUtils.h"

View File

@ -22,7 +22,7 @@
#include "nsIRequestObserver.h"
#include "nsIStreamListener.h"
#include "nsIScriptSecurityManager.h"
#include "nsCrossSiteListenerProxy.h"
#include "nsCORSListenerProxy.h"
#include "mozilla/dom/HTMLMediaElement.h"
#include "nsError.h"
#include "nsICachingChannel.h"

View File

@ -11,7 +11,12 @@ EXPORTS.mozilla.dom += [
'nsMixedContentBlocker.h',
]
EXPORTS += [
'nsCORSListenerProxy.h'
]
UNIFIED_SOURCES += [
'nsCORSListenerProxy.cpp',
'nsCSPContext.cpp',
'nsCSPParser.cpp',
'nsCSPService.cpp',

View File

@ -6,7 +6,7 @@
#include "mozilla/Assertions.h"
#include "mozilla/LinkedList.h"
#include "nsCrossSiteListenerProxy.h"
#include "nsCORSListenerProxy.h"
#include "nsIChannel.h"
#include "nsIHttpChannel.h"
#include "nsError.h"

View File

@ -34,7 +34,7 @@
#include "nsAttrName.h"
#include "nsIScriptError.h"
#include "nsIURL.h"
#include "nsCrossSiteListenerProxy.h"
#include "nsCORSListenerProxy.h"
#include "nsError.h"
#include "mozilla/Attributes.h"
#include "mozilla/dom/Element.h"

View File

@ -16,7 +16,7 @@
#include "nsCOMPtr.h"
#include "nsContentUtils.h"
#include "nsCrossSiteListenerProxy.h"
#include "nsCORSListenerProxy.h"
#include "nsNetUtil.h"
#include "nsMimeTypes.h"
#include "nsStreamUtils.h"

View File

@ -1959,14 +1959,6 @@ public:
}
NS_DISPLAY_DECL_NAME(mName, mType)
virtual nsRect GetComponentAlphaBounds(nsDisplayListBuilder* aBuilder) MOZ_OVERRIDE {
if (mType == nsDisplayItem::TYPE_HEADER_FOOTER) {
bool snap;
return GetBounds(aBuilder, &snap);
}
return nsRect();
}
protected:
PaintCallback mPaint;
const char* mName;

View File

@ -46,7 +46,7 @@
#include "nsCCUncollectableMarker.h"
#include "nsTextFragment.h"
#include "nsCSSRuleProcessor.h"
#include "nsCrossSiteListenerProxy.h"
#include "nsCORSListenerProxy.h"
#include "nsHTMLDNSPrefetch.h"
#include "nsHtml5Module.h"
#include "mozilla/dom/FallbackEncoding.h"

View File

@ -470,18 +470,45 @@ GetNextPage(nsIFrame* aPageContentFrame)
return f;
}
static void PaintHeaderFooter(nsIFrame* aFrame, nsRenderingContext* aCtx,
const nsRect& aDirtyRect, nsPoint aPt)
{
static_cast<nsPageFrame*>(aFrame)->PaintHeaderFooter(*aCtx, aPt);
}
static gfx::Matrix4x4 ComputePageTransform(nsIFrame* aFrame, float aAppUnitsPerPixel)
{
float scale = aFrame->PresContext()->GetPageScale();
return gfx::Matrix4x4::Scaling(scale, scale, 1);
}
class nsDisplayHeaderFooter : public nsDisplayItem {
public:
nsDisplayHeaderFooter(nsDisplayListBuilder* aBuilder, nsPageFrame *aFrame)
: nsDisplayItem(aBuilder, aFrame), mFrame(aFrame)
, mDisableSubpixelAA(false)
{
MOZ_COUNT_CTOR(nsDisplayHeaderFooter);
}
#ifdef NS_BUILD_REFCNT_LOGGING
virtual ~nsDisplayHeaderFooter() {
MOZ_COUNT_DTOR(nsDisplayHeaderFooter);
}
#endif
virtual void Paint(nsDisplayListBuilder* aBuilder,
nsRenderingContext* aCtx) MOZ_OVERRIDE {
mFrame->PaintHeaderFooter(*aCtx, ToReferenceFrame(), mDisableSubpixelAA);
}
NS_DISPLAY_DECL_NAME("HeaderFooter", nsDisplayItem::TYPE_HEADER_FOOTER)
virtual nsRect GetComponentAlphaBounds(nsDisplayListBuilder* aBuilder) MOZ_OVERRIDE {
bool snap;
return GetBounds(aBuilder, &snap);
}
virtual void DisableComponentAlpha() MOZ_OVERRIDE {
mDisableSubpixelAA = true;
}
protected:
nsPageFrame* mFrame;
bool mDisableSubpixelAA;
};
//------------------------------------------------------------------------------
void
nsPageFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
@ -563,9 +590,7 @@ nsPageFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
if (PresContext()->IsRootPaginatedDocument()) {
set.Content()->AppendNewToTop(new (aBuilder)
nsDisplayGeneric(aBuilder, this, ::PaintHeaderFooter,
"HeaderFooter",
nsDisplayItem::TYPE_HEADER_FOOTER));
nsDisplayHeaderFooter(aBuilder, this));
}
set.MoveTo(aLists);
@ -582,7 +607,7 @@ nsPageFrame::SetPageNumInfo(int32_t aPageNumber, int32_t aTotalPages)
void
nsPageFrame::PaintHeaderFooter(nsRenderingContext& aRenderingContext,
nsPoint aPt)
nsPoint aPt, bool aDisableSubpixelAA)
{
nsPresContext* pc = PresContext();
@ -596,6 +621,8 @@ nsPageFrame::PaintHeaderFooter(nsRenderingContext& aRenderingContext,
nsRect rect(aPt, mRect.Size());
aRenderingContext.ThebesContext()->SetColor(NS_RGB(0,0,0));
gfxContextAutoDisableSubpixelAntialiasing disable(aRenderingContext.ThebesContext(), aDisableSubpixelAA);
// Get the FontMetrics to determine width.height of strings
nsRefPtr<nsFontMetrics> fontMet;
pc->DeviceContext()->GetMetricsFor(mPD->mHeadFootFont, nullptr, false,

View File

@ -55,7 +55,7 @@ public:
virtual bool HonorPrintBackgroundSettings() MOZ_OVERRIDE { return false; }
void PaintHeaderFooter(nsRenderingContext& aRenderingContext,
nsPoint aPt);
nsPoint aPt, bool aSubpixelAA);
protected:
explicit nsPageFrame(nsStyleContext* aContext);

View File

@ -15,7 +15,7 @@
#include "mozilla/dom/Promise.h"
#include "mozilla/AsyncEventDispatcher.h"
#include "mozilla/Preferences.h"
#include "nsCrossSiteListenerProxy.h"
#include "nsCORSListenerProxy.h"
#include "nsFontFaceLoader.h"
#include "nsIConsoleService.h"
#include "nsIContentPolicy.h"

View File

@ -47,7 +47,7 @@
#include "nsThreadUtils.h"
#include "nsGkAtoms.h"
#include "nsIThreadInternal.h"
#include "nsCrossSiteListenerProxy.h"
#include "nsCORSListenerProxy.h"
#include "nsINetworkPredictor.h"
#include "mozilla/dom/ShadowRoot.h"
#include "mozilla/dom/URL.h"

View File

@ -239,6 +239,9 @@ SpecialPowers.Cu.import('resource://gre/modules/UserAgentOverrides.jsm', window)
SpecialPowers.wrap(UserAgentOverrides).init();
SimpleTest.waitForExplicitFinish();
SimpleTest.requestCompleteLog();
info(SpecialPowers.Cc["@mozilla.org/dom/site-specific-user-agent;1"].number);
testOverrides(function ()
testInactive(function ()