Merge f-t to m-c

This commit is contained in:
Phil Ringnalda 2014-04-19 18:20:04 -07:00
commit 98235b0aae
11 changed files with 64 additions and 39 deletions

View File

@ -197,7 +197,7 @@ let gGrid = {
}
let availSpace = document.documentElement.clientHeight - this._cellMargin -
document.querySelector("#newtab-margin-top").offsetHeight;
document.querySelector("#newtab-margin-undo-container").offsetHeight;
let visibleRows = Math.floor(availSpace / this._cellHeight);
this._node.style.height = this._computeHeight() + "px";
this._node.style.maxHeight = this._computeHeight(visibleRows) + "px";

View File

@ -51,16 +51,21 @@ input[type=button] {
-moz-box-orient: vertical;
}
#newtab-margin-top {
#newtab-margin-undo-container {
display: -moz-box;
height: 40px;
-moz-box-align: center;
-moz-box-pack: center;
}
#newtab-horizontal-margin {
display: -moz-box;
-moz-box-flex: 5;
-moz-box-flex: 1;
}
#newtab-margin-top,
#newtab-margin-bottom {
display: -moz-box;
-moz-box-flex: 1;
position: relative;
}
.newtab-side-margin {

View File

@ -27,7 +27,10 @@
<div id="newtab-scrollbox">
<div id="newtab-vertical-margin">
<div id="newtab-margin-top">
<div id="newtab-margin-top"/>
<div id="newtab-margin-undo-container">
<div id="newtab-undo-container" undo-disabled="true">
<xul:label id="newtab-undo-label"
value="&newtab.undo.removedLabel;" />
@ -43,8 +46,6 @@
</div>
</div>
<xul:spacer flex="1"/>
<div id="newtab-horizontal-margin">
<div class="newtab-side-margin"/>
@ -54,7 +55,8 @@
<div class="newtab-side-margin"/>
</div>
<xul:spacer flex="1"/>
<div id="newtab-margin-bottom"/>
</div>
<input id="newtab-toggle" type="button"/>
</div>

View File

@ -783,7 +783,7 @@ InplaceEditor.prototype = {
_onBlur: function InplaceEditor_onBlur(aEvent, aDoNotClear)
{
if (aEvent && this.popup && this.popup.isOpen &&
this.contentType == CONTENT_TYPES.CSS_MIXED) {
this.popup.selectedIndex >= 0) {
let label, preLabel;
if (this._selectedIndex === undefined) {
({label, preLabel}) = this.popup.getItemAtIndex(this.popup.selectedIndex);
@ -819,6 +819,11 @@ InplaceEditor.prototype = {
};
this.popup._panel.addEventListener("popuphidden", onPopupHidden);
this.popup.hidePopup();
// Content type other than CSS_MIXED is used in rule-view where the values
// are live previewed. So we apply the value before returning.
if (this.contentType != CONTENT_TYPES.CSS_MIXED) {
this._apply();
}
return;
}
this._apply();

View File

@ -1998,7 +1998,8 @@ TextPropertyEditor.prototype = {
get editing() {
return !!(this.nameSpan.inplaceEditor || this.valueSpan.inplaceEditor ||
this.ruleEditor.ruleView.colorPicker.tooltip.isShown() ||
this.ruleEditor.ruleView.colorPicker.eyedropperOpen);
this.ruleEditor.ruleView.colorPicker.eyedropperOpen) ||
this.popup.isOpen;
},
/**

View File

@ -343,6 +343,7 @@ Experiments.Experiments = function (policy=new Experiments.Policy()) {
this._log = Log.repository.getLoggerWithMessagePrefix(
"Browser.Experiments.Experiments",
"Experiments #" + gExperimentsCounter++ + "::");
this._log.trace("constructor");
this._policy = policy;
@ -424,9 +425,12 @@ Experiments.Experiments.prototype = {
* The promise is fulfilled when all pending tasks are finished.
*/
uninit: Task.async(function* () {
this._log.trace("uninit: started");
yield this._loadTask;
this._log.trace("uninit: finished with _loadTask");
if (!this._shutdown) {
this._log.trace("uninit: no previous shutdown");
this._unregisterWithAddonManager();
gPrefs.ignore(PREF_LOGGING, configureLogging);
@ -443,6 +447,7 @@ Experiments.Experiments.prototype = {
this._shutdown = true;
if (this._mainTask) {
try {
this._log.trace("uninit: waiting on _mainTask");
yield this._mainTask;
} catch (e if e instanceof AlreadyShutdownError) {
// We error out of tasks after shutdown via that exception.

View File

@ -9,7 +9,8 @@
}
/* SCROLLBOX */
#newtab-scrollbox:not([page-disabled]) {
#newtab-scrollbox:not([page-disabled]),
#newtab-scrollbox:not([page-disabled]) #newtab-margin-bottom {
color: rgb(0,0,0);
background-color: hsl(0,0%,95%);
}

View File

@ -9,7 +9,8 @@
}
/* SCROLLBOX */
#newtab-scrollbox:not([page-disabled]) {
#newtab-scrollbox:not([page-disabled]),
#newtab-scrollbox:not([page-disabled]) #newtab-margin-bottom {
color: rgb(0,0,0);
background-color: hsl(0,0%,95%);
}

View File

@ -9,7 +9,8 @@
}
/* SCROLLBOX */
#newtab-scrollbox:not([page-disabled]) {
#newtab-scrollbox:not([page-disabled]),
#newtab-scrollbox:not([page-disabled]) #newtab-margin-bottom {
color: rgb(0,0,0);
background-color: hsl(0,0%,95%);
}

View File

@ -51,8 +51,7 @@ user_pref("toolkit.telemetry.notifiedOptOut", 999);
user_pref("font.size.inflation.emPerLine", 0);
user_pref("font.size.inflation.minTwips", 0);
// AddonManager tests require that the experiments feature be enabled.
user_pref("experiments.enabled", true);
// AddonManager tests require that the experiments provider be present.
user_pref("experiments.supported", true);
user_pref("experiments.logging.level", "Trace");
// Point the manifest at something local so we don't risk it hitting production

View File

@ -10,6 +10,8 @@ let gCategoryUtilities;
let gExperiments;
let gHttpServer;
let gSavedManifestURI;
function getExperimentAddons() {
let deferred = Promise.defer();
AddonManager.getAddonsByTypes(["experiment"], (addons) => {
@ -23,8 +25,16 @@ add_task(function* initializeState() {
gCategoryUtilities = new CategoryUtilities(gManagerWindow);
registerCleanupFunction(() => {
Services.prefs.clearUserPref("experiments.enabled");
if (gHttpServer) {
gHttpServer.stop(() => {});
Services.prefs.clearUserPref("experiments.manifest.cert.checkAttributes");
if (gSavedManifestURI !== undefined) {
Services.prefs.setCharPref("experments.manifest.uri", gSavedManifestURI);
}
}
if (gExperiments) {
gExperiments._policy.ignoreHashes = false;
}
});
@ -167,24 +177,6 @@ add_task(function* testCleanup() {
Assert.equal(addons.length, 0, "No experiment add-ons are installed.");
});
// We need to initialize the experiments service for the following tests.
add_task(function* initializeExperiments() {
if (!gExperiments) {
return;
}
// We need to remove the cache file to help ensure consistent state.
yield OS.File.remove(gExperiments._cacheFilePath);
info("Initializing experiments service.");
yield gExperiments.init();
info("Experiments service finished first run.");
// Check conditions, just to be sure.
let experiments = yield gExperiments.getExperiments();
Assert.equal(experiments.length, 0, "No experiments known to the service.");
});
// The following tests should ideally live in browser/experiments/. However,
// they rely on some of the helper functions from head.js, which can't easily
// be consumed from other directories. So, they live here.
@ -220,15 +212,24 @@ add_task(function* testActivateExperiment() {
});
Services.prefs.setBoolPref("experiments.manifest.cert.checkAttributes", false);
gSavedManifestURI = Services.prefs.getCharPref("experiments.manifest.uri");
Services.prefs.setCharPref("experiments.manifest.uri", root + "manifest");
registerCleanupFunction(() => {
Services.prefs.clearUserPref("experiments.manifest.cert.checkAttributes");
Services.prefs.clearUserPref("experiments.manifest.uri");
});
// We need to remove the cache file to help ensure consistent state.
yield OS.File.remove(gExperiments._cacheFilePath);
Services.prefs.setBoolPref("experiments.enabled", true);
info("Initializing experiments service.");
yield gExperiments.init();
info("Experiments service finished first run.");
// Check conditions, just to be sure.
let experiments = yield gExperiments.getExperiments();
Assert.equal(experiments.length, 0, "No experiments known to the service.");
// This makes testing easier.
gExperiments._policy.ignoreHashes = true;
registerCleanupFunction(() => { gExperiments._policy.ignoreHashes = false; });
info("Manually updating experiments manifest.");
yield gExperiments.updateManifest();
@ -269,6 +270,10 @@ add_task(function testDeactivateExperiment() {
add_task(function* testCleanup() {
if (gExperiments) {
Services.prefs.clearUserPref("experiments.enabled");
Services.prefs.clearUserPref("experiments.manifest.cert.checkAttributes");
Services.prefs.setCharPref("experiments.manifest.uri", gSavedManifestURI);
// We perform the uninit/init cycle to purge any leftover state.
yield OS.File.remove(gExperiments._cacheFilePath);
yield gExperiments.uninit();