merge fx-team to mozilla-central

This commit is contained in:
Carsten "Tomcat" Book 2014-01-14 15:45:38 +01:00
Родитель 8e8c44704e 0ddf6a8a1e
Коммит 270c1710d8
27 изменённых файлов: 226 добавлений и 58 удалений

Просмотреть файл

@ -7,9 +7,9 @@
#main-window:not([chromehidden~="toolbar"]) {
%ifdef XP_MACOSX
min-width: 425px;
min-width: 335px;
%else
min-width: 390px;
min-width: 300px;
%endif
}
@ -284,7 +284,7 @@ toolbarpaletteitem > #personal-bookmarks > #bookmarks-toolbar-placeholder,
}
#urlbar-container {
min-width: 50ch;
min-width: 30ch;
}
#search-container {

Просмотреть файл

@ -52,7 +52,7 @@ add_task(function() {
ok(!navbar.hasAttribute("overflowing"), "Should start with a non-overflowing toolbar.");
ok(CustomizableUI.inDefaultState, "Should start in default state.");
window.resizeTo(390, window.outerHeight);
window.resizeTo(380, window.outerHeight);
yield waitForCondition(() => navbar.hasAttribute("overflowing"));
ok(!navbar.querySelector("#search-container"), "Search container should be overflowing");
let searchbar = document.getElementById("searchbar");

Просмотреть файл

@ -108,7 +108,7 @@ add_task(function() {
ok(!navbar.hasAttribute("overflowing"), "Should start with a non-overflowing toolbar.");
ok(CustomizableUI.inDefaultState, "Should start in default state.");
window.resizeTo(480, window.outerHeight);
window.resizeTo(380, window.outerHeight);
yield waitForCondition(() => navbar.hasAttribute("overflowing"));
ok(!navbar.querySelector("#" + kSearchBox), "Search container should be overflowing");
let placements = CustomizableUI.getWidgetIdsInArea(navbar.id);

Просмотреть файл

@ -1868,7 +1868,11 @@ VariableBubbleView.prototype = {
if (VariablesView.isPrimitive({ value: objectActor })) {
let className = VariablesView.getClass(objectActor);
let textContent = VariablesView.getString(objectActor);
this._tooltip.setTextContent([textContent], className, "plain");
this._tooltip.setTextContent({
messages: [textContent],
messagesClass: className,
containerClass: "plain"
});
} else {
this._tooltip.setVariableContent(objectActor, {
searchPlaceholder: L10N.getStr("emptyPropertiesFilterText"),

Просмотреть файл

@ -81,7 +81,8 @@ ToolbarView.prototype = {
*/
showResumeWarning: function(aPausedUrl) {
let label = L10N.getFormatStr("resumptionOrderPanelTitle", aPausedUrl);
this._resumeOrderTooltip.setTextContent([label]);
let defaultStyle = "default-tooltip-simple-text-colors";
this._resumeOrderTooltip.setTextContent({ messages: [label], isAlertTooltip: true });
this._resumeOrderTooltip.show(this._resumeButton);
},

Просмотреть файл

@ -1239,6 +1239,9 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, {
let copyUrlElement = $("#request-menu-context-copy-url");
copyUrlElement.hidden = !this.selectedItem;
let newTabElement = $("#request-menu-context-newtab");
newTabElement.hidden = !this.selectedItem;
},
/**

Просмотреть файл

@ -567,7 +567,7 @@ let ShadersEditorsView = {
let tooltip = node._markerErrorsTooltip = new Tooltip(document);
tooltip.defaultOffsetX = GUTTER_ERROR_PANEL_OFFSET_X;
tooltip.setTextContent(messages);
tooltip.setTextContent({ messages: messages });
tooltip.startTogglingOnHover(node, () => true, GUTTER_ERROR_PANEL_DELAY);
},

Просмотреть файл

@ -411,10 +411,12 @@ Tooltip.prototype = {
* A style class for the text messages.
* @param {string} containerClass [optional]
* A style class for the text messages container.
* @param {boolean} isAlertTooltip [optional]
* Pass true to add an alert image for your tooltip.
*/
setTextContent: function(messages,
messagesClass = "default-tooltip-simple-text-colors",
containerClass = "default-tooltip-simple-text-colors") {
setTextContent: function({ messages, messagesClass, containerClass, isAlertTooltip }) {
messagesClass = messagesClass || "default-tooltip-simple-text-colors";
containerClass = containerClass || "default-tooltip-simple-text-colors";
let vbox = this.doc.createElement("vbox");
vbox.className = "devtools-tooltip-simple-text-container " + containerClass;
@ -428,7 +430,18 @@ Tooltip.prototype = {
vbox.appendChild(description);
}
this.content = vbox;
if (isAlertTooltip) {
let hbox = this.doc.createElement("hbox");
hbox.setAttribute("align", "start");
let alertImg = this.doc.createElement("image");
alertImg.className = "devtools-tooltip-alert-icon";
hbox.appendChild(alertImg);
hbox.appendChild(vbox);
this.content = hbox;
} else {
this.content = vbox;
}
},
/**
@ -511,7 +524,7 @@ Tooltip.prototype = {
setImageContent: function(imageUrl, options={}) {
// Main container
let vbox = this.doc.createElement("vbox");
vbox.setAttribute("align", "center")
vbox.setAttribute("align", "center");
// Display the image
let image = this.doc.createElement("image");

Просмотреть файл

@ -2370,7 +2370,11 @@ UserProperties.prototype = {
if (entry && aName in entry) {
let item = entry[aName];
return item || aDefault;
if (item != aDefault) {
delete entry[aName];
return aDefault;
}
return item;
}
return aDefault;
},

Просмотреть файл

@ -64,3 +64,4 @@ support-files =
sourcemaps.scss
[browser_computedview_original_source_link.js]
[browser_bug946331_close_tooltip_on_new_selection.js]
[browser_bug942297_user_property_reset.js]

Просмотреть файл

@ -0,0 +1,128 @@
/* 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/ */
// Test that user set style properties can be changed from the markup-view and
// don't survive page reload
let {devtools} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
let promise = devtools.require("sdk/core/promise");
let {Task} = Cu.import("resource://gre/modules/Task.jsm", {});
let TEST_PAGE = [
"data:text/html,",
"<p id='id1' style='width:200px;'>element 1</p>",
"<p id='id2' style='width:100px;'>element 2</p>"
].join("");
let doc;
let inspector;
let ruleView;
let markupView;
function test() {
waitForExplicitFinish();
gBrowser.selectedTab = gBrowser.addTab();
gBrowser.selectedBrowser.addEventListener("load", function onload(evt) {
gBrowser.selectedBrowser.removeEventListener("load", onload, true);
doc = content.document;
waitForFocus(() => {
openRuleView((aInspector, aView) => {
inspector = aInspector;
ruleView = aView;
markupView = inspector.markup;
Task.spawn(function() {
yield selectElement("id1");
yield modifyRuleViewWidth("300px");
assertRuleAndMarkupViewWidth("id1", "300px");
yield selectElement("id2");
assertRuleAndMarkupViewWidth("id2", "100px");
yield modifyRuleViewWidth("50px");
assertRuleAndMarkupViewWidth("id2", "50px");
yield reloadPage();
yield selectElement("id1");
assertRuleAndMarkupViewWidth("id1", "200px");
yield selectElement("id2");
assertRuleAndMarkupViewWidth("id2", "100px");
finishTest();
}).then(null, Cu.reportError);
});
}, content);
}, true);
content.location = TEST_PAGE;
}
function finishTest() {
doc = inspector = ruleView = markupView = null;
gBrowser.removeCurrentTab();
finish();
}
function selectElement(id) {
let deferred = promise.defer();
inspector.selection.setNode(doc.getElementById(id));
inspector.once("inspector-updated", deferred.resolve);
return deferred.promise;
}
function getStyleRule() {
return ruleView.doc.querySelector(".ruleview-rule");
}
function modifyRuleViewWidth(value) {
let deferred = promise.defer();
let valueSpan = getStyleRule().querySelector(".ruleview-propertyvalue");
waitForEditorFocus(valueSpan.parentNode, () => {
let editor = inplaceEditor(valueSpan);
editor.input.value = value;
waitForEditorBlur(editor, () => {
// Changing the style will refresh the markup view, let's wait for that
inspector.once("markupmutation", () => {
waitForEditorBlur({input: ruleView.doc.activeElement}, deferred.resolve);
EventUtils.sendKey("escape");
});
});
EventUtils.sendKey("return");
});
valueSpan.click();
return deferred.promise;
}
function getContainerStyleAttrValue(id) {
let front = markupView.walker.frontForRawNode(doc.getElementById(id));
let container = markupView.getContainer(front);
let attrIndex = 0;
for (let attrName of container.elt.querySelectorAll(".attr-name")) {
if (attrName.textContent === "style") {
return container.elt.querySelectorAll(".attr-value")[attrIndex];
}
attrIndex ++;
}
}
function assertRuleAndMarkupViewWidth(id, value) {
let valueSpan = getStyleRule().querySelector(".ruleview-propertyvalue");
is(valueSpan.textContent, value, "Rule-view style width is " + value + " as expected");
let attr = getContainerStyleAttrValue(id);
is(attr.textContent.replace(/\s/g, ""), "width:" + value + ";", "Markup-view style attribute width is " + value);
}
function reloadPage() {
let deferred = promise.defer();
inspector.once("new-root", () => {
doc = content.document;
markupView = inspector.markup;
markupView._waitForChildren().then(deferred.resolve);
});
content.location.reload();
return deferred.promise;
}

Просмотреть файл

@ -173,10 +173,10 @@ var FindHelperUI = {
this.searchAgain(this._searchString, false);
},
onFindResult: function(aResult, aFindBackwards, aLinkURL, aRect) {
this._status = aResult;
if (aRect) {
this._zoom(aRect, Browser.selectedBrowser.contentDocumentHeight);
onFindResult: function(aData) {
this._status = aData.result;
if (aData.rect) {
this._zoom(aData.rect, Browser.selectedBrowser.contentDocumentHeight);
}
this.updateCommands();
},

Просмотреть файл

@ -788,6 +788,10 @@ documenttab[selected] .documenttab-selection {
list-style-image: url(chrome://browser/skin/images/navbar-menu.png);
}
#close-button {
list-style-image: url(chrome://browser/skin/images/navbar-close.png);
}
@media (min-resolution: @min_res_140pc@) {
#download-progress {
list-style-image: url(chrome://browser/skin/images/navbar-download@1.4x.png);
@ -804,6 +808,10 @@ documenttab[selected] .documenttab-selection {
#menu-button {
list-style-image: url(chrome://browser/skin/images/navbar-menu@1.4x.png);
}
#close-button {
list-style-image: url(chrome://browser/skin/images/navbar-close@1.4x.png);
}
}
@media (min-resolution: @min_res_180pc@) {
@ -822,18 +830,10 @@ documenttab[selected] .documenttab-selection {
#menu-button {
list-style-image: url(chrome://browser/skin/images/navbar-menu@1.8x.png);
}
}
#close-button {
-moz-image-region: rect(0px, 480px, 40px, 440px);
}
#close-button:hover:not(:active) {
-moz-image-region: rect(40px, 480px, 80px, 440px);
}
#close-button:active {
-moz-image-region: rect(80px, 480px, 120px, 440px);
#close-button {
list-style-image: url(chrome://browser/skin/images/navbar-close@1.8x.png);
}
}
/* Panel UI ================================================================ */

Двоичные данные
browser/metro/theme/images/navbar-close.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 3.3 KiB

Двоичные данные
browser/metro/theme/images/navbar-close@1.4x.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 4.4 KiB

Двоичные данные
browser/metro/theme/images/navbar-close@1.8x.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 5.3 KiB

Просмотреть файл

@ -31,6 +31,9 @@ chrome.jar:
skin/images/navbar-back.png (images/navbar-back.png)
skin/images/navbar-back@1.4x.png (images/navbar-back@1.4x.png)
skin/images/navbar-back@1.8x.png (images/navbar-back@1.8x.png)
skin/images/navbar-close.png (images/navbar-close.png)
skin/images/navbar-close@1.4x.png (images/navbar-close@1.4x.png)
skin/images/navbar-close@1.8x.png (images/navbar-close@1.8x.png)
skin/images/navbar-contextual-clear.png (images/navbar-contextual-clear.png)
skin/images/navbar-contextual-clear@1.4x.png (images/navbar-contextual-clear@1.4x.png)
skin/images/navbar-contextual-clear@1.8x.png (images/navbar-contextual-clear@1.8x.png)

Просмотреть файл

@ -202,6 +202,19 @@
margin-bottom: -4px;
}
/* Tooltip: Alert Icon */
.devtools-tooltip-alert-icon {
width: 32px;
height: 32px;
margin: 6px;
-moz-margin-end: 20px;
}
.devtools-tooltip-alert-icon {
list-style-image: url("chrome://global/skin/icons/warning-32.png");
}
/* Tooltip: Variables View */
.devtools-tooltip-variables-view-box {

Просмотреть файл

@ -2087,7 +2087,6 @@ public abstract class GeckoApp
unregisterEventListener("ToggleChrome:Show");
unregisterEventListener("ToggleChrome:Focus");
unregisterEventListener("Permissions:Data");
unregisterEventListener("Tab:ViewportMetadata");
unregisterEventListener("Session:StatePurged");
unregisterEventListener("Bookmark:Insert");
unregisterEventListener("Accessibility:Event");
@ -2109,6 +2108,7 @@ public abstract class GeckoApp
unregisterEventListener("Contact:Add");
unregisterEventListener("Intent:Open");
unregisterEventListener("Intent:GetHandlers");
unregisterEventListener("Locale:Set");
deleteTempFiles();

Просмотреть файл

@ -1439,6 +1439,7 @@ public class BrowserProvider extends ContentProvider {
db.execSQL("DROP VIEW IF EXISTS " + Obsolete.VIEW_BOOKMARKS_WITH_IMAGES);
db.execSQL("DROP INDEX IF EXISTS bookmarks_url_index");
db.execSQL("DROP INDEX IF EXISTS bookmarks_type_deleted_index");
db.execSQL("DROP INDEX IF EXISTS bookmarks_guid_index");
db.execSQL("DROP INDEX IF EXISTS bookmarks_modified_index");

Просмотреть файл

@ -65,8 +65,8 @@ var FindHelper = {
this._viewportChanged = false;
},
onFindResult: function(aResult, aFindBackwards, aLinkURL) {
if (aResult == Ci.nsITypeAheadFind.FIND_NOTFOUND) {
onFindResult: function(aData) {
if (aData.result == Ci.nsITypeAheadFind.FIND_NOTFOUND) {
if (this._viewportChanged) {
if (this._targetTab != BrowserApp.selectedTab) {
// this should never happen

Просмотреть файл

@ -71,9 +71,9 @@ function promiseFindFinished(searchText, highlightOn) {
findbar._findField.value = searchText;
let resultListener;
let findTimeout = setTimeout(() => foundOrTimedout(true), 2000);
let foundOrTimedout = function(timedOut) {
if (timedOut)
let findTimeout = setTimeout(() => foundOrTimedout(null), 2000);
let foundOrTimedout = function(aData) {
if (aData === null)
info("Result listener not called, timeout reached.");
clearTimeout(findTimeout);
findbar.browser.finder.removeResultListener(resultListener);

Просмотреть файл

@ -1126,15 +1126,13 @@
- when not in FIND_LINKS mode.
-->
<method name="onFindResult">
<parameter name="aResult"/>
<parameter name="aFindBackwards"/>
<parameter name="aLinkURL" />
<parameter name="aData"/>
<body><![CDATA[
this._updateStatusUI(aResult, aFindBackwards);
this._updateStatusUIBar(aLinkURL);
this._updateStatusUI(aData.result, aData.findBackwards);
this._updateStatusUIBar(aData.linkURL);
if (aResult == this.nsITypeAheadFind.FIND_NOTFOUND)
this._findFailedString = this.browser.finder.searchString;
if (aData.result == this.nsITypeAheadFind.FIND_NOTFOUND)
this._findFailedString = aData.searchString;
else
this._findFailedString = null;

Просмотреть файл

@ -164,6 +164,7 @@ let HighlighterActor = protocol.ActorClass({
}
};
this._tabActor.window.focus();
this._startPickerListeners();
return null;
@ -445,7 +446,6 @@ BoxModelHighlighter.prototype = {
this._hideOutline();
this._hideInfobar();
this._detachPageListeners();
this.chromeWin.focus();
}
},

Просмотреть файл

@ -56,10 +56,16 @@ Finder.prototype = {
linkURL = this._textToSubURIService.unEscapeURIForUI(docCharset, foundLink.href);
}
let rect = this._getResultRect();
let data = {
result: aResult,
findBackwards: aFindBackwards,
linkURL: linkURL,
rect: this._getResultRect(),
searchString: this._searchString,
};
for (let l of this._listeners) {
l.onFindResult(aResult, aFindBackwards, linkURL, rect);
l.onFindResult(data);
}
},

Просмотреть файл

@ -34,8 +34,7 @@ RemoteFinder.prototype = {
this._searchString = aMessage.data.searchString;
for (let l of this._listeners) {
l.onFindResult(aMessage.data.result, aMessage.data.findBackwards,
aMessage.data.linkURL, aMessage.data.rect);
l.onFindResult(aMessage.data);
}
},
@ -108,14 +107,8 @@ RemoteFinderListener.prototype = {
"Finder:KeyPress"
],
onFindResult: function (aResult, aFindBackwards, aLinkURL, aRect) {
this._global.sendAsyncMessage("Finder:Result", {
result: aResult,
findBackwards: aFindBackwards,
linkURL: aLinkURL,
rect: aRect,
searchString: this._finder.searchString,
});
onFindResult: function (aData) {
this._global.sendAsyncMessage("Finder:Result", aData);
},
//XXXmikedeboer-20131016: implement |shouldFocusContent| here to mitigate

Просмотреть файл

@ -34,14 +34,14 @@ function startTests () {
};
finder.addResultListener(listener);
listener.onFindResult = function (result) {
listener.onFindResult = function ({result}) {
ok(result == Ci.nsITypeAheadFind.FIND_FOUND, "should find string");
listener.onFindResult = function (result) {
listener.onFindResult = function ({result}) {
ok(result == Ci.nsITypeAheadFind.FIND_NOTFOUND, "should not find string");
let first = true;
listener.onFindResult = function (result) {
listener.onFindResult = function ({result}) {
ok(result == Ci.nsITypeAheadFind.FIND_FOUND, "should find link");
browser.messageManager.addMessageListener("OutlineTest", function f(aMessage) {