diff --git a/browser/base/content/browser.css b/browser/base/content/browser.css
index 8b173d8e68fd..18cdd6e45941 100644
--- a/browser/base/content/browser.css
+++ b/browser/base/content/browser.css
@@ -107,10 +107,15 @@ toolbar[printpreview="true"] {
}
%endif
-toolbarpaletteitem[place="palette"] > toolbaritem > hbox[type="places"] {
+.bookmarks-toolbar-customize,
+#wrapper-personal-bookmarks > #personal-bookmarks > #PlacesToolbar > hbox > #PlacesToolbarItems {
display: none;
}
+#wrapper-personal-bookmarks[place="toolbar"] > #personal-bookmarks > #PlacesToolbar > .bookmarks-toolbar-customize {
+ display: -moz-box;
+}
+
#main-window[disablechrome] #navigator-toolbox[tabsontop="true"] > toolbar:not(#toolbar-menubar):not(#TabsToolbar) {
visibility: collapse;
}
diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js
index 9fb149579f62..861a635f9fee 100644
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -1564,23 +1564,27 @@ function delayedStartup(isLoadingBlank, mustLoadSidebar) {
}
catch (ex) { /* never mind; suppose SessionStore is broken */ }
if (shouldCheck && !shell.isDefaultBrowser(true) && !willRecoverSession) {
- var brandBundle = document.getElementById("bundle_brand");
- var shellBundle = document.getElementById("bundle_shell");
+ // Delay the set-default-browser prompt so it doesn't block
+ // initialisation of the session store service.
+ setTimeout(function () {
+ var brandBundle = document.getElementById("bundle_brand");
+ var shellBundle = document.getElementById("bundle_shell");
- var brandShortName = brandBundle.getString("brandShortName");
- var promptTitle = shellBundle.getString("setDefaultBrowserTitle");
- var promptMessage = shellBundle.getFormattedString("setDefaultBrowserMessage",
- [brandShortName]);
- var checkboxLabel = shellBundle.getFormattedString("setDefaultBrowserDontAsk",
- [brandShortName]);
- var checkEveryTime = { value: shouldCheck };
- var ps = Services.prompt;
- var rv = ps.confirmEx(window, promptTitle, promptMessage,
- ps.STD_YES_NO_BUTTONS,
- null, null, null, checkboxLabel, checkEveryTime);
- if (rv == 0)
- shell.setDefaultBrowser(true, false);
- shell.shouldCheckDefaultBrowser = checkEveryTime.value;
+ var brandShortName = brandBundle.getString("brandShortName");
+ var promptTitle = shellBundle.getString("setDefaultBrowserTitle");
+ var promptMessage = shellBundle.getFormattedString("setDefaultBrowserMessage",
+ [brandShortName]);
+ var checkboxLabel = shellBundle.getFormattedString("setDefaultBrowserDontAsk",
+ [brandShortName]);
+ var checkEveryTime = { value: shouldCheck };
+ var ps = Services.prompt;
+ var rv = ps.confirmEx(window, promptTitle, promptMessage,
+ ps.STD_YES_NO_BUTTONS,
+ null, null, null, checkboxLabel, checkEveryTime);
+ if (rv == 0)
+ shell.setDefaultBrowser(true, false);
+ shell.shouldCheckDefaultBrowser = checkEveryTime.value;
+ }, 0);
}
}
#endif
diff --git a/browser/components/places/content/places.css b/browser/components/places/content/places.css
index b2c6558d8df5..7160693f940f 100644
--- a/browser/components/places/content/places.css
+++ b/browser/components/places/content/places.css
@@ -2,15 +2,6 @@ tree[type="places"] {
-moz-binding: url("chrome://browser/content/places/tree.xml#places-tree");
}
-.bookmarks-toolbar-customize,
-toolbarpaletteitem #PlacesToolbarItems {
- display: none;
-}
-
-toolbarpaletteitem .bookmarks-toolbar-customize {
- display: -moz-box;
-}
-
.toolbar-drop-indicator {
position: relative;
z-index: 1;
diff --git a/browser/devtools/highlighter/inspector.jsm b/browser/devtools/highlighter/inspector.jsm
index 32926bce15be..ce4bfc9e9126 100644
--- a/browser/devtools/highlighter/inspector.jsm
+++ b/browser/devtools/highlighter/inspector.jsm
@@ -160,6 +160,7 @@ Highlighter.prototype = {
this.transitionDisabler = null;
+ this.computeZoomFactor();
this.handleResize();
},
@@ -441,16 +442,10 @@ Highlighter.prototype = {
return this._highlighting; // same rectangle
}
- // get page zoom factor, if any
- let zoom =
- this.win.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
- .getInterface(Components.interfaces.nsIDOMWindowUtils)
- .screenPixelsPerCSSPixel;
-
// adjust rect for zoom scaling
let aRectScaled = {};
for (let prop in aRect) {
- aRectScaled[prop] = aRect[prop] * zoom;
+ aRectScaled[prop] = aRect[prop] * this.zoom;
}
if (aRectScaled.left >= 0 && aRectScaled.top >= 0 &&
@@ -523,14 +518,29 @@ Highlighter.prototype = {
*/
moveInfobar: function Highlighter_moveInfobar()
{
- let rect = this._highlightRect;
- if (rect && this._highlighting) {
+ if (this._highlightRect) {
+ let winHeight = this.win.innerHeight * this.zoom;
+ let winWidth = this.win.innerWidth * this.zoom;
+
+ let rect = {top: this._highlightRect.top,
+ left: this._highlightRect.left,
+ width: this._highlightRect.width,
+ height: this._highlightRect.height};
+
+ rect.top = Math.max(rect.top, 0);
+ rect.left = Math.max(rect.left, 0);
+ rect.width = Math.max(rect.width, 0);
+ rect.height = Math.max(rect.height, 0);
+
+ rect.top = Math.min(rect.top, winHeight);
+ rect.left = Math.min(rect.left, winWidth);
+
this.nodeInfo.container.removeAttribute("disabled");
// Can the bar be above the node?
if (rect.top < this.nodeInfo.barHeight) {
// No. Can we move the toolbar under the node?
if (rect.top + rect.height +
- this.nodeInfo.barHeight > this.win.innerHeight) {
+ this.nodeInfo.barHeight > winHeight) {
// No. Let's move it inside.
this.nodeInfo.container.style.top = rect.top + "px";
this.nodeInfo.container.setAttribute("position", "overlap");
@@ -554,8 +564,8 @@ Highlighter.prototype = {
left = 0;
this.nodeInfo.container.setAttribute("hide-arrow", "true");
} else {
- if (left + barWidth > this.win.innerWidth) {
- left = this.win.innerWidth - barWidth;
+ if (left + barWidth > winWidth) {
+ left = winWidth - barWidth;
this.nodeInfo.container.setAttribute("hide-arrow", "true");
} else {
this.nodeInfo.container.removeAttribute("hide-arrow");
@@ -638,6 +648,16 @@ Highlighter.prototype = {
return !INSPECTOR_INVISIBLE_ELEMENTS[nodeName];
},
+ /**
+ * Store page zoom factor.
+ */
+ computeZoomFactor: function Highlighter_computeZoomFactor() {
+ this.zoom =
+ this.win.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
+ .getInterface(Components.interfaces.nsIDOMWindowUtils)
+ .screenPixelsPerCSSPixel;
+ },
+
/////////////////////////////////////////////////////////////////////////
//// Event Handling
@@ -676,6 +696,7 @@ Highlighter.prototype = {
this.handleMouseMove(aEvent);
break;
case "resize":
+ this.computeZoomFactor();
this.brieflyDisableTransitions();
this.handleResize(aEvent);
break;
diff --git a/browser/devtools/highlighter/test/browser_inspector_highlighter.js b/browser/devtools/highlighter/test/browser_inspector_highlighter.js
index 0c1243e3c6ef..c53a2270c86e 100644
--- a/browser/devtools/highlighter/test/browser_inspector_highlighter.js
+++ b/browser/devtools/highlighter/test/browser_inspector_highlighter.js
@@ -153,29 +153,27 @@ function finishTestComparisons()
.QueryInterface(Ci.nsIMarkupDocumentViewer);
contentViewer.fullZoom = 2;
- // check what zoom factor we're at, should be 2
- let zoom =
- InspectorUI.win.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
- .getInterface(Components.interfaces.nsIDOMWindowUtils)
- .screenPixelsPerCSSPixel;
+ executeSoon(function() {
+ // check what zoom factor we're at, should be 2
+ let zoom = InspectorUI.highlighter.zoom;
+ is(zoom, 2, "zoom is 2?");
- is(zoom, 2, "zoom is 2?");
+ // simulate the zoomed dimensions of the div element
+ let divDims = div.getBoundingClientRect();
+ let divWidth = divDims.width * zoom;
+ let divHeight = divDims.height * zoom;
- // simulate the zoomed dimensions of the div element
- let divDims = div.getBoundingClientRect();
- let divWidth = divDims.width * zoom;
- let divHeight = divDims.height * zoom;
+ // now zoomed, get new dimensions of transparent veil box over element
+ let veilBoxDims = InspectorUI.highlighter.veilTransparentBox.getBoundingClientRect();
+ let veilBoxWidth = veilBoxDims.width;
+ let veilBoxHeight = veilBoxDims.height;
- // now zoomed, get new dimensions of transparent veil box over element
- let veilBoxDims = InspectorUI.highlighter.veilTransparentBox.getBoundingClientRect();
- let veilBoxWidth = veilBoxDims.width;
- let veilBoxHeight = veilBoxDims.height;
+ is(veilBoxWidth, divWidth, "transparent veil box width matches width of element (2x zoom)");
+ is(veilBoxHeight, divHeight, "transparent veil box height matches width of element (2x zoom)");
- is(veilBoxWidth, divWidth, "transparent veil box width matches width of element (2x zoom)");
- is(veilBoxHeight, divHeight, "transparent veil box height matches width of element (2x zoom)");
-
- doc = h1 = div = null;
- executeSoon(finishUp);
+ doc = h1 = div = null;
+ executeSoon(finishUp);
+ });
}
function finishUp() {
diff --git a/browser/devtools/highlighter/test/browser_inspector_infobar.js b/browser/devtools/highlighter/test/browser_inspector_infobar.js
index 856eadd2823a..682dd30f1967 100644
--- a/browser/devtools/highlighter/test/browser_inspector_infobar.js
+++ b/browser/devtools/highlighter/test/browser_inspector_infobar.js
@@ -17,8 +17,8 @@ function test()
waitForFocus(setupInfobarTest, content);
}, true);
- let style = "body{width:100%;height: 100%} div {position: absolute;height: 100px;width: 500px}#bottom {bottom: 0px}#vertical {height: 100%}";
- let html = "
"
+ let style = "body{width:100%;height: 100%} div {position: absolute;height: 100px;width: 500px}#bottom {bottom: 0px}#vertical {height: 100%}#farbottom{bottom: -200px}";
+ let html = ""
content.location = "data:text/html," + encodeURIComponent(html);
@@ -29,6 +29,7 @@ function test()
{node: doc.querySelector("#vertical"), position: "overlap", tag: "DIV", id: "#vertical", classes: ""},
{node: doc.querySelector("#bottom"), position: "top", tag: "DIV", id: "#bottom", classes: ""},
{node: doc.querySelector("body"), position: "overlap", tag: "BODY", id: "", classes: ""},
+ {node: doc.querySelector("#farbottom"), position: "top", tag: "DIV", id: "#farbottom", classes: ""},
]
for (let i = 0; i < nodes.length; i++) {
@@ -47,10 +48,8 @@ function test()
cursor = 0;
executeSoon(function() {
- Services.obs.addObserver(nodeSelected,
- InspectorUI.INSPECTOR_NOTIFICATIONS.HIGHLIGHTING, false);
-
InspectorUI.inspectNode(nodes[0].node);
+ nodeSelected();
});
}
@@ -61,8 +60,6 @@ function test()
cursor++;
if (cursor >= nodes.length) {
- Services.obs.removeObserver(nodeSelected,
- InspectorUI.INSPECTOR_NOTIFICATIONS.HIGHLIGHTING);
Services.obs.addObserver(finishUp,
InspectorUI.INSPECTOR_NOTIFICATIONS.CLOSED, false);
@@ -72,6 +69,7 @@ function test()
} else {
let node = nodes[cursor].node;
InspectorUI.inspectNode(node);
+ nodeSelected();
}
});
}
diff --git a/browser/devtools/scratchpad/scratchpad.js b/browser/devtools/scratchpad/scratchpad.js
index 9d57f93136d1..79bce769d14e 100644
--- a/browser/devtools/scratchpad/scratchpad.js
+++ b/browser/devtools/scratchpad/scratchpad.js
@@ -581,8 +581,12 @@ var Scratchpad = {
let content = null;
if (Components.isSuccessCode(aStatus)) {
+ let converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"].
+ createInstance(Ci.nsIScriptableUnicodeConverter);
+ converter.charset = "UTF-8";
content = NetUtil.readInputStreamToString(aInputStream,
aInputStream.available());
+ content = converter.ConvertToUnicode(content);
self.setText(content);
self.editor.resetUndo();
}
diff --git a/browser/devtools/styleeditor/styleeditor.css b/browser/devtools/styleeditor/styleeditor.css
index 72286dd0472b..64c7ae4b4208 100644
--- a/browser/devtools/styleeditor/styleeditor.css
+++ b/browser/devtools/styleeditor/styleeditor.css
@@ -89,7 +89,8 @@ li.error > .stylesheet-info > .stylesheet-more > .stylesheet-error-message {
}
.stylesheet-rule-count,
-li:hover > hgroup > .stylesheet-more > h3 > .stylesheet-saveButton {
+li.splitview-active > hgroup > .stylesheet-more > h3 > .stylesheet-saveButton,
+li:hover > hgroup > .stylesheet-more > h3 > .stylesheet-saveButton {
display: -moz-box;
}
@@ -99,6 +100,7 @@ li:hover > hgroup > .stylesheet-more > h3 > .stylesheet-saveButton {
/* portrait mode */
@media (max-aspect-ratio: 5/3) {
+ li.splitview-active > hgroup > .stylesheet-more > .stylesheet-rule-count,
li:hover > hgroup > .stylesheet-more > .stylesheet-rule-count {
display: none;
}
diff --git a/browser/devtools/styleinspector/CssRuleView.jsm b/browser/devtools/styleinspector/CssRuleView.jsm
index 889cc6d9c498..a359c4b65000 100644
--- a/browser/devtools/styleinspector/CssRuleView.jsm
+++ b/browser/devtools/styleinspector/CssRuleView.jsm
@@ -13,7 +13,7 @@
* for the specific language governing rights and limitations under the
* License.
*
- * The Original Code is the Mozilla Inspector Module.
+ * The Original Code is the Mozilla CSS Rule View.
*
* The Initial Developer of the Original Code is
* The Mozilla Foundation.
@@ -21,7 +21,8 @@
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
- * Dave Camp (dcamp@mozilla.com) (Original Author)
+ * Dave Camp (Original Author)
+ * Rob Campbell
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
@@ -778,7 +779,16 @@ RuleEditor.prototype = {
class: "ruleview-selector",
textContent: this.rule.selectorText
});
- appendText(header, " {");
+
+ this.openBrace = createChild(header, "span", {
+ class: "ruleview-ruleopen",
+ tabindex: "0",
+ textContent: " {"
+ });
+
+ this.openBrace.addEventListener("click", function() {
+ this.newProperty();
+ }.bind(this), true);
this.propertyList = createChild(code, "ul", {
class: "ruleview-propertylist"
diff --git a/browser/devtools/tilt/TiltVisualizer.jsm b/browser/devtools/tilt/TiltVisualizer.jsm
index 0c27b052e066..70e6cf3b60c5 100644
--- a/browser/devtools/tilt/TiltVisualizer.jsm
+++ b/browser/devtools/tilt/TiltVisualizer.jsm
@@ -853,6 +853,7 @@ TiltVisualizer.Controller = function TV_Controller(aCanvas, aPresenter)
aCanvas.addEventListener("MozMousePixelScroll", this.onMozScroll, false);
aCanvas.addEventListener("keydown", this.onKeyDown, false);
aCanvas.addEventListener("keyup", this.onKeyUp, false);
+ aCanvas.addEventListener("blur", this.onBlur, false);
// handle resize events to change the arcball dimensions
aPresenter.contentWindow.addEventListener("resize", this.onResize, false);
@@ -1008,6 +1009,13 @@ TiltVisualizer.Controller.prototype = {
this.arcball.keyUp(code);
},
+ /**
+ * Called when the canvas looses focus.
+ */
+ onBlur: function TVC_onBlur(e) {
+ this.arcball._keyCode = {};
+ },
+
/**
* Called when the content window of the current browser is resized.
*/
@@ -1049,6 +1057,7 @@ TiltVisualizer.Controller.prototype = {
canvas.removeEventListener("MozMousePixelScroll", this.onMozScroll, false);
canvas.removeEventListener("keydown", this.onKeyDown, false);
canvas.removeEventListener("keyup", this.onKeyUp, false);
+ canvas.removeEventListener("blur", this.onBlur, false);
presenter.contentWindow.removeEventListener("resize", this.onResize,false);
presenter.ondraw = null;
}
diff --git a/browser/devtools/tilt/test/Makefile.in b/browser/devtools/tilt/test/Makefile.in
index d152eea15010..e8a003d25968 100644
--- a/browser/devtools/tilt/test/Makefile.in
+++ b/browser/devtools/tilt/test/Makefile.in
@@ -53,6 +53,7 @@ _BROWSER_TEST_FILES = \
browser_tilt_05_destruction-esc.js \
browser_tilt_05_destruction.js \
browser_tilt_arcball.js \
+ browser_tilt_controller.js \
browser_tilt_gl01.js \
browser_tilt_gl02.js \
browser_tilt_gl03.js \
diff --git a/browser/devtools/tilt/test/browser_tilt_controller.js b/browser/devtools/tilt/test/browser_tilt_controller.js
new file mode 100644
index 000000000000..4ca01ac9e013
--- /dev/null
+++ b/browser/devtools/tilt/test/browser_tilt_controller.js
@@ -0,0 +1,86 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+/*global ok, is, info, waitForExplicitFinish, finish, executeSoon, gBrowser */
+/*global isEqualVec, isTiltEnabled, isWebGLSupported, createTab, createTilt */
+/*global EventUtils, vec3, mat4, quat4 */
+"use strict";
+
+function test() {
+ if (!isTiltEnabled()) {
+ info("Skipping controller test because Tilt isn't enabled.");
+ return;
+ }
+ if (!isWebGLSupported()) {
+ info("Skipping controller test because WebGL isn't supported.");
+ return;
+ }
+
+ waitForExplicitFinish();
+
+ createTab(function() {
+ createTilt({
+ onTiltOpen: function(instance)
+ {
+ let canvas = instance.presenter.canvas;
+ let prev_tran = vec3.create([0, 0, 0]);
+ let prev_rot = quat4.create([0, 0, 0, 1]);
+
+ function tran() {
+ return instance.presenter.transforms.translation;
+ }
+
+ function rot() {
+ return instance.presenter.transforms.rotation;
+ }
+
+ function save() {
+ prev_tran = vec3.create(tran());
+ prev_rot = quat4.create(rot());
+ }
+
+ ok(isEqualVec(tran(), prev_tran),
+ "At init, the translation should be zero.");
+ ok(isEqualVec(rot(), prev_rot),
+ "At init, the rotation should be zero.");
+
+
+ EventUtils.synthesizeKey("VK_A", { type: "keydown" });
+ EventUtils.synthesizeKey("VK_LEFT", { type: "keydown" });
+ instance.controller.update();
+
+ ok(!isEqualVec(tran(), prev_tran),
+ "After a translation key is pressed, the vector should change.");
+ ok(!isEqualVec(rot(), prev_rot),
+ "After a rotation key is pressed, the quaternion should change.");
+
+ save();
+
+
+ gBrowser.selectedBrowser.contentWindow.focus();
+ instance.controller.update();
+
+ ok(!isEqualVec(tran(), prev_tran),
+ "Even if the canvas lost focus, the vector has some inertia.");
+ ok(!isEqualVec(rot(), prev_rot),
+ "Even if the canvas lost focus, the quaternion has some inertia.");
+
+ save();
+
+
+ while (!isEqualVec(tran(), prev_tran) || !isEqualVec(rot(), prev_rot)) {
+ instance.controller.update();
+ save();
+ }
+
+ ok(isEqualVec(tran(), prev_tran) && isEqualVec(rot(), prev_rot),
+ "After the focus is lost, the transforms inertia eventually stops.");
+ },
+ onEnd: function()
+ {
+ gBrowser.removeCurrentTab();
+ finish();
+ }
+ }, true);
+ });
+}
diff --git a/browser/devtools/tilt/test/head.js b/browser/devtools/tilt/test/head.js
index 675d423b1e53..7eb3590ceac2 100644
--- a/browser/devtools/tilt/test/head.js
+++ b/browser/devtools/tilt/test/head.js
@@ -69,6 +69,17 @@ function isApproxVec(vec1, vec2) {
return true;
}
+function isEqualVec(vec1, vec2) {
+ if (vec1.length !== vec2.length) {
+ return false;
+ }
+ for (let i = 0, len = vec1.length; i < len; i++) {
+ if (vec1[i] !== vec2[i]) {
+ return false;
+ }
+ }
+ return true;
+}
function createCanvas() {
return document.createElementNS("http://www.w3.org/1999/xhtml", "canvas");
diff --git a/browser/locales/en-US/chrome/browser/aboutDialog.dtd b/browser/locales/en-US/chrome/browser/aboutDialog.dtd
index 5a86bfa40900..1dc99002a27f 100644
--- a/browser/locales/en-US/chrome/browser/aboutDialog.dtd
+++ b/browser/locales/en-US/chrome/browser/aboutDialog.dtd
@@ -31,7 +31,7 @@
-
+
diff --git a/browser/themes/gnomestripe/browser.css b/browser/themes/gnomestripe/browser.css
index c202701c2315..8ed0ff8652b3 100644
--- a/browser/themes/gnomestripe/browser.css
+++ b/browser/themes/gnomestripe/browser.css
@@ -148,9 +148,7 @@ toolbarbutton.bookmark-item[open="true"] {
}
#wrapper-personal-bookmarks[place="palette"] > .toolbarpaletteitem-box {
- width: 16px;
- height: 16px;
- background: url("chrome://browser/skin/places/bookmarksToolbar.png") no-repeat;
+ background: url("chrome://browser/skin/places/bookmarksToolbar.png") no-repeat center;
}
.bookmarks-toolbar-customize {
diff --git a/browser/themes/gnomestripe/devtools/csshtmltree.css b/browser/themes/gnomestripe/devtools/csshtmltree.css
index 432bfbdd4b4a..774ace1c269a 100644
--- a/browser/themes/gnomestripe/devtools/csshtmltree.css
+++ b/browser/themes/gnomestripe/devtools/csshtmltree.css
@@ -23,6 +23,7 @@
* Mihai Șucan
* Michael Ratcliffe
* Dão Gottwald
+ * Rob Campbell
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
@@ -229,6 +230,10 @@
padding: 2px 5px;
}
+.ruleview-ruleopen {
+ -moz-padding-end: 5px;
+}
+
.ruleview-propertylist {
list-style: none;
padding: 0;
diff --git a/browser/themes/pinstripe/browser.css b/browser/themes/pinstripe/browser.css
index e35d00cf2ffa..210c691350d4 100644
--- a/browser/themes/pinstripe/browser.css
+++ b/browser/themes/pinstripe/browser.css
@@ -267,9 +267,7 @@ toolbarbutton.bookmark-item > menupopup {
}
#wrapper-personal-bookmarks[place="palette"] > .toolbarpaletteitem-box {
- width: 16px;
- height: 16px;
- background: url("chrome://browser/skin/places/bookmarksToolbar.png") no-repeat;
+ background: url("chrome://browser/skin/places/bookmarksToolbar.png") no-repeat center;
}
.bookmarks-toolbar-customize {
diff --git a/browser/themes/pinstripe/devtools/background-noise-toolbar.png b/browser/themes/pinstripe/devtools/background-noise-toolbar.png
new file mode 100644
index 000000000000..bde8d4683cb7
Binary files /dev/null and b/browser/themes/pinstripe/devtools/background-noise-toolbar.png differ
diff --git a/browser/themes/pinstripe/devtools/common.css b/browser/themes/pinstripe/devtools/common.css
index ee0eb582603a..fc8679ccd524 100644
--- a/browser/themes/pinstripe/devtools/common.css
+++ b/browser/themes/pinstripe/devtools/common.css
@@ -43,7 +43,7 @@
-moz-appearance: none;
padding: 4px 3px;
box-shadow: 0 1px 0 0 hsla(210, 16%, 76%, .2) inset;
- background-image: -moz-linear-gradient(top, hsl(210,11%,36%), hsl(210,11%,18%));
+ background-image: url(background-noise-toolbar.png), -moz-linear-gradient(top, hsl(210,11%,36%), hsl(210,11%,18%));
}
.devtools-toolbarbutton {
diff --git a/browser/themes/pinstripe/devtools/csshtmltree.css b/browser/themes/pinstripe/devtools/csshtmltree.css
index dc8add1999af..93d506abd924 100644
--- a/browser/themes/pinstripe/devtools/csshtmltree.css
+++ b/browser/themes/pinstripe/devtools/csshtmltree.css
@@ -23,6 +23,7 @@
* Mihai Șucan
* Michael Ratcliffe
* Dão Gottwald
+ * Rob Campbell
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
@@ -231,6 +232,10 @@
padding: 2px 5px;
}
+.ruleview-ruleopen {
+ -moz-padding-end: 5px;
+}
+
.ruleview-propertylist {
list-style: none;
padding: 0;
diff --git a/browser/themes/pinstripe/jar.mn b/browser/themes/pinstripe/jar.mn
index 9e8bf4b427a3..7ee87a5ed72f 100644
--- a/browser/themes/pinstripe/jar.mn
+++ b/browser/themes/pinstripe/jar.mn
@@ -160,6 +160,7 @@ browser.jar:
skin/classic/browser/devtools/itemToggle.png (devtools/itemToggle.png)
skin/classic/browser/devtools/itemArrow-rtl.png (devtools/itemArrow-rtl.png)
skin/classic/browser/devtools/itemArrow-ltr.png (devtools/itemArrow-ltr.png)
+ skin/classic/browser/devtools/background-noise-toolbar.png (devtools/background-noise-toolbar.png)
#ifdef MOZ_SERVICES_SYNC
skin/classic/browser/sync-throbber.png
skin/classic/browser/sync-16.png
diff --git a/browser/themes/winstripe/browser.css b/browser/themes/winstripe/browser.css
index dcec8715c20c..72e217c282e3 100644
--- a/browser/themes/winstripe/browser.css
+++ b/browser/themes/winstripe/browser.css
@@ -563,9 +563,7 @@ toolbarbutton.bookmark-item[open="true"] {
}
#wrapper-personal-bookmarks[place="palette"] > .toolbarpaletteitem-box {
- width: 16px;
- height: 16px;
- background: url("chrome://browser/skin/places/bookmarksToolbar.png") no-repeat;
+ background: url("chrome://browser/skin/places/bookmarksToolbar.png") no-repeat center;
}
.bookmarks-toolbar-customize {
diff --git a/browser/themes/winstripe/devtools/csshtmltree.css b/browser/themes/winstripe/devtools/csshtmltree.css
index 091bae5dbfe2..9a0e4c03b0dc 100644
--- a/browser/themes/winstripe/devtools/csshtmltree.css
+++ b/browser/themes/winstripe/devtools/csshtmltree.css
@@ -23,6 +23,7 @@
* Mihai Șucan
* Michael Ratcliffe
* Dão Gottwald
+ * Rob Campbell
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
@@ -230,6 +231,10 @@
padding: 2px 5px;
}
+.ruleview-ruleopen {
+ -moz-padding-end: 5px;
+}
+
.ruleview-propertylist {
list-style: none;
padding: 0;
diff --git a/toolkit/content/customizeToolbar.css b/toolkit/content/customizeToolbar.css
index eacf42b431f2..e3681a02d8d6 100644
--- a/toolkit/content/customizeToolbar.css
+++ b/toolkit/content/customizeToolbar.css
@@ -20,8 +20,9 @@
the Initial Developer. All Rights Reserved.
Contributor(s):
- David Hyatt (hyatt@apple.com)
- Blake Ross (blaker@netscape.com)
+ David Hyatt
+ Blake Ross
+ Jared Wein
Alternatively, the contents of this file may be used under the terms of
either the GNU General Public License Version 2 or later (the "GPL"), or
@@ -41,17 +42,27 @@
@namespace html url("http://www.w3.org/1999/xhtml"); /* namespace for HTML elements */
#palette-box {
- overflow: auto;
- margin: 0px 15px 10px 15px;
+ overflow: auto;
+ display: block;
+ min-height: 3em;
}
-#palette-box > hbox > toolbarpaletteitem {
- padding-top: 8px;
- padding-bottom: 8px;
+#palette-box > toolbarpaletteitem {
+ width: 110px;
+ height: 94px;
+ overflow: hidden;
+ display: inline-block;
}
-#palette-box > hbox {
- min-height: 8em;
+.toolbarpaletteitem-box {
+ -moz-box-pack: center;
+ -moz-box-flex: 1;
+ width: 110px;
+ max-width: 110px;
+}
+
+toolbarpaletteitem > label {
+ text-align: center;
}
#main-box > box {
diff --git a/toolkit/content/customizeToolbar.js b/toolkit/content/customizeToolbar.js
index 1eaddf450f80..3799eb810f70 100644
--- a/toolkit/content/customizeToolbar.js
+++ b/toolkit/content/customizeToolbar.js
@@ -20,9 +20,10 @@
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
-# David Hyatt (hyatt@apple.com)
-# Blake Ross (blaker@netscape.com)
-# Joe Hewitt (hewitt@netscape.com)
+# David Hyatt
+# Blake Ross
+# Joe Hewitt
+# Jared Wein
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
@@ -38,13 +39,12 @@
#
# ***** END LICENSE BLOCK *****
-const kRowMax = 4;
-
var gToolboxDocument = null;
var gToolbox = null;
var gCurrentDragOverItem = null;
var gToolboxChanged = false;
var gToolboxSheet = false;
+var gPaletteBox = null;
function onLoad()
{
@@ -69,6 +69,7 @@ function InitWithToolbox(aToolbox)
forEachCustomizableToolbar(function (toolbar) {
toolbar.setAttribute("customizing", "true");
});
+ gPaletteBox = document.getElementById("palette-box");
var elts = getRootElements();
for (let i=0; i < elts.length; i++) {
@@ -278,18 +279,12 @@ function createWrapper(aId, aDocument)
/**
* Wraps an item that has been cloned from a template and adds
- * it to the end of a row in the palette.
+ * it to the end of the palette.
*/
-function wrapPaletteItem(aPaletteItem, aCurrentRow, aSpacer)
+function wrapPaletteItem(aPaletteItem)
{
var wrapper = createWrapper(aPaletteItem.id, document);
- wrapper.setAttribute("flex", 1);
- wrapper.setAttribute("align", "center");
- wrapper.setAttribute("pack", "center");
- wrapper.setAttribute("minheight", "0");
- wrapper.setAttribute("minwidth", "0");
-
wrapper.appendChild(aPaletteItem);
// XXX We need to call this AFTER the palette item has been appended
@@ -297,11 +292,7 @@ function wrapPaletteItem(aPaletteItem, aCurrentRow, aSpacer)
// palette due to removal of the command and disabled attributes - JRH
cleanUpItemForPalette(aPaletteItem, wrapper);
- if (aSpacer)
- aCurrentRow.insertBefore(wrapper, aSpacer);
- else
- aCurrentRow.appendChild(wrapper);
-
+ gPaletteBox.appendChild(wrapper);
}
/**
@@ -345,35 +336,28 @@ function getCurrentItemIds()
function buildPalette()
{
// Empty the palette first.
- var paletteBox = document.getElementById("palette-box");
- while (paletteBox.lastChild)
- paletteBox.removeChild(paletteBox.lastChild);
-
- var currentRow = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
- "hbox");
- currentRow.setAttribute("class", "paletteRow");
+ while (gPaletteBox.lastChild)
+ gPaletteBox.removeChild(gPaletteBox.lastChild);
// Add the toolbar separator item.
var templateNode = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
"toolbarseparator");
templateNode.id = "separator";
- wrapPaletteItem(templateNode, currentRow, null);
+ wrapPaletteItem(templateNode);
// Add the toolbar spring item.
templateNode = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
"toolbarspring");
templateNode.id = "spring";
templateNode.flex = 1;
- wrapPaletteItem(templateNode, currentRow, null);
+ wrapPaletteItem(templateNode);
// Add the toolbar spacer item.
templateNode = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
"toolbarspacer");
templateNode.id = "spacer";
templateNode.flex = 1;
- wrapPaletteItem(templateNode, currentRow, null);
-
- var rowSlot = 3;
+ wrapPaletteItem(templateNode);
var currentItems = getCurrentItemIds();
templateNode = gToolbox.palette.firstChild;
@@ -381,74 +365,11 @@ function buildPalette()
// Check if the item is already in a toolbar before adding it to the palette.
if (!(templateNode.id in currentItems)) {
var paletteItem = document.importNode(templateNode, true);
-
- if (rowSlot == kRowMax) {
- // Append the old row.
- paletteBox.appendChild(currentRow);
-
- // Make a new row.
- currentRow = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
- "hbox");
- currentRow.setAttribute("class", "paletteRow");
- rowSlot = 0;
- }
-
- ++rowSlot;
- wrapPaletteItem(paletteItem, currentRow, null);
+ wrapPaletteItem(paletteItem);
}
templateNode = templateNode.nextSibling;
}
-
- if (currentRow) {
- fillRowWithFlex(currentRow);
- paletteBox.appendChild(currentRow);
- }
-}
-
-/**
- * Creates a new palette item for a cloned template node and
- * adds it to the last slot in the palette.
- */
-function appendPaletteItem(aItem)
-{
- var paletteBox = document.getElementById("palette-box");
- var lastRow = paletteBox.lastChild;
- var lastSpacer = lastRow.lastChild;
-
- if (lastSpacer.localName != "spacer") {
- // The current row is full, so we have to create a new row.
- lastRow = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
- "hbox");
- lastRow.setAttribute("class", "paletteRow");
- paletteBox.appendChild(lastRow);
-
- wrapPaletteItem(aItem, lastRow, null);
-
- fillRowWithFlex(lastRow);
- } else {
- // Decrement the flex of the last spacer or remove it entirely.
- var flex = lastSpacer.getAttribute("flex");
- if (flex == 1) {
- lastRow.removeChild(lastSpacer);
- lastSpacer = null;
- } else
- lastSpacer.setAttribute("flex", --flex);
-
- // Insert the wrapper where the last spacer was.
- wrapPaletteItem(aItem, lastRow, lastSpacer);
- }
-}
-
-function fillRowWithFlex(aRow)
-{
- var remainingFlex = kRowMax - aRow.childNodes.length;
- if (remainingFlex > 0) {
- var spacer = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
- "spacer");
- spacer.setAttribute("flex", remainingFlex);
- aRow.appendChild(spacer);
- }
}
/**
@@ -471,6 +392,7 @@ function cleanUpItemForPalette(aItem, aWrapper)
var title = stringBundle.getString(aItem.localName.slice(7) + "Title");
aWrapper.setAttribute("title", title);
}
+ aWrapper.setAttribute("tooltiptext", aWrapper.getAttribute("title"));
// Remove attributes that screw up our appearance.
aItem.removeAttribute("command");
@@ -865,48 +787,10 @@ function onToolbarDrop(aEvent)
wrapper.flex = newItem.flex;
// Remove the wrapper from the palette.
- var currentRow = draggedPaletteWrapper.parentNode;
if (draggedItemId != "separator" &&
draggedItemId != "spring" &&
draggedItemId != "spacer")
- {
- currentRow.removeChild(draggedPaletteWrapper);
-
- while (currentRow) {
- // Pull the first child of the next row up
- // into this row.
- var nextRow = currentRow.nextSibling;
-
- if (!nextRow) {
- var last = currentRow.lastChild;
- var first = currentRow.firstChild;
- if (first == last) {
- // Kill the row.
- currentRow.parentNode.removeChild(currentRow);
- break;
- }
-
- if (last.localName == "spacer") {
- var flex = last.getAttribute("flex");
- last.setAttribute("flex", ++flex);
- // Reflow doesn't happen for some reason. Trigger it with a hide/show. ICK! -dwh
- last.hidden = true;
- last.hidden = false;
- break;
- } else {
- // Make a spacer and give it a flex of 1.
- var spacer = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
- "spacer");
- spacer.setAttribute("flex", "1");
- currentRow.appendChild(spacer);
- }
- break;
- }
-
- currentRow.appendChild(nextRow.firstChild);
- currentRow = currentRow.nextSibling;
- }
- }
+ gPaletteBox.removeChild(draggedPaletteWrapper);
}
gCurrentDragOverItem = null;
@@ -937,7 +821,7 @@ function onPaletteDrop(aEvent)
wrapperType != "spacer" &&
wrapperType != "spring") {
restoreItemForToolbar(wrapper.firstChild, wrapper);
- appendPaletteItem(document.importNode(wrapper.firstChild, true));
+ wrapPaletteItem(document.importNode(wrapper.firstChild, true));
gToolbox.palette.appendChild(wrapper.firstChild);
}
diff --git a/toolkit/themes/pinstripe/global/customizeToolbar.css b/toolkit/themes/pinstripe/global/customizeToolbar.css
index 0631b944ea9f..93fffe5d0c08 100644
--- a/toolkit/themes/pinstripe/global/customizeToolbar.css
+++ b/toolkit/themes/pinstripe/global/customizeToolbar.css
@@ -38,10 +38,13 @@
#palette-box {
margin-top: 2px;
+ -moz-appearance: listbox;
+ margin: 0 0 10px;
}
-#palette-box > hbox > toolbarpaletteitem {
- padding: 2px;
- margin: 0px;
+
+#palette-box > toolbarpaletteitem {
+ padding: 8px 2px;
+ margin: 0 8px;
}
#main-box {
diff --git a/toolkit/themes/pinstripe/global/toolbar.css b/toolkit/themes/pinstripe/global/toolbar.css
index 822dfe170da5..160e630795da 100644
--- a/toolkit/themes/pinstripe/global/toolbar.css
+++ b/toolkit/themes/pinstripe/global/toolbar.css
@@ -117,10 +117,17 @@ toolbarpaletteitem[type="spacer"] {
.toolbarpaletteitem-box[type="spacer"][place="palette"],
.toolbarpaletteitem-box[type="spring"][place="palette"] {
+ margin-top: 0;
margin-bottom: 2px;
height: 32px;
}
+.toolbarpaletteitem-box[type="spring"][place="palette"] {
+ background-position: center;
+ margin-left: 8px;
+ margin-right: 8px;
+}
+
/* ..... drag and drop feedback ..... */
toolbarpaletteitem[dragover="left"] {
diff --git a/toolkit/themes/winstripe/global/customizeToolbar.css b/toolkit/themes/winstripe/global/customizeToolbar.css
index 0879fbb70760..20e002dbcab6 100644
--- a/toolkit/themes/winstripe/global/customizeToolbar.css
+++ b/toolkit/themes/winstripe/global/customizeToolbar.css
@@ -46,3 +46,13 @@ dialog {
font-weight: bold;
font-size: larger;
}
+
+#palette-box {
+ -moz-appearance: listbox;
+ margin: 0 0 10px;
+}
+
+#palette-box > toolbarpaletteitem {
+ padding: 8px 2px;
+ margin: 0 8px;
+}