Merge mozilla-central into build-system

--HG--
rename : content/html/content/public/nsHTMLCanvasElement.h => content/html/content/public/HTMLCanvasElement.h
rename : content/html/content/src/nsHTMLCanvasElement.cpp => content/html/content/src/HTMLCanvasElement.cpp
This commit is contained in:
Ms2ger 2013-01-06 11:58:19 +01:00
Родитель 9a3d3a3ef4 a5972c7b9b
Коммит 63425cf9e5
585 изменённых файлов: 19350 добавлений и 9303 удалений

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

@ -35,7 +35,7 @@
#include "nsINameSpaceManager.h" #include "nsINameSpaceManager.h"
#include "nsIPresShell.h" #include "nsIPresShell.h"
#include "nsIServiceManager.h" #include "nsIServiceManager.h"
#include "nsIViewManager.h" #include "nsViewManager.h"
#include "nsIScrollableFrame.h" #include "nsIScrollableFrame.h"
#include "nsUnicharUtils.h" #include "nsUnicharUtils.h"
#include "nsIURI.h" #include "nsIURI.h"
@ -1253,7 +1253,7 @@ DocAccessible::GetNativeWindow() const
if (!mPresShell) if (!mPresShell)
return nullptr; return nullptr;
nsIViewManager* vm = mPresShell->GetViewManager(); nsViewManager* vm = mPresShell->GetViewManager();
if (!vm) if (!vm)
return nullptr; return nullptr;

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

@ -529,22 +529,32 @@ HyperTextAccessible::DOMPointToHypertextOffset(nsINode* aNode,
} else { } else {
// findNode could be null if aNodeOffset == # of child nodes, which means // findNode could be null if aNodeOffset == # of child nodes, which means
// one of two things: // one of two things:
// 1) we're at the end of the children, keep findNode = null, so that we get // 1) there are no children, and the passed-in node is not mContent -- use
// the last possible offset
// 2) there are no children and the passed-in node is mContent, which means
// we're an aempty nsIAccessibleText
// 3) there are no children, and the passed-in node is not mContent -- use
// parentContent for the node to find // parentContent for the node to find
// 2) there are no children and the passed-in node is mContent, which means
// we're an empty nsIAccessibleText
// 3) there are children and we're at the end of the children
findNode = aNode->GetChildAt(aNodeOffset); findNode = aNode->GetChildAt(aNodeOffset);
if (!findNode && !aNodeOffset) { if (!findNode) {
if (aNode == GetNode()) { if (aNodeOffset == 0) {
// There are no children, which means this is an empty nsIAccessibleText, in which if (aNode == GetNode()) {
// case we can only be at hypertext offset 0 // Case #1: this accessible has no children and thus has empty text,
*aHyperTextOffset = 0; // we can only be at hypertext offset 0.
return nullptr; *aHyperTextOffset = 0;
return nullptr;
}
// Case #2: there are no children, we're at this node.
findNode = aNode;
} else if (aNodeOffset == aNode->GetChildCount()) {
// Case #3: we're after the last child, get next node to this one.
for (nsINode* tmpNode = aNode;
!findNode && tmpNode && tmpNode != mContent;
tmpNode = tmpNode->GetParent()) {
findNode = tmpNode->GetNextSibling();
}
} }
findNode = aNode; // Case #2: there are no children
} }
} }

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

@ -28,7 +28,7 @@
#include "nsIDOMHTMLTableCellElement.h" #include "nsIDOMHTMLTableCellElement.h"
#include "nsIDOMHTMLTableElement.h" #include "nsIDOMHTMLTableElement.h"
#include "nsIDOMHTMLTableRowElement.h" #include "nsIDOMHTMLTableRowElement.h"
#include "nsIDOMHTMLTableSectionElem.h" #include "nsIDOMHTMLTableSectionElement.h"
#include "nsIDocument.h" #include "nsIDocument.h"
#include "nsIMutableArray.h" #include "nsIMutableArray.h"
#include "nsIPresShell.h" #include "nsIPresShell.h"

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

@ -10,7 +10,7 @@
#include "nsCOMPtr.h" #include "nsCOMPtr.h"
#include "nsObjCExceptions.h" #include "nsObjCExceptions.h"
#include "nsIWidget.h" #include "nsIWidget.h"
#include "nsIViewManager.h" #include "nsViewManager.h"
using namespace mozilla::a11y; using namespace mozilla::a11y;

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

@ -34,7 +34,7 @@
#include "nsIServiceManager.h" #include "nsIServiceManager.h"
#include "nsTextFormatter.h" #include "nsTextFormatter.h"
#include "nsView.h" #include "nsView.h"
#include "nsIViewManager.h" #include "nsViewManager.h"
#include "nsEventMap.h" #include "nsEventMap.h"
#include "nsArrayUtils.h" #include "nsArrayUtils.h"
#include "mozilla/Preferences.h" #include "mozilla/Preferences.h"
@ -1653,7 +1653,7 @@ AccessibleWrap::GetHWNDFor(Accessible* aAccessible)
nsIWidget* widget = frame->GetNearestWidget(); nsIWidget* widget = frame->GetNearestWidget();
if (widget && widget->IsVisible()) { if (widget && widget->IsVisible()) {
nsIPresShell* shell = document->PresShell(); nsIPresShell* shell = document->PresShell();
nsIViewManager* vm = shell->GetViewManager(); nsViewManager* vm = shell->GetViewManager();
if (vm) { if (vm) {
nsCOMPtr<nsIWidget> rootWidget; nsCOMPtr<nsIWidget> rootWidget;
vm->GetRootWidget(getter_AddRefs(rootWidget)); vm->GetRootWidget(getter_AddRefs(rootWidget));

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

@ -21,7 +21,7 @@
#include "nsISelectionController.h" #include "nsISelectionController.h"
#include "nsIServiceManager.h" #include "nsIServiceManager.h"
#include "nsIURI.h" #include "nsIURI.h"
#include "nsIViewManager.h" #include "nsViewManager.h"
#include "nsIWebNavigation.h" #include "nsIWebNavigation.h"
using namespace mozilla; using namespace mozilla;

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

@ -1266,6 +1266,38 @@ function synthSelectAll(aNodeOrID, aCheckerOrEventSeq)
} }
} }
/**
* Move the caret in text accessible.
*/
function moveCaretToDOMPoint(aID, aNode, aOffset, aExpectedOffset,
aFocusTargetID)
{
this.target = getAccessible(aID, [nsIAccessibleText]);
this.focus = aFocusTargetID ? getAccessible(aFocusTargetID) : null;
this.focusNode = this.focus ? this.focus.DOMNode : null;
this.invoke = function moveCaretToDOMPoint_invoke()
{
if (this.focusNode)
this.focusNode.focus();
window.getSelection().getRangeAt(0).setStart(aNode, aOffset);
}
this.getID = function moveCaretToDOMPoint_getID()
{
return "Set caret on " + prettyName(aID) + " at point: " +
prettyName(aNode) + " node with offset " + aOffset;
}
this.eventSeq = [
new caretMoveChecker(aExpectedOffset, this.target)
];
if (this.focus)
this.eventSeq.push(new asyncInvokerChecker(EVENT_FOCUS, this.focus));
}
/** /**
* Set caret offset in text accessible. * Set caret offset in text accessible.
*/ */

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

@ -77,6 +77,18 @@
id = "p"; id = "p";
gQueue.push(new synthTab(id, new caretMoveChecker(0, id))); gQueue.push(new synthTab(id, new caretMoveChecker(0, id)));
// Set caret after a child of span element, i.e. after 'text' text.
gQueue.push(new moveCaretToDOMPoint("test1", getNode("test1_span"), 1,
4, "test1"));
gQueue.push(new moveCaretToDOMPoint("test2", getNode("test2_span"), 1,
4, "test2"));
// empty text element
gQueue.push(new moveCaretToDOMPoint("test3", getNode("test3"), 0,
0, "test3"));
gQueue.push(new moveCaretToDOMPoint("test4", getNode("test4_span"), 0,
0, "test4"));
gQueue.invoke(); // Will call SimpleTest.finish(); gQueue.invoke(); // Will call SimpleTest.finish();
} }
@ -90,7 +102,12 @@
<a target="_blank" <a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=454377" href="https://bugzilla.mozilla.org/show_bug.cgi?id=454377"
title="Accessible caret move events testing"> title="Accessible caret move events testing">
Mozilla Bug 454377 Bug 454377
</a>
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=824901"
title="HyperTextAccessible::DOMPointToHypertextOffset fails for node and offset equal to node child count">
Bug 824901
</a> </a>
<p id="display"></p> <p id="display"></p>
<div id="content" style="display: none"></div> <div id="content" style="display: none"></div>
@ -102,6 +119,11 @@
<p id="p" contentEditable="true"><span>text</span><br/>text</p> <p id="p" contentEditable="true"><span>text</span><br/>text</p>
<div id="div" contentEditable="true"><p id="p1_in_div">text</p><p id="p2_in_div">text</p></div> <div id="div" contentEditable="true"><p id="p1_in_div">text</p><p id="p2_in_div">text</p></div>
<p contentEditable="true" id="test1"><span id="test1_span">text</span>ohoho</p>
<p contentEditable="true" id="test2"><span><span id="test2_span">text</span></span>ohoho</p>
<p contentEditable="true" id="test3"></p>
<p contentEditable="true" id="test4"><span id="test4_span"></span></p>
<div id="eventdump"></div> <div id="eventdump"></div>
</body> </body>
</html> </html>

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

@ -283,10 +283,14 @@ pref("content.image.allow_locking", true);
pref("image.mem.min_discard_timeout_ms", 10000); pref("image.mem.min_discard_timeout_ms", 10000);
pref("image.mem.max_decoded_image_kb", 5120); /* 5MB */ pref("image.mem.max_decoded_image_kb", 5120); /* 5MB */
// XXX this isn't a good check for "are touch events supported", but
// we don't really have a better one at the moment.
#ifdef MOZ_WIDGET_GONK
// enable touch events interfaces // enable touch events interfaces
pref("dom.w3c_touch_events.enabled", 1); pref("dom.w3c_touch_events.enabled", 1);
pref("dom.w3c_touch_events.safetyX", 0); // escape borders in units of 1/240" pref("dom.w3c_touch_events.safetyX", 0); // escape borders in units of 1/240"
pref("dom.w3c_touch_events.safetyY", 120); // escape borders in units of 1/240" pref("dom.w3c_touch_events.safetyY", 120); // escape borders in units of 1/240"
#endif
#ifdef MOZ_SAFE_BROWSING #ifdef MOZ_SAFE_BROWSING
// Safe browsing does nothing unless this pref is set // Safe browsing does nothing unless this pref is set
@ -544,6 +548,8 @@ pref("hal.processPriorityManager.gonk.masterOomScoreAdjust", 0);
pref("hal.processPriorityManager.gonk.masterKillUnderMB", 1); pref("hal.processPriorityManager.gonk.masterKillUnderMB", 1);
pref("hal.processPriorityManager.gonk.foregroundOomScoreAdjust", 67); pref("hal.processPriorityManager.gonk.foregroundOomScoreAdjust", 67);
pref("hal.processPriorityManager.gonk.foregroundKillUnderMB", 4); pref("hal.processPriorityManager.gonk.foregroundKillUnderMB", 4);
pref("hal.processPriorityManager.gonk.backgroundPerceivableOomScoreAdjust", 134);
pref("hal.processPriorityManager.gonk.backgroundPerceivebleKillUnderMB", 5);
pref("hal.processPriorityManager.gonk.backgroundHomescreenOomScoreAdjust", 200); pref("hal.processPriorityManager.gonk.backgroundHomescreenOomScoreAdjust", 200);
pref("hal.processPriorityManager.gonk.backgroundHomescreenKillUnderMB", 5); pref("hal.processPriorityManager.gonk.backgroundHomescreenKillUnderMB", 5);
pref("hal.processPriorityManager.gonk.backgroundOomScoreAdjust", 400); pref("hal.processPriorityManager.gonk.backgroundOomScoreAdjust", 400);

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

@ -18,8 +18,6 @@ ifdef MOZ_EXTENSIONS
tier_app_dirs += extensions tier_app_dirs += extensions
endif endif
tier_app_dirs += services
tier_app_dirs += \ tier_app_dirs += \
$(MOZ_BRANDING_DIRECTORY) \ $(MOZ_BRANDING_DIRECTORY) \
b2g \ b2g \

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

@ -25,12 +25,159 @@ XPCOMUtils.defineLazyGetter(this, "domWindowUtils", function () {
const RESIZE_SCROLL_DELAY = 20; const RESIZE_SCROLL_DELAY = 20;
let HTMLDocument = Ci.nsIDOMHTMLDocument;
let HTMLHtmlElement = Ci.nsIDOMHTMLHtmlElement;
let HTMLBodyElement = Ci.nsIDOMHTMLBodyElement;
let HTMLIFrameElement = Ci.nsIDOMHTMLIFrameElement;
let HTMLInputElement = Ci.nsIDOMHTMLInputElement; let HTMLInputElement = Ci.nsIDOMHTMLInputElement;
let HTMLTextAreaElement = Ci.nsIDOMHTMLTextAreaElement; let HTMLTextAreaElement = Ci.nsIDOMHTMLTextAreaElement;
let HTMLSelectElement = Ci.nsIDOMHTMLSelectElement; let HTMLSelectElement = Ci.nsIDOMHTMLSelectElement;
let HTMLOptGroupElement = Ci.nsIDOMHTMLOptGroupElement; let HTMLOptGroupElement = Ci.nsIDOMHTMLOptGroupElement;
let HTMLOptionElement = Ci.nsIDOMHTMLOptionElement; let HTMLOptionElement = Ci.nsIDOMHTMLOptionElement;
let FormVisibility = {
/**
* Searches upwards in the DOM for an element that has been scrolled.
*
* @param {HTMLElement} node element to start search at.
* @return {Window|HTMLElement|Null} null when none are found window/element otherwise.
*/
findScrolled: function fv_findScrolled(node) {
let win = node.ownerDocument.defaultView;
while (!(node instanceof HTMLBodyElement)) {
// We can skip elements that have not been scrolled.
// We only care about top now remember to add the scrollLeft
// check if we decide to care about the X axis.
if (node.scrollTop !== 0) {
// the element has been scrolled so we may need to adjust
// where we think the root element is located.
//
// Otherwise it may seem visible but be scrolled out of the viewport
// inside this scrollable node.
return node;
} else {
// this node does not effect where we think
// the node is even if it is scrollable it has not hidden
// the element we are looking for.
node = node.parentNode;
continue;
}
}
// we also care about the window this is the more
// common case where the content is larger then
// the viewport/screen.
if (win.scrollMaxX || win.scrollMaxY) {
return win;
}
return null;
},
/**
* Checks if "top and "bottom" points of the position is visible.
*
* @param {Number} top position.
* @param {Number} height of the element.
* @param {Number} maxHeight of the window.
* @return {Boolean} true when visible.
*/
yAxisVisible: function fv_yAxisVisible(top, height, maxHeight) {
return (top > 0 && (top + height) < maxHeight);
},
/**
* Searches up through the dom for scrollable elements
* which are not currently visible (relative to the viewport).
*
* @param {HTMLElement} element to start search at.
* @param {Object} pos .top, .height and .width of element.
*/
scrollablesVisible: function fv_scrollablesVisible(element, pos) {
while ((element = this.findScrolled(element))) {
if (element.window && element.self === element)
break;
// remember getBoundingClientRect does not care
// about scrolling only where the element starts
// in the document.
let offset = element.getBoundingClientRect();
// the top of both the scrollable area and
// the form element itself are in the same document.
// We adjust the "top" so if the elements coordinates
// are relative to the viewport in the current document.
let adjustedTop = pos.top - offset.top;
let visible = this.yAxisVisible(
adjustedTop,
pos.height,
pos.width
);
if (!visible)
return false;
element = element.parentNode;
}
return true;
},
/**
* Verifies the element is visible in the viewport.
* Handles scrollable areas, frames and scrollable viewport(s) (windows).
*
* @param {HTMLElement} element to verify.
* @return {Boolean} true when visible.
*/
isVisible: function fv_isVisible(element) {
// scrollable frames can be ignored we just care about iframes...
let rect = element.getBoundingClientRect();
let parent = element.ownerDocument.defaultView;
// used to calculate the inner position of frames / scrollables.
// The intent was to use this information to scroll either up or down.
// scrollIntoView(true) will _break_ some web content so we can't do
// this today. If we want that functionality we need to manually scroll
// the individual elements.
let pos = {
top: rect.top,
height: rect.height,
width: rect.width
};
let visible = true;
do {
let frame = parent.frameElement;
visible = visible &&
this.yAxisVisible(pos.top, pos.height, parent.innerHeight) &&
this.scrollablesVisible(element, pos);
// nothing we can do about this now...
// In the future we can use this information to scroll
// only the elements we need to at this point as we should
// have all the details we need to figure out how to scroll.
if (!visible)
return false;
if (frame) {
let frameRect = frame.getBoundingClientRect();
pos.top += frameRect.top + frame.clientTop;
}
} while (
(parent !== parent.parent) &&
(parent = parent.parent)
);
return visible;
}
};
let FormAssistant = { let FormAssistant = {
init: function fa_init() { init: function fa_init() {
addEventListener("focus", this, true, false); addEventListener("focus", this, true, false);
@ -89,8 +236,10 @@ let FormAssistant = {
switch (evt.type) { switch (evt.type) {
case "focus": case "focus":
if (this.isTextInputElement(target) && this.isIMEDisabled()) if (target && isContentEditable(target)) {
return; this.showKeyboard(this.getTopLevelEditable(target));
break;
}
if (target && this.isFocusableElement(target)) if (target && this.isFocusableElement(target))
this.showKeyboard(target); this.showKeyboard(target);
@ -133,7 +282,7 @@ let FormAssistant = {
if (this.focusedElement) { if (this.focusedElement) {
this.scrollIntoViewTimeout = content.setTimeout(function () { this.scrollIntoViewTimeout = content.setTimeout(function () {
this.scrollIntoViewTimeout = null; this.scrollIntoViewTimeout = null;
if (this.focusedElement) { if (this.focusedElement && !FormVisibility.isVisible(this.focusedElement)) {
this.focusedElement.scrollIntoView(false); this.focusedElement.scrollIntoView(false);
} }
}.bind(this), RESIZE_SCROLL_DELAY); }.bind(this), RESIZE_SCROLL_DELAY);
@ -193,22 +342,9 @@ let FormAssistant = {
}, },
observe: function fa_observe(subject, topic, data) { observe: function fa_observe(subject, topic, data) {
switch (topic) { Services.obs.removeObserver(this, "xpcom-shutdown");
case "xpcom-shutdown": removeMessageListener("Forms:Select:Choice", this);
Services.obs.removeObserver(this, "xpcom-shutdown"); removeMessageListener("Forms:Input:Value", this);
removeMessageListener("Forms:Select:Choice", this);
removeMessageListener("Forms:Input:Value", this);
break;
}
},
isIMEDisabled: function fa_isIMEDisabled() {
let disabled = false;
try {
disabled = domWindowUtils.IMEStatus == domWindowUtils.IME_STATUS_DISABLED;
} catch (e) {}
return disabled;
}, },
showKeyboard: function fa_showKeyboard(target) { showKeyboard: function fa_showKeyboard(target) {
@ -232,10 +368,6 @@ let FormAssistant = {
}, },
isFocusableElement: function fa_isFocusableElement(element) { isFocusableElement: function fa_isFocusableElement(element) {
if (element.contentEditable && element.contentEditable == "true") {
return true;
}
if (element instanceof HTMLSelectElement || if (element instanceof HTMLSelectElement ||
element instanceof HTMLTextAreaElement) element instanceof HTMLTextAreaElement)
return true; return true;
@ -251,7 +383,31 @@ let FormAssistant = {
isTextInputElement: function fa_isTextInputElement(element) { isTextInputElement: function fa_isTextInputElement(element) {
return element instanceof HTMLInputElement || return element instanceof HTMLInputElement ||
element instanceof HTMLTextAreaElement || element instanceof HTMLTextAreaElement ||
(element.contentEditable && element.contentEditable == "true"); isContentEditable(element);
},
getTopLevelEditable: function fa_getTopLevelEditable(element) {
function retrieveTopLevelEditable(element) {
// Retrieve the top element that is editable
if (element instanceof HTMLHtmlElement)
element = element.ownerDocument.body;
else if (element instanceof HTMLDocument)
element = element.body;
while (element && !isContentEditable(element))
element = element.parentNode;
// Return the container frame if we are into a nested editable frame
if (element &&
element instanceof HTMLBodyElement &&
element.ownerDocument.defaultView != content.document.defaultView)
return element.ownerDocument.defaultView.frameElement;
}
if (element instanceof HTMLIFrameElement)
return element;
return retrieveTopLevelEditable(element) || element;
}, },
sendKeyboardState: function(element) { sendKeyboardState: function(element) {
@ -270,12 +426,27 @@ let FormAssistant = {
FormAssistant.init(); FormAssistant.init();
function isContentEditable(element) {
if (element.isContentEditable || element.designMode == "on")
return true;
// If a body element is editable and the body is the child of an
// iframe we can assume this is an advanced HTML editor
if (element instanceof HTMLIFrameElement &&
element.contentDocument &&
(element.contentDocument.body.isContentEditable ||
element.contentDocument.designMode == "on"))
return true;
return element.ownerDocument && element.ownerDocument.designMode == "on";
}
function getJSON(element) { function getJSON(element) {
let type = element.type || ""; let type = element.type || "";
let value = element.value || "" let value = element.value || ""
// Treat contenteditble element as a special text field // Treat contenteditble element as a special text field
if (element.contentEditable && element.contentEditable == "true") { if (isContentEditable(element)) {
type = "text"; type = "text";
value = element.textContent; value = element.textContent;
} }

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

@ -81,8 +81,12 @@ var shell = {
get CrashSubmit() { get CrashSubmit() {
delete this.CrashSubmit; delete this.CrashSubmit;
#ifdef MOZ_CRASHREPORTER
Cu.import("resource://gre/modules/CrashSubmit.jsm", this); Cu.import("resource://gre/modules/CrashSubmit.jsm", this);
return this.CrashSubmit; return this.CrashSubmit;
#else
return this.CrashSubmit = null;
#endif
}, },
onlineForCrashReport: function shell_onlineForCrashReport() { onlineForCrashReport: function shell_onlineForCrashReport() {
@ -103,7 +107,7 @@ var shell = {
} catch(e) { } } catch(e) { }
// Bail if there isn't a valid crashID. // Bail if there isn't a valid crashID.
if (!crashID && !this.CrashSubmit.pendingIDs().length) { if (!this.CrashSubmit || !crashID && !this.CrashSubmit.pendingIDs().length) {
return; return;
} }

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

@ -1,5 +1,5 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist" lastupdate="1356125617000"> <blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist" lastupdate="1357164966000">
<emItems> <emItems>
<emItem blockID="i58" id="webmaster@buzzzzvideos.info"> <emItem blockID="i58" id="webmaster@buzzzzvideos.info">
<versionRange minVersion="0" maxVersion="*"> <versionRange minVersion="0" maxVersion="*">
@ -379,7 +379,7 @@
</versionRange> </versionRange>
</emItem> </emItem>
<emItem blockID="i220" id="pricepeep@getpricepeep.com"> <emItem blockID="i220" id="pricepeep@getpricepeep.com">
<versionRange minVersion="0" maxVersion="*" severity="1"> <versionRange minVersion="0" maxVersion="2.1.0.19.99" severity="1">
</versionRange> </versionRange>
</emItem> </emItem>
<emItem blockID="i226" id="{462be121-2b54-4218-bf00-b9bf8135b23f}"> <emItem blockID="i226" id="{462be121-2b54-4218-bf00-b9bf8135b23f}">
@ -576,14 +576,14 @@
<pluginItem blockID="p176"> <pluginItem blockID="p176">
<match name="filename" exp="(NPSWF32\.dll)|(Flash\ Player\.plugin)" /> <versionRange minVersion="0" maxVersion="10.3.183.18.999" severity="0" vulnerabilitystatus="1"> <match name="filename" exp="(NPSWF32\.dll)|(Flash\ Player\.plugin)" /> <versionRange minVersion="0" maxVersion="10.3.183.18.999" severity="0" vulnerabilitystatus="1">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"> <targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="18.0a1" maxVersion="*" /> <versionRange minVersion="19.0a1" maxVersion="*" />
</targetApplication> </targetApplication>
</versionRange> </versionRange>
</pluginItem> </pluginItem>
<pluginItem blockID="p178"> <pluginItem blockID="p178">
<match name="filename" exp="(NPSWF[0-9_]*\.dll)|(Flash\ Player\.plugin)" /> <versionRange minVersion="11.0" maxVersion="11.4.402.286.999" severity="0" vulnerabilitystatus="1"> <match name="filename" exp="(NPSWF[0-9_]*\.dll)|(Flash\ Player\.plugin)" /> <versionRange minVersion="11.0" maxVersion="11.4.402.286.999" severity="0" vulnerabilitystatus="1">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"> <targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="18.0a1" maxVersion="*" /> <versionRange minVersion="19.0a1" maxVersion="*" />
</targetApplication> </targetApplication>
</versionRange> </versionRange>
</pluginItem> </pluginItem>

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

@ -111,6 +111,7 @@ XRE_SetupDllBlocklistType XRE_SetupDllBlocklist;
XRE_TelemetryAccumulateType XRE_TelemetryAccumulate; XRE_TelemetryAccumulateType XRE_TelemetryAccumulate;
XRE_StartupTimelineRecordType XRE_StartupTimelineRecord; XRE_StartupTimelineRecordType XRE_StartupTimelineRecord;
XRE_mainType XRE_main; XRE_mainType XRE_main;
XRE_DisableWritePoisoningType XRE_DisableWritePoisoning;
static const nsDynamicFunctionLoad kXULFuncs[] = { static const nsDynamicFunctionLoad kXULFuncs[] = {
{ "XRE_GetFileFromPath", (NSFuncPtr*) &XRE_GetFileFromPath }, { "XRE_GetFileFromPath", (NSFuncPtr*) &XRE_GetFileFromPath },
@ -122,6 +123,7 @@ static const nsDynamicFunctionLoad kXULFuncs[] = {
{ "XRE_TelemetryAccumulate", (NSFuncPtr*) &XRE_TelemetryAccumulate }, { "XRE_TelemetryAccumulate", (NSFuncPtr*) &XRE_TelemetryAccumulate },
{ "XRE_StartupTimelineRecord", (NSFuncPtr*) &XRE_StartupTimelineRecord }, { "XRE_StartupTimelineRecord", (NSFuncPtr*) &XRE_StartupTimelineRecord },
{ "XRE_main", (NSFuncPtr*) &XRE_main }, { "XRE_main", (NSFuncPtr*) &XRE_main },
{ "XRE_DisableWritePoisoning", (NSFuncPtr*) &XRE_DisableWritePoisoning },
{ nullptr, nullptr } { nullptr, nullptr }
}; };
@ -387,5 +389,19 @@ int main(int argc, char* argv[])
} }
XPCOMGlueShutdown(); XPCOMGlueShutdown();
#ifdef XP_MACOSX
// Allow writes again. While we would like to catch writes from static
// destructors to allow early exits to use _exit, we know that there is
// at least one such write that we don't control (see bug 826029). For
// now we enable writes again and early exits will have to use exit instead
// of _exit.
// Currently write poisoning is only available on OS X. Since on OS X we never
// unload XUL, it is safe to call this function after XPCOMGlueShutdown.
XRE_DisableWritePoisoning();
#endif
return result; return result;
} }

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

@ -172,8 +172,10 @@ let TestPilotSetup = {
"testpilot:task:dataAutoSubmitted", this._onTaskDataAutoSubmitted, self); "testpilot:task:dataAutoSubmitted", this._onTaskDataAutoSubmitted, self);
// Set up observation for application shutdown. // Set up observation for application shutdown.
this._obs.add("quit-application", this.globalShutdown, self); this._obs.add("quit-application", this.globalShutdown, self);
#ifndef MOZ_PER_WINDOW_PRIVATE_BROWSING
// Set up observation for enter/exit private browsing: // Set up observation for enter/exit private browsing:
this._obs.add("private-browsing", this.onPrivateBrowsingMode, self); this._obs.add("private-browsing", this.onPrivateBrowsingMode, self);
#endif
// Set up timers to remind user x minutes after startup // Set up timers to remind user x minutes after startup
// and once per day thereafter. Use nsITimer so it doesn't belong to // and once per day thereafter. Use nsITimer so it doesn't belong to
@ -243,7 +245,9 @@ let TestPilotSetup = {
this._obs.remove( this._obs.remove(
"testpilot:task:dataAutoSubmitted", this._onTaskDataAutoSubmitted, self); "testpilot:task:dataAutoSubmitted", this._onTaskDataAutoSubmitted, self);
this._obs.remove("quit-application", this.globalShutdown, self); this._obs.remove("quit-application", this.globalShutdown, self);
#ifndef MOZ_PER_WINDOW_PRIVATE_BROWSING
this._obs.remove("private-browsing", this.onPrivateBrowsingMode, self); this._obs.remove("private-browsing", this.onPrivateBrowsingMode, self);
#endif
this._loader.unload(); this._loader.unload();
this._shortTimer.cancel(); this._shortTimer.cancel();
this._longTimer.cancel(); this._longTimer.cancel();
@ -257,6 +261,7 @@ let TestPilotSetup = {
return wm.getMostRecentWindow("navigator:browser"); return wm.getMostRecentWindow("navigator:browser");
}, },
#ifndef MOZ_PER_WINDOW_PRIVATE_BROWSING
onPrivateBrowsingMode: function TPS_onPrivateBrowsingMode(topic, data) { onPrivateBrowsingMode: function TPS_onPrivateBrowsingMode(topic, data) {
for (let i = 0; i < this.taskList.length; i++) { for (let i = 0; i < this.taskList.length; i++) {
if (data == "enter") { if (data == "enter") {
@ -266,6 +271,7 @@ let TestPilotSetup = {
} }
} }
}, },
#endif
onWindowUnload: function TPS__onWindowRegistered(window) { onWindowUnload: function TPS__onWindowRegistered(window) {
this._logger.trace("Called TestPilotSetup.onWindow unload!"); this._logger.trace("Called TestPilotSetup.onWindow unload!");

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

@ -162,11 +162,13 @@ var TestPilotTask = {
// Called by extension core when Firefox is shutting down. // Called by extension core when Firefox is shutting down.
}, },
#ifndef MOZ_PER_WINDOW_PRIVATE_BROWSING
onEnterPrivateBrowsing: function TestPilotTask_onEnterPrivate() { onEnterPrivateBrowsing: function TestPilotTask_onEnterPrivate() {
}, },
onExitPrivateBrowsing: function TestPilotTask_onExitPrivate() { onExitPrivateBrowsing: function TestPilotTask_onExitPrivate() {
}, },
#endif
onNewWindow: function TestPilotTask_onNewWindow(window) { onNewWindow: function TestPilotTask_onNewWindow(window) {
}, },
@ -532,6 +534,7 @@ TestPilotExperiment.prototype = {
} }
}, },
#ifndef MOZ_PER_WINDOW_PRIVATE_BROWSING
onEnterPrivateBrowsing: function TestPilotExperiment_onEnterPrivate() { onEnterPrivateBrowsing: function TestPilotExperiment_onEnterPrivate() {
this._logger.trace("Task is entering private browsing."); this._logger.trace("Task is entering private browsing.");
if (this.experimentIsRunning()) { if (this.experimentIsRunning()) {
@ -553,6 +556,7 @@ TestPilotExperiment.prototype = {
} }
} }
}, },
#endif
getStudyMetadata: function TestPilotExperiment_getStudyMetadata() { getStudyMetadata: function TestPilotExperiment_getStudyMetadata() {
try { try {

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

@ -536,6 +536,11 @@ pref("mousewheel.with_shift.action", 1);
// acceleration is the best modifier for zoom-in/out. However, we should keep // acceleration is the best modifier for zoom-in/out. However, we should keep
// the control key setting for backward compatibility. // the control key setting for backward compatibility.
pref("mousewheel.with_meta.action", 3); // command key on Mac pref("mousewheel.with_meta.action", 3); // command key on Mac
// Disable control-/meta-modified horizontal mousewheel events, since
// those are used on Mac as part of modified swipe gestures (e.g.
// Left swipe+Cmd = go back in a new tab).
pref("mousewheel.with_control.action.override_x", 0);
pref("mousewheel.with_meta.action.override_x", 0);
#else #else
pref("mousewheel.with_alt.action", 1); pref("mousewheel.with_alt.action", 1);
pref("mousewheel.with_shift.action", 2); pref("mousewheel.with_shift.action", 2);

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

@ -565,7 +565,7 @@
<menupopup id="menuWebDeveloperPopup"> <menupopup id="menuWebDeveloperPopup">
<menuitem id="menu_devToolbox" <menuitem id="menu_devToolbox"
observes="devtoolsMenuBroadcaster_DevToolbox" observes="devtoolsMenuBroadcaster_DevToolbox"
accesskey="&devToolbox.accesskey;"/> accesskey="&devToolboxMenuItem.accesskey;"/>
<menuseparator id="menu_devtools_separator"/> <menuseparator id="menu_devtools_separator"/>
<menuitem id="menu_devToolbar" <menuitem id="menu_devToolbar"
observes="devtoolsMenuBroadcaster_DevToolbar" observes="devtoolsMenuBroadcaster_DevToolbar"

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

@ -64,7 +64,7 @@ var StarUI = {
this._restoreCommandsState(); this._restoreCommandsState();
this._itemId = -1; this._itemId = -1;
if (this._batching) { if (this._batching) {
PlacesUtils.transactionManager.endBatch(); PlacesUtils.transactionManager.endBatch(false);
this._batching = false; this._batching = false;
} }
@ -76,13 +76,13 @@ var StarUI = {
case "remove": { case "remove": {
// Remove all bookmarks for the bookmark's url, this also removes // Remove all bookmarks for the bookmark's url, this also removes
// the tags for the url. // the tags for the url.
PlacesUtils.transactionManager.beginBatch(); PlacesUtils.transactionManager.beginBatch(null);
let itemIds = PlacesUtils.getBookmarksForURI(this._uriForRemoval); let itemIds = PlacesUtils.getBookmarksForURI(this._uriForRemoval);
for (let i = 0; i < itemIds.length; i++) { for (let i = 0; i < itemIds.length; i++) {
let txn = new PlacesRemoveItemTransaction(itemIds[i]); let txn = new PlacesRemoveItemTransaction(itemIds[i]);
PlacesUtils.transactionManager.doTransaction(txn); PlacesUtils.transactionManager.doTransaction(txn);
} }
PlacesUtils.transactionManager.endBatch(); PlacesUtils.transactionManager.endBatch(false);
break; break;
} }
} }
@ -235,7 +235,7 @@ var StarUI = {
beginBatch: function SU_beginBatch() { beginBatch: function SU_beginBatch() {
if (!this._batching) { if (!this._batching) {
PlacesUtils.transactionManager.beginBatch(); PlacesUtils.transactionManager.beginBatch(null);
this._batching = true; this._batching = true;
} }
} }

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

@ -174,7 +174,7 @@
<!-- DevTools broadcasters --> <!-- DevTools broadcasters -->
<broadcaster id="devtoolsMenuBroadcaster_DevToolbox" <broadcaster id="devtoolsMenuBroadcaster_DevToolbox"
label="&devToolbarToolsButton.label;" label="&devToolboxMenuItem.label;"
type="checkbox" autocheck="false" type="checkbox" autocheck="false"
command="Tools:DevToolbox"/> command="Tools:DevToolbox"/>
<broadcaster id="devtoolsMenuBroadcaster_DevToolbar" <broadcaster id="devtoolsMenuBroadcaster_DevToolbar"

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

@ -1516,6 +1516,11 @@ var gBrowserInit = {
gDevToolsBrowser.forgetBrowserWindow(window); gDevToolsBrowser.forgetBrowserWindow(window);
let desc = Object.getOwnPropertyDescriptor(window, "DeveloperToolbar");
if (desc && !desc.get) {
DeveloperToolbar.destroy();
}
// First clean up services initialized in gBrowserInit.onLoad (or those whose // First clean up services initialized in gBrowserInit.onLoad (or those whose
// uninit methods don't depend on the services having been initialized). // uninit methods don't depend on the services having been initialized).
allTabs.uninit(); allTabs.uninit();

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

@ -1152,7 +1152,8 @@
</stack> </stack>
<toolbarbutton id="developer-toolbar-toolbox-button" <toolbarbutton id="developer-toolbar-toolbox-button"
class="developer-toolbar-button" class="developer-toolbar-button"
observes="devtoolsMenuBroadcaster_DevToolbox"/> observes="devtoolsMenuBroadcaster_DevToolbox"
tooltiptext="&devToolbarToolsButton.tooltip;"/>
#ifndef XP_MACOSX #ifndef XP_MACOSX
<toolbarbutton id="developer-toolbar-closebutton" <toolbarbutton id="developer-toolbar-closebutton"
class="devtools-closebutton" class="devtools-closebutton"

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

@ -14,8 +14,6 @@ endif
tier_app_dirs += $(MOZ_BRANDING_DIRECTORY) tier_app_dirs += $(MOZ_BRANDING_DIRECTORY)
tier_app_dirs += services
ifdef MOZ_WEBAPP_RUNTIME ifdef MOZ_WEBAPP_RUNTIME
tier_app_dirs += webapprt tier_app_dirs += webapprt
endif endif

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

@ -26,9 +26,8 @@ richlistitem.download {
[state="4"], /* Paused */ [state="4"], /* Paused */
[state="5"]) /* Starting (queued) */) [state="5"]) /* Starting (queued) */)
.downloadShowMenuItem, .downloadShowMenuItem,
.download-state[state="7"] .downloadCommandsSeparator,
.download-state[state="7"] .downloadCommandsSeparator .download-state:not([state]) .downloadCommandsSeparator
{ {
display: none; display: none;
} }

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

@ -12,11 +12,16 @@ let Cu = Components.utils;
let Ci = Components.interfaces; let Ci = Components.interfaces;
let Cc = Components.classes; let Cc = Components.classes;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/NetUtil.jsm"); Cu.import("resource://gre/modules/NetUtil.jsm");
Cu.import("resource://gre/modules/DownloadUtils.jsm"); Cu.import("resource://gre/modules/DownloadUtils.jsm");
Cu.import("resource:///modules/DownloadsCommon.jsm"); Cu.import("resource:///modules/DownloadsCommon.jsm");
Cu.import("resource://gre/modules/PlacesUtils.jsm"); Cu.import("resource://gre/modules/PlacesUtils.jsm");
Cu.import("resource://gre/modules/osfile.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
"resource://gre/modules/PrivateBrowsingUtils.jsm");
const nsIDM = Ci.nsIDownloadManager; const nsIDM = Ci.nsIDownloadManager;
@ -28,7 +33,7 @@ const DOWNLOAD_VIEW_SUPPORTED_COMMANDS =
["cmd_delete", "cmd_copy", "cmd_paste", "cmd_selectAll", ["cmd_delete", "cmd_copy", "cmd_paste", "cmd_selectAll",
"downloadsCmd_pauseResume", "downloadsCmd_cancel", "downloadsCmd_pauseResume", "downloadsCmd_cancel",
"downloadsCmd_open", "downloadsCmd_show", "downloadsCmd_retry", "downloadsCmd_open", "downloadsCmd_show", "downloadsCmd_retry",
"downloadsCmd_openReferrer"]; "downloadsCmd_openReferrer", "downloadsCmd_clearDownloads"];
const NOT_AVAILABLE = Number.MAX_VALUE; const NOT_AVAILABLE = Number.MAX_VALUE;
@ -93,10 +98,14 @@ DownloadElementShell.prototype = {
if ((this._dataItem = aValue)) { if ((this._dataItem = aValue)) {
this._wasDone = this._dataItem.done; this._wasDone = this._dataItem.done;
this._wasInProgress = this._dataItem.inProgress; this._wasInProgress = this._dataItem.inProgress;
this._targetFileInfoFetched = false;
this._fetchTargetFileInfo();
} }
else if (this._placesNode) { else if (this._placesNode) {
this._wasInProgress = false; this._wasInProgress = false;
this._wasDone = this.getDownloadState(true) == nsIDM.DOWNLOAD_FINISHED; this._wasDone = this.getDownloadState(true) == nsIDM.DOWNLOAD_FINISHED;
this._targetFileInfoFetched = false;
this._fetchTargetFileInfo();
} }
this._updateStatusUI(); this._updateStatusUI();
@ -113,10 +122,15 @@ DownloadElementShell.prototype = {
this._annotations = new Map(); this._annotations = new Map();
} }
this._placesNode = aNode; this._placesNode = aNode;
// We don't need to update the UI if we had a data item, because
// the places information isn't used in this case.
if (!this._dataItem && this._placesNode) { if (!this._dataItem && this._placesNode) {
this._wasInProgress = false; this._wasInProgress = false;
this._wasDone = this.getDownloadState(true) == nsIDM.DOWNLOAD_FINISHED; this._wasDone = this.getDownloadState(true) == nsIDM.DOWNLOAD_FINISHED;
this._targetFileInfoFetched = false;
this._updateStatusUI(); this._updateStatusUI();
this._fetchTargetFileInfo();
} }
} }
return aNode; return aNode;
@ -177,14 +191,6 @@ DownloadElementShell.prototype = {
return value; return value;
}, },
// The uri (as a string) of the target file, if any.
get _targetFileURI() {
if (this._dataItem)
return this._dataItem.file;
return this._getAnnotation(DESTINATION_FILE_URI_ANNO, "");
},
// The label for the download // The label for the download
get _displayName() { get _displayName() {
if (this._dataItem) if (this._dataItem)
@ -199,43 +205,70 @@ DownloadElementShell.prototype = {
return this._placesNode.title || this.downloadURI; return this._placesNode.title || this.downloadURI;
}, },
// If there's a target file for the download, this is its nsIFile object. // The uri (as a string) of the target file, if any.
get _file() { get _targetFileURI() {
if (!("__file" in this)) { if (this._dataItem)
if (this._dataItem) { return this._dataItem.file;
this.__file = this._dataItem.localFile;
} return this._getAnnotation(DESTINATION_FILE_URI_ANNO, "");
else {
this.__file = this._targetFileURI ?
GetFileForFileURI(this._targetFileURI) : null;
}
}
return this.__file;
}, },
// The target's file size in bytes. If there's no target file, or If we get _targetFilePath() {
// cannot determine its size, 0 is returned. let fileURI = this._targetFileURI;
get _fileSize() { if (fileURI)
if (!("__fileSize" in this)) { return GetFileForFileURI(fileURI).path;
if (!this._file || !this._file.exists()) return "";
this.__fileSize = 0; },
try {
this.__fileSize = this._file.fileSize; _fetchTargetFileInfo: function DES__fetchTargetFileInfo() {
} if (this._targetFileInfoFetched)
catch(ex) { throw new Error("_fetchTargetFileInfo should not be called if the information was already fetched");
Cu.reportError(ex);
this.__fileSize = 0; let path = this._targetFilePath;
}
// In previous version, the target file annotations were not set,
// so we cannot where is the file.
if (!path) {
this._targetFileInfoFetched = true;
this._targetFileExists = false;
return;
} }
return this.__fileSize;
OS.File.stat(path).then(
function onSuccess(fileInfo) {
this._targetFileInfoFetched = true;
this._targetFileExists = true;
this._targetFileSize = fileInfo.size;
delete this._state;
this._updateDownloadStatusUI();
}.bind(this),
function onFailure(aReason) {
if (reason instanceof OS.File.Error && reason.becauseNoSuchFile) {
this._targetFileInfoFetched = true;
this._targetFileExists = false;
}
else {
Cu.reportError("Could not fetch info for target file (reason: " +
aReason + ")");
}
this._updateDownloadStatusUI();
}.bind(this)
);
}, },
/** /**
* Get the state of the download * Get the state of the download (see nsIDownloadManager).
* For past downloads, for which we don't know the state at first,
* |undefined| is returned until we have info for the target file,
* indicating the state is unknown. |undefined| is also returned
* if the file was not found at last.
*
* @param [optional] aForceUpdate * @param [optional] aForceUpdate
* Whether to force update the cached download state. Default: false. * Whether to force update the cached download state. Default: false.
* @return the download state if available, |undefined| otherwise.
*/ */
// The download state (see nsIDownloadManager).
getDownloadState: function DES_getDownloadState(aForceUpdate = false) { getDownloadState: function DES_getDownloadState(aForceUpdate = false) {
if (aForceUpdate || !("_state" in this)) { if (aForceUpdate || !("_state" in this)) {
if (this._dataItem) { if (this._dataItem) {
@ -246,19 +279,12 @@ DownloadElementShell.prototype = {
this._state = this._getAnnotation(DOWNLOAD_STATE_ANNO); this._state = this._getAnnotation(DOWNLOAD_STATE_ANNO);
} }
catch (ex) { catch (ex) {
// The state annotation didn't exist in past releases. if (!this._targetFileInfoFetched || !this._targetFileExists)
if (!this._file) { this._state = undefined;
else if (this._targetFileSize > 0)
this._state = nsIDM.DOWNLOAD_FINISHED;
else
this._state = nsIDM.DOWNLOAD_FAILED; this._state = nsIDM.DOWNLOAD_FAILED;
}
else if (this._file.exists()) {
this._state = this._fileSize > 0 ?
nsIDM.DOWNLOAD_FINISHED : nsIDM.DOWNLOAD_FAILED;
}
else {
// XXXmano I'm not sure if this right. We should probably show no
// status text at all in this case.
this._state = nsIDM.DOWNLOAD_CANCELED;
}
} }
} }
} }
@ -266,7 +292,7 @@ DownloadElementShell.prototype = {
}, },
// The status text for the download // The status text for the download
get _statusText() { _getStatusText: function DES__getStatusText() {
let s = DownloadsCommon.strings; let s = DownloadsCommon.strings;
if (this._dataItem && this._dataItem.inProgress) { if (this._dataItem && this._dataItem.inProgress) {
if (this._dataItem.paused) { if (this._dataItem.paused) {
@ -316,15 +342,15 @@ DownloadElementShell.prototype = {
return s.stateDirty; return s.stateDirty;
case nsIDM.DOWNLOAD_FINISHED:{ case nsIDM.DOWNLOAD_FINISHED:{
// For completed downloads, show the file size (e.g. "1.5 MB") // For completed downloads, show the file size (e.g. "1.5 MB")
if (this._fileSize > 0) { if (this._targetFileInfoFetched && this._targetFileExists) {
let [size, unit] = DownloadUtils.convertByteUnits(this._fileSize); let [size, unit] = DownloadUtils.convertByteUnits(this._targetFileSize);
return s.sizeWithUnits(size, unit); return s.sizeWithUnits(size, unit);
} }
break; break;
} }
} }
return ""; return s.sizeUnknown;
}, },
// The progressmeter element for the download // The progressmeter element for the download
@ -342,8 +368,11 @@ DownloadElementShell.prototype = {
// appropriate buttons and context menu items), the status text label, // appropriate buttons and context menu items), the status text label,
// and the progress meter. // and the progress meter.
_updateDownloadStatusUI: function DES__updateDownloadStatusUI() { _updateDownloadStatusUI: function DES__updateDownloadStatusUI() {
this._element.setAttribute("state", this.getDownloadState(true)); let state = this.getDownloadState(true);
this._element.setAttribute("status", this._statusText); if (state !== undefined)
this._element.setAttribute("state", state);
this._element.setAttribute("status", this._getStatusText());
// For past-downloads, we're done. For session-downloads, we may also need // For past-downloads, we're done. For session-downloads, we may also need
// to update the progress-meter. // to update the progress-meter.
@ -374,14 +403,12 @@ DownloadElementShell.prototype = {
event.initEvent("ValueChange", true, true); event.initEvent("ValueChange", true, true);
this._progressElement.dispatchEvent(event); this._progressElement.dispatchEvent(event);
} }
goUpdateDownloadCommands();
}, },
_updateStatusUI: function DES__updateStatusUI() { _updateStatusUI: function DES__updateStatusUI() {
this._updateDownloadStatusUI();
this._element.setAttribute("image", this._icon);
this._element.setAttribute("displayName", this._displayName); this._element.setAttribute("displayName", this._displayName);
this._element.setAttribute("image", this._icon);
this._updateDownloadStatusUI();
}, },
placesNodeIconChanged: function DES_placesNodeIconChanged() { placesNodeIconChanged: function DES_placesNodeIconChanged() {
@ -406,16 +433,22 @@ DownloadElementShell.prototype = {
} }
else if (aAnnoName == DOWNLOAD_STATE_ANNO) { else if (aAnnoName == DOWNLOAD_STATE_ANNO) {
this._updateDownloadStatusUI(); this._updateDownloadStatusUI();
if (this._element.selected)
goUpdateDownloadCommands();
} }
} }
}, },
/* DownloadView */ /* DownloadView */
onStateChange: function DES_onStateChange() { onStateChange: function DES_onStateChange() {
// See comment in DVI_onStateChange in downloads.js (the panel-view) if (!this._wasDone && this._dataItem.done) {
if (!this._wasDone && this._dataItem.done) // See comment in DVI_onStateChange in downloads.js (the panel-view)
this._element.setAttribute("image", this._icon + "&state=normal"); this._element.setAttribute("image", this._icon + "&state=normal");
this._targetFileInfoFetched = false;
this._fetchTargetFileInfo();
}
this._wasDone = this._dataItem.done; this._wasDone = this._dataItem.done;
// Update the end time using the current time if required. // Update the end time using the current time if required.
@ -427,6 +460,8 @@ DownloadElementShell.prototype = {
this._wasInProgress = this._dataItem.inProgress; this._wasInProgress = this._dataItem.inProgress;
this._updateDownloadStatusUI(); this._updateDownloadStatusUI();
if (this._element.selected)
goUpdateDownloadCommands();
}, },
/* DownloadView */ /* DownloadView */
@ -438,18 +473,37 @@ DownloadElementShell.prototype = {
isCommandEnabled: function DES_isCommandEnabled(aCommand) { isCommandEnabled: function DES_isCommandEnabled(aCommand) {
switch (aCommand) { switch (aCommand) {
case "downloadsCmd_open": { case "downloadsCmd_open": {
return this._file.exists() && // We cannot open a session dowload file unless it's done ("openable").
((this._dataItem && this._dataItem.openable) || // If it's finished, we need to make sure the file was not removed,
(this.getDownloadState() == nsIDM.DOWNLOAD_FINISHED)); // as we do for past downloads.
if (this._dataItem && !this._dataItem.openable)
return false;
// Disable the command until we can yet tell whether
// or not the file is there.
if (!this._targetFileInfoFetched)
return false;
return this._targetFileExists;
} }
case "downloadsCmd_show": { case "downloadsCmd_show": {
return this._getTargetFileOrPartFileIfExists() != null; // TODO: Bug 827010 - Handle part-file asynchronously.
if (this._dataItem &&
this._dataItem.partFile && this._dataItem.partFile.exists())
return true;
// Disable the command until we can yet tell whether
// or not the file is there.
if (!this._targetFileInfoFetched)
return false;
return this._targetFileExists;
} }
case "downloadsCmd_pauseResume": case "downloadsCmd_pauseResume":
return this._dataItem && this._dataItem.inProgress && this._dataItem.resumable; return this._dataItem && this._dataItem.inProgress && this._dataItem.resumable;
case "downloadsCmd_retry": case "downloadsCmd_retry":
return ((this._dataItem && this._dataItem.canRetry) || // Disable the retry command for past downloads until it's fully implemented.
(!this._dataItem && this._file)) return this._dataItem && this._dataItem.canRetry;
case "downloadsCmd_openReferrer": case "downloadsCmd_openReferrer":
return this._dataItem && !!this._dataItem.referrer; return this._dataItem && !!this._dataItem.referrer;
case "cmd_delete": case "cmd_delete":
@ -463,15 +517,6 @@ DownloadElementShell.prototype = {
return false; return false;
}, },
_getTargetFileOrPartFileIfExists: function DES__getTargetFileOrPartFileIfExists() {
if (this._file && this._file.exists())
return this._file;
if (this._dataItem &&
this._dataItem.partFile && this._dataItem.partFile.exists())
return this._dataItem.partFile;
return null;
},
_retryAsHistoryDownload: function DES__retryAsHistoryDownload() { _retryAsHistoryDownload: function DES__retryAsHistoryDownload() {
// TODO: save in the right location (the current saveURL api does not allow this) // TODO: save in the right location (the current saveURL api does not allow this)
saveURL(this.downloadURI, this._displayName, null, true, true, undefined, document); saveURL(this.downloadURI, this._displayName, null, true, true, undefined, document);
@ -484,14 +529,16 @@ DownloadElementShell.prototype = {
if (this._dateItem) if (this._dateItem)
this._dataItem.openLocalFile(window); this._dataItem.openLocalFile(window);
else else
DownloadsCommon.openDownloadedFile(this._file, null, window); DownloadsCommon.openDownloadedFile(
GetFileForFileURI(this._targetFileURI), null, window);
break; break;
} }
case "downloadsCmd_show": { case "downloadsCmd_show": {
if (this._dataItem) if (this._dataItem)
this._dataItem.showLocalFile(); this._dataItem.showLocalFile();
else else
DownloadsCommon.showDownloadedFile(this._getTargetFileOrPartFileIfExists()); DownloadsCommon.showDownloadedFile(
GetFileForFileURI(this._targetFileURI));
break; break;
} }
case "downloadsCmd_openReferrer": { case "downloadsCmd_openReferrer": {
@ -826,7 +873,7 @@ DownloadsPlacesView.prototype = {
} }
else { else {
let before = this._lastSessionDownloadElement ? let before = this._lastSessionDownloadElement ?
this._lastSessionDownloadElement.nextSibling : this._richlistbox.firstchild; this._lastSessionDownloadElement.nextSibling : this._richlistbox.firstChild;
this._richlistbox.insertBefore(shell.element, before); this._richlistbox.insertBefore(shell.element, before);
} }
} }
@ -965,6 +1012,7 @@ DownloadsPlacesView.prototype = {
sortingChanged: function() {}, sortingChanged: function() {},
nodeMoved: function() {}, nodeMoved: function() {},
nodeURIChanged: function() {}, nodeURIChanged: function() {},
batching: function() {},
get controller() this._richlistbox.controller, get controller() this._richlistbox.controller,
@ -1012,6 +1060,8 @@ DownloadsPlacesView.prototype = {
return true; return true;
case "cmd_paste": case "cmd_paste":
return this._canDownloadClipboardURL(); return this._canDownloadClipboardURL();
case "downloadsCmd_clearDownloads":
return !!this._richlistbox.firstChild;
default: default:
return Array.every(selectedElements, function(element) { return Array.every(selectedElements, function(element) {
return element._shell.isCommandEnabled(aCommand); return element._shell.isCommandEnabled(aCommand);
@ -1073,6 +1123,18 @@ DownloadsPlacesView.prototype = {
case "cmd_paste": case "cmd_paste":
this._downloadURLFromClipboard(); this._downloadURLFromClipboard();
break; break;
case "downloadsCmd_clearDownloads":
if (PrivateBrowsingUtils.isWindowPrivate(window)) {
Services.downloads.cleanUpPrivate();
} else {
Services.downloads.cleanUp();
}
if (this.result) {
Cc["@mozilla.org/browser/download-history;1"]
.getService(Ci.nsIDownloadHistory)
.removeAllDownloads();
}
break;
default: { default: {
let selectedElements = this._richlistbox.selectedItems; let selectedElements = this._richlistbox.selectedItems;
for (let element of selectedElements) { for (let element of selectedElements) {
@ -1092,7 +1154,12 @@ DownloadsPlacesView.prototype = {
// Set the state attribute so that only the appropriate items are displayed. // Set the state attribute so that only the appropriate items are displayed.
let contextMenu = document.getElementById("downloadsContextMenu"); let contextMenu = document.getElementById("downloadsContextMenu");
contextMenu.setAttribute("state", element._shell.getDownloadState()); let state = element._shell.getDownloadState();
if (state !== undefined)
contextMenu.setAttribute("state", state);
else
contextMenu.removeAttribute("state");
return true; return true;
}, },
@ -1118,6 +1185,19 @@ DownloadsPlacesView.prototype = {
element._shell.doCommand("downloadsCmd_pauseResume"); element._shell.doCommand("downloadsCmd_pauseResume");
} }
} }
},
onDoubleClick: function DPV_onDoubleClick(aEvent) {
if (aEvent.button != 0)
return;
let selectedElements = this._richlistbox.selectedItems;
if (!selectedElements || selectedElements.length != 1)
return;
let element = selectedElements[0];
if (element._shell)
element._shell.doDefaultCommand();
} }
}; };

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

@ -43,7 +43,11 @@
seltype="multiple" seltype="multiple"
id="downloadsRichListBox" context="downloadsContextMenu" id="downloadsRichListBox" context="downloadsContextMenu"
onkeypress="return this._placesView.onKeyPress(event);" onkeypress="return this._placesView.onKeyPress(event);"
oncontextmenu="return this._placesView.onContextMenu(event);"/> ondblclick="return this._placesView.onDoubleClick(event);"
oncontextmenu="return this._placesView.onContextMenu(event);"
onfocus="goUpdateDownloadCommands();"
onselect="goUpdateDownloadCommands();"
onblur="goUpdateDownloadCommands();"/>
<commandset id="downloadCommands" <commandset id="downloadCommands"
commandupdater="true" commandupdater="true"
@ -61,6 +65,8 @@
oncommand="goDoCommand('downloadsCmd_retry')"/> oncommand="goDoCommand('downloadsCmd_retry')"/>
<command id="downloadsCmd_openReferrer" <command id="downloadsCmd_openReferrer"
oncommand="goDoCommand('downloadsCmd_openReferrer')"/> oncommand="goDoCommand('downloadsCmd_openReferrer')"/>
<command id="downloadsCmd_clearDownloads"
oncommand="goDoCommand('downloadsCmd_clearDownloads')"/>
</commandset> </commandset>
<menupopup id="downloadsContextMenu" class="download-state"> <menupopup id="downloadsContextMenu" class="download-state">
@ -99,5 +105,11 @@
<menuitem command="cmd_copy" <menuitem command="cmd_copy"
label="&cmd.copyDownloadLink.label;" label="&cmd.copyDownloadLink.label;"
accesskey="&cmd.copyDownloadLink.accesskey;"/> accesskey="&cmd.copyDownloadLink.accesskey;"/>
<menuseparator/>
<menuitem command="downloadsCmd_clearDownloads"
label="&cmd.clearDownloads.label;"
accesskey="&cmd.clearDownloads.accesskey;"/>
</menupopup> </menupopup>
</overlay> </overlay>

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

@ -39,7 +39,9 @@ richlistitem.download button {
.downloadRetry, .downloadRetry,
.download-state:not( [state="1"] /* Finished */) .download-state:not( [state="1"] /* Finished */)
.downloadShow .downloadShow,
.download-state:not([state]) > button
{ {
display: none; display: none;
} }

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

@ -405,7 +405,7 @@ var BookmarkPropertiesPanel = {
if (this._batching) if (this._batching)
return; return;
PlacesUtils.transactionManager.beginBatch(); PlacesUtils.transactionManager.beginBatch(null);
this._batching = true; this._batching = true;
}, },
@ -413,7 +413,7 @@ var BookmarkPropertiesPanel = {
if (!this._batching) if (!this._batching)
return; return;
PlacesUtils.transactionManager.endBatch(); PlacesUtils.transactionManager.endBatch(false);
this._batching = false; this._batching = false;
}, },

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

@ -4,6 +4,11 @@
<?xul-overlay href="chrome://browser/content/downloads/allDownloadsViewOverlay.xul"?> <?xul-overlay href="chrome://browser/content/downloads/allDownloadsViewOverlay.xul"?>
<!DOCTYPE overlay [
<!ENTITY % downloadsDTD SYSTEM "chrome://browser/locale/downloads/downloads.dtd">
%downloadsDTD;
]>
<overlay id="downloadsViewOverlay" <overlay id="downloadsViewOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
@ -15,7 +20,8 @@
ContentArea.setContentViewForQueryString(DOWNLOADS_QUERY, ContentArea.setContentViewForQueryString(DOWNLOADS_QUERY,
function() new DownloadsPlacesView(document.getElementById("downloadsRichListBox")), function() new DownloadsPlacesView(document.getElementById("downloadsRichListBox")),
{ showDetailsPane: false }); { showDetailsPane: false,
toolbarSet: "back-button, forward-button, organizeButton, clearDownloadsButton, libraryToolbarSpacer, searchFilter" });
]]></script> ]]></script>
<window id="places"> <window id="places">
@ -26,4 +32,13 @@
<deck id="placesViewsDeck"> <deck id="placesViewsDeck">
<richlistbox id="downloadsRichListBox"/> <richlistbox id="downloadsRichListBox"/>
</deck> </deck>
<toolbar id="placesToolbar">
<toolbarbutton id="clearDownloadsButton"
insertbefore="libraryToolbarSpacer"
label="&clearDownloadsButton.label;"
command="downloadsCmd_clearDownloads"
tooltiptext="&clearDownloadsButton.tooltip;"/>
</toolbar>
</overlay> </overlay>

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

@ -1252,6 +1252,7 @@ let ContentArea = {
init: function CA_init() { init: function CA_init() {
this._deck = document.getElementById("placesViewsDeck"); this._deck = document.getElementById("placesViewsDeck");
this._toolbar = document.getElementById("placesToolbar");
ContentTree.init(); ContentTree.init();
}, },
@ -1315,9 +1316,25 @@ let ContentArea = {
set currentPlace(aQueryString) { set currentPlace(aQueryString) {
this.currentView = this.getContentViewForQueryString(aQueryString); this.currentView = this.getContentViewForQueryString(aQueryString);
this.currentView.place = aQueryString; this.currentView.place = aQueryString;
this._updateToolbarSet();
return aQueryString; return aQueryString;
}, },
_updateToolbarSet: function CA__updateToolbarSet() {
let toolbarSet = this.currentViewOptions.toolbarSet;
for (let elt of this._toolbar.childNodes) {
// On Windows and Linux the menu buttons are menus wrapped in a menubar.
if (elt.id == "placesMenu") {
for (let menuElt of elt.childNodes) {
menuElt.hidden = toolbarSet.indexOf(menuElt.id) == -1;
}
}
else {
elt.hidden = toolbarSet.indexOf(elt.id) == -1;
}
}
},
/** /**
* Options for the current view. * Options for the current view.
* *
@ -1347,7 +1364,10 @@ let ContentTree = {
get view() this._view, get view() this._view,
get viewOptions() Object.seal({ showDetailsPane: true }), get viewOptions() Object.seal({
showDetailsPane: true,
toolbarSet: "back-button, forward-button, organizeButton, viewMenu, maintenanceButton, libraryToolbarSpacer, searchFilter"
}),
openSelectedNode: function CT_openSelectedNode(aEvent) { openSelectedNode: function CT_openSelectedNode(aEvent) {
let view = this.view; let view = this.view;

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

@ -326,7 +326,7 @@
</menubar> </menubar>
#endif #endif
<spacer flex="1"/> <spacer id="libraryToolbarSpacer" flex="1"/>
<textbox id="searchFilter" <textbox id="searchFilter"
clickSelectsAll="true" clickSelectsAll="true"

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

@ -1153,10 +1153,10 @@ XPCOMUtils.defineLazyGetter(PlacesUIUtils, "ptm", function() {
//// nsITransactionManager forwarders. //// nsITransactionManager forwarders.
beginBatch: function() beginBatch: function()
PlacesUtils.transactionManager.beginBatch(), PlacesUtils.transactionManager.beginBatch(null),
endBatch: function() endBatch: function()
PlacesUtils.transactionManager.endBatch(), PlacesUtils.transactionManager.endBatch(false),
doTransaction: function(txn) doTransaction: function(txn)
PlacesUtils.transactionManager.doTransaction(txn), PlacesUtils.transactionManager.doTransaction(txn),

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -1,297 +0,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/. */
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
this.EXPORTED_SYMBOLS = [ "Flags" ];
Cu.import("resource:///modules/devtools/gcli.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "AddonManager",
"resource://gre/modules/AddonManager.jsm");
// We need to use an object in which to store any flags because a primitive
// would remain undefined.
this.Flags = {
addonsLoaded: false
};
/**
* 'addon' command.
*/
gcli.addCommand({
name: "addon",
description: gcli.lookup("addonDesc")
});
/**
* 'addon list' command.
*/
gcli.addCommand({
name: "addon list",
description: gcli.lookup("addonListDesc"),
params: [{
name: 'type',
type: {
name: 'selection',
data: ["dictionary", "extension", "locale", "plugin", "theme", "all"]
},
defaultValue: 'all',
description: gcli.lookup("addonListTypeDesc"),
}],
exec: function(aArgs, context) {
function representEnabledAddon(aAddon) {
return "<li><![CDATA[" + aAddon.name + "\u2002" + aAddon.version +
getAddonStatus(aAddon) + "]]></li>";
}
function representDisabledAddon(aAddon) {
return "<li class=\"gcli-addon-disabled\">" +
"<![CDATA[" + aAddon.name + "\u2002" + aAddon.version + aAddon.version +
"]]></li>";
}
function getAddonStatus(aAddon) {
let operations = [];
if (aAddon.pendingOperations & AddonManager.PENDING_ENABLE) {
operations.push("PENDING_ENABLE");
}
if (aAddon.pendingOperations & AddonManager.PENDING_DISABLE) {
operations.push("PENDING_DISABLE");
}
if (aAddon.pendingOperations & AddonManager.PENDING_UNINSTALL) {
operations.push("PENDING_UNINSTALL");
}
if (aAddon.pendingOperations & AddonManager.PENDING_INSTALL) {
operations.push("PENDING_INSTALL");
}
if (aAddon.pendingOperations & AddonManager.PENDING_UPGRADE) {
operations.push("PENDING_UPGRADE");
}
if (operations.length) {
return " (" + operations.join(", ") + ")";
}
return "";
}
/**
* Compares two addons by their name. Used in sorting.
*/
function compareAddonNames(aNameA, aNameB) {
return String.localeCompare(aNameA.name, aNameB.name);
}
/**
* Resolves the promise which is the scope (this) of this function, filling
* it with an HTML representation of the passed add-ons.
*/
function list(aType, aAddons) {
if (!aAddons.length) {
this.resolve(gcli.lookup("addonNoneOfType"));
}
// Separate the enabled add-ons from the disabled ones.
let enabledAddons = [];
let disabledAddons = [];
aAddons.forEach(function(aAddon) {
if (aAddon.isActive) {
enabledAddons.push(aAddon);
} else {
disabledAddons.push(aAddon);
}
});
let header;
switch(aType) {
case "dictionary":
header = gcli.lookup("addonListDictionaryHeading");
break;
case "extension":
header = gcli.lookup("addonListExtensionHeading");
break;
case "locale":
header = gcli.lookup("addonListLocaleHeading");
break;
case "plugin":
header = gcli.lookup("addonListPluginHeading");
break;
case "theme":
header = gcli.lookup("addonListThemeHeading");
case "all":
header = gcli.lookup("addonListAllHeading");
break;
default:
header = gcli.lookup("addonListUnknownHeading");
}
// Map and sort the add-ons, and create an HTML list.
let message = header +
"<ol>" +
enabledAddons.sort(compareAddonNames).map(representEnabledAddon).join("") +
disabledAddons.sort(compareAddonNames).map(representDisabledAddon).join("") +
"</ol>";
this.resolve(context.createView({ html: message }));
}
// Create the promise that will be resolved when the add-on listing has
// been finished.
let promise = context.createPromise();
let types = aArgs.type == "all" ? null : [aArgs.type];
AddonManager.getAddonsByTypes(types, list.bind(promise, aArgs.type));
return promise;
}
});
// We need a list of addon names for the enable and disable commands. Because
// getting the name list is async we do not add the commands until we have the
// list.
AddonManager.getAllAddons(function addonAsync(aAddons) {
// We listen for installs to keep our addon list up to date. There is no need
// to listen for uninstalls because uninstalled addons are simply disabled
// until restart (to enable undo functionality).
AddonManager.addAddonListener({
onInstalled: function(aAddon) {
addonNameCache.push({
name: representAddon(aAddon).replace(/\s/g, "_"),
value: aAddon.name
});
},
onUninstalled: function(aAddon) {
let name = representAddon(aAddon).replace(/\s/g, "_");
for (let i = 0; i < addonNameCache.length; i++) {
if(addonNameCache[i].name == name) {
addonNameCache.splice(i, 1);
break;
}
}
},
});
/**
* Returns a string that represents the passed add-on.
*/
function representAddon(aAddon) {
let name = aAddon.name + " " + aAddon.version;
return name.trim();
}
let addonNameCache = [];
// The name parameter, used in "addon enable" and "addon disable."
let nameParameter = {
name: "name",
type: {
name: "selection",
lookup: addonNameCache
},
description: gcli.lookup("addonNameDesc")
};
for (let addon of aAddons) {
addonNameCache.push({
name: representAddon(addon).replace(/\s/g, "_"),
value: addon.name
});
}
/**
* 'addon enable' command.
*/
gcli.addCommand({
name: "addon enable",
description: gcli.lookup("addonEnableDesc"),
params: [nameParameter],
exec: function(aArgs, context) {
/**
* Enables the addon in the passed list which has a name that matches
* according to the passed name comparer, and resolves the promise which
* is the scope (this) of this function to display the result of this
* enable attempt.
*/
function enable(aName, addons) {
// Find the add-on.
let addon = null;
addons.some(function(candidate) {
if (candidate.name == aName) {
addon = candidate;
return true;
} else {
return false;
}
});
let name = representAddon(addon);
let message = "";
if (!addon.userDisabled) {
message = gcli.lookupFormat("addonAlreadyEnabled", [name]);
} else {
addon.userDisabled = false;
message = gcli.lookupFormat("addonEnabled", [name]);
}
this.resolve(message);
}
let promise = context.createPromise();
// List the installed add-ons, enable one when done listing.
AddonManager.getAllAddons(enable.bind(promise, aArgs.name));
return promise;
}
});
/**
* 'addon disable' command.
*/
gcli.addCommand({
name: "addon disable",
description: gcli.lookup("addonDisableDesc"),
params: [nameParameter],
exec: function(aArgs, context) {
/**
* Like enable, but ... you know ... the exact opposite.
*/
function disable(aName, addons) {
// Find the add-on.
let addon = null;
addons.some(function(candidate) {
if (candidate.name == aName) {
addon = candidate;
return true;
} else {
return false;
}
});
let name = representAddon(addon);
let message = "";
if (addon.userDisabled) {
message = gcli.lookupFormat("addonAlreadyDisabled", [name]);
} else {
addon.userDisabled = true;
message = gcli.lookupFormat("addonDisabled", [name]);
}
this.resolve(message);
}
let promise = context.createPromise();
// List the installed add-ons, disable one when done listing.
AddonManager.getAllAddons(disable.bind(promise, aArgs.name));
return promise;
}
});
Flags.addonsLoaded = true;
Services.obs.notifyObservers(null, "gcli_addon_commands_ready", null);
});

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

@ -1,184 +0,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/. */
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
this.EXPORTED_SYMBOLS = [ ];
Cu.import("resource:///modules/devtools/gcli.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "HUDService",
"resource:///modules/HUDService.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "TargetFactory",
"resource:///modules/devtools/Target.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "gDevTools",
"resource:///modules/devtools/gDevTools.jsm");
/**
* 'break' command
*/
gcli.addCommand({
name: "break",
description: gcli.lookup("breakDesc"),
manual: gcli.lookup("breakManual")
});
/**
* 'break list' command
*/
gcli.addCommand({
name: "break list",
description: gcli.lookup("breaklistDesc"),
returnType: "html",
exec: function(args, context) {
let dbg = getPanel(context, "jsdebugger");
if (!dbg) {
return gcli.lookup("debuggerStopped");
}
let breakpoints = dbg.getAllBreakpoints();
if (Object.keys(breakpoints).length === 0) {
return gcli.lookup("breaklistNone");
}
let reply = gcli.lookup("breaklistIntro");
reply += "<ol>";
for each (let breakpoint in breakpoints) {
let text = gcli.lookupFormat("breaklistLineEntry",
[breakpoint.location.url,
breakpoint.location.line]);
reply += "<li>" + text + "</li>";
};
reply += "</ol>";
return reply;
}
});
/**
* 'break add' command
*/
gcli.addCommand({
name: "break add",
description: gcli.lookup("breakaddDesc"),
manual: gcli.lookup("breakaddManual")
});
/**
* 'break add line' command
*/
gcli.addCommand({
name: "break add line",
description: gcli.lookup("breakaddlineDesc"),
params: [
{
name: "file",
type: {
name: "selection",
data: function(args, context) {
let files = [];
let dbg = getPanel(context, "jsdebugger");
if (dbg) {
let sourcesView = dbg.panelWin.DebuggerView.Sources;
for (let item in sourcesView) {
files.push(item.value);
}
}
return files;
}
},
description: gcli.lookup("breakaddlineFileDesc")
},
{
name: "line",
type: { name: "number", min: 1, step: 10 },
description: gcli.lookup("breakaddlineLineDesc")
}
],
returnType: "html",
exec: function(args, context) {
args.type = "line";
let dbg = getPanel(context, "jsdebugger");
if (!dbg) {
return gcli.lookup("debuggerStopped");
}
var deferred = context.defer();
let position = { url: args.file, line: args.line };
dbg.addBreakpoint(position, function(aBreakpoint, aError) {
if (aError) {
deferred.resolve(gcli.lookupFormat("breakaddFailed", [aError]));
return;
}
deferred.resolve(gcli.lookup("breakaddAdded"));
});
return deferred.promise;
}
});
/**
* 'break del' command
*/
gcli.addCommand({
name: "break del",
description: gcli.lookup("breakdelDesc"),
params: [
{
name: "breakid",
type: {
name: "number",
min: 0,
max: function(args, context) {
let dbg = getPanel(context, "jsdebugger");
return dbg == null ?
null :
Object.keys(dbg.getAllBreakpoints()).length - 1;
},
},
description: gcli.lookup("breakdelBreakidDesc")
}
],
returnType: "html",
exec: function(args, context) {
let dbg = getPanel(context, "jsdebugger");
if (!dbg) {
return gcli.lookup("debuggerStopped");
}
let breakpoints = dbg.getAllBreakpoints();
let id = Object.keys(breakpoints)[args.breakid];
if (!id || !(id in breakpoints)) {
return gcli.lookup("breakNotFound");
}
let deferred = context.defer();
try {
dbg.removeBreakpoint(breakpoints[id], function() {
deferred.resolve(gcli.lookup("breakdelRemoved"));
});
} catch (ex) {
// If the debugger has been closed already, don't scare the user.
deferred.resolve(gcli.lookup("breakdelRemoved"));
}
return deferred.promise;
}
});
/**
* A helper to go from a command context to a debugger panel
*/
function getPanel(context, id) {
if (context == null) {
return undefined;
}
let gBrowser = context.environment.chromeDocument.defaultView.gBrowser;
let target = TargetFactory.forTab(gBrowser.selectedTab);
let toolbox = gDevTools.getToolbox(target);
return toolbox == null ? undefined : toolbox.getPanel(id);
}

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

@ -1,107 +0,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/. */
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
this.EXPORTED_SYMBOLS = [ ];
Cu.import("resource:///modules/devtools/gcli.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "gDevTools",
"resource:///modules/devtools/gDevTools.jsm");
XPCOMUtils.defineLazyGetter(this, "Debugger", function() {
let JsDebugger = {};
Components.utils.import("resource://gre/modules/jsdebugger.jsm", JsDebugger);
let global = Components.utils.getGlobalForObject({});
JsDebugger.addDebuggerToGlobal(global);
return global.Debugger;
});
XPCOMUtils.defineLazyModuleGetter(this, "TargetFactory",
"resource:///modules/devtools/Target.jsm");
let debuggers = [];
/**
* 'calllog' command
*/
gcli.addCommand({
name: "calllog",
description: gcli.lookup("calllogDesc")
})
/**
* 'calllog start' command
*/
gcli.addCommand({
name: "calllog start",
description: gcli.lookup("calllogStartDesc"),
exec: function(args, context) {
let contentWindow = context.environment.contentDocument.defaultView;
let dbg = new Debugger(contentWindow);
dbg.onEnterFrame = function(frame) {
// BUG 773652 - Make the output from the GCLI calllog command nicer
contentWindow.console.log("Method call: " + this.callDescription(frame));
}.bind(this);
debuggers.push(dbg);
let gBrowser = context.environment.chromeDocument.defaultView.gBrowser;
let target = TargetFactory.forTab(gBrowser.selectedTab);
gDevTools.showToolbox(target, "webconsole");
return gcli.lookup("calllogStartReply");
},
callDescription: function(frame) {
let name = "<anonymous>";
if (frame.callee.name) {
name = frame.callee.name;
}
else {
let desc = frame.callee.getOwnPropertyDescriptor("displayName");
if (desc && desc.value && typeof desc.value == "string") {
name = desc.value;
}
}
let args = frame.arguments.map(this.valueToString).join(", ");
return name + "(" + args + ")";
},
valueToString: function(value) {
if (typeof value !== "object" || value === null) {
return uneval(value);
}
return "[object " + value.class + "]";
}
});
/**
* 'calllog stop' command
*/
gcli.addCommand({
name: "calllog stop",
description: gcli.lookup("calllogStopDesc"),
exec: function(args, context) {
let numDebuggers = debuggers.length;
if (numDebuggers == 0) {
return gcli.lookup("calllogStopNoLogging");
}
for (let dbg of debuggers) {
dbg.onEnterFrame = undefined;
}
debuggers = [];
return gcli.lookupFormat("calllogStopReply", [ numDebuggers ]);
}
});

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

@ -1,158 +0,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/. */
this.EXPORTED_SYMBOLS = [ ];
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
Cu.import("resource:///modules/devtools/gcli.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "gDevTools",
"resource:///modules/devtools/gDevTools.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "TargetFactory",
"resource:///modules/devtools/Target.jsm");
XPCOMUtils.defineLazyGetter(this, "Debugger", function() {
let JsDebugger = {};
Cu.import("resource://gre/modules/jsdebugger.jsm", JsDebugger);
let global = Components.utils.getGlobalForObject({});
JsDebugger.addDebuggerToGlobal(global);
return global.Debugger;
});
let debuggers = [];
let sandboxes = [];
/**
* 'calllog chromestart' command
*/
gcli.addCommand({
name: "calllog chromestart",
description: gcli.lookup("calllogChromeStartDesc"),
get hidden() gcli.hiddenByChromePref(),
params: [
{
name: "sourceType",
type: {
name: "selection",
data: ["content-variable", "chrome-variable", "jsm", "javascript"]
}
},
{
name: "source",
type: "string",
description: gcli.lookup("calllogChromeSourceTypeDesc"),
manual: gcli.lookup("calllogChromeSourceTypeManual"),
}
],
exec: function(args, context) {
let globalObj;
let contentWindow = context.environment.contentDocument.defaultView;
if (args.sourceType == "jsm") {
try {
globalObj = Cu.import(args.source);
}
catch (e) {
return gcli.lookup("callLogChromeInvalidJSM");
}
} else if (args.sourceType == "content-variable") {
if (args.source in contentWindow) {
globalObj = Cu.getGlobalForObject(contentWindow[args.source]);
} else {
throw new Error(gcli.lookup("callLogChromeVarNotFoundContent"));
}
} else if (args.sourceType == "chrome-variable") {
let chromeWin = context.environment.chromeDocument.defaultView;
if (args.source in chromeWin) {
globalObj = Cu.getGlobalForObject(chromeWin[args.source]);
} else {
return gcli.lookup("callLogChromeVarNotFoundChrome");
}
} else {
let chromeWin = context.environment.chromeDocument.defaultView;
let sandbox = new Cu.Sandbox(chromeWin,
{
sandboxPrototype: chromeWin,
wantXrays: false,
sandboxName: "gcli-cmd-calllog-chrome"
});
let returnVal;
try {
returnVal = Cu.evalInSandbox(args.source, sandbox, "ECMAv5");
sandboxes.push(sandbox);
} catch(e) {
// We need to save the message before cleaning up else e contains a dead
// object.
let msg = gcli.lookup("callLogChromeEvalException") + ": " + e;
Cu.nukeSandbox(sandbox);
return msg;
}
if (typeof returnVal == "undefined") {
return gcli.lookup("callLogChromeEvalNeedsObject");
}
globalObj = Cu.getGlobalForObject(returnVal);
}
let dbg = new Debugger(globalObj);
debuggers.push(dbg);
dbg.onEnterFrame = function(frame) {
// BUG 773652 - Make the output from the GCLI calllog command nicer
contentWindow.console.log(gcli.lookup("callLogChromeMethodCall") +
": " + this.callDescription(frame));
}.bind(this);
let gBrowser = context.environment.chromeDocument.defaultView.gBrowser;
let target = TargetFactory.forTab(gBrowser.selectedTab);
gDevTools.showToolbox(target, "webconsole");
return gcli.lookup("calllogChromeStartReply");
},
valueToString: function(value) {
if (typeof value !== "object" || value === null)
return uneval(value);
return "[object " + value.class + "]";
},
callDescription: function(frame) {
let name = frame.callee.name || gcli.lookup("callLogChromeAnonFunction");
let args = frame.arguments.map(this.valueToString).join(", ");
return name + "(" + args + ")";
}
});
/**
* 'calllog chromestop' command
*/
gcli.addCommand({
name: "calllog chromestop",
description: gcli.lookup("calllogChromeStopDesc"),
get hidden() gcli.hiddenByChromePref(),
exec: function(args, context) {
let numDebuggers = debuggers.length;
if (numDebuggers == 0) {
return gcli.lookup("calllogChromeStopNoLogging");
}
for (let dbg of debuggers) {
dbg.onEnterFrame = undefined;
dbg.enabled = false;
}
for (let sandbox of sandboxes) {
Cu.nukeSandbox(sandbox);
}
debuggers = [];
sandboxes = [];
return gcli.lookupFormat("calllogChromeStopReply", [ numDebuggers ]);
}
});

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

@ -1,129 +0,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/. */
this.EXPORTED_SYMBOLS = [ "CmdCommands" ];
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
Cu.import("resource:///modules/devtools/gcli.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
let prefSvc = "@mozilla.org/preferences-service;1";
XPCOMUtils.defineLazyGetter(this, "prefBranch", function() {
let prefService = Cc[prefSvc].getService(Ci.nsIPrefService);
return prefService.getBranch(null).QueryInterface(Ci.nsIPrefBranch2);
});
XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
"resource://gre/modules/NetUtil.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "console",
"resource://gre/modules/devtools/Console.jsm");
const PREF_DIR = "devtools.commands.dir";
/**
* A place to store the names of the commands that we have added as a result of
* calling refreshAutoCommands(). Used by refreshAutoCommands to remove the
* added commands.
*/
let commands = [];
/**
* Exported API
*/
this.CmdCommands = {
/**
* Called to look in a directory pointed at by the devtools.commands.dir pref
* for *.mozcmd files which are then loaded.
* @param nsIPrincipal aSandboxPrincipal Scope object for the Sandbox in which
* we eval the script from the .mozcmd file. This should be a chrome window.
*/
refreshAutoCommands: function GC_refreshAutoCommands(aSandboxPrincipal) {
// First get rid of the last set of commands
commands.forEach(function(name) {
gcli.removeCommand(name);
});
let dirName = prefBranch.getComplexValue(PREF_DIR,
Ci.nsISupportsString).data.trim();
if (dirName == "") {
return;
}
let dir = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile);
dir.initWithPath(dirName);
if (!dir.exists() || !dir.isDirectory()) {
throw new Error('\'' + dirName + '\' is not a directory.');
}
let en = dir.directoryEntries.QueryInterface(Ci.nsIDirectoryEnumerator);
while (true) {
let file = en.nextFile;
if (!file) {
break;
}
if (file.leafName.match(/.*\.mozcmd$/) && file.isFile() && file.isReadable()) {
loadCommandFile(file, aSandboxPrincipal);
}
}
},
};
/**
* Load the commands from a single file
* @param nsIFile aFile The file containing the commands that we should read
* @param nsIPrincipal aSandboxPrincipal Scope object for the Sandbox in which
* we eval the script from the .mozcmd file. This should be a chrome window.
*/
function loadCommandFile(aFile, aSandboxPrincipal) {
NetUtil.asyncFetch(aFile, function refresh_fetch(aStream, aStatus) {
if (!Components.isSuccessCode(aStatus)) {
console.error("NetUtil.asyncFetch(" + aFile.path + ",..) failed. Status=" + aStatus);
return;
}
let source = NetUtil.readInputStreamToString(aStream, aStream.available());
aStream.close();
let sandbox = new Cu.Sandbox(aSandboxPrincipal, {
sandboxPrototype: aSandboxPrincipal,
wantXrays: false,
sandboxName: aFile.path
});
let data = Cu.evalInSandbox(source, sandbox, "1.8", aFile.leafName, 1);
if (!Array.isArray(data)) {
console.error("Command file '" + aFile.leafName + "' does not have top level array.");
return;
}
data.forEach(function(commandSpec) {
gcli.addCommand(commandSpec);
commands.push(commandSpec.name);
});
}.bind(this));
}
/**
* 'cmd' command
*/
gcli.addCommand({
name: "cmd",
get hidden() { return !prefBranch.prefHasUserValue(PREF_DIR); },
description: gcli.lookup("cmdDesc")
});
/**
* 'cmd refresh' command
*/
gcli.addCommand({
name: "cmd refresh",
description: gcli.lookup("cmdRefreshDesc"),
get hidden() { return !prefBranch.prefHasUserValue(PREF_DIR); },
exec: function Command_cmdRefresh(args, context) {
let chromeWindow = context.environment.chromeDocument.defaultView;
CmdCommands.refreshAutoCommands(chromeWindow);
}
});

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

@ -1,68 +0,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/. */
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
this.EXPORTED_SYMBOLS = [ ];
Cu.import("resource:///modules/devtools/gcli.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "HUDService",
"resource:///modules/HUDService.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "gDevTools",
"resource:///modules/devtools/gDevTools.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "TargetFactory",
"resource:///modules/devtools/Target.jsm");
/**
* 'console' command
*/
gcli.addCommand({
name: "console",
description: gcli.lookup("consoleDesc"),
manual: gcli.lookup("consoleManual")
});
/**
* 'console clear' command
*/
gcli.addCommand({
name: "console clear",
description: gcli.lookup("consoleclearDesc"),
exec: function Command_consoleClear(args, context) {
let window = context.environment.contentDocument.defaultView;
let hud = HUDService.getHudByWindow(window);
// hud will be null if the web console has not been opened for this window
if (hud) {
hud.jsterm.clearOutput();
}
}
});
/**
* 'console close' command
*/
gcli.addCommand({
name: "console close",
description: gcli.lookup("consolecloseDesc"),
exec: function Command_consoleClose(args, context) {
let gBrowser = context.environment.chromeDocument.defaultView.gBrowser;
let target = TargetFactory.forTab(gBrowser.selectedTab);
return gDevTools.closeToolbox(target);
}
});
/**
* 'console open' command
*/
gcli.addCommand({
name: "console open",
description: gcli.lookup("consoleopenDesc"),
exec: function Command_consoleOpen(args, context) {
let gBrowser = context.environment.chromeDocument.defaultView.gBrowser;
let target = TargetFactory.forTab(gBrowser.selectedTab);
return gDevTools.showToolbox(target, "webconsole");
}
});

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

@ -1,207 +0,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/. */
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
this.EXPORTED_SYMBOLS = [ ];
Cu.import("resource:///modules/devtools/gcli.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "console",
"resource://gre/modules/devtools/Console.jsm");
// We should really be using nsICookieManager so we can read more than just the
// key/value of cookies. The difficulty is filtering the cookies that are
// relevant to the current page. See
// https://github.com/firebug/firebug/blob/master/extension/content/firebug/cookies/cookieObserver.js#L123
// For details on how this is done with Firebug
/**
* 'cookie' command
*/
gcli.addCommand({
name: "cookie",
description: gcli.lookup("cookieDesc"),
manual: gcli.lookup("cookieManual")
});
/**
* The template for the 'cookie list' command.
*/
var cookieListHtml = "" +
"<table>" +
" <tr>" +
" <th>" + gcli.lookup("cookieListOutKey") + "</th>" +
" <th>" + gcli.lookup("cookieListOutValue") + "</th>" +
" <th>" + gcli.lookup("cookieListOutActions") + "</th>" +
" </tr>" +
" <tr foreach='cookie in ${cookies}'>" +
" <td>${cookie.key}</td>" +
" <td>${cookie.value}</td>" +
" <td>" +
" <span class='gcli-out-shortcut' onclick='${onclick}'" +
" data-command='cookie set ${cookie.key} '" +
" >" + gcli.lookup("cookieListOutEdit") + "</span>" +
" <span class='gcli-out-shortcut'" +
" onclick='${onclick}' ondblclick='${ondblclick}'" +
" data-command='cookie remove ${cookie.key}'" +
" >" + gcli.lookup("cookieListOutRemove") + "</span>" +
" </td>" +
" </tr>" +
"</table>" +
"";
/**
* 'cookie list' command
*/
gcli.addCommand({
name: "cookie list",
description: gcli.lookup("cookieListDesc"),
manual: gcli.lookup("cookieListManual"),
returnType: "string",
exec: function Command_cookieList(args, context) {
// Parse out an array of { key:..., value:... } objects for each cookie
var doc = context.environment.contentDocument;
var cookies = doc.cookie.split("; ").map(function(cookieStr) {
var equalsPos = cookieStr.indexOf("=");
return {
key: cookieStr.substring(0, equalsPos),
value: cookieStr.substring(equalsPos + 1)
};
});
return context.createView({
html: cookieListHtml,
data: {
cookies: cookies,
onclick: createUpdateHandler(context),
ondblclick: createExecuteHandler(context),
}
});
}
});
/**
* 'cookie remove' command
*/
gcli.addCommand({
name: "cookie remove",
description: gcli.lookup("cookieRemoveDesc"),
manual: gcli.lookup("cookieRemoveManual"),
params: [
{
name: "key",
type: "string",
description: gcli.lookup("cookieRemoveKeyDesc"),
}
],
exec: function Command_cookieRemove(args, context) {
let document = context.environment.contentDocument;
let expDate = new Date();
expDate.setDate(expDate.getDate() - 1);
document.cookie = escape(args.key) + "=; expires=" + expDate.toGMTString();
}
});
/**
* 'cookie set' command
*/
gcli.addCommand({
name: "cookie set",
description: gcli.lookup("cookieSetDesc"),
manual: gcli.lookup("cookieSetManual"),
params: [
{
name: "key",
type: "string",
description: gcli.lookup("cookieSetKeyDesc")
},
{
name: "value",
type: "string",
description: gcli.lookup("cookieSetValueDesc")
},
{
group: gcli.lookup("cookieSetOptionsDesc"),
params: [
{
name: "path",
type: "string",
defaultValue: "/",
description: gcli.lookup("cookieSetPathDesc")
},
{
name: "domain",
type: "string",
defaultValue: null,
description: gcli.lookup("cookieSetDomainDesc")
},
{
name: "secure",
type: "boolean",
description: gcli.lookup("cookieSetSecureDesc")
}
]
}
],
exec: function Command_cookieSet(args, context) {
let document = context.environment.contentDocument;
document.cookie = escape(args.key) + "=" + escape(args.value) +
(args.domain ? "; domain=" + args.domain : "") +
(args.path ? "; path=" + args.path : "") +
(args.secure ? "; secure" : "");
}
});
/**
* Helper to find the 'data-command' attribute and call some action on it.
* @see |updateCommand()| and |executeCommand()|
*/
function withCommand(element, action) {
var command = element.getAttribute("data-command");
if (!command) {
command = element.querySelector("*[data-command]")
.getAttribute("data-command");
}
if (command) {
action(command);
}
else {
console.warn("Missing data-command for " + util.findCssSelector(element));
}
}
/**
* Create a handler to update the requisition to contain the text held in the
* first matching data-command attribute under the currentTarget of the event.
* @param context Either a Requisition or an ExecutionContext or another object
* that contains an |update()| function that follows a similar contract.
*/
function createUpdateHandler(context) {
return function(ev) {
withCommand(ev.currentTarget, function(command) {
context.update(command);
});
}
}
/**
* Create a handler to execute the text held in the data-command attribute
* under the currentTarget of the event.
* @param context Either a Requisition or an ExecutionContext or another object
* that contains an |update()| function that follows a similar contract.
*/
function createExecuteHandler(context) {
return function(ev) {
withCommand(ev.currentTarget, function(command) {
context.exec({
visible: true,
typed: command
});
});
}
}

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

@ -1,176 +0,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/. */
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
this.EXPORTED_SYMBOLS = [ ];
Cu.import("resource:///modules/devtools/gcli.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "gDevTools",
"resource:///modules/devtools/gDevTools.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "TargetFactory",
"resource:///modules/devtools/Target.jsm");
/**
* 'dbg' command
*/
gcli.addCommand({
name: "dbg",
description: gcli.lookup("dbgDesc"),
manual: gcli.lookup("dbgManual")
});
/**
* 'dbg open' command
*/
gcli.addCommand({
name: "dbg open",
description: gcli.lookup("dbgOpen"),
params: [],
exec: function (args, context) {
let gBrowser = context.environment.chromeDocument.defaultView.gBrowser;
let target = TargetFactory.forTab(gBrowser.selectedTab);
return gDevTools.showToolbox(target, "jsdebugger");
}
});
/**
* 'dbg close' command
*/
gcli.addCommand({
name: "dbg close",
description: gcli.lookup("dbgClose"),
params: [],
exec: function (args, context) {
let gBrowser = context.environment.chromeDocument.defaultView.gBrowser;
let target = TargetFactory.forTab(gBrowser.selectedTab);
return gDevTools.closeToolbox(target);
}
});
/**
* 'dbg interrupt' command
*/
gcli.addCommand({
name: "dbg interrupt",
description: gcli.lookup("dbgInterrupt"),
params: [],
exec: function(args, context) {
let dbg = getPanel(context, "jsdebugger");
if (!dbg) {
return gcli.lookup("debuggerStopped");
}
let controller = dbg._controller;
let thread = controller.activeThread;
if (!thread.paused) {
thread.interrupt();
}
}
});
/**
* 'dbg continue' command
*/
gcli.addCommand({
name: "dbg continue",
description: gcli.lookup("dbgContinue"),
params: [],
exec: function(args, context) {
let dbg = getPanel(context, "jsdebugger");
if (!dbg) {
return gcli.lookup("debuggerStopped");
}
let controller = dbg._controller;
let thread = controller.activeThread;
if (thread.paused) {
thread.resume();
}
}
});
/**
* 'dbg step' command
*/
gcli.addCommand({
name: "dbg step",
description: gcli.lookup("dbgStepDesc"),
manual: gcli.lookup("dbgStepManual")
});
/**
* 'dbg step over' command
*/
gcli.addCommand({
name: "dbg step over",
description: gcli.lookup("dbgStepOverDesc"),
params: [],
exec: function(args, context) {
let dbg = getPanel(context, "jsdebugger");
if (!dbg) {
return gcli.lookup("debuggerStopped");
}
let controller = dbg._controller;
let thread = controller.activeThread;
if (thread.paused) {
thread.stepOver();
}
}
});
/**
* 'dbg step in' command
*/
gcli.addCommand({
name: 'dbg step in',
description: gcli.lookup("dbgStepInDesc"),
params: [],
exec: function(args, context) {
let dbg = getPanel(context, "jsdebugger");
if (!dbg) {
return gcli.lookup("debuggerStopped");
}
let controller = dbg._controller;
let thread = controller.activeThread;
if (thread.paused) {
thread.stepIn();
}
}
});
/**
* 'dbg step over' command
*/
gcli.addCommand({
name: 'dbg step out',
description: gcli.lookup("dbgStepOutDesc"),
params: [],
exec: function(args, context) {
let dbg = getPanel(context, "jsdebugger");
if (!dbg) {
return gcli.lookup("debuggerStopped");
}
let controller = dbg._controller;
let thread = controller.activeThread;
if (thread.paused) {
thread.stepOut();
}
}
});
/**
* A helper to go from a command context to a debugger panel
*/
function getPanel(context, id) {
let gBrowser = context.environment.chromeDocument.defaultView.gBrowser;
let target = TargetFactory.forTab(gBrowser.selectedTab);
let toolbox = gDevTools.getToolbox(target);
return toolbox == null ? undefined : toolbox.getPanel(id);
}

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

@ -1,29 +0,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/. */
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
this.EXPORTED_SYMBOLS = [ ];
Cu.import("resource:///modules/devtools/gcli.jsm");
/**
* 'echo' command
*/
gcli.addCommand({
name: "echo",
description: gcli.lookup("echoDesc"),
params: [
{
name: "message",
type: "string",
description: gcli.lookup("echoMessageDesc")
}
],
returnType: "string",
hidden: true,
exec: function Command_echo(args, context) {
return args.message;
}
});

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

@ -1,32 +0,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/. */
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
this.EXPORTED_SYMBOLS = [ ];
Cu.import("resource:///modules/devtools/gcli.jsm");
/**
* 'export' command
*/
gcli.addCommand({
name: "export",
description: gcli.lookup("exportDesc"),
});
/**
* The 'export html' command. This command allows the user to export the page to
* HTML after they do DOM changes.
*/
gcli.addCommand({
name: "export html",
description: gcli.lookup("exportHtmlDesc"),
exec: function(args, context) {
let document = context.environment.contentDocument;
let window = document.defaultView;
let page = document.documentElement.outerHTML;
window.open('data:text/plain;charset=utf8,' + encodeURIComponent(page));
}
});

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

@ -1,138 +0,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/. */
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
const XMLHttpRequest =
Components.Constructor("@mozilla.org/xmlextras/xmlhttprequest;1");
this.EXPORTED_SYMBOLS = [ ];
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource:///modules/devtools/gcli.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "js_beautify",
"resource:///modules/devtools/Jsbeautify.jsm");
/**
* jsb command.
*/
gcli.addCommand({
name: 'jsb',
description: gcli.lookup('jsbDesc'),
returnValue:'string',
params: [
{
name: 'url',
type: 'string',
description: gcli.lookup('jsbUrlDesc')
},
{
group: gcli.lookup("jsbOptionsDesc"),
params: [
{
name: 'indentSize',
type: 'number',
description: gcli.lookup('jsbIndentSizeDesc'),
manual: gcli.lookup('jsbIndentSizeManual'),
defaultValue: 2
},
{
name: 'indentChar',
type: {
name: 'selection',
lookup: [
{ name: "space", value: " " },
{ name: "tab", value: "\t" }
]
},
description: gcli.lookup('jsbIndentCharDesc'),
manual: gcli.lookup('jsbIndentCharManual'),
defaultValue: ' ',
},
{
name: 'doNotPreserveNewlines',
type: 'boolean',
description: gcli.lookup('jsbDoNotPreserveNewlinesDesc')
},
{
name: 'preserveMaxNewlines',
type: 'number',
description: gcli.lookup('jsbPreserveMaxNewlinesDesc'),
manual: gcli.lookup('jsbPreserveMaxNewlinesManual'),
defaultValue: -1
},
{
name: 'jslintHappy',
type: 'boolean',
description: gcli.lookup('jsbJslintHappyDesc'),
manual: gcli.lookup('jsbJslintHappyManual')
},
{
name: 'braceStyle',
type: {
name: 'selection',
data: ['collapse', 'expand', 'end-expand', 'expand-strict']
},
description: gcli.lookup('jsbBraceStyleDesc'),
manual: gcli.lookup('jsbBraceStyleManual'),
defaultValue: "collapse"
},
{
name: 'noSpaceBeforeConditional',
type: 'boolean',
description: gcli.lookup('jsbNoSpaceBeforeConditionalDesc')
},
{
name: 'unescapeStrings',
type: 'boolean',
description: gcli.lookup('jsbUnescapeStringsDesc'),
manual: gcli.lookup('jsbUnescapeStringsManual')
}
]
}
],
exec: function(args, context) {
let opts = {
indent_size: args.indentSize,
indent_char: args.indentChar,
preserve_newlines: !args.doNotPreserveNewlines,
max_preserve_newlines: args.preserveMaxNewlines == -1 ?
undefined : args.preserveMaxNewlines,
jslint_happy: args.jslintHappy,
brace_style: args.braceStyle,
space_before_conditional: !args.noSpaceBeforeConditional,
unescape_strings: args.unescapeStrings
};
let xhr = new XMLHttpRequest();
try {
xhr.open("GET", args.url, true);
} catch(e) {
return gcli.lookup('jsbInvalidURL');
}
let promise = context.createPromise();
xhr.onreadystatechange = function(aEvt) {
if (xhr.readyState == 4) {
if (xhr.status == 200 || xhr.status == 0) {
let browserDoc = context.environment.chromeDocument;
let browserWindow = browserDoc.defaultView;
let gBrowser = browserWindow.gBrowser;
let result = js_beautify(xhr.responseText, opts);
browserWindow.Scratchpad.ScratchpadManager.openScratchpad({text: result});
promise.resolve();
} else {
promise.resolve("Unable to load page to beautify: " + args.url + " " +
xhr.status + " " + xhr.statusText);
}
};
}
xhr.send(null);
return promise;
}
});

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

@ -1,264 +0,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/. */
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
this.EXPORTED_SYMBOLS = [ ];
Cu.import("resource:///modules/devtools/gcli.jsm");
/**
* 'pagemod' command
*/
gcli.addCommand({
name: "pagemod",
description: gcli.lookup("pagemodDesc"),
});
/**
* The 'pagemod replace' command. This command allows the user to search and
* replace within text nodes and attributes.
*/
gcli.addCommand({
name: "pagemod replace",
description: gcli.lookup("pagemodReplaceDesc"),
params: [
{
name: "search",
type: "string",
description: gcli.lookup("pagemodReplaceSearchDesc"),
},
{
name: "replace",
type: "string",
description: gcli.lookup("pagemodReplaceReplaceDesc"),
},
{
name: "ignoreCase",
type: "boolean",
description: gcli.lookup("pagemodReplaceIgnoreCaseDesc"),
},
{
name: "selector",
type: "string",
description: gcli.lookup("pagemodReplaceSelectorDesc"),
defaultValue: "*:not(script):not(style):not(embed):not(object):not(frame):not(iframe):not(frameset)",
},
{
name: "root",
type: "node",
description: gcli.lookup("pagemodReplaceRootDesc"),
defaultValue: null,
},
{
name: "attrOnly",
type: "boolean",
description: gcli.lookup("pagemodReplaceAttrOnlyDesc"),
},
{
name: "contentOnly",
type: "boolean",
description: gcli.lookup("pagemodReplaceContentOnlyDesc"),
},
{
name: "attributes",
type: "string",
description: gcli.lookup("pagemodReplaceAttributesDesc"),
defaultValue: null,
},
],
exec: function(args, context) {
let document = context.environment.contentDocument;
let searchTextNodes = !args.attrOnly;
let searchAttributes = !args.contentOnly;
let regexOptions = args.ignoreCase ? 'ig' : 'g';
let search = new RegExp(escapeRegex(args.search), regexOptions);
let attributeRegex = null;
if (args.attributes) {
attributeRegex = new RegExp(args.attributes, regexOptions);
}
let root = args.root || document;
let elements = root.querySelectorAll(args.selector);
elements = Array.prototype.slice.call(elements);
let replacedTextNodes = 0;
let replacedAttributes = 0;
function replaceAttribute() {
replacedAttributes++;
return args.replace;
}
function replaceTextNode() {
replacedTextNodes++;
return args.replace;
}
for (let i = 0; i < elements.length; i++) {
let element = elements[i];
if (searchTextNodes) {
for (let y = 0; y < element.childNodes.length; y++) {
let node = element.childNodes[y];
if (node.nodeType == node.TEXT_NODE) {
node.textContent = node.textContent.replace(search, replaceTextNode);
}
}
}
if (searchAttributes) {
if (!element.attributes) {
continue;
}
for (let y = 0; y < element.attributes.length; y++) {
let attr = element.attributes[y];
if (!attributeRegex || attributeRegex.test(attr.name)) {
attr.value = attr.value.replace(search, replaceAttribute);
}
}
}
}
return gcli.lookupFormat("pagemodReplaceResult",
[elements.length, replacedTextNodes,
replacedAttributes]);
}
});
/**
* 'pagemod remove' command
*/
gcli.addCommand({
name: "pagemod remove",
description: gcli.lookup("pagemodRemoveDesc"),
});
/**
* The 'pagemod remove element' command.
*/
gcli.addCommand({
name: "pagemod remove element",
description: gcli.lookup("pagemodRemoveElementDesc"),
params: [
{
name: "search",
type: "string",
description: gcli.lookup("pagemodRemoveElementSearchDesc"),
},
{
name: "root",
type: "node",
description: gcli.lookup("pagemodRemoveElementRootDesc"),
defaultValue: null,
},
{
name: 'stripOnly',
type: 'boolean',
description: gcli.lookup("pagemodRemoveElementStripOnlyDesc"),
},
{
name: 'ifEmptyOnly',
type: 'boolean',
description: gcli.lookup("pagemodRemoveElementIfEmptyOnlyDesc"),
},
],
exec: function(args, context) {
let document = context.environment.contentDocument;
let root = args.root || document;
let elements = Array.prototype.slice.call(root.querySelectorAll(args.search));
let removed = 0;
for (let i = 0; i < elements.length; i++) {
let element = elements[i];
let parentNode = element.parentNode;
if (!parentNode || !element.removeChild) {
continue;
}
if (args.stripOnly) {
while (element.hasChildNodes()) {
parentNode.insertBefore(element.childNodes[0], element);
}
}
if (!args.ifEmptyOnly || !element.hasChildNodes()) {
element.parentNode.removeChild(element);
removed++;
}
}
return gcli.lookupFormat("pagemodRemoveElementResultMatchedAndRemovedElements",
[elements.length, removed]);
}
});
/**
* The 'pagemod remove attribute' command.
*/
gcli.addCommand({
name: "pagemod remove attribute",
description: gcli.lookup("pagemodRemoveAttributeDesc"),
params: [
{
name: "searchAttributes",
type: "string",
description: gcli.lookup("pagemodRemoveAttributeSearchAttributesDesc"),
},
{
name: "searchElements",
type: "string",
description: gcli.lookup("pagemodRemoveAttributeSearchElementsDesc"),
},
{
name: "root",
type: "node",
description: gcli.lookup("pagemodRemoveAttributeRootDesc"),
defaultValue: null,
},
{
name: "ignoreCase",
type: "boolean",
description: gcli.lookup("pagemodRemoveAttributeIgnoreCaseDesc"),
},
],
exec: function(args, context) {
let document = context.environment.contentDocument;
let root = args.root || document;
let regexOptions = args.ignoreCase ? 'ig' : 'g';
let attributeRegex = new RegExp(args.searchAttributes, regexOptions);
let elements = root.querySelectorAll(args.searchElements);
elements = Array.prototype.slice.call(elements);
let removed = 0;
for (let i = 0; i < elements.length; i++) {
let element = elements[i];
if (!element.attributes) {
continue;
}
var attrs = Array.prototype.slice.call(element.attributes);
for (let y = 0; y < attrs.length; y++) {
let attr = attrs[y];
if (attributeRegex.test(attr.name)) {
element.removeAttribute(attr.name);
removed++;
}
}
}
return gcli.lookupFormat("pagemodRemoveAttributeResult",
[elements.length, removed]);
}
});
/**
* Make a given string safe to use in a regular expression.
*
* @param string aString
* The string you want to use in a regex.
* @return string
* The equivalent of |aString| but safe to use in a regex.
*/
function escapeRegex(aString) {
return aString.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
}

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

@ -1,54 +0,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/. */
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
this.EXPORTED_SYMBOLS = [ ];
Cu.import("resource:///modules/devtools/gcli.jsm");
Cu.import("resource://gre/modules/Services.jsm");
/**
* Restart command
*
* @param boolean nocache
* Disables loading content from cache upon restart.
*
* Examples :
* >> restart
* - restarts browser immediately
* >> restart --nocache
* - restarts immediately and starts Firefox without using cache
*/
gcli.addCommand({
name: "restart",
description: gcli.lookup("restartFirefoxDesc"),
params: [
{
name: "nocache",
type: "boolean",
description: gcli.lookup("restartFirefoxNocacheDesc")
}
],
returnType: "string",
exec: function Restart(args, context) {
let canceled = Cc["@mozilla.org/supports-PRBool;1"]
.createInstance(Ci.nsISupportsPRBool);
Services.obs.notifyObservers(canceled, "quit-application-requested", "restart");
if (canceled.data) {
return gcli.lookup("restartFirefoxRequestCancelled");
}
// disable loading content from cache.
if (args.nocache) {
Services.appinfo.invalidateCachesOnRestart();
}
// restart
Cc['@mozilla.org/toolkit/app-startup;1']
.getService(Ci.nsIAppStartup)
.quit(Ci.nsIAppStartup.eAttemptQuit | Ci.nsIAppStartup.eRestart);
return gcli.lookup("restartFirefoxRestarting");
}
});

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

@ -1,238 +0,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/. */
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
this.EXPORTED_SYMBOLS = [ ];
Cu.import("resource:///modules/devtools/gcli.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "LayoutHelpers",
"resource:///modules/devtools/LayoutHelpers.jsm");
// String used as an indication to generate default file name in the following
// format: "Screen Shot yyyy-mm-dd at HH.MM.SS.png"
const FILENAME_DEFAULT_VALUE = " ";
/**
* 'screenshot' command
*/
gcli.addCommand({
name: "screenshot",
description: gcli.lookup("screenshotDesc"),
manual: gcli.lookup("screenshotManual"),
returnType: "html",
params: [
{
name: "filename",
type: "string",
defaultValue: FILENAME_DEFAULT_VALUE,
description: gcli.lookup("screenshotFilenameDesc"),
manual: gcli.lookup("screenshotFilenameManual")
},
{
group: gcli.lookup("screenshotGroupOptions"),
params: [
{
name: "clipboard",
type: "boolean",
description: gcli.lookup("screenshotClipboardDesc"),
manual: gcli.lookup("screenshotClipboardManual")
},
{
name: "chrome",
type: "boolean",
description: gcli.lookup("screenshotChromeDesc"),
manual: gcli.lookup("screenshotChromeManual")
},
{
name: "delay",
type: { name: "number", min: 0 },
defaultValue: 0,
description: gcli.lookup("screenshotDelayDesc"),
manual: gcli.lookup("screenshotDelayManual")
},
{
name: "fullpage",
type: "boolean",
description: gcli.lookup("screenshotFullPageDesc"),
manual: gcli.lookup("screenshotFullPageManual")
},
{
name: "selector",
type: "node",
defaultValue: null,
description: gcli.lookup("inspectNodeDesc"),
manual: gcli.lookup("inspectNodeManual")
}
]
}
],
exec: function Command_screenshot(args, context) {
if (args.chrome && args.selector) {
// Node screenshot with chrome option does not work as inteded
// Refer https://bugzilla.mozilla.org/show_bug.cgi?id=659268#c7
// throwing for now.
throw new Error(gcli.lookup("screenshotSelectorChromeConflict"));
}
var document = args.chrome? context.environment.chromeDocument
: context.environment.contentDocument;
if (args.delay > 0) {
var promise = context.createPromise();
document.defaultView.setTimeout(function Command_screenshotDelay() {
let reply = this.grabScreen(document, args.filename, args.clipboard,
args.fullpage);
promise.resolve(reply);
}.bind(this), args.delay * 1000);
return promise;
}
else {
return this.grabScreen(document, args.filename, args.clipboard,
args.fullpage, args.selector);
}
},
grabScreen:
function Command_screenshotGrabScreen(document, filename, clipboard,
fullpage, node) {
let window = document.defaultView;
let canvas = document.createElementNS("http://www.w3.org/1999/xhtml", "canvas");
let left = 0;
let top = 0;
let width;
let height;
let div = document.createElementNS("http://www.w3.org/1999/xhtml", "div");
if (!fullpage) {
if (!node) {
left = window.scrollX;
top = window.scrollY;
width = window.innerWidth;
height = window.innerHeight;
} else {
let rect = LayoutHelpers.getRect(node, window);
top = rect.top;
left = rect.left;
width = rect.width;
height = rect.height;
}
} else {
width = window.innerWidth + window.scrollMaxX;
height = window.innerHeight + window.scrollMaxY;
}
canvas.width = width;
canvas.height = height;
let ctx = canvas.getContext("2d");
ctx.drawWindow(window, left, top, width, height, "#fff");
let data = canvas.toDataURL("image/png", "");
let loadContext = document.defaultView
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsILoadContext);
try {
if (clipboard) {
let io = Cc["@mozilla.org/network/io-service;1"]
.getService(Ci.nsIIOService);
let channel = io.newChannel(data, null, null);
let input = channel.open();
let imgTools = Cc["@mozilla.org/image/tools;1"]
.getService(Ci.imgITools);
let container = {};
imgTools.decodeImageData(input, channel.contentType, container);
let wrapped = Cc["@mozilla.org/supports-interface-pointer;1"]
.createInstance(Ci.nsISupportsInterfacePointer);
wrapped.data = container.value;
let trans = Cc["@mozilla.org/widget/transferable;1"]
.createInstance(Ci.nsITransferable);
trans.init(loadContext);
trans.addDataFlavor(channel.contentType);
trans.setTransferData(channel.contentType, wrapped, -1);
let clipid = Ci.nsIClipboard;
let clip = Cc["@mozilla.org/widget/clipboard;1"].getService(clipid);
clip.setData(trans, null, clipid.kGlobalClipboard);
div.textContent = gcli.lookup("screenshotCopied");
return div;
}
}
catch (ex) {
div.textContent = gcli.lookup("screenshotErrorCopying");
return div;
}
let file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile);
// Create a name for the file if not present
if (filename == FILENAME_DEFAULT_VALUE) {
let date = new Date();
let dateString = date.getFullYear() + "-" + (date.getMonth() + 1) +
"-" + date.getDate();
dateString = dateString.split("-").map(function(part) {
if (part.length == 1) {
part = "0" + part;
}
return part;
}).join("-");
let timeString = date.toTimeString().replace(/:/g, ".").split(" ")[0];
filename = gcli.lookupFormat("screenshotGeneratedFilename",
[dateString, timeString]) + ".png";
}
// Check there is a .png extension to filename
else if (!filename.match(/.png$/i)) {
filename += ".png";
}
// If the filename is relative, tack it onto the download directory
if (!filename.match(/[\\\/]/)) {
let downloadMgr = Cc["@mozilla.org/download-manager;1"]
.getService(Ci.nsIDownloadManager);
let tempfile = downloadMgr.userDownloadsDirectory;
tempfile.append(filename);
filename = tempfile.path;
}
try {
file.initWithPath(filename);
} catch (ex) {
div.textContent = gcli.lookup("screenshotErrorSavingToFile") + " " + filename;
return div;
}
let ioService = Cc["@mozilla.org/network/io-service;1"]
.getService(Ci.nsIIOService);
let Persist = Ci.nsIWebBrowserPersist;
let persist = Cc["@mozilla.org/embedding/browser/nsWebBrowserPersist;1"]
.createInstance(Persist);
persist.persistFlags = Persist.PERSIST_FLAGS_REPLACE_EXISTING_FILES |
Persist.PERSIST_FLAGS_AUTODETECT_APPLY_CONVERSION;
let source = ioService.newURI(data, "UTF8", null);
persist.saveURI(source, null, null, null, null, file, loadContext);
div.textContent = gcli.lookup("screenshotSavedToFile") + " \"" + filename +
"\"";
div.addEventListener("click", function openFile() {
div.removeEventListener("click", openFile);
file.reveal();
});
div.style.cursor = "pointer";
let image = document.createElement("div");
let previewHeight = parseInt(256*height/width);
image.setAttribute("style",
"width:256px; height:" + previewHeight + "px;" +
"max-height: 256px;" +
"background-image: url('" + data + "');" +
"background-size: 256px " + previewHeight + "px;" +
"margin: 4px; display: block");
div.appendChild(image);
return div;
}
});

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

@ -7,21 +7,9 @@ this.EXPORTED_SYMBOLS = [ ];
const Cu = Components.utils; const Cu = Components.utils;
Cu.import("resource:///modules/devtools/CmdAddon.jsm"); Cu.import("resource:///modules/devtools/BuiltinCommands.jsm");
Cu.import("resource:///modules/devtools/CmdBreak.jsm");
Cu.import("resource:///modules/devtools/CmdCalllog.jsm");
Cu.import("resource:///modules/devtools/CmdCalllogChrome.jsm");
Cu.import("resource:///modules/devtools/CmdConsole.jsm");
Cu.import("resource:///modules/devtools/CmdCookie.jsm");
Cu.import("resource:///modules/devtools/CmdDbg.jsm");
Cu.import("resource:///modules/devtools/CmdEcho.jsm");
Cu.import("resource:///modules/devtools/CmdEdit.jsm"); Cu.import("resource:///modules/devtools/CmdEdit.jsm");
Cu.import("resource:///modules/devtools/CmdExport.jsm");
Cu.import("resource:///modules/devtools/CmdInspect.jsm"); Cu.import("resource:///modules/devtools/CmdInspect.jsm");
Cu.import("resource:///modules/devtools/CmdJsb.jsm");
Cu.import("resource:///modules/devtools/CmdPagemod.jsm");
Cu.import("resource:///modules/devtools/CmdResize.jsm"); Cu.import("resource:///modules/devtools/CmdResize.jsm");
Cu.import("resource:///modules/devtools/CmdRestart.jsm");
Cu.import("resource:///modules/devtools/CmdScreenshot.jsm");
Cu.import("resource:///modules/devtools/CmdTilt.jsm"); Cu.import("resource:///modules/devtools/CmdTilt.jsm");
Cu.import("resource:///modules/devtools/CmdScratchpad.jsm"); Cu.import("resource:///modules/devtools/CmdScratchpad.jsm");

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

@ -2436,7 +2436,6 @@ function Parameter(paramSpec, command, groupName) {
this.name = this.paramSpec.name; this.name = this.paramSpec.name;
this.type = this.paramSpec.type; this.type = this.paramSpec.type;
this.groupName = groupName; this.groupName = groupName;
this.defaultValue = this.paramSpec.defaultValue;
if (!this.name) { if (!this.name) {
throw new Error('In ' + this.command.name + throw new Error('In ' + this.command.name +
@ -2453,22 +2452,20 @@ function Parameter(paramSpec, command, groupName) {
// boolean parameters have an implicit defaultValue:false, which should // boolean parameters have an implicit defaultValue:false, which should
// not be changed. See the docs. // not be changed. See the docs.
if (this.type instanceof BooleanType) { if (this.type instanceof BooleanType &&
if (this.defaultValue !== undefined) { this.paramSpec.defaultValue !== undefined) {
throw new Error('In ' + this.command.name + '/' + this.name + throw new Error('In ' + this.command.name + '/' + this.name +
': boolean parameters can not have a defaultValue.' + ': boolean parameters can not have a defaultValue.' +
' Ignoring'); ' Ignoring');
}
this.defaultValue = false;
} }
// Check the defaultValue for validity. // Check the defaultValue for validity.
// Both undefined and null get a pass on this test. undefined is used when // Both undefined and null get a pass on this test. undefined is used when
// there is no defaultValue, and null is used when the parameter is // there is no defaultValue, and null is used when the parameter is
// optional, neither are required to parse and stringify. // optional, neither are required to parse and stringify.
if (this.defaultValue != null) { if (this._defaultValue != null) {
try { try {
var defaultText = this.type.stringify(this.defaultValue); var defaultText = this.type.stringify(this.paramSpec.defaultValue);
var defaultConversion = this.type.parseString(defaultText); var defaultConversion = this.type.parseString(defaultText);
if (defaultConversion.getStatus() !== Status.VALID) { if (defaultConversion.getStatus() !== Status.VALID) {
throw new Error('In ' + this.command.name + '/' + this.name + throw new Error('In ' + this.command.name + '/' + this.name +
@ -2482,20 +2479,31 @@ function Parameter(paramSpec, command, groupName) {
} }
} }
// Some types (boolean, array) have a non 'undefined' blank value. Give the
// type a chance to override the default defaultValue of undefined
if (this.defaultValue === undefined) {
this.defaultValue = this.type.getBlank().value;
}
// All parameters that can only be set via a named parameter must have a // All parameters that can only be set via a named parameter must have a
// non-undefined default value // non-undefined default value
if (!this.isPositionalAllowed && this.defaultValue === undefined) { if (!this.isPositionalAllowed && this.paramSpec.defaultValue === undefined &&
this.type.getBlank == null && !(this.type instanceof BooleanType)) {
throw new Error('In ' + this.command.name + '/' + this.name + throw new Error('In ' + this.command.name + '/' + this.name +
': Missing defaultValue for optional parameter.'); ': Missing defaultValue for optional parameter.');
} }
} }
/**
* type.getBlank can be expensive, so we delay execution where we can
*/
Object.defineProperty(Parameter.prototype, 'defaultValue', {
get: function() {
if (!('_defaultValue' in this)) {
this._defaultValue = (this.paramSpec.defaultValue !== undefined) ?
this.paramSpec.defaultValue :
this.type.getBlank().value;
}
return this._defaultValue;
},
enumerable : true
});
/** /**
* Does the given name uniquely identify this param (among the other params * Does the given name uniquely identify this param (among the other params
* in this command) * in this command)
@ -2689,11 +2697,10 @@ canon.onCanonChange = util.createEvent('canon.onCanonChange');
* CommandOutputManager stores the output objects generated by executed * CommandOutputManager stores the output objects generated by executed
* commands. * commands.
* *
* CommandOutputManager is exposed (via canon.commandOutputManager) to the the * CommandOutputManager is exposed to the the outside world and could (but
* outside world and could (but shouldn't) be used before gcli.startup() has * shouldn't) be used before gcli.startup() has been called.
* been called. This could should be defensive to that where possible, and we * This could should be defensive to that where possible, and we should
* should certainly document if the use of it or similar will fail if used too * certainly document if the use of it or similar will fail if used too soon.
* soon.
*/ */
function CommandOutputManager() { function CommandOutputManager() {
this.onOutput = util.createEvent('CommandOutputManager.onOutput'); this.onOutput = util.createEvent('CommandOutputManager.onOutput');
@ -2701,12 +2708,6 @@ function CommandOutputManager() {
canon.CommandOutputManager = CommandOutputManager; canon.CommandOutputManager = CommandOutputManager;
/**
* We maintain a global command output manager for the majority case where
* there is only one important set of outputs.
*/
canon.commandOutputManager = new CommandOutputManager();
}); });
/* /*
@ -2736,6 +2737,18 @@ define('gcli/util', ['require', 'exports', 'module' ], function(require, exports
var eventDebug = false; var eventDebug = false;
/**
* Patch up broken console API from node
*/
if (eventDebug) {
if (console.group == null) {
console.group = function() { console.log(arguments); };
}
if (console.groupEnd == null) {
console.groupEnd = function() { console.log(arguments); };
}
}
/** /**
* Useful way to create a name for a handler, used in createEvent() * Useful way to create a name for a handler, used in createEvent()
*/ */
@ -2817,6 +2830,10 @@ exports.createEvent = function(name) {
* @param scope Optional 'this' object for the function call * @param scope Optional 'this' object for the function call
*/ */
event.add = function(func, scope) { event.add = function(func, scope) {
if (eventDebug) {
console.log('Adding listener to ' + name);
}
handlers.push({ func: func, scope: scope }); handlers.push({ func: func, scope: scope });
}; };
@ -2827,16 +2844,20 @@ exports.createEvent = function(name) {
* @param scope Optional 'this' object for the function call * @param scope Optional 'this' object for the function call
*/ */
event.remove = function(func, scope) { event.remove = function(func, scope) {
if (eventDebug) {
console.log('Removing listener from ' + name);
}
var found = false; var found = false;
handlers = handlers.filter(function(test) { handlers = handlers.filter(function(test) {
var noMatch = (test.func !== func && test.scope !== scope); var match = (test.func === func && test.scope === scope);
if (!noMatch) { if (match) {
found = true; found = true;
} }
return noMatch; return !match;
}); });
if (!found) { if (!found) {
console.warn('Failed to remove handler from ' + name); console.warn('Handler not found. Attached to ' + name);
} }
}; };
@ -4057,6 +4078,7 @@ exports.setDocument = function(document) {
*/ */
exports.unsetDocument = function() { exports.unsetDocument = function() {
doc = undefined; doc = undefined;
exports._empty = undefined;
}; };
/** /**
@ -4686,26 +4708,8 @@ imports.XPCOMUtils.defineLazyGetter(imports, 'supportsString', function() {
var util = require('gcli/util'); var util = require('gcli/util');
var types = require('gcli/types'); var types = require('gcli/types');
var allSettings = [];
/** /**
* Cache existing settings on startup * All local settings have this prefix when used in Firefox
*/
exports.startup = function() {
imports.prefBranch.getChildList('').forEach(function(name) {
allSettings.push(new Setting(name));
}.bind(this));
allSettings.sort(function(s1, s2) {
return s1.name.localeCompare(s2.name);
}.bind(this));
};
exports.shutdown = function() {
allSettings = [];
};
/**
*
*/ */
var DEVTOOLS_PREFIX = 'devtools.gcli.'; var DEVTOOLS_PREFIX = 'devtools.gcli.';
@ -4824,14 +4828,76 @@ Setting.prototype.setDefault = function() {
Services.prefs.savePrefFile(null); Services.prefs.savePrefFile(null);
}; };
/** /**
* 'static' function to get an array containing all known Settings * Collection of preferences for sorted access
*/
var settingsAll = [];
/**
* Collection of preferences for fast indexed access
*/
var settingsMap = new Map();
/**
* Flag so we know if we've read the system preferences
*/
var hasReadSystem = false;
/**
* Clear out all preferences and return to initial state
*/
function reset() {
settingsMap = new Map();
settingsAll = [];
hasReadSystem = false;
}
/**
* Reset everything on startup and shutdown because we're doing lazy loading
*/
exports.startup = function() {
reset();
};
exports.shutdown = function() {
reset();
};
/**
* Load system prefs if they've not been loaded already
* @return true
*/
function readSystem() {
if (hasReadSystem) {
return;
}
imports.prefBranch.getChildList('').forEach(function(name) {
var setting = new Setting(name);
settingsAll.push(setting);
settingsMap.set(name, setting);
});
settingsAll.sort(function(s1, s2) {
return s1.name.localeCompare(s2.name);
});
hasReadSystem = true;
}
/**
* Get an array containing all known Settings filtered to match the given
* filter (string) at any point in the name of the setting
*/ */
exports.getAll = function(filter) { exports.getAll = function(filter) {
readSystem();
if (filter == null) { if (filter == null) {
return allSettings; return settingsAll;
} }
return allSettings.filter(function(setting) {
return settingsAll.filter(function(setting) {
return setting.name.indexOf(filter) !== -1; return setting.name.indexOf(filter) !== -1;
}); });
}; };
@ -4841,12 +4907,19 @@ exports.getAll = function(filter) {
*/ */
exports.addSetting = function(prefSpec) { exports.addSetting = function(prefSpec) {
var setting = new Setting(prefSpec); var setting = new Setting(prefSpec);
for (var i = 0; i < allSettings.length; i++) {
if (allSettings[i].name === setting.name) { if (settingsMap.has(setting.name)) {
allSettings[i] = setting; // Once exists already, we're going to need to replace it in the array
for (var i = 0; i < settingsAll.length; i++) {
if (settingsAll[i].name === setting.name) {
settingsAll[i] = setting;
}
} }
} }
settingsMap.set(setting.name, setting);
exports.onChange({ added: setting.name }); exports.onChange({ added: setting.name });
return setting; return setting;
}; };
@ -4860,15 +4933,20 @@ exports.addSetting = function(prefSpec) {
* @return The found Setting object, or undefined if the setting was not found * @return The found Setting object, or undefined if the setting was not found
*/ */
exports.getSetting = function(name) { exports.getSetting = function(name) {
var found = undefined; // We might be able to give the answer without needing to read all system
allSettings.some(function(setting) { // settings if this is an internal setting
if (setting.name === name) { var found = settingsMap.get(name);
found = setting; if (found) {
return true; return found;
} }
return false;
}); if (hasReadSystem) {
return found; return undefined;
}
else {
readSystem();
return settingsMap.get(name);
}
}; };
/** /**
@ -4879,8 +4957,7 @@ exports.onChange = util.createEvent('Settings.onChange');
/** /**
* Remove a setting. A no-op in this case * Remove a setting. A no-op in this case
*/ */
exports.removeSetting = function(nameOrSpec) { exports.removeSetting = function() { };
};
}); });
@ -5109,6 +5186,7 @@ var l10n = require('gcli/l10n');
var canon = require('gcli/canon'); var canon = require('gcli/canon');
var Q = require('gcli/promise'); var Q = require('gcli/promise');
var CommandOutputManager = require('gcli/canon').CommandOutputManager;
var Status = require('gcli/types').Status; var Status = require('gcli/types').Status;
var Conversion = require('gcli/types').Conversion; var Conversion = require('gcli/types').Conversion;
@ -5467,9 +5545,11 @@ UnassignedAssignment.prototype.getStatus = function(arg) {
* @param doc A DOM Document passed to commands using the Execution Context in * @param doc A DOM Document passed to commands using the Execution Context in
* order to allow creation of DOM nodes. If missing Requisition will use the * order to allow creation of DOM nodes. If missing Requisition will use the
* global 'document'. * global 'document'.
* @param commandOutputManager A custom commandOutputManager to which output
* should be sent (optional)
* @constructor * @constructor
*/ */
function Requisition(environment, doc) { function Requisition(environment, doc, commandOutputManager) {
this.environment = environment; this.environment = environment;
this.document = doc; this.document = doc;
if (this.document == null) { if (this.document == null) {
@ -5480,6 +5560,7 @@ function Requisition(environment, doc) {
// Ignore // Ignore
} }
} }
this.commandOutputManager = commandOutputManager || new CommandOutputManager();
// The command that we are about to execute. // The command that we are about to execute.
// @see setCommandConversion() // @see setCommandConversion()
@ -5510,8 +5591,6 @@ function Requisition(environment, doc) {
this.commandAssignment.onAssignmentChange.add(this._commandAssignmentChanged, this); this.commandAssignment.onAssignmentChange.add(this._commandAssignmentChanged, this);
this.commandAssignment.onAssignmentChange.add(this._assignmentChanged, this); this.commandAssignment.onAssignmentChange.add(this._assignmentChanged, this);
this.commandOutputManager = canon.commandOutputManager;
this.onAssignmentChange = util.createEvent('Requisition.onAssignmentChange'); this.onAssignmentChange = util.createEvent('Requisition.onAssignmentChange');
this.onTextChange = util.createEvent('Requisition.onTextChange'); this.onTextChange = util.createEvent('Requisition.onTextChange');
} }
@ -6992,21 +7071,21 @@ exports.shutdown = function() {
* @param options Object containing user customization properties, including: * @param options Object containing user customization properties, including:
* - blurDelay (default=150ms) * - blurDelay (default=150ms)
* - debug (default=false) * - debug (default=false)
* - commandOutputManager (default=canon.commandOutputManager)
* @param components Object that links to other UI components. GCLI provided: * @param components Object that links to other UI components. GCLI provided:
* - document * - document
* - requisition
*/ */
function FocusManager(options, components) { function FocusManager(options, components) {
options = options || {}; options = options || {};
this._document = components.document || document; this._document = components.document || document;
this._requisition = components.requisition;
this._debug = options.debug || false; this._debug = options.debug || false;
this._blurDelay = options.blurDelay || 150; this._blurDelay = options.blurDelay || 150;
this._window = this._document.defaultView; this._window = this._document.defaultView;
this._commandOutputManager = options.commandOutputManager || this._requisition.commandOutputManager.onOutput.add(this._outputted, this);
canon.commandOutputManager;
this._commandOutputManager.onOutput.add(this._outputted, this);
this._blurDelayTimeout = null; // Result of setTimeout in delaying a blur this._blurDelayTimeout = null; // Result of setTimeout in delaying a blur
this._monitoredElements = []; // See addMonitoredElement() this._monitoredElements = []; // See addMonitoredElement()
@ -7035,7 +7114,7 @@ FocusManager.prototype.destroy = function() {
eagerHelper.onChange.remove(this._eagerHelperChanged, this); eagerHelper.onChange.remove(this._eagerHelperChanged, this);
this._document.removeEventListener('focus', this._focused, true); this._document.removeEventListener('focus', this._focused, true);
this._commandOutputManager.onOutput.remove(this._outputted, this); this._requisition.commandOutputManager.onOutput.remove(this._outputted, this);
for (var i = 0; i < this._monitoredElements.length; i++) { for (var i = 0; i < this._monitoredElements.length; i++) {
var monitor = this._monitoredElements[i]; var monitor = this._monitoredElements[i];
@ -7053,7 +7132,7 @@ FocusManager.prototype.destroy = function() {
delete this._focused; delete this._focused;
delete this._document; delete this._document;
delete this._window; delete this._window;
delete this._commandOutputManager; delete this._requisition;
}; };
/** /**
@ -9012,7 +9091,7 @@ var resource = require('gcli/types/resource');
var host = require('gcli/host'); var host = require('gcli/host');
var intro = require('gcli/ui/intro'); var intro = require('gcli/ui/intro');
var commandOutputManager = require('gcli/canon').commandOutputManager; var CommandOutputManager = require('gcli/canon').CommandOutputManager;
/** /**
* Handy utility to inject the content document (i.e. for the viewed page, * Handy utility to inject the content document (i.e. for the viewed page,
@ -9048,6 +9127,7 @@ function setContentDocument(document) {
* - environment * - environment
* - scratchpad (optional) * - scratchpad (optional)
* - chromeWindow * - chromeWindow
* - commandOutputManager (optional)
*/ */
function FFDisplay(options) { function FFDisplay(options) {
if (options.eval) { if (options.eval) {
@ -9056,13 +9136,19 @@ function FFDisplay(options) {
setContentDocument(options.contentDocument); setContentDocument(options.contentDocument);
host.chromeWindow = options.chromeWindow; host.chromeWindow = options.chromeWindow;
this.onOutput = commandOutputManager.onOutput; this.commandOutputManager = options.commandOutputManager;
this.requisition = new Requisition(options.environment, options.outputDocument); if (this.commandOutputManager == null) {
this.commandOutputManager = new CommandOutputManager();
}
this.onOutput = this.commandOutputManager.onOutput;
this.requisition = new Requisition(options.environment,
options.outputDocument,
this.commandOutputManager);
// Create a FocusManager for the various parts to register with
this.focusManager = new FocusManager(options, { this.focusManager = new FocusManager(options, {
// TODO: can we kill chromeDocument here? document: options.chromeDocument,
document: options.chromeDocument requisition: this.requisition,
}); });
this.onVisibilityChange = this.focusManager.onVisibilityChange; this.onVisibilityChange = this.focusManager.onVisibilityChange;
@ -9106,7 +9192,7 @@ function FFDisplay(options) {
* separate method * separate method
*/ */
FFDisplay.prototype.maybeShowIntro = function() { FFDisplay.prototype.maybeShowIntro = function() {
intro.maybeShowIntro(commandOutputManager); intro.maybeShowIntro(this.commandOutputManager);
}; };
/** /**
@ -9151,7 +9237,7 @@ FFDisplay.prototype.destroy = function() {
// DOM node hunter script from looking in all the nooks and crannies, so it's // DOM node hunter script from looking in all the nooks and crannies, so it's
// better if we can be leak-free without deleting them: // better if we can be leak-free without deleting them:
// - consoleWrap, resizer, tooltip, completer, inputter, // - consoleWrap, resizer, tooltip, completer, inputter,
// - focusManager, onVisibilityChange, requisition // - focusManager, onVisibilityChange, requisition, commandOutputManager
}; };
/** /**
@ -9945,7 +10031,8 @@ function Completer(options, components) {
this.inputter.onAssignmentChange.add(this.update, this); this.inputter.onAssignmentChange.add(this.update, this);
this.inputter.onChoiceChange.add(this.update, this); this.inputter.onChoiceChange.add(this.update, this);
if (components.autoResize) { this.autoResize = components.autoResize;
if (this.autoResize) {
this.inputter.onResize.add(this.resized, this); this.inputter.onResize.add(this.resized, this);
var dimensions = this.inputter.getDimensions(); var dimensions = this.inputter.getDimensions();
@ -9968,7 +10055,10 @@ Completer.prototype.destroy = function() {
this.inputter.onInputChange.remove(this.update, this); this.inputter.onInputChange.remove(this.update, this);
this.inputter.onAssignmentChange.remove(this.update, this); this.inputter.onAssignmentChange.remove(this.update, this);
this.inputter.onChoiceChange.remove(this.update, this); this.inputter.onChoiceChange.remove(this.update, this);
this.inputter.onResize.remove(this.resized, this);
if (this.autoResize) {
this.inputter.onResize.remove(this.resized, this);
}
delete this.document; delete this.document;
delete this.element; delete this.element;

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

@ -4,7 +4,7 @@
// Tests that the addon commands works as they should // Tests that the addon commands works as they should
let imported = {}; let imported = {};
Components.utils.import("resource:///modules/devtools/CmdAddon.jsm", imported); Components.utils.import("resource:///modules/devtools/BuiltinCommands.jsm", imported);
function test() { function test() {
DeveloperToolbarTest.test("about:blank", [ GAT_test ]); DeveloperToolbarTest.test("about:blank", [ GAT_test ]);
@ -96,7 +96,7 @@ function GAT_test() {
Services.obs.addObserver(GAT_ready, "gcli_addon_commands_ready", false); Services.obs.addObserver(GAT_ready, "gcli_addon_commands_ready", false);
if (imported.Flags.addonsLoaded) { if (imported.CmdAddonFlags.addonsLoaded) {
info("The getAllAddons command has already completed and we have missed "); info("The getAllAddons command has already completed and we have missed ");
info("the notification. Let's send the gcli_addon_commands_ready "); info("the notification. Let's send the gcli_addon_commands_ready ");
info("notification ourselves."); info("notification ourselves.");

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

@ -42,7 +42,7 @@ function test() {
var Requisition = require('gcli/cli').Requisition; var Requisition = require('gcli/cli').Requisition;
var canon = require('gcli/canon'); var CommandOutputManager = require('gcli/canon').CommandOutputManager;
// var mockCommands = require('gclitest/mockCommands'); // var mockCommands = require('gclitest/mockCommands');
var nodetype = require('gcli/types/node'); var nodetype = require('gcli/types/node');
@ -53,16 +53,22 @@ var actualOutput;
var hideExec = false; var hideExec = false;
var skip = 'skip'; var skip = 'skip';
exports.setup = function() { var environment = { value: 'example environment data' };
var commandOutputManager = new CommandOutputManager();
var requisition = new Requisition(environment, null, commandOutputManager);
exports.setup = function(options) {
mockCommands.setup(); mockCommands.setup();
mockCommands.onCommandExec.add(commandExeced); mockCommands.onCommandExec.add(commandExeced);
canon.commandOutputManager.onOutput.add(commandOutputed);
commandOutputManager.onOutput.add(commandOutputed);
}; };
exports.shutdown = function() { exports.shutdown = function(options) {
mockCommands.shutdown(); mockCommands.shutdown();
mockCommands.onCommandExec.remove(commandExeced); mockCommands.onCommandExec.remove(commandExeced);
canon.commandOutputManager.onOutput.remove(commandOutputed);
commandOutputManager.onOutput.remove(commandOutputed);
}; };
function commandExeced(ev) { function commandExeced(ev) {
@ -74,9 +80,6 @@ function commandOutputed(ev) {
} }
function exec(command, expectedArgs) { function exec(command, expectedArgs) {
var environment = {};
var requisition = new Requisition(environment);
var outputObject = requisition.exec({ typed: command, hidden: hideExec }); var outputObject = requisition.exec({ typed: command, hidden: hideExec });
assert.is(command.indexOf(actualExec.command.name), 0, 'Command name: ' + command); assert.is(command.indexOf(actualExec.command.name), 0, 'Command name: ' + command);

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

@ -1739,12 +1739,11 @@ create({ constructor: GlobalSearchView, proto: MenuContainer.prototype }, {
*/ */
_bounceMatch: function DVGS__bounceMatch(aMatch) { _bounceMatch: function DVGS__bounceMatch(aMatch) {
Services.tm.currentThread.dispatch({ run: function() { Services.tm.currentThread.dispatch({ run: function() {
aMatch.setAttribute("focused", "");
aMatch.addEventListener("transitionend", function onEvent() { aMatch.addEventListener("transitionend", function onEvent() {
aMatch.removeEventListener("transitionend", onEvent); aMatch.removeEventListener("transitionend", onEvent);
aMatch.removeAttribute("focused"); aMatch.removeAttribute("focused");
}); });
aMatch.setAttribute("focused", "");
}}, 0); }}, 0);
}, },

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

@ -113,7 +113,8 @@ ToolbarView.prototype = {
_onTogglePanesPressed: function DVT__onTogglePanesPressed() { _onTogglePanesPressed: function DVT__onTogglePanesPressed() {
DebuggerView.togglePanes({ DebuggerView.togglePanes({
visible: DebuggerView.panesHidden, visible: DebuggerView.panesHidden,
animated: true animated: true,
delayed: true
}); });
}, },
@ -1056,6 +1057,7 @@ create({ constructor: FilteredSourcesView, proto: MenuContainer.prototype }, {
let panel = this._panel = document.createElement("panel"); let panel = this._panel = document.createElement("panel");
panel.id = "filtered-sources-panel"; panel.id = "filtered-sources-panel";
panel.setAttribute("noautofocus", "true"); panel.setAttribute("noautofocus", "true");
panel.setAttribute("level", "top");
panel.setAttribute("position", FILTERED_SOURCES_POPUP_POSITION); panel.setAttribute("position", FILTERED_SOURCES_POPUP_POSITION);
document.documentElement.appendChild(panel); document.documentElement.appendChild(panel);

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

@ -394,47 +394,61 @@ let DebuggerView = {
* An object containing some of the following boolean properties: * An object containing some of the following boolean properties:
* - visible: true if the pane should be shown, false for hidden * - visible: true if the pane should be shown, false for hidden
* - animated: true to display an animation on toggle * - animated: true to display an animation on toggle
* - delayed: true to wait a few cycles before toggle
* - callback: a function to invoke when the panes toggle finishes * - callback: a function to invoke when the panes toggle finishes
*/ */
togglePanes: function DV__togglePanes(aFlags = {}) { togglePanes: function DV__togglePanes(aFlags = {}) {
// Avoid useless toggles. // Avoid useless toggles.
if (aFlags.visible == !this.panesHidden) { if (aFlags.visible == !this.panesHidden) {
aFlags.callback && aFlags.callback(); if (aFlags.callback) aFlags.callback();
return; return;
} }
if (aFlags.visible) { // Computes and sets the panes margins in order to hide or show them.
this._stackframesAndBreakpoints.style.marginLeft = "0"; function set() {
this._variablesAndExpressions.style.marginRight = "0"; if (aFlags.visible) {
this._togglePanesButton.removeAttribute("panesHidden"); this._stackframesAndBreakpoints.style.marginLeft = "0";
this._togglePanesButton.setAttribute("tooltiptext", L10N.getStr("collapsePanes")); this._variablesAndExpressions.style.marginRight = "0";
} else { this._togglePanesButton.removeAttribute("panesHidden");
let marginL = ~~(this._stackframesAndBreakpoints.getAttribute("width")) + 1; this._togglePanesButton.setAttribute("tooltiptext", L10N.getStr("collapsePanes"));
let marginR = ~~(this._variablesAndExpressions.getAttribute("width")) + 1; } else {
this._stackframesAndBreakpoints.style.marginLeft = -marginL + "px"; let marginL = ~~(this._stackframesAndBreakpoints.getAttribute("width")) + 1;
this._variablesAndExpressions.style.marginRight = -marginR + "px"; let marginR = ~~(this._variablesAndExpressions.getAttribute("width")) + 1;
this._togglePanesButton.setAttribute("panesHidden", "true"); this._stackframesAndBreakpoints.style.marginLeft = -marginL + "px";
this._togglePanesButton.setAttribute("tooltiptext", L10N.getStr("expandPanes")); this._variablesAndExpressions.style.marginRight = -marginR + "px";
this._togglePanesButton.setAttribute("panesHidden", "true");
this._togglePanesButton.setAttribute("tooltiptext", L10N.getStr("expandPanes"));
}
if (aFlags.animated) {
// Displaying the panes may have the effect of triggering scrollbars to
// appear in the source editor, which would render the currently
// highlighted line to appear behind them in some cases.
window.addEventListener("transitionend", function onEvent() {
window.removeEventListener("transitionend", onEvent, false);
DebuggerView.updateEditor();
// Invoke the callback when the transition ended.
if (aFlags.callback) aFlags.callback();
}, false);
} else {
// Invoke the callback immediately since there's no transition.
if (aFlags.callback) aFlags.callback();
}
} }
if (aFlags.animated) { if (aFlags.animated) {
this._stackframesAndBreakpoints.setAttribute("animated", ""); this._stackframesAndBreakpoints.setAttribute("animated", "");
this._variablesAndExpressions.setAttribute("animated", ""); this._variablesAndExpressions.setAttribute("animated", "");
// Displaying the panes may have the effect of triggering scrollbars to
// appear in the source editor, which would render the currently
// highlighted line to appear behind them in some cases.
let self = this;
window.addEventListener("transitionend", function onEvent() {
window.removeEventListener("transitionend", onEvent, false);
aFlags.callback && aFlags.callback();
self.updateEditor();
}, false);
} else { } else {
this._stackframesAndBreakpoints.removeAttribute("animated"); this._stackframesAndBreakpoints.removeAttribute("animated");
this._variablesAndExpressions.removeAttribute("animated"); this._variablesAndExpressions.removeAttribute("animated");
aFlags.callback && aFlags.callback(); }
if (aFlags.delayed) {
window.setTimeout(set.bind(this), PANES_APPEARANCE_DELAY);
} else {
set.call(this);
} }
}, },
@ -450,6 +464,7 @@ let DebuggerView = {
DebuggerView.togglePanes({ DebuggerView.togglePanes({
visible: true, visible: true,
animated: true, animated: true,
delayed: true,
callback: aCallback callback: aCallback
}); });
}, PANES_APPEARANCE_DELAY); }, PANES_APPEARANCE_DELAY);

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

@ -238,6 +238,7 @@
</toolbar> </toolbar>
<panel id="searchbox-panel" <panel id="searchbox-panel"
level="top"
type="arrow" type="arrow"
noautofocus="true" noautofocus="true"
position="before_start"> position="before_start">
@ -267,6 +268,7 @@
</panel> </panel>
<panel id="conditional-breakpoint-panel" <panel id="conditional-breakpoint-panel"
level="top"
type="arrow" type="arrow"
noautofocus="true" noautofocus="true"
position="after_start"> position="after_start">

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

@ -87,7 +87,7 @@ MOCHITEST_BROWSER_TESTS = \
browser_dbg_breakpoint-new-script.js \ browser_dbg_breakpoint-new-script.js \
browser_dbg_bug737803_editor_actual_location.js \ browser_dbg_bug737803_editor_actual_location.js \
browser_dbg_progress-listener-bug.js \ browser_dbg_progress-listener-bug.js \
$(filter disabled-for-intermittent-crashes--bug-821701, browser_dbg_chrome-debugging.js) \ browser_dbg_chrome-debugging.js \
$(filter disabled-for-intermittent-failures--bug-753225, browser_dbg_createRemote.js) \ $(filter disabled-for-intermittent-failures--bug-753225, browser_dbg_createRemote.js) \
head.js \ head.js \
$(NULL) $(NULL)

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

@ -16,9 +16,6 @@ const DEBUGGER_TAB_URL = EXAMPLE_URL + "browser_dbg_debuggerstatement.html";
function test() function test()
{ {
// Make sure there is enough time for findAllGlobals.
requestLongerTimeout(3);
let transport = DebuggerServer.connectPipe(); let transport = DebuggerServer.connectPipe();
gClient = new DebuggerClient(transport); gClient = new DebuggerClient(transport);
gClient.connect(function(aType, aTraits) { gClient.connect(function(aType, aTraits) {

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

@ -45,8 +45,8 @@ function testVariablesFiltering()
"There should be 0 variables displayed in the test scope"); "There should be 0 variables displayed in the test scope");
is(loadScope.querySelectorAll(".variable:not([non-match])").length, 1, is(loadScope.querySelectorAll(".variable:not([non-match])").length, 1,
"There should be 1 variable displayed in the load scope"); "There should be 1 variable displayed in the load scope");
is(globalScope.querySelectorAll(".variable:not([non-match])").length, 3, is(globalScope.querySelectorAll(".variable:not([non-match])").length, 5,
"There should be 3 variables displayed in the global scope"); "There should be 5 variables displayed in the global scope");
is(innerScope.querySelectorAll(".property:not([non-match])").length, 0, is(innerScope.querySelectorAll(".property:not([non-match])").length, 0,
"There should be 0 properties displayed in the inner scope"); "There should be 0 properties displayed in the inner scope");

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

@ -286,7 +286,8 @@ TabWebProgressListener.prototype = {
return; return;
} }
if (this.target) { // emit event if the top frame is navigating
if (this.target && this.target.window == progress.DOMWindow) {
this.target.emit("will-navigate", request); this.target.emit("will-navigate", request);
} }
}, },

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

@ -135,7 +135,7 @@ let styleEditorDefinition = {
tooltip: l10n("ToolboxStyleEditor.tooltip", styleEditorStrings), tooltip: l10n("ToolboxStyleEditor.tooltip", styleEditorStrings),
isTargetSupported: function(target) { isTargetSupported: function(target) {
return !target.isRemote && !target.isChrome; return target.isLocalTab;
}, },
build: function(iframeWindow, toolbox) { build: function(iframeWindow, toolbox) {
@ -152,11 +152,7 @@ let profilerDefinition = {
tooltip: l10n("profiler.tooltip", profilerStrings), tooltip: l10n("profiler.tooltip", profilerStrings),
isTargetSupported: function (target) { isTargetSupported: function (target) {
if (target.isRemote || target.isChrome) { return !target.isRemote;
return false;
}
return true;
}, },
build: function (frame, target) { build: function (frame, target) {

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

@ -16,6 +16,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "Hosts",
"resource:///modules/devtools/ToolboxHosts.jsm"); "resource:///modules/devtools/ToolboxHosts.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "CommandUtils", XPCOMUtils.defineLazyModuleGetter(this, "CommandUtils",
"resource:///modules/devtools/DeveloperToolbar.jsm"); "resource:///modules/devtools/DeveloperToolbar.jsm");
XPCOMUtils.defineLazyGetter(this, "toolboxStrings", function() { XPCOMUtils.defineLazyGetter(this, "toolboxStrings", function() {
let bundle = Services.strings.createBundle("chrome://browser/locale/devtools/toolbox.properties"); let bundle = Services.strings.createBundle("chrome://browser/locale/devtools/toolbox.properties");
let l10n = function(name) { let l10n = function(name) {
@ -28,13 +29,12 @@ XPCOMUtils.defineLazyGetter(this, "toolboxStrings", function() {
return l10n; return l10n;
}); });
// DO NOT put Require.jsm or gcli.jsm into lazy getters as this breaks the XPCOMUtils.defineLazyGetter(this, "Requisition", function() {
// requisition import a few lines down. Cu.import("resource://gre/modules/devtools/Require.jsm");
Cu.import("resource:///modules/devtools/gcli.jsm"); Cu.import("resource:///modules/devtools/gcli.jsm");
Cu.import("resource://gre/modules/devtools/Require.jsm");
let Requisition = require('gcli/cli').Requisition; return require('gcli/cli').Requisition;
let CommandOutputManager = require('gcli/canon').CommandOutputManager; });
this.EXPORTED_SYMBOLS = [ "Toolbox" ]; this.EXPORTED_SYMBOLS = [ "Toolbox" ];
@ -244,9 +244,14 @@ Toolbox.prototype = {
open: function TBOX_open() { open: function TBOX_open() {
let deferred = Promise.defer(); let deferred = Promise.defer();
this._host.open().then(function(iframe) { this._host.create().then(function(iframe) {
let onload = function() { let domReady = function() {
iframe.removeEventListener("DOMContentLoaded", onload, true); iframe.removeEventListener("DOMContentLoaded", domReady, true);
let vbox = this.doc.getElementById("toolbox-panel-" + this._currentToolId);
if (vbox) {
this.doc.commandDispatcher.advanceFocusIntoSubtree(vbox);
}
this.isReady = true; this.isReady = true;
@ -255,7 +260,7 @@ Toolbox.prototype = {
this._buildDockButtons(); this._buildDockButtons();
this._buildTabs(); this._buildTabs();
this._buildButtons(this.frame); this._buildButtons();
this.selectTool(this._defaultToolId).then(function(panel) { this.selectTool(this._defaultToolId).then(function(panel) {
this.emit("ready"); this.emit("ready");
@ -263,7 +268,7 @@ Toolbox.prototype = {
}.bind(this)); }.bind(this));
}.bind(this); }.bind(this);
iframe.addEventListener("DOMContentLoaded", onload, true); iframe.addEventListener("DOMContentLoaded", domReady, true);
iframe.setAttribute("src", this._URL); iframe.setAttribute("src", this._URL);
}.bind(this)); }.bind(this));
@ -317,21 +322,17 @@ Toolbox.prototype = {
/** /**
* Add buttons to the UI as specified in the devtools.window.toolbarSpec pref * Add buttons to the UI as specified in the devtools.window.toolbarSpec pref
*
* @param {iframe} frame
* The iframe to contain the buttons
*/ */
_buildButtons: function TBOX_buildButtons(frame) { _buildButtons: function TBOX_buildButtons() {
if (this.target.isRemote) { if (!this.target.isLocalTab) {
return; return;
} }
let toolbarSpec = CommandUtils.getCommandbarSpec("devtools.toolbox.toolbarSpec"); let toolbarSpec = CommandUtils.getCommandbarSpec("devtools.toolbox.toolbarSpec");
let environment = { chromeDocument: frame.ownerDocument }; let environment = { chromeDocument: this.target.tab.ownerDocument };
let requisition = new Requisition(environment); let requisition = new Requisition(environment);
requisition.commandOutputManager = new CommandOutputManager();
let buttons = CommandUtils.createButtons(toolbarSpec, this.doc, requisition); let buttons = CommandUtils.createButtons(toolbarSpec, this._target, this.doc, requisition);
let container = this.doc.getElementById("toolbox-buttons"); let container = this.doc.getElementById("toolbox-buttons");
buttons.forEach(function(button) { buttons.forEach(function(button) {
@ -473,11 +474,10 @@ Toolbox.prototype = {
* The created host object * The created host object
*/ */
_createHost: function TBOX_createHost(hostType) { _createHost: function TBOX_createHost(hostType) {
let hostTab = this._getHostTab();
if (!Hosts[hostType]) { if (!Hosts[hostType]) {
throw new Error('Unknown hostType: '+ hostType); throw new Error('Unknown hostType: '+ hostType);
} }
let newHost = new Hosts[hostType](hostTab); let newHost = new Hosts[hostType](this.target.tab);
// clean up the toolbox if its window is closed // clean up the toolbox if its window is closed
newHost.on("window-closed", this.destroy); newHost.on("window-closed", this.destroy);
@ -502,7 +502,7 @@ Toolbox.prototype = {
} }
let newHost = this._createHost(hostType); let newHost = this._createHost(hostType);
return newHost.open().then(function(iframe) { return newHost.create().then(function(iframe) {
// change toolbox document's parent to the new host // change toolbox document's parent to the new host
iframe.QueryInterface(Ci.nsIFrameLoaderOwner); iframe.QueryInterface(Ci.nsIFrameLoaderOwner);
iframe.swapFrameLoaders(this.frame); iframe.swapFrameLoaders(this.frame);
@ -520,18 +520,6 @@ Toolbox.prototype = {
}.bind(this)); }.bind(this));
}, },
/**
* Get the most appropriate host tab, either the target or the current tab
*/
_getHostTab: function TBOX_getHostTab() {
if (!this._target.isRemote && !this._target.isChrome) {
return this._target.tab;
} else {
let win = Services.wm.getMostRecentWindow("navigator:browser");
return win.gBrowser.selectedTab;
}
},
/** /**
* Handler for the tool-registered event. * Handler for the tool-registered event.
* @param {string} event * @param {string} event

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

@ -17,7 +17,7 @@ this.EXPORTED_SYMBOLS = [ "Hosts" ];
* sidebar or a separate window). Any host object should implement the * sidebar or a separate window). Any host object should implement the
* following functions: * following functions:
* *
* open() - create the UI and emit a 'ready' event when the UI is ready to use * create() - create the UI and emit a 'ready' event when the UI is ready to use
* destroy() - destroy the host's UI * destroy() - destroy the host's UI
*/ */
@ -44,7 +44,7 @@ BottomHost.prototype = {
/** /**
* Create a box at the bottom of the host tab. * Create a box at the bottom of the host tab.
*/ */
open: function BH_open() { create: function BH_create() {
let deferred = Promise.defer(); let deferred = Promise.defer();
let gBrowser = this.hostTab.ownerDocument.defaultView.gBrowser; let gBrowser = this.hostTab.ownerDocument.defaultView.gBrowser;
@ -54,7 +54,7 @@ BottomHost.prototype = {
this._splitter.setAttribute("class", "devtools-horizontal-splitter"); this._splitter.setAttribute("class", "devtools-horizontal-splitter");
this.frame = ownerDocument.createElement("iframe"); this.frame = ownerDocument.createElement("iframe");
this.frame.id = "devtools-toolbox-bottom-iframe"; this.frame.className = "devtools-toolbox-bottom-iframe";
this.frame.height = Services.prefs.getIntPref(this.heightPref); this.frame.height = Services.prefs.getIntPref(this.heightPref);
this._nbox = gBrowser.getNotificationBox(this.hostTab.linkedBrowser); this._nbox = gBrowser.getNotificationBox(this.hostTab.linkedBrowser);
@ -112,7 +112,7 @@ SidebarHost.prototype = {
/** /**
* Create a box in the sidebar of the host tab. * Create a box in the sidebar of the host tab.
*/ */
open: function RH_open() { create: function SH_create() {
let deferred = Promise.defer(); let deferred = Promise.defer();
let gBrowser = this.hostTab.ownerDocument.defaultView.gBrowser; let gBrowser = this.hostTab.ownerDocument.defaultView.gBrowser;
@ -122,7 +122,7 @@ SidebarHost.prototype = {
this._splitter.setAttribute("class", "devtools-side-splitter"); this._splitter.setAttribute("class", "devtools-side-splitter");
this.frame = ownerDocument.createElement("iframe"); this.frame = ownerDocument.createElement("iframe");
this.frame.id = "devtools-toolbox-side-iframe"; this.frame.className = "devtools-toolbox-side-iframe";
this.frame.width = Services.prefs.getIntPref(this.widthPref); this.frame.width = Services.prefs.getIntPref(this.widthPref);
this._sidebar = gBrowser.getSidebarContainer(this.hostTab.linkedBrowser); this._sidebar = gBrowser.getSidebarContainer(this.hostTab.linkedBrowser);
@ -147,7 +147,7 @@ SidebarHost.prototype = {
/** /**
* Destroy the sidebar. * Destroy the sidebar.
*/ */
destroy: function RH_destroy() { destroy: function SH_destroy() {
if (!this._destroyed) { if (!this._destroyed) {
this._destroyed = true; this._destroyed = true;
@ -177,7 +177,7 @@ WindowHost.prototype = {
/** /**
* Create a new xul window to contain the toolbox. * Create a new xul window to contain the toolbox.
*/ */
open: function WH_open() { create: function WH_create() {
let deferred = Promise.defer(); let deferred = Promise.defer();
let flags = "chrome,centerscreen,resizable,dialog=no"; let flags = "chrome,centerscreen,resizable,dialog=no";

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

@ -429,7 +429,7 @@ let gDevToolsBrowser = {
}, },
/** /**
* Update the "Toggle Toolbox" checkbox in the developer tools menu. This is * Update the "Toggle Tools" checkbox in the developer tools menu. This is
* called when a toolbox is created or destroyed. * called when a toolbox is created or destroyed.
*/ */
_updateMenuCheckbox: function DT_updateMenuCheckbox() { _updateMenuCheckbox: function DT_updateMenuCheckbox() {

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

@ -38,7 +38,8 @@ function testBottomHost(aToolbox)
checkHostType(Toolbox.HostType.BOTTOM); checkHostType(Toolbox.HostType.BOTTOM);
// test UI presence // test UI presence
let iframe = document.getElementById("devtools-toolbox-bottom-iframe"); let nbox = gBrowser.getNotificationBox();
let iframe = document.getAnonymousElementByAttribute(nbox, "class", "devtools-toolbox-bottom-iframe");
ok(iframe, "toolbox bottom iframe exists"); ok(iframe, "toolbox bottom iframe exists");
checkToolboxLoaded(iframe); checkToolboxLoaded(iframe);
@ -51,10 +52,11 @@ function testSidebarHost()
checkHostType(Toolbox.HostType.SIDE); checkHostType(Toolbox.HostType.SIDE);
// test UI presence // test UI presence
let bottom = document.getElementById("devtools-toolbox-bottom-iframe"); let nbox = gBrowser.getNotificationBox();
let bottom = document.getAnonymousElementByAttribute(nbox, "class", "devtools-toolbox-bottom-iframe");
ok(!bottom, "toolbox bottom iframe doesn't exist"); ok(!bottom, "toolbox bottom iframe doesn't exist");
let iframe = document.getElementById("devtools-toolbox-side-iframe"); let iframe = document.getAnonymousElementByAttribute(nbox, "class", "devtools-toolbox-side-iframe");
ok(iframe, "toolbox side iframe exists"); ok(iframe, "toolbox side iframe exists");
checkToolboxLoaded(iframe); checkToolboxLoaded(iframe);
@ -66,7 +68,8 @@ function testWindowHost()
{ {
checkHostType(Toolbox.HostType.WINDOW); checkHostType(Toolbox.HostType.WINDOW);
let sidebar = document.getElementById("devtools-toolbox-side-iframe"); let nbox = gBrowser.getNotificationBox();
let sidebar = document.getAnonymousElementByAttribute(nbox, "class", "devtools-toolbox-side-iframe");
ok(!sidebar, "toolbox sidebar iframe doesn't exist"); ok(!sidebar, "toolbox sidebar iframe doesn't exist");
let win = Services.wm.getMostRecentWindow("devtools:toolbox"); let win = Services.wm.getMostRecentWindow("devtools:toolbox");

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

@ -228,7 +228,15 @@ InspectorPanel.prototype = {
request.suspend(); request.suspend();
let notificationBox = this._toolbox.getNotificationBox(); let notificationBox = null;
if (this.target.isLocalTab) {
let gBrowser = this.target.tab.ownerDocument.defaultView.gBrowser;
notificationBox = gBrowser.getNotificationBox();
}
else {
notificationBox = this._toolbox.getNotificationBox();
}
let notification = notificationBox. let notification = notificationBox.
getNotificationWithValue("inspector-page-navigation"); getNotificationWithValue("inspector-page-navigation");
@ -259,9 +267,7 @@ InspectorPanel.prototype = {
if (request) { if (request) {
request.resume(); request.resume();
request = null; request = null;
return true;
} }
return false;
}.bind(this), }.bind(this),
}, },
{ {

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

@ -25,7 +25,7 @@ function test() {
let target = TargetFactory.forTab(gBrowser.selectedTab); let target = TargetFactory.forTab(gBrowser.selectedTab);
let toolbox = gDevTools.getToolbox(target); let toolbox = gDevTools.getToolbox(target);
notificationBox = toolbox.getNotificationBox(); notificationBox = gBrowser.getNotificationBox();
notificationBox.addEventListener("AlertActive", alertActive1, false); notificationBox.addEventListener("AlertActive", alertActive1, false);
ok(toolbox, "We have access to the notificationBox"); ok(toolbox, "We have access to the notificationBox");

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

@ -36,8 +36,10 @@ function test()
{ {
is(getActiveInspector().selection.node, objectNode, "selection matches node"); is(getActiveInspector().selection.node, objectNode, "selection matches node");
let target = TargetFactory.forTab(gBrowser.selectedTab); let target = TargetFactory.forTab(gBrowser.selectedTab);
gDevTools.closeToolbox(target); executeSoon(function() {
finishUp(); gDevTools.closeToolbox(target);
finishUp();
});
} }

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

@ -30,7 +30,7 @@ function test()
openInspector(findAndHighlightNode); openInspector(findAndHighlightNode);
} }
function findAndHighlightNode(aInspector) function findAndHighlightNode(aInspector, aToolbox)
{ {
inspector = aInspector; inspector = aInspector;

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

@ -19,7 +19,7 @@ function openInspector(callback)
{ {
let target = TargetFactory.forTab(gBrowser.selectedTab); let target = TargetFactory.forTab(gBrowser.selectedTab);
gDevTools.showToolbox(target, "inspector").then(function(toolbox) { gDevTools.showToolbox(target, "inspector").then(function(toolbox) {
callback(toolbox.getCurrentPanel()); callback(toolbox.getCurrentPanel(), toolbox);
}).then(null, console.error); }).then(null, console.error);
} }

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

@ -40,9 +40,7 @@ browser.jar:
content/browser/devtools/profiler/cleopatra/js/ProgressReporter.js (profiler/cleopatra/js/ProgressReporter.js) content/browser/devtools/profiler/cleopatra/js/ProgressReporter.js (profiler/cleopatra/js/ProgressReporter.js)
content/browser/devtools/profiler/cleopatra/js/devtools.js (profiler/cleopatra/js/devtools.js) content/browser/devtools/profiler/cleopatra/js/devtools.js (profiler/cleopatra/js/devtools.js)
content/browser/devtools/profiler/cleopatra/images/circlearrow.svg (profiler/cleopatra/images/circlearrow.svg) content/browser/devtools/profiler/cleopatra/images/circlearrow.svg (profiler/cleopatra/images/circlearrow.svg)
content/browser/devtools/profiler/cleopatra/images/filter.png (profiler/cleopatra/images/filter.png)
content/browser/devtools/profiler/cleopatra/images/noise.png (profiler/cleopatra/images/noise.png) content/browser/devtools/profiler/cleopatra/images/noise.png (profiler/cleopatra/images/noise.png)
content/browser/devtools/profiler/cleopatra/images/showall.png (profiler/cleopatra/images/showall.png)
content/browser/devtools/profiler/cleopatra/images/throbber.svg (profiler/cleopatra/images/throbber.svg) content/browser/devtools/profiler/cleopatra/images/throbber.svg (profiler/cleopatra/images/throbber.svg)
content/browser/devtools/profiler/cleopatra/images/treetwisty.svg (profiler/cleopatra/images/treetwisty.svg) content/browser/devtools/profiler/cleopatra/images/treetwisty.svg (profiler/cleopatra/images/treetwisty.svg)
content/browser/devtools/commandline.css (commandline/commandline.css) content/browser/devtools/commandline.css (commandline/commandline.css)

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

@ -17,8 +17,6 @@
<script src="profiler/cleopatra/js/ui.js"></script> <script src="profiler/cleopatra/js/ui.js"></script>
<script src="profiler/cleopatra/js/ProgressReporter.js"></script> <script src="profiler/cleopatra/js/ProgressReporter.js"></script>
<script src="profiler/cleopatra/js/devtools.js"></script> <script src="profiler/cleopatra/js/devtools.js"></script>
<link rel="shortcut icon" href="favicon.png" />
</head> </head>
<body onload="notifyParent('loaded');"> <body onload="notifyParent('loaded');">

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

@ -4,7 +4,6 @@
.treeViewContainer { .treeViewContainer {
-moz-user-select: none; -moz-user-select: none;
-webkit-user-select: none;
user-select: none; user-select: none;
cursor: default; cursor: default;
line-height: 16px; line-height: 16px;
@ -26,8 +25,6 @@
.treeColumnHeader { .treeColumnHeader {
position: absolute; position: absolute;
display: block; display: block;
background: -moz-linear-gradient(#FFF 45%, #EEE 60%);
background: -webkit-linear-gradient(#FFF 45%, #EEE 60%);
background: linear-gradient(#FFF 45%, #EEE 60%); background: linear-gradient(#FFF 45%, #EEE 60%);
margin: 0; margin: 0;
padding: 0; padding: 0;
@ -93,17 +90,11 @@
.treeViewVerticalScrollbox, .treeViewVerticalScrollbox,
.treeViewHorizontalScrollbox { .treeViewHorizontalScrollbox {
background: -moz-linear-gradient(white, white 50%, #F0F5FF 50%, #F0F5FF);
background: -webkit-linear-gradient(white, white 50%, #F0F5FF 50%, #F0F5FF);
background: linear-gradient(white, white 50%, #F0F5FF 50%, #F0F5FF); background: linear-gradient(white, white 50%, #F0F5FF 50%, #F0F5FF);
background-size: 100px 32px; background-size: 100px 32px;
} }
.leftColumnBackground { .leftColumnBackground {
background: -moz-linear-gradient(left, transparent, transparent 98px, #CCC 98px, #CCC 99px, transparent 99px),
-moz-linear-gradient(white, white 50%, #F0F5FF 50%, #F0F5FF);
background: -webkit-linear-gradient(left, transparent, transparent 98px, #CCC 98px, #CCC 99px, transparent 99px),
-webkit-linear-gradient(white, white 50%, #F0F5FF 50%, #F0F5FF);
background: linear-gradient(left, transparent, transparent 98px, #CCC 98px, #CCC 99px, transparent 99px), background: linear-gradient(left, transparent, transparent 98px, #CCC 98px, #CCC 99px, transparent 99px),
linear-gradient(white, white 50%, #F0F5FF 50%, #F0F5FF); linear-gradient(white, white 50%, #F0F5FF 50%, #F0F5FF);
background-size: auto, 100px 32px; background-size: auto, 100px 32px;

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

@ -31,10 +31,6 @@ body {
.profileProgressPane { .profileProgressPane {
padding: 20px; padding: 20px;
background-color: rgb(229,229,229); background-color: rgb(229,229,229);
background-image: url(../images/noise.png),
-moz-linear-gradient(rgba(255,255,255,.5),rgba(255,255,255,.2));
background-image: url(../images/noise.png),
-webkit-linear-gradient(rgba(255,255,255,.5),rgba(255,255,255,.2));
background-image: url(../images/noise.png), background-image: url(../images/noise.png),
linear-gradient(rgba(255,255,255,.5),rgba(255,255,255,.2)); linear-gradient(rgba(255,255,255,.5),rgba(255,255,255,.2));
text-shadow: rgba(255, 255, 255, 0.4) 0 1px; text-shadow: rgba(255, 255, 255, 0.4) 0 1px;
@ -62,22 +58,39 @@ body {
height: 16px; height: 16px;
} }
.finishedProfilePaneBackgroundCover { .finishedProfilePaneBackgroundCover {
-webkit-animation: darken 300ms cubic-bezier(0, 0, 1, 0); animation: darken 300ms cubic-bezier(0, 0, 1, 0);
-moz-animation: darken 300ms cubic-bezier(0, 0, 1, 0);
background-color: rgba(0, 0, 0, 0.5); background-color: rgba(0, 0, 0, 0.5);
} }
.finishedProfilePane { .finishedProfilePane {
-webkit-animation: appear 300ms ease-out; animation: appear 300ms ease-out;
-moz-animation: appear 300ms ease-out;
} }
@keyframes darken {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@keyframes appear {
from {
transform: scale(0.3);
opacity: 0;
pointer-events: none;
}
to {
transform: scale(1);
opacity: 1;
pointer-events: auto;
}
}
.breadcrumbTrail { .breadcrumbTrail {
top: 0; top: 0;
right: 0; right: 0;
height: 29px; height: 29px;
left: 0; left: 0;
background: -moz-linear-gradient(#FFF 50%, #F3F3F3 55%);
background: -webkit-linear-gradient(#FFF 50%, #F3F3F3 55%);
background: linear-gradient(#FFF 50%, #F3F3F3 55%); background: linear-gradient(#FFF 50%, #F3F3F3 55%);
border-bottom: 1px solid #CCC; border-bottom: 1px solid #CCC;
margin: 0; margin: 0;
@ -85,8 +98,6 @@ body {
overflow: hidden; overflow: hidden;
} }
.breadcrumbTrailItem { .breadcrumbTrailItem {
background: -moz-linear-gradient(#FFF 50%, #F3F3F3 55%);
background: -webkit-linear-gradient(#FFF 50%, #F3F3F3 55%);
background: linear-gradient(#FFF 50%, #F3F3F3 55%); background: linear-gradient(#FFF 50%, #F3F3F3 55%);
display: block; display: block;
margin: 0; margin: 0;
@ -96,7 +107,6 @@ body {
padding: 0 10px; padding: 0 10px;
font-size: 12px; font-size: 12px;
-moz-user-select: none; -moz-user-select: none;
-webkit-user-select: none;
user-select: none; user-select: none;
cursor: default; cursor: default;
border-right: 1px solid #CCC; border-right: 1px solid #CCC;
@ -106,7 +116,7 @@ body {
white-space: nowrap; white-space: nowrap;
position: relative; position: relative;
} }
@-webkit-keyframes slide-out { @keyframes slide-out {
from { from {
margin-left: -270px; margin-left: -270px;
opacity: 0; opacity: 0;
@ -116,7 +126,7 @@ body {
opacity: 1; opacity: 1;
} }
} }
@-moz-keyframes slide-out { @keyframes slide-out {
from { from {
margin-left: -270px; margin-left: -270px;
opacity: 0; opacity: 0;
@ -127,12 +137,9 @@ body {
} }
} }
.breadcrumbTrailItem:not(:first-child) { .breadcrumbTrailItem:not(:first-child) {
-moz-animation: slide-out; animation: slide-out;
-moz-animation-duration: 400ms; animation-duration: 400ms;
-moz-animation-timing-function: ease-out; animation-timing-function: ease-out;
-webkit-animation: slide-out;
-webkit-animation-duration: 400ms;
-webkit-animation-timing-function: ease-out;
} }
.breadcrumbTrailItem.selected { .breadcrumbTrailItem.selected {
background: linear-gradient(#E5E5E5 50%, #DADADA 55%); background: linear-gradient(#E5E5E5 50%, #DADADA 55%);
@ -141,10 +148,8 @@ body {
background: linear-gradient(#F2F2F2 50%, #E6E6E6 55%); background: linear-gradient(#F2F2F2 50%, #E6E6E6 55%);
} }
.breadcrumbTrailItem.deleted { .breadcrumbTrailItem.deleted {
-moz-transition: 400ms ease-out; transition: 400ms ease-out;
-moz-transition-property: opacity, margin-left; transition-property: opacity, margin-left;
-webkit-transition: 400ms ease-out;
-webkit-transition-property: opacity, margin-left;
opacity: 0; opacity: 0;
margin-left: -270px; margin-left: -270px;
} }
@ -199,7 +204,6 @@ body {
} }
.sideBar { .sideBar {
-moz-box-sizing: border-box; -moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box; box-sizing: border-box;
position: absolute; position: absolute;
left: 0; left: 0;
@ -246,8 +250,6 @@ body {
right: 0; right: 0;
left: 0; left: 0;
border-bottom: 1px solid #CCC; border-bottom: 1px solid #CCC;
background: -moz-linear-gradient(#EEE, #CCC);
background: -webkit-linear-gradient(#EEE, #CCC);
background: linear-gradient(#EEE, #CCC); background: linear-gradient(#EEE, #CCC);
} }
.histogramHilite { .histogramHilite {
@ -287,8 +289,6 @@ body {
text-indent: 8px; text-indent: 8px;
} }
.fileListItem.selected { .fileListItem.selected {
background: -moz-linear-gradient(#4B91D7 1px, #5FA9E4 1px, #5FA9E4 2px, #58A0DE 3px, #2B70C7 39px, #2763B4 39px);
background: -webkit-linear-gradient(#4B91D7 1px, #5FA9E4 1px, #5FA9E4 2px, #58A0DE 3px, #2B70C7 39px, #2763B4 39px);
background: linear-gradient(#4B91D7 1px, #5FA9E4 1px, #5FA9E4 2px, #58A0DE 3px, #2B70C7 39px, #2763B4 39px); background: linear-gradient(#4B91D7 1px, #5FA9E4 1px, #5FA9E4 2px, #58A0DE 3px, #2B70C7 39px, #2763B4 39px);
color: #FFF; color: #FFF;
text-shadow: 0 1px rgba(0, 0, 0, 0.3); text-shadow: 0 1px rgba(0, 0, 0, 0.3);
@ -313,10 +313,8 @@ body {
opacity: 0; opacity: 0;
pointer-events: none; pointer-events: none;
background: rgba(120, 120, 120, 0.2); background: rgba(120, 120, 120, 0.2);
-moz-transition: 200ms ease-in-out; transition: 200ms ease-in-out;
-moz-transition-property: visibility, opacity; transition-property: visibility, opacity;
-webkit-transition: 200ms ease-in-out;
-webkit-transition-property: visibility, opacity;
} }
.busyCover.busy { .busyCover.busy {
visibility: visible; visibility: visible;
@ -330,7 +328,6 @@ body {
margin: -12px; margin: -12px;
} }
label { label {
-webkit-user-select: none;
-moz-user-select: none; -moz-user-select: none;
} }
.videoPane { .videoPane {

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

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

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

@ -35,6 +35,25 @@ gcli.addCommand({
tooltipText: gcli.lookup("resizeModeToggleTooltip"), tooltipText: gcli.lookup("resizeModeToggleTooltip"),
description: gcli.lookup('resizeModeToggleDesc'), description: gcli.lookup('resizeModeToggleDesc'),
manual: gcli.lookup('resizeModeManual'), manual: gcli.lookup('resizeModeManual'),
state: {
isChecked: function(aTarget) {
let browserWindow = aTarget.tab.ownerDocument.defaultView;
let mgr = browserWindow.ResponsiveUI.ResponsiveUIManager;
return mgr.isActiveForTab(aTarget.tab);
},
onChange: function(aTarget, aChangeHandler) {
let browserWindow = aTarget.tab.ownerDocument.defaultView;
let mgr = browserWindow.ResponsiveUI.ResponsiveUIManager;
mgr.on("on", aChangeHandler);
mgr.on("off", aChangeHandler);
},
offChange: function(aTarget, aChangeHandler) {
let browserWindow = aTarget.tab.ownerDocument.defaultView;
let mgr = browserWindow.ResponsiveUI.ResponsiveUIManager;
mgr.off("on", aChangeHandler);
mgr.off("off", aChangeHandler);
},
},
exec: gcli_cmd_resize exec: gcli_cmd_resize
}); });

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

@ -35,10 +35,19 @@ this.ResponsiveUIManager = {
if (aTab.__responsiveUI) { if (aTab.__responsiveUI) {
aTab.__responsiveUI.close(); aTab.__responsiveUI.close();
} else { } else {
aTab.__responsiveUI = new ResponsiveUI(aWindow, aTab); new ResponsiveUI(aWindow, aTab);
} }
}, },
/**
* Returns true if responsive view is active for the provided tab.
*
* @param aTab the tab targeted.
*/
isActiveForTab: function(aTab) {
return !!aTab.__responsiveUI;
},
/** /**
* Handle gcli commands. * Handle gcli commands.
* *
@ -51,13 +60,13 @@ this.ResponsiveUIManager = {
switch (aCommand) { switch (aCommand) {
case "resize to": case "resize to":
if (!aTab.__responsiveUI) { if (!aTab.__responsiveUI) {
aTab.__responsiveUI = new ResponsiveUI(aWindow, aTab); new ResponsiveUI(aWindow, aTab);
} }
aTab.__responsiveUI.setSize(aArgs.width, aArgs.height); aTab.__responsiveUI.setSize(aArgs.width, aArgs.height);
break; break;
case "resize on": case "resize on":
if (!aTab.__responsiveUI) { if (!aTab.__responsiveUI) {
aTab.__responsiveUI = new ResponsiveUI(aWindow, aTab); new ResponsiveUI(aWindow, aTab);
} }
break; break;
case "resize off": case "resize off":
@ -167,6 +176,8 @@ function ResponsiveUI(aWindow, aTab)
if (this._floatingScrollbars) if (this._floatingScrollbars)
switchToFloatingScrollbars(this.tab); switchToFloatingScrollbars(this.tab);
this.tab.__responsiveUI = this;
ResponsiveUIManager.emit("on", this.tab, this); ResponsiveUIManager.emit("on", this.tab, this);
} }

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

@ -28,7 +28,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "PageErrorListener",
"resource://gre/modules/devtools/WebConsoleUtils.jsm"); "resource://gre/modules/devtools/WebConsoleUtils.jsm");
XPCOMUtils.defineLazyGetter(this, "prefBranch", function() { XPCOMUtils.defineLazyGetter(this, "prefBranch", function() {
var prefService = Components.classes["@mozilla.org/preferences-service;1"] let prefService = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefService); .getService(Components.interfaces.nsIPrefService);
return prefService.getBranch(null) return prefService.getBranch(null)
.QueryInterface(Components.interfaces.nsIPrefBranch2); .QueryInterface(Components.interfaces.nsIPrefBranch2);
@ -51,12 +51,16 @@ this.CommandUtils = {
/** /**
* A toolbarSpec is an array of buttonSpecs. A buttonSpec is an array of * A toolbarSpec is an array of buttonSpecs. A buttonSpec is an array of
* strings each of which is a GCLI command (including args if needed). * strings each of which is a GCLI command (including args if needed).
*
* Warning: this method uses the unload event of the window that owns the
* buttons that are of type checkbox. this means that we don't properly
* unregister event handlers until the window is destroyed.
*/ */
createButtons: function CU_createButtons(toolbarSpec, document, requisition) { createButtons: function CU_createButtons(toolbarSpec, target, document, requisition) {
var reply = []; let reply = [];
toolbarSpec.forEach(function(buttonSpec) { toolbarSpec.forEach(function(buttonSpec) {
var button = document.createElement("toolbarbutton"); let button = document.createElement("toolbarbutton");
reply.push(button); reply.push(button);
if (typeof buttonSpec == "string") { if (typeof buttonSpec == "string") {
@ -66,7 +70,7 @@ this.CommandUtils = {
requisition.update(buttonSpec.typed); requisition.update(buttonSpec.typed);
// Ignore invalid commands // Ignore invalid commands
var command = requisition.commandAssignment.value; let command = requisition.commandAssignment.value;
if (command == null) { if (command == null) {
// TODO: Have a broken icon // TODO: Have a broken icon
// button.icon = 'Broken'; // button.icon = 'Broken';
@ -101,15 +105,24 @@ this.CommandUtils = {
}, false); }, false);
// Allow the command button to be toggleable // Allow the command button to be toggleable
/* if (command.state) {
if (command.checkedState) { button.setAttribute("autocheck", false);
button.setAttribute("type", "checkbox"); let onChange = function(event, eventTab) {
button.setAttribute("checked", command.checkedState.get() ? "true" : "false"); if (eventTab == target.tab) {
command.checkedState.on("change", function() { if (command.state.isChecked(target)) {
button.checked = command.checkedState.get(); button.setAttribute("checked", true);
}); }
else if (button.hasAttribute("checked")) {
button.removeAttribute("checked");
}
}
};
command.state.onChange(target, onChange);
onChange(null, target.tab);
document.defaultView.addEventListener("unload", function() {
command.state.offChange(target, onChange);
}, false);
} }
*/
} }
}); });
@ -192,7 +205,7 @@ Object.defineProperty(DeveloperToolbar.prototype, 'visible', {
enumerable: true enumerable: true
}); });
var _gSequenceId = 0; let _gSequenceId = 0;
/** /**
* Getter for a unique ID. * Getter for a unique ID.
@ -239,8 +252,8 @@ DeveloperToolbar.prototype.focusToggle = function DT_focusToggle()
if (this.visible) { if (this.visible) {
// If we have focus then the active element is the HTML input contained // If we have focus then the active element is the HTML input contained
// inside the xul input element // inside the xul input element
var active = this._chromeWindow.document.activeElement; let active = this._chromeWindow.document.activeElement;
var position = this._input.compareDocumentPosition(active); let position = this._input.compareDocumentPosition(active);
if (position & Node.DOCUMENT_POSITION_CONTAINED_BY) { if (position & Node.DOCUMENT_POSITION_CONTAINED_BY) {
this.hide(); this.hide();
} }
@ -443,7 +456,12 @@ DeveloperToolbar.prototype.hide = function DT_hide()
*/ */
DeveloperToolbar.prototype.destroy = function DT_destroy() DeveloperToolbar.prototype.destroy = function DT_destroy()
{ {
if (this._lastState == NOTIFICATIONS.HIDE) {
return;
}
this._chromeWindow.getBrowser().tabContainer.removeEventListener("TabSelect", this, false); this._chromeWindow.getBrowser().tabContainer.removeEventListener("TabSelect", this, false);
this._chromeWindow.getBrowser().tabContainer.removeEventListener("TabClose", this, false);
this._chromeWindow.getBrowser().removeEventListener("load", this, true); this._chromeWindow.getBrowser().removeEventListener("load", this, true);
this._chromeWindow.getBrowser().removeEventListener("beforeunload", this, true); this._chromeWindow.getBrowser().removeEventListener("beforeunload", this, true);
@ -470,6 +488,8 @@ DeveloperToolbar.prototype.destroy = function DT_destroy()
delete this.outputPanel; delete this.outputPanel;
delete this.tooltipPanel; delete this.tooltipPanel;
*/ */
this._lastState = NOTIFICATIONS.HIDE;
}; };
/** /**

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

@ -1683,12 +1683,11 @@ VariablesView.prototype.commitHierarchy = function VV_commitHierarchy() {
// Dispatch this action after all the nodes have been drawn, so that // Dispatch this action after all the nodes have been drawn, so that
// the transition efects can take place. // the transition efects can take place.
this.window.setTimeout(function(aTarget) { this.window.setTimeout(function(aTarget) {
aTarget.setAttribute("changed", "");
aTarget.addEventListener("transitionend", function onEvent() { aTarget.addEventListener("transitionend", function onEvent() {
aTarget.removeEventListener("transitionend", onEvent, false); aTarget.removeEventListener("transitionend", onEvent, false);
aTarget.removeAttribute("changed"); aTarget.removeAttribute("changed");
}, false); }, false);
aTarget.setAttribute("changed", "");
}.bind(this, currVariable.target), LAZY_EMPTY_DELAY + 1); }.bind(this, currVariable.target), LAZY_EMPTY_DELAY + 1);
} }
}; };

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

@ -400,7 +400,7 @@ StyleEditorChrome.prototype = {
onEditorAdded: function SEC_selectSheet_onEditorAdded(aChrome, aEditor) { onEditorAdded: function SEC_selectSheet_onEditorAdded(aChrome, aEditor) {
let sheet = self._styleSheetToSelect.sheet; let sheet = self._styleSheetToSelect.sheet;
if ((sheet && aEditor.styleSheet == sheet) || if ((sheet && aEditor.styleSheet == sheet) ||
aEditor.styleSheetIndex == 0) { (aEditor.styleSheetIndex == 0 && sheet == null)) {
aChrome.removeChromeListener(this); aChrome.removeChromeListener(this);
select(aEditor); select(aEditor);
} }

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

@ -62,7 +62,7 @@ UpdateProcess.prototype = {
*/ */
schedule: function UP_schedule() schedule: function UP_schedule()
{ {
if (this.cancelled) { if (this.canceled) {
return; return;
} }
this._timeout = this.win.setTimeout(this._timeoutHandler.bind(this), 0); this._timeout = this.win.setTimeout(this._timeoutHandler.bind(this), 0);
@ -100,7 +100,7 @@ UpdateProcess.prototype = {
_runBatch: function Y_runBatch() _runBatch: function Y_runBatch()
{ {
let time = Date.now(); let time = Date.now();
while(!this.cancelled) { while(!this.canceled) {
// Continue until iter.next() throws... // Continue until iter.next() throws...
let next = this.iter.next(); let next = this.iter.next();
this.onItem(next[1]); this.onItem(next[1]);
@ -147,7 +147,6 @@ this.CssHtmlTree = function CssHtmlTree(aStyleInspector)
this.root = this.styleDocument.getElementById("root"); this.root = this.styleDocument.getElementById("root");
this.templateRoot = this.styleDocument.getElementById("templateRoot"); this.templateRoot = this.styleDocument.getElementById("templateRoot");
this.propertyContainer = this.styleDocument.getElementById("propertyContainer"); this.propertyContainer = this.styleDocument.getElementById("propertyContainer");
this.panel = aStyleInspector.panel;
// No results text. // No results text.
this.noResults = this.styleDocument.getElementById("noResults"); this.noResults = this.styleDocument.getElementById("noResults");
@ -257,6 +256,13 @@ CssHtmlTree.prototype = {
this._unmatchedProperties = null; this._unmatchedProperties = null;
this._matchedProperties = null; this._matchedProperties = null;
if (!aElement) {
if (this._refreshProcess) {
this._refreshProcess.cancel();
}
return;
}
if (this.htmlComplete) { if (this.htmlComplete) {
this.refreshSourceFilter(); this.refreshSourceFilter();
this.refreshPanel(); this.refreshPanel();

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

@ -80,6 +80,7 @@ this.RuleViewTool = function RVT_RuleViewTool(aInspector, aWindow, aIFrame)
this._cssLinkHandler); this._cssLinkHandler);
this._onSelect = this.onSelect.bind(this); this._onSelect = this.onSelect.bind(this);
this.inspector.selection.on("detached", this._onSelect);
this.inspector.selection.on("new-node", this._onSelect); this.inspector.selection.on("new-node", this._onSelect);
this.refresh = this.refresh.bind(this); this.refresh = this.refresh.bind(this);
this.inspector.on("layout-change", this.refresh); this.inspector.on("layout-change", this.refresh);
@ -159,6 +160,7 @@ this.ComputedViewTool = function CVT_ComputedViewTool(aInspector, aWindow, aIFra
this.view = new CssHtmlTree(this); this.view = new CssHtmlTree(this);
this._onSelect = this.onSelect.bind(this); this._onSelect = this.onSelect.bind(this);
this.inspector.selection.on("detached", this._onSelect);
this.inspector.selection.on("new-node", this._onSelect); this.inspector.selection.on("new-node", this._onSelect);
if (this.inspector.highlighter) { if (this.inspector.highlighter) {
this.inspector.highlighter.on("locked", this._onSelect); this.inspector.highlighter.on("locked", this._onSelect);
@ -179,7 +181,7 @@ ComputedViewTool.prototype = {
{ {
if (!this.inspector.selection.isConnected() || if (!this.inspector.selection.isConnected() ||
!this.inspector.selection.isElementNode()) { !this.inspector.selection.isElementNode()) {
// FIXME: We should hide view's content this.view.highlight(null);
return; return;
} }

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

@ -5,11 +5,11 @@
this.EXPORTED_SYMBOLS = [ ]; this.EXPORTED_SYMBOLS = [ ];
Components.utils.import('resource://gre/modules/XPCOMUtils.jsm');
Components.utils.import("resource:///modules/devtools/gcli.jsm"); Components.utils.import("resource:///modules/devtools/gcli.jsm");
Components.utils.import("resource:///modules/HUDService.jsm");
Components.utils.import("resource:///modules/devtools/Tilt.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "TiltManager",
"resource:///modules/devtools/Tilt.jsm");
/** /**
* 'tilt' command * 'tilt' command
*/ */
@ -46,6 +46,22 @@ gcli.addCommand({
buttonClass: "command-button", buttonClass: "command-button",
tooltipText: gcli.lookup("tiltToggleTooltip"), tooltipText: gcli.lookup("tiltToggleTooltip"),
hidden: true, hidden: true,
state: {
isChecked: function(aTarget) {
let browserWindow = aTarget.tab.ownerDocument.defaultView;
return !!TiltManager.getTiltForBrowser(browserWindow).currentInstance;
},
onChange: function(aTarget, aChangeHandler) {
let browserWindow = aTarget.tab.ownerDocument.defaultView;
let tilt = TiltManager.getTiltForBrowser(browserWindow);
tilt.on("change", aChangeHandler);
},
offChange: function(aTarget, aChangeHandler) {
let browserWindow = aTarget.tab.ownerDocument.defaultView;
let tilt = TiltManager.getTiltForBrowser(browserWindow);
tilt.off("change", aChangeHandler);
},
},
exec: function(args, context) { exec: function(args, context) {
let chromeWindow = context.environment.chromeDocument.defaultView; let chromeWindow = context.environment.chromeDocument.defaultView;
let Tilt = TiltManager.getTiltForBrowser(chromeWindow); let Tilt = TiltManager.getTiltForBrowser(chromeWindow);

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

@ -46,6 +46,7 @@ const TILT_NOTIFICATIONS = {
Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource:///modules/devtools/TiltGL.jsm"); Cu.import("resource:///modules/devtools/TiltGL.jsm");
Cu.import("resource:///modules/devtools/TiltUtils.jsm"); Cu.import("resource:///modules/devtools/TiltUtils.jsm");
Cu.import("resource:///modules/devtools/EventEmitter.jsm");
Cu.import("resource:///modules/devtools/TiltVisualizer.jsm"); Cu.import("resource:///modules/devtools/TiltVisualizer.jsm");
this.EXPORTED_SYMBOLS = ["TiltManager"]; this.EXPORTED_SYMBOLS = ["TiltManager"];
@ -87,6 +88,8 @@ this.Tilt = function Tilt(aWindow)
*/ */
this.NOTIFICATIONS = TILT_NOTIFICATIONS; this.NOTIFICATIONS = TILT_NOTIFICATIONS;
EventEmitter.decorate(this);
this.setup(); this.setup();
} }
@ -128,6 +131,7 @@ Tilt.prototype = {
return; return;
} }
this.emit("change", this.chromeWindow.gBrowser.selectedTab);
Services.obs.notifyObservers(null, TILT_NOTIFICATIONS.INITIALIZING, null); Services.obs.notifyObservers(null, TILT_NOTIFICATIONS.INITIALIZING, null);
}, },
@ -183,6 +187,7 @@ Tilt.prototype = {
this._isDestroying = false; this._isDestroying = false;
this.chromeWindow.gBrowser.selectedBrowser.focus(); this.chromeWindow.gBrowser.selectedBrowser.focus();
this.emit("change", this.chromeWindow.gBrowser.selectedTab);
Services.obs.notifyObservers(null, TILT_NOTIFICATIONS.DESTROYED, null); Services.obs.notifyObservers(null, TILT_NOTIFICATIONS.DESTROYED, null);
}, },

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

@ -30,10 +30,10 @@ WebConsolePanel.prototype = {
* open is effectively an asynchronous constructor * open is effectively an asynchronous constructor
*/ */
open: function StyleEditor_open() { open: function StyleEditor_open() {
let tab = this._toolbox._getHostTab();
let parentDoc = this._frameWindow.document.defaultView.parent.document; let parentDoc = this._frameWindow.document.defaultView.parent.document;
let iframe = parentDoc.getElementById("toolbox-panel-iframe-webconsole"); let iframe = parentDoc.getElementById("toolbox-panel-iframe-webconsole");
this.hud = HUDService.activateHUDForContext(tab, iframe, this._toolbox.target); this.hud = HUDService.activateHUDForContext(this.target.tab, iframe,
this._toolbox.target);
let deferred = Promise.defer(); let deferred = Promise.defer();

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

@ -104,7 +104,7 @@ MOCHITEST_BROWSER_FILES = \
browser_webconsole_bug_622303_persistent_filters.js \ browser_webconsole_bug_622303_persistent_filters.js \
browser_webconsole_bug_770099_bad_policyuri.js \ browser_webconsole_bug_770099_bad_policyuri.js \
browser_webconsole_bug_770099_violation.js \ browser_webconsole_bug_770099_violation.js \
$(filter disabled-temporarily--bug-808264, browser_webconsole_bug_782653_CSS_links_in_Style_Editor.js) \ browser_webconsole_bug_782653_CSS_links_in_Style_Editor.js \
browser_cached_messages.js \ browser_cached_messages.js \
browser_bug664688_sandbox_update_after_navigation.js \ browser_bug664688_sandbox_update_after_navigation.js \
browser_result_format_as_string.js \ browser_result_format_as_string.js \

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

@ -78,6 +78,7 @@
@BINPATH@/@MOZ_CHILD_PROCESS_NAME@ @BINPATH@/@MOZ_CHILD_PROCESS_NAME@
#endif #endif
#ifdef XP_WIN32 #ifdef XP_WIN32
@BINPATH@/plugin-hang-ui@BIN_SUFFIX@
#ifndef MOZ_DEBUG #ifndef MOZ_DEBUG
#if MOZ_MSVC_REDIST == 1400 #if MOZ_MSVC_REDIST == 1400
@BINPATH@/Microsoft.VC80.CRT.manifest @BINPATH@/Microsoft.VC80.CRT.manifest

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

@ -234,10 +234,11 @@ These should match what Safari and other Apple applications use on OS X Lion. --
<!ENTITY devToolbarMenu.accesskey "v"> <!ENTITY devToolbarMenu.accesskey "v">
<!ENTITY devToolbar.keycode "VK_F2"> <!ENTITY devToolbar.keycode "VK_F2">
<!ENTITY devToolbar.keytext "F2"> <!ENTITY devToolbar.keytext "F2">
<!ENTITY devToolbarToolsButton.label "Toggle Toolbox"> <!ENTITY devToolboxMenuItem.label "Toggle Tools">
<!ENTITY devToolbarOtherToolsButton.label "More Tools"> <!ENTITY devToolboxMenuItem.accesskey "T">
<!ENTITY devToolbox.accesskey "B"> <!ENTITY devToolbarToolsButton.tooltip "Toggle developer tools">
<!ENTITY devToolbarOtherToolsButton.label "More Tools">
<!ENTITY getMoreDevtoolsCmd.label "Get More Tools"> <!ENTITY getMoreDevtoolsCmd.label "Get More Tools">
<!ENTITY getMoreDevtoolsCmd.accesskey "M"> <!ENTITY getMoreDevtoolsCmd.accesskey "M">

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

@ -64,6 +64,8 @@
<!ENTITY cmd.removeFromHistory.accesskey "e"> <!ENTITY cmd.removeFromHistory.accesskey "e">
<!ENTITY cmd.clearList.label "Clear List"> <!ENTITY cmd.clearList.label "Clear List">
<!ENTITY cmd.clearList.accesskey "a"> <!ENTITY cmd.clearList.accesskey "a">
<!ENTITY cmd.clearDownloads.label "Clear Downloads">
<!ENTITY cmd.clearDownloads.accesskey "D">
<!-- LOCALIZATION NOTE (downloadsHistory.label, downloadsHistory.accesskey): <!-- LOCALIZATION NOTE (downloadsHistory.label, downloadsHistory.accesskey):
This string is shown at the bottom of the Downloads Panel when all the This string is shown at the bottom of the Downloads Panel when all the
@ -72,3 +74,6 @@
--> -->
<!ENTITY downloadsHistory.label "Show All Downloads"> <!ENTITY downloadsHistory.label "Show All Downloads">
<!ENTITY downloadsHistory.accesskey "S"> <!ENTITY downloadsHistory.accesskey "S">
<!ENTITY clearDownloadsButton.label "Clear Downloads">
<!ENTITY clearDownloadsButton.tooltip "Clears completed, canceled and failed downloads">

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

@ -55,7 +55,7 @@
#nav-bar[tabsontop=true], #nav-bar[tabsontop=true],
#nav-bar[tabsontop=true][collapsed=true]:not([customizing]) + toolbar, #nav-bar[tabsontop=true][collapsed=true]:not([customizing]) + toolbar,
#nav-bar[tabsontop=true][collapsed=true]:not([customizing]) + #customToolbars + #PersonalToolbar { #nav-bar[tabsontop=true][collapsed=true]:not([customizing]) + #customToolbars + #PersonalToolbar {
background-image: -moz-linear-gradient(@toolbarHighlight@, rgba(255,255,255,0)); background-image: linear-gradient(@toolbarHighlight@, rgba(255,255,255,0));
} }
#personal-bookmarks { #personal-bookmarks {
@ -1057,10 +1057,10 @@ toolbar[iconsize="small"] #feed-button {
background-color: #fff; background-color: #fff;
color: hsl(92,100%,30%); color: hsl(92,100%,30%);
-moz-margin-end: 4px; -moz-margin-end: 4px;
background-image: -moz-linear-gradient(hsla(92,81%,16%,0), background-image: linear-gradient(hsla(92,81%,16%,0),
hsla(92,81%,16%,.2) 25%, hsla(92,81%,16%,.2) 25%,
hsla(92,81%,16%,.2) 75%, hsla(92,81%,16%,.2) 75%,
hsla(92,81%,16%,0)); hsla(92,81%,16%,0));
background-position: right; background-position: right;
background-size: 1px; background-size: 1px;
background-repeat: no-repeat; background-repeat: no-repeat;
@ -1481,7 +1481,7 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
margin: 8px -10px -10px -10px; margin: 8px -10px -10px -10px;
padding: 8px 10px; padding: 8px 10px;
border-top: 1px solid ThreeDShadow; border-top: 1px solid ThreeDShadow;
background-image: -moz-linear-gradient(hsla(0,0%,0%,.15), hsla(0,0%,0%,.08) 6px); background-image: linear-gradient(hsla(0,0%,0%,.15), hsla(0,0%,0%,.08) 6px);
} }
.panel-promo-icon { .panel-promo-icon {
@ -1540,15 +1540,14 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
} }
#TabsToolbar[tabsontop=false] { #TabsToolbar[tabsontop=false] {
background-image: background-image: linear-gradient(to top, rgba(0,0,0,.3) 1px, rgba(0,0,0,.05) 1px, transparent 50%);
-moz-linear-gradient(bottom, rgba(0,0,0,.3) 1px, rgba(0,0,0,.05) 1px, transparent 50%);
} }
.tabbrowser-tab, .tabbrowser-tab,
.tabs-newtab-button { .tabs-newtab-button {
position: static; position: static;
-moz-appearance: none; -moz-appearance: none;
background: -moz-linear-gradient(hsla(0,0%,100%,.2), hsla(0,0%,45%,.2) 2px, hsla(0,0%,32%,.2) 80%); background: linear-gradient(hsla(0,0%,100%,.2), hsla(0,0%,45%,.2) 2px, hsla(0,0%,32%,.2) 80%);
background-origin: border-box; background-origin: border-box;
background-position: 1px 2px; background-position: 1px 2px;
background-size: 100% calc(100% - 2px); background-size: 100% calc(100% - 2px);
@ -1565,52 +1564,52 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
.tabbrowser-tab:hover, .tabbrowser-tab:hover,
.tabs-newtab-button:hover { .tabs-newtab-button:hover {
background-image: -moz-linear-gradient(hsla(0,0%,100%,.6), hsla(0,0%,100%,.2) 4px, hsla(0,0%,75%,.2) 80%); background-image: linear-gradient(hsla(0,0%,100%,.6), hsla(0,0%,100%,.2) 4px, hsla(0,0%,75%,.2) 80%);
} }
.tabbrowser-tab[selected="true"] { .tabbrowser-tab[selected="true"] {
background-image: -moz-linear-gradient(@selectedTabHighlight@, @toolbarHighlight@ 32%), background-image: linear-gradient(@selectedTabHighlight@, @toolbarHighlight@ 32%),
-moz-linear-gradient(-moz-dialog, -moz-dialog); linear-gradient(-moz-dialog, -moz-dialog);
color: -moz-dialogtext; color: -moz-dialogtext;
} }
#main-window[tabsontop=false]:not([disablechrome]) .tabbrowser-tab[selected=true]:not(:-moz-lwtheme) { #main-window[tabsontop=false]:not([disablechrome]) .tabbrowser-tab[selected=true]:not(:-moz-lwtheme) {
background-image: -moz-linear-gradient(bottom, rgba(0,0,0,.3) 1px, transparent 1px), background-image: linear-gradient(to top, rgba(0,0,0,.3) 1px, transparent 1px),
-moz-linear-gradient(@selectedTabHighlight@, @toolbarHighlight@ 32%), linear-gradient(@selectedTabHighlight@, @toolbarHighlight@ 32%),
-moz-linear-gradient(-moz-dialog, -moz-dialog); linear-gradient(-moz-dialog, -moz-dialog);
} }
.tabbrowser-tab[selected="true"]:-moz-lwtheme { .tabbrowser-tab[selected="true"]:-moz-lwtheme {
background-image: -moz-linear-gradient(@selectedTabHighlight@, @toolbarHighlight@ 32%); background-image: linear-gradient(@selectedTabHighlight@, @toolbarHighlight@ 32%);
color: inherit; color: inherit;
} }
.tabbrowser-tab:-moz-lwtheme-brighttext:not([selected="true"]), .tabbrowser-tab:-moz-lwtheme-brighttext:not([selected="true"]),
.tabs-newtab-button:-moz-lwtheme-brighttext { .tabs-newtab-button:-moz-lwtheme-brighttext {
background-image: -moz-linear-gradient(hsla(0,0%,60%,.6), hsla(0,0%,40%,.6) 4px, hsla(0,0%,30%,.6) 80%); background-image: linear-gradient(hsla(0,0%,60%,.6), hsla(0,0%,40%,.6) 4px, hsla(0,0%,30%,.6) 80%);
} }
.tabbrowser-tab:-moz-lwtheme-brighttext:not([selected="true"]):hover, .tabbrowser-tab:-moz-lwtheme-brighttext:not([selected="true"]):hover,
.tabs-newtab-button:-moz-lwtheme-brighttext:hover { .tabs-newtab-button:-moz-lwtheme-brighttext:hover {
background-image: -moz-linear-gradient(hsla(0,0%,80%,.6), hsla(0,0%,60%,.6) 4px, hsla(0,0%,45%,.6) 80%); background-image: linear-gradient(hsla(0,0%,80%,.6), hsla(0,0%,60%,.6) 4px, hsla(0,0%,45%,.6) 80%);
} }
.tabbrowser-tab:-moz-lwtheme-darktext:not([selected="true"]), .tabbrowser-tab:-moz-lwtheme-darktext:not([selected="true"]),
.tabs-newtab-button:-moz-lwtheme-darktext { .tabs-newtab-button:-moz-lwtheme-darktext {
background-image: -moz-linear-gradient(hsla(0,0%,100%,.5), hsla(0,0%,60%,.5) 4px, hsla(0,0%,45%,.5) 80%); background-image: linear-gradient(hsla(0,0%,100%,.5), hsla(0,0%,60%,.5) 4px, hsla(0,0%,45%,.5) 80%);
} }
.tabbrowser-tab:-moz-lwtheme-darktext:not([selected="true"]):hover, .tabbrowser-tab:-moz-lwtheme-darktext:not([selected="true"]):hover,
.tabs-newtab-button:-moz-lwtheme-darktext:hover { .tabs-newtab-button:-moz-lwtheme-darktext:hover {
background-image: -moz-linear-gradient(hsla(0,0%,100%,.5), hsla(0,0%,80%,.5) 4px, hsla(0,0%,60%,.5) 80%); background-image: linear-gradient(hsla(0,0%,100%,.5), hsla(0,0%,80%,.5) 4px, hsla(0,0%,60%,.5) 80%);
} }
.tabbrowser-tab[pinned][titlechanged]:not([selected="true"]) { .tabbrowser-tab[pinned][titlechanged]:not([selected="true"]) {
background-image: -moz-radial-gradient(center 3px, circle cover, rgba(233,242,252,1) 3%, rgba(172,206,255,.75) 40%, rgba(87,151,201,.5) 80%, rgba(87,151,201,0)); background-image: radial-gradient(circle farthest-corner at 50% 3px, rgba(233,242,252,1) 3%, rgba(172,206,255,.75) 40%, rgba(87,151,201,.5) 80%, rgba(87,151,201,0));
} }
.tabbrowser-tab[pinned][titlechanged]:not([selected="true"]):hover { .tabbrowser-tab[pinned][titlechanged]:not([selected="true"]):hover {
background-image: -moz-linear-gradient(hsla(0,0%,100%,.8), hsla(0,0%,100%,.6) 2px, hsla(0,0%,75%,.2) 80%), background-image: linear-gradient(hsla(0,0%,100%,.8), hsla(0,0%,100%,.6) 2px, hsla(0,0%,75%,.2) 80%),
-moz-radial-gradient(center 3px, circle cover, rgba(233,242,252,1) 3%, rgba(172,206,255,.75) 40%, rgba(87,151,201,.5) 80%, rgba(87,151,201,0)); radial-gradient(circle farthest-corner at 50% 3px, rgba(233,242,252,1) 3%, rgba(172,206,255,.75) 40%, rgba(87,151,201,.5) 80%, rgba(87,151,201,0));
} }
#tabbrowser-tabs[positionpinnedtabs] > .tabbrowser-tab > .tab-stack > .tab-content[pinned] { #tabbrowser-tabs[positionpinnedtabs] > .tabbrowser-tab > .tab-stack > .tab-content[pinned] {
@ -1939,9 +1938,9 @@ toolbar[mode="text"] toolbarbutton.chevron > .toolbarbutton-icon {
#addon-bar[customizing] > #status-bar { #addon-bar[customizing] > #status-bar {
opacity: .5; opacity: .5;
background-image: -moz-repeating-linear-gradient(-45deg, background-image: repeating-linear-gradient(135deg,
rgba(255,255,255,.3), rgba(255,255,255,.3) 5px, rgba(255,255,255,.3), rgba(255,255,255,.3) 5px,
rgba(0,0,0,.3) 5px, rgba(0,0,0,.3) 10px); rgba(0,0,0,.3) 5px, rgba(0,0,0,.3) 10px);
} }
#status-bar > statusbarpanel { #status-bar > statusbarpanel {
@ -1963,7 +1962,7 @@ toolbar[mode="text"] toolbarbutton.chevron > .toolbarbutton-icon {
.statuspanel-label { .statuspanel-label {
margin: 0; margin: 0;
padding: 2px 4px; padding: 2px 4px;
background: -moz-linear-gradient(white, #ddd); background: linear-gradient(#fff, #ddd);
border: 1px none #ccc; border: 1px none #ccc;
border-top-style: solid; border-top-style: solid;
color: #333; color: #333;
@ -2009,7 +2008,7 @@ toolbar[mode="text"] toolbarbutton.chevron > .toolbarbutton-icon {
color: hsl(200, 100%, 65%); color: hsl(200, 100%, 65%);
border: 1px solid hsla(210, 19%, 63%, .5); border: 1px solid hsla(210, 19%, 63%, .5);
border-radius: 3px; border-radius: 3px;
background: -moz-linear-gradient(hsl(209, 18%, 30%), hsl(210, 24%, 16%)) no-repeat padding-box; background: linear-gradient(hsl(209, 18%, 30%), hsl(210, 24%, 16%)) no-repeat padding-box;
} }
/* Highlighter - Node Infobar - text */ /* Highlighter - Node Infobar - text */
@ -2093,7 +2092,7 @@ html|*.highlighter-nodeinfobar-pseudo-classes {
margin-top: 8px; margin-top: 8px;
border-right-color: hsla(210, 19%, 63%, .5); border-right-color: hsla(210, 19%, 63%, .5);
border-top-color: hsla(210, 19%, 63%, .5); border-top-color: hsla(210, 19%, 63%, .5);
background-image: -moz-linear-gradient(bottom left, transparent 50%, hsl(209, 18%, 30%) 50%); background-image: linear-gradient(to top right, transparent 50%, hsl(209, 18%, 30%) 50%);
} }
.highlighter-nodeinfobar-arrow-bottom { .highlighter-nodeinfobar-arrow-bottom {
@ -2101,7 +2100,7 @@ html|*.highlighter-nodeinfobar-pseudo-classes {
margin-bottom: 8px; margin-bottom: 8px;
border-left-color: hsla(210, 19%, 63%, .5); border-left-color: hsla(210, 19%, 63%, .5);
border-bottom-color: hsla(210, 19%, 63%, .5); border-bottom-color: hsla(210, 19%, 63%, .5);
background-image: -moz-linear-gradient(top right, transparent 50%, hsl(210, 24%, 16%) 50%); background-image: linear-gradient(to bottom left, transparent 50%, hsl(210, 24%, 16%) 50%);
} }
.highlighter-nodeinfobar-container[position="top"] > .highlighter-nodeinfobar, .highlighter-nodeinfobar-container[position="top"] > .highlighter-nodeinfobar,
@ -2290,6 +2289,14 @@ html|*#gcli-output-frame {
/* Developer Toolbar */ /* Developer Toolbar */
#developer-toolbar-toolbox-button {
min-width: 18px;
}
#developer-toolbar-toolbox-button > .toolbarbutton-text {
display: none;
}
.developer-toolbar-button { .developer-toolbar-button {
-moz-appearance: none; -moz-appearance: none;
min-width: 78px; min-width: 78px;
@ -2332,7 +2339,7 @@ html|*#gcli-output-frame {
color: #FDF3DE; color: #FDF3DE;
min-width: 16px; min-width: 16px;
text-shadow: none; text-shadow: none;
background-image: -moz-linear-gradient(top, #B4211B, #8A1915); background-image: linear-gradient(#B4211B, #8A1915);
border-radius: 1px; border-radius: 1px;
-moz-margin-end: 2px; -moz-margin-end: 2px;
} }

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

@ -72,7 +72,7 @@
} }
#command-button-responsive { #command-button-responsive {
list-style-image: url(chrome://browser/skin/devtools/command-responsivemode.png); list-style-image: url("chrome://browser/skin/devtools/command-responsivemode.png");
-moz-image-region: rect(0px, 16px, 16px, 0px); -moz-image-region: rect(0px, 16px, 16px, 0px);
} }
#command-button-responsive:hover { #command-button-responsive:hover {
@ -86,7 +86,7 @@
} }
#command-button-tilt { #command-button-tilt {
list-style-image: url(chrome://browser/skin/devtools/command-tilt.png); list-style-image: url("chrome://browser/skin/devtools/command-tilt.png");
-moz-image-region: rect(0px, 16px, 16px, 0px); -moz-image-region: rect(0px, 16px, 16px, 0px);
} }
#command-button-tilt:hover { #command-button-tilt:hover {
@ -102,7 +102,7 @@
} }
#command-button-scratchpad { #command-button-scratchpad {
list-style-image: url(chrome://browser/skin/devtools/command-scratchpad.png); list-style-image: url("chrome://browser/skin/devtools/command-scratchpad.png");
-moz-image-region: rect(0px, 16px, 16px, 0px); -moz-image-region: rect(0px, 16px, 16px, 0px);
} }
@ -119,7 +119,7 @@
.devtools-tabbar { .devtools-tabbar {
-moz-appearance: none; -moz-appearance: none;
background-image: url(background-noise-toolbar.png), background-image: url("background-noise-toolbar.png"),
linear-gradient(#303840, #2d3640); linear-gradient(#303840, #2d3640);
border-top: 1px solid #060a0d; border-top: 1px solid #060a0d;
box-shadow: 0 1px 0 hsla(204,45%,98%,.05) inset, box-shadow: 0 1px 0 hsla(204,45%,98%,.05) inset,
@ -173,7 +173,7 @@
background-image: linear-gradient(hsla(204,45%,98%,.05), hsla(204,45%,98%,.1)), background-image: linear-gradient(hsla(204,45%,98%,.05), hsla(204,45%,98%,.1)),
linear-gradient(hsla(204,45%,98%,.05), hsla(204,45%,98%,.1)), linear-gradient(hsla(204,45%,98%,.05), hsla(204,45%,98%,.1)),
linear-gradient(hsla(206,37%,4%,.1), hsla(206,37%,4%,.2)); linear-gradient(hsla(206,37%,4%,.1), hsla(206,37%,4%,.2));
background size: 1px 100%, background-size: 1px 100%,
1px 100%, 1px 100%,
100%; 100%;
background-repeat: no-repeat, background-repeat: no-repeat,
@ -189,8 +189,8 @@
.devtools-tab[selected=true] { .devtools-tab[selected=true] {
color: #f5f7fa; color: #f5f7fa;
background-image: radial-gradient(ellipse farthest-corner at center top, #9fdfff, hsla(200,100%,70%,.3)), background-image: radial-gradient(farthest-corner at center top, #9fdfff, hsla(200,100%,70%,.3)),
radial-gradient(ellipse farthest-side at center top, hsla(200,100%,70%,.4), hsla(200,100%,70%,0)), radial-gradient(farthest-side at center top, hsla(200,100%,70%,.4), hsla(200,100%,70%,0)),
linear-gradient(hsla(204,45%,98%,.05), hsla(204,45%,98%,.1)), linear-gradient(hsla(204,45%,98%,.05), hsla(204,45%,98%,.1)),
linear-gradient(hsla(204,45%,98%,.02), hsla(204,45%,98%,.04)), linear-gradient(hsla(204,45%,98%,.02), hsla(204,45%,98%,.04)),
linear-gradient(hsla(206,37%,4%,.2), hsla(206,37%,4%,.3)); linear-gradient(hsla(206,37%,4%,.2), hsla(206,37%,4%,.3));

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

До

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

После

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

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

До

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

После

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

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

@ -77,7 +77,7 @@ toolbar[mode="full"] toolbarseparator {
padding-top: 4px !important; padding-top: 4px !important;
border-bottom: 1px solid rgba(0, 0, 0, 0.57); border-bottom: 1px solid rgba(0, 0, 0, 0.57);
background-color: -moz-mac-chrome-active; background-color: -moz-mac-chrome-active;
background-image: -moz-linear-gradient(rgba(255,255,255,.43), rgba(255,255,255,0)) !important; /* override lwtheme style */ background-image: linear-gradient(rgba(255,255,255,.43), rgba(255,255,255,0)) !important; /* override lwtheme style */
background-origin: border-box !important; background-origin: border-box !important;
} }
@ -371,7 +371,7 @@ toolbarbutton.bookmark-item > menupopup {
padding: 0 3px; padding: 0 3px;
border: 1px solid rgba(0, 0, 0, 0.4); border: 1px solid rgba(0, 0, 0, 0.4);
border-radius: @toolbarbuttonCornerRadius@; border-radius: @toolbarbuttonCornerRadius@;
background: -moz-linear-gradient(rgba(255,255,255,0.5), rgba(255,255,255,0.2) 50%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.2)) repeat-x; background: linear-gradient(rgba(255,255,255,0.5), rgba(255,255,255,0.2) 50%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.2)) repeat-x;
background-origin: border-box; background-origin: border-box;
box-shadow: inset 0 1px rgba(255,255,255,0.3), 0 1px rgba(255,255,255,0.2); box-shadow: inset 0 1px rgba(255,255,255,0.3), 0 1px rgba(255,255,255,0.2);
} }
@ -380,7 +380,7 @@ toolbarbutton.bookmark-item > menupopup {
.toolbarbutton-1 > .toolbarbutton-menubutton-button:-moz-lwtheme-darktext, .toolbarbutton-1 > .toolbarbutton-menubutton-button:-moz-lwtheme-darktext,
.toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker:-moz-lwtheme-darktext, .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker:-moz-lwtheme-darktext,
#restore-button:-moz-lwtheme-darktext { #restore-button:-moz-lwtheme-darktext {
background-image: -moz-linear-gradient(rgba(255,255,255,0.3), rgba(50,50,50,0.2) 50%, rgba(0,0,0,0.2) 50%, rgba(0,0,0,0.13)); background-image: linear-gradient(rgba(255,255,255,0.3), rgba(50,50,50,0.2) 50%, rgba(0,0,0,0.2) 50%, rgba(0,0,0,0.13));
} }
.toolbarbutton-1[type="menu-button"] { .toolbarbutton-1[type="menu-button"] {
@ -650,7 +650,7 @@ toolbar[mode="icons"] #forward-button {
@conditionalForwardWithUrlbar@ > #forward-button:not(:-moz-lwtheme) { @conditionalForwardWithUrlbar@ > #forward-button:not(:-moz-lwtheme) {
-moz-appearance: none; -moz-appearance: none;
-moz-padding-start: 2px; -moz-padding-start: 2px;
background: -moz-linear-gradient(hsl(0,0%,99%), hsl(0,0%,67%)) padding-box; background: linear-gradient(hsl(0,0%,99%), hsl(0,0%,67%)) padding-box;
border: 1px solid; border: 1px solid;
border-color: hsl(0,0%,31%) hsla(0,0%,29%,.6) hsl(0,0%,27%); border-color: hsl(0,0%,31%) hsla(0,0%,29%,.6) hsl(0,0%,27%);
box-shadow: inset 0 1px 0 hsla(0,0%,100%,.35), box-shadow: inset 0 1px 0 hsla(0,0%,100%,.35),
@ -672,7 +672,7 @@ toolbar[mode="icons"] #forward-button {
} }
@conditionalForwardWithUrlbar@ > #forward-button:hover:active:not(:-moz-lwtheme) { @conditionalForwardWithUrlbar@ > #forward-button:hover:active:not(:-moz-lwtheme) {
background-image: -moz-linear-gradient(hsl(0,0%,74%), hsl(0,0%,61%)); background-image: linear-gradient(hsl(0,0%,74%), hsl(0,0%,61%));
box-shadow: inset rgba(0,0,0,.3) 0 -6px 10px, box-shadow: inset rgba(0,0,0,.3) 0 -6px 10px,
inset #000 0 1px 3px, inset #000 0 1px 3px,
inset rgba(0,0,0,.2) 0 1px 3px, inset rgba(0,0,0,.2) 0 1px 3px,
@ -681,7 +681,7 @@ toolbar[mode="icons"] #forward-button {
@conditionalForwardWithUrlbar@ > #forward-button:-moz-window-inactive:not(:-moz-lwtheme) { @conditionalForwardWithUrlbar@ > #forward-button:-moz-window-inactive:not(:-moz-lwtheme) {
border-color: hsl(0,0%,64%) hsl(0,0%,65%) hsl(0,0%,66%); border-color: hsl(0,0%,64%) hsl(0,0%,65%) hsl(0,0%,66%);
background-image: -moz-linear-gradient(hsl(0,0%,99%), hsl(0,0%,82%)); background-image: linear-gradient(hsl(0,0%,99%), hsl(0,0%,82%));
box-shadow: inset 0 1px 0 hsla(0,0%,100%,.35); box-shadow: inset 0 1px 0 hsla(0,0%,100%,.35);
} }
@ -691,7 +691,7 @@ toolbar[mode="icons"] #forward-button {
@media (-moz-mac-lion-theme) { @media (-moz-mac-lion-theme) {
@conditionalForwardWithUrlbar@ > #forward-button:not(:-moz-lwtheme) { @conditionalForwardWithUrlbar@ > #forward-button:not(:-moz-lwtheme) {
background-image: -moz-linear-gradient(hsla(0,0%,100%,.73), hsla(0,0%,100%,.05) 85%); background-image: linear-gradient(hsla(0,0%,100%,.73), hsla(0,0%,100%,.05) 85%);
border-color: hsla(0,0%,0%,.35) hsla(0,0%,0%,.25) hsla(0,0%,0%,.2); border-color: hsla(0,0%,0%,.35) hsla(0,0%,0%,.25) hsla(0,0%,0%,.2);
box-shadow: inset 0 1px 0 hsla(0,0%,100%,.2), box-shadow: inset 0 1px 0 hsla(0,0%,100%,.2),
inset 0 0 1px hsla(0,0%,100%,.1), inset 0 0 1px hsla(0,0%,100%,.1),
@ -699,7 +699,7 @@ toolbar[mode="icons"] #forward-button {
} }
@conditionalForwardWithUrlbar@ > #forward-button:hover:active:not(:-moz-lwtheme) { @conditionalForwardWithUrlbar@ > #forward-button:hover:active:not(:-moz-lwtheme) {
background-image: -moz-linear-gradient(hsla(0,0%,60%,.37), hsla(0,0%,100%,.35) 95%); background-image: linear-gradient(hsla(0,0%,60%,.37), hsla(0,0%,100%,.35) 95%);
border-color: hsla(0,0%,0%,.43) hsla(0,0%,0%,.25) hsla(0,0%,0%,.37); border-color: hsla(0,0%,0%,.43) hsla(0,0%,0%,.25) hsla(0,0%,0%,.37);
box-shadow: inset 0 1px 0 hsla(0,0%,0%,.02), box-shadow: inset 0 1px 0 hsla(0,0%,0%,.02),
inset 0 1px 2px hsla(0,0%,0%,.2), inset 0 1px 2px hsla(0,0%,0%,.2),
@ -1126,7 +1126,7 @@ toolbar[mode="icons"] #zoom-in-button {
@media (-moz-mac-lion-theme) { @media (-moz-mac-lion-theme) {
#urlbar, #urlbar,
.searchbar-textbox { .searchbar-textbox {
background-image: -moz-linear-gradient(hsl(0,0%,97%), hsl(0,0%,100%)); background-image: linear-gradient(hsl(0,0%,97%), hsl(0,0%,100%));
border-color: hsla(0,0%,0%,.35) hsla(0,0%,0%,.25) hsla(0,0%,0%,.15); border-color: hsla(0,0%,0%,.35) hsla(0,0%,0%,.25) hsla(0,0%,0%,.15);
box-shadow: 0 1px 0 hsla(0,0%,100%,.2), box-shadow: 0 1px 0 hsla(0,0%,100%,.2),
inset 0 0 1px hsla(0,0%,0%,.05), inset 0 0 1px hsla(0,0%,0%,.05),
@ -1257,10 +1257,10 @@ toolbar[mode="icons"] #zoom-in-button {
#urlbar[pageproxystate="valid"] > #identity-box.verifiedIdentity { #urlbar[pageproxystate="valid"] > #identity-box.verifiedIdentity {
color: hsl(92,100%,30%); color: hsl(92,100%,30%);
-moz-padding-end: 4px; -moz-padding-end: 4px;
background-image: -moz-linear-gradient(hsla(92,81%,16%,0), background-image: linear-gradient(hsla(92,81%,16%,0),
hsla(92,81%,16%,.2) 25%, hsla(92,81%,16%,.2) 25%,
hsla(92,81%,16%,.2) 75%, hsla(92,81%,16%,.2) 75%,
hsla(92,81%,16%,0)); hsla(92,81%,16%,0));
background-position: right; background-position: right;
background-size: 1px; background-size: 1px;
background-repeat: no-repeat; background-repeat: no-repeat;
@ -1296,7 +1296,7 @@ toolbar[mode="icons"] #zoom-in-button {
.urlbar-history-dropmarker[open="true"], .urlbar-history-dropmarker[open="true"],
.urlbar-history-dropmarker:hover:active { .urlbar-history-dropmarker:hover:active {
-moz-image-region: rect(0px, 22px, 14px, 11px); -moz-image-region: rect(0px, 22px, 14px, 11px);
background-image: -moz-radial-gradient(center, circle closest-side, hsla(205,100%,70%,.3), hsla(205,100%,70%,0)); background-image: radial-gradient(circle closest-side, hsla(205,100%,70%,.3), hsla(205,100%,70%,0));
} }
@media (min-resolution: 2dppx) { @media (min-resolution: 2dppx) {
@ -1325,7 +1325,7 @@ toolbar[mode="icons"] #zoom-in-button {
.urlbar-icon[open="true"], .urlbar-icon[open="true"],
.urlbar-icon:hover:active { .urlbar-icon:hover:active {
background-image: -moz-radial-gradient(center, circle closest-side, hsla(205,100%,70%,.3), hsla(205,100%,70%,0)); background-image: radial-gradient(circle closest-side, hsla(205,100%,70%,.3), hsla(205,100%,70%,0));
} }
#urlbar-search-splitter { #urlbar-search-splitter {
@ -1531,7 +1531,7 @@ window[tabsontop="false"] richlistitem[type~="action"][actiontype="switchtab"][s
} }
#urlbar > toolbarbutton:not([disabled]):hover:active { #urlbar > toolbarbutton:not([disabled]):hover:active {
background-image: -moz-radial-gradient(center, circle closest-side, hsla(205,100%,70%,.3), hsla(205,100%,70%,0)); background-image: radial-gradient(circle closest-side, hsla(205,100%,70%,.3), hsla(205,100%,70%,0));
} }
#go-button { #go-button {
@ -2271,27 +2271,27 @@ toolbarbutton.chevron > .toolbarbutton-menu-dropmarker {
.tab-background-start[pinned][titlechanged]:not([selected="true"]), .tab-background-start[pinned][titlechanged]:not([selected="true"]),
.tab-background-end[pinned][titlechanged]:not([selected="true"]) { .tab-background-end[pinned][titlechanged]:not([selected="true"]) {
background-image: -moz-linear-gradient(rgba(148,205,253,.2), rgba(148,205,253,.2)) !important; background-image: linear-gradient(rgba(148,205,253,.2), rgba(148,205,253,.2)) !important;
} }
@TABSONBOTTOM_TAB_STACK@ > .tab-background > .tab-background-middle[pinned][titlechanged]:not([selected="true"]) { @TABSONBOTTOM_TAB_STACK@ > .tab-background > .tab-background-middle[pinned][titlechanged]:not([selected="true"]) {
background-image: -moz-radial-gradient(center 99%, circle cover, rgba(254,254,255,1) 3%, rgba(210,235,255,.9) 12%, rgba(148,205,253,.6) 30%, rgba(148,205,253,.2) 70%); background-image: radial-gradient(circle farthest-corner at 50% 99%, rgba(254,254,255,1) 3%, rgba(210,235,255,.9) 12%, rgba(148,205,253,.6) 30%, rgba(148,205,253,.2) 70%);
} }
@TABSONTOP_TAB_STACK@ > .tab-background > .tab-background-middle[pinned][titlechanged]:not([selected="true"]) { @TABSONTOP_TAB_STACK@ > .tab-background > .tab-background-middle[pinned][titlechanged]:not([selected="true"]) {
background-image: -moz-radial-gradient(center 2px, circle cover, rgba(254,254,255,1) 3%, rgba(210,235,255,.9) 12%, rgba(148,205,253,.6) 30%, rgba(148,205,253,.2) 70%); background-image: radial-gradient(circle farthest-corner at 50% 2px, rgba(254,254,255,1) 3%, rgba(210,235,255,.9) 12%, rgba(148,205,253,.6) 30%, rgba(148,205,253,.2) 70%);
} }
.tabbrowser-tab > .tab-stack > .tab-background > .tab-background-start:-moz-lwtheme-brighttext:not([selected="true"]), .tabbrowser-tab > .tab-stack > .tab-background > .tab-background-start:-moz-lwtheme-brighttext:not([selected="true"]),
.tabbrowser-tab > .tab-stack > .tab-background > .tab-background-middle:-moz-lwtheme-brighttext:not([selected="true"]), .tabbrowser-tab > .tab-stack > .tab-background > .tab-background-middle:-moz-lwtheme-brighttext:not([selected="true"]),
.tabbrowser-tab > .tab-stack > .tab-background > .tab-background-end:-moz-lwtheme-brighttext:not([selected="true"]) { .tabbrowser-tab > .tab-stack > .tab-background > .tab-background-end:-moz-lwtheme-brighttext:not([selected="true"]) {
background-image: -moz-linear-gradient(hsla(0,0%,40%,.6), hsla(0,0%,30%,.6) 50%); background-image: linear-gradient(hsla(0,0%,40%,.6), hsla(0,0%,30%,.6) 50%);
} }
.tabbrowser-tab > .tab-stack > .tab-background > .tab-background-start:-moz-lwtheme-darktext:not([selected="true"]), .tabbrowser-tab > .tab-stack > .tab-background > .tab-background-start:-moz-lwtheme-darktext:not([selected="true"]),
.tabbrowser-tab > .tab-stack > .tab-background > .tab-background-middle:-moz-lwtheme-darktext:not([selected="true"]), .tabbrowser-tab > .tab-stack > .tab-background > .tab-background-middle:-moz-lwtheme-darktext:not([selected="true"]),
.tabbrowser-tab > .tab-stack > .tab-background > .tab-background-end:-moz-lwtheme-darktext:not([selected="true"]) { .tabbrowser-tab > .tab-stack > .tab-background > .tab-background-end:-moz-lwtheme-darktext:not([selected="true"]) {
background-image: -moz-linear-gradient(hsla(0,0%,60%,.5), hsla(0,0%,45%,.5) 50%); background-image: linear-gradient(hsla(0,0%,60%,.5), hsla(0,0%,45%,.5) 50%);
} }
@TABSONTOP_TAB_STACK@ > .tab-content, @TABSONTOP_TAB_STACK@ > .tab-content,
@ -2423,12 +2423,12 @@ toolbarbutton.chevron > .toolbarbutton-menu-dropmarker {
#TabsToolbar[tabsontop="true"]:not(:-moz-lwtheme) { #TabsToolbar[tabsontop="true"]:not(:-moz-lwtheme) {
padding-bottom: 2px; padding-bottom: 2px;
background: url(chrome://browser/skin/tabbrowser/tabbar-top-bg-active.png), background: url(chrome://browser/skin/tabbrowser/tabbar-top-bg-active.png),
-moz-linear-gradient(bottom, -moz-mac-chrome-active 2px, transparent 2px); linear-gradient(to top, -moz-mac-chrome-active 2px, transparent 2px);
} }
#TabsToolbar[tabsontop="true"]:not(:-moz-lwtheme):-moz-window-inactive { #TabsToolbar[tabsontop="true"]:not(:-moz-lwtheme):-moz-window-inactive {
background: url(chrome://browser/skin/tabbrowser/tabbar-top-bg-inactive.png), background: url(chrome://browser/skin/tabbrowser/tabbar-top-bg-inactive.png),
-moz-linear-gradient(bottom, -moz-mac-chrome-inactive 2px, transparent 2px); linear-gradient(to top, -moz-mac-chrome-inactive 2px, transparent 2px);
} }
/* In tabs-on-bottom mode, fill the whole toolbar with the chrome /* In tabs-on-bottom mode, fill the whole toolbar with the chrome
@ -2668,7 +2668,7 @@ toolbarbutton.chevron > .toolbarbutton-menu-dropmarker {
:-moz-any(#TabsToolbar, #addon-bar) .toolbarbutton-1:not([type="menu-button"]):not([disabled]):not([open]):hover, :-moz-any(#TabsToolbar, #addon-bar) .toolbarbutton-1:not([type="menu-button"]):not([disabled]):not([open]):hover,
:-moz-any(#TabsToolbar, #addon-bar) .toolbarbutton-1 > .toolbarbutton-menubutton-button:not([disabled]):hover, :-moz-any(#TabsToolbar, #addon-bar) .toolbarbutton-1 > .toolbarbutton-menubutton-button:not([disabled]):hover,
:-moz-any(#TabsToolbar, #addon-bar) .toolbarbutton-1:not([disabled]):not([buttonover]):hover > .toolbarbutton-menubutton-dropmarker { :-moz-any(#TabsToolbar, #addon-bar) .toolbarbutton-1:not([disabled]):not([buttonover]):hover > .toolbarbutton-menubutton-dropmarker {
background-image: -moz-linear-gradient(transparent, rgba(0,0,0,.15)) !important; background-image: linear-gradient(transparent, rgba(0,0,0,.15)) !important;
} }
.tabbrowser-arrowscrollbox > .scrollbutton-up:not([disabled]):hover:active, .tabbrowser-arrowscrollbox > .scrollbutton-up:not([disabled]):hover:active,
@ -2677,7 +2677,7 @@ toolbarbutton.chevron > .toolbarbutton-menu-dropmarker {
:-moz-any(#TabsToolbar, #addon-bar) .toolbarbutton-1[type="menu"][open], :-moz-any(#TabsToolbar, #addon-bar) .toolbarbutton-1[type="menu"][open],
:-moz-any(#TabsToolbar, #addon-bar) .toolbarbutton-1 > .toolbarbutton-menubutton-button:not([disabled]):hover:active, :-moz-any(#TabsToolbar, #addon-bar) .toolbarbutton-1 > .toolbarbutton-menubutton-button:not([disabled]):hover:active,
:-moz-any(#TabsToolbar, #addon-bar) .toolbarbutton-1[open]:not([disabled]):hover > .toolbarbutton-menubutton-dropmarker { :-moz-any(#TabsToolbar, #addon-bar) .toolbarbutton-1[open]:not([disabled]):hover > .toolbarbutton-menubutton-dropmarker {
background-image: -moz-linear-gradient(transparent, rgba(0,0,0,.3)) !important; background-image: linear-gradient(transparent, rgba(0,0,0,.3)) !important;
} }
.tabs-newtab-button, .tabs-newtab-button,
@ -3347,9 +3347,9 @@ toolbarbutton.chevron > .toolbarbutton-menu-dropmarker {
#addon-bar[customizing] > #status-bar { #addon-bar[customizing] > #status-bar {
opacity: .5; opacity: .5;
background-image: -moz-repeating-linear-gradient(-45deg, background-image: repeating-linear-gradient(135deg,
rgba(255,255,255,.3), rgba(255,255,255,.3) 5px, rgba(255,255,255,.3), rgba(255,255,255,.3) 5px,
rgba(0,0,0,.3) 5px, rgba(0,0,0,.3) 10px); rgba(0,0,0,.3) 5px, rgba(0,0,0,.3) 10px);
} }
#status-bar > statusbarpanel { #status-bar > statusbarpanel {
@ -3397,7 +3397,7 @@ toolbarbutton.chevron > .toolbarbutton-menu-dropmarker {
.statuspanel-label { .statuspanel-label {
margin: 0; margin: 0;
padding: 2px 4px; padding: 2px 4px;
background: -moz-linear-gradient(white, #ddd); background: linear-gradient(#fff, #ddd);
border: 1px none #ccc; border: 1px none #ccc;
border-top-style: solid; border-top-style: solid;
color: #333; color: #333;
@ -3470,7 +3470,7 @@ toolbarbutton.chevron > .toolbarbutton-menu-dropmarker {
color: hsl(200, 100%, 65%); color: hsl(200, 100%, 65%);
border: 1px solid hsla(210, 19%, 63%, .5); border: 1px solid hsla(210, 19%, 63%, .5);
border-radius: 3px; border-radius: 3px;
background: -moz-linear-gradient(hsl(209, 18%, 30%), hsl(210, 24%, 16%)) no-repeat padding-box; background: linear-gradient(hsl(209, 18%, 30%), hsl(210, 24%, 16%)) no-repeat padding-box;
} }
/* Highlighter - Node Infobar - text */ /* Highlighter - Node Infobar - text */
@ -3555,7 +3555,7 @@ html|*.highlighter-nodeinfobar-pseudo-classes {
margin-top: 8px; margin-top: 8px;
border-right-color: hsla(210, 19%, 63%, .5); border-right-color: hsla(210, 19%, 63%, .5);
border-top-color: hsla(210, 19%, 63%, .5); border-top-color: hsla(210, 19%, 63%, .5);
background-image: -moz-linear-gradient(bottom left, transparent 50%, hsl(209, 18%, 30%) 50%); background-image: linear-gradient(to top right, transparent 50%, hsl(209, 18%, 30%) 50%);
} }
.highlighter-nodeinfobar-arrow-bottom { .highlighter-nodeinfobar-arrow-bottom {
@ -3563,7 +3563,7 @@ html|*.highlighter-nodeinfobar-pseudo-classes {
margin-bottom: 8px; margin-bottom: 8px;
border-left-color: hsla(210, 19%, 63%, .5); border-left-color: hsla(210, 19%, 63%, .5);
border-bottom-color: hsla(210, 19%, 63%, .5); border-bottom-color: hsla(210, 19%, 63%, .5);
background-image: -moz-linear-gradient(top right, transparent 50%, hsl(210, 24%, 16%) 50%); background-image: linear-gradient(to bottom left, transparent 50%, hsl(210, 24%, 16%) 50%);
} }
.highlighter-nodeinfobar-container[position="top"] > .highlighter-nodeinfobar, .highlighter-nodeinfobar-container[position="top"] > .highlighter-nodeinfobar,
@ -3752,6 +3752,14 @@ html|*#gcli-output-frame {
/* Developer Toolbar */ /* Developer Toolbar */
#developer-toolbar-toolbox-button {
min-width: 18px;
}
#developer-toolbar-toolbox-button > .toolbarbutton-text {
display: none;
}
.developer-toolbar-button { .developer-toolbar-button {
-moz-appearance: none; -moz-appearance: none;
min-width: 78px; min-width: 78px;
@ -3789,7 +3797,7 @@ html|*#gcli-output-frame {
color: #FDF3DE; color: #FDF3DE;
min-width: 16px; min-width: 16px;
text-shadow: none; text-shadow: none;
background-image: -moz-linear-gradient(top, #B4211B, #8A1915); background-image: linear-gradient(#B4211B, #8A1915);
border-radius: 1px; border-radius: 1px;
} }

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

@ -59,7 +59,7 @@
} }
#command-button-responsive { #command-button-responsive {
list-style-image: url(chrome://browser/skin/devtools/command-responsivemode.png); list-style-image: url("chrome://browser/skin/devtools/command-responsivemode.png");
-moz-image-region: rect(0px, 16px, 16px, 0px); -moz-image-region: rect(0px, 16px, 16px, 0px);
} }
#command-button-responsive:hover { #command-button-responsive:hover {
@ -73,7 +73,7 @@
} }
#command-button-tilt { #command-button-tilt {
list-style-image: url(chrome://browser/skin/devtools/command-tilt.png); list-style-image: url("chrome://browser/skin/devtools/command-tilt.png");
-moz-image-region: rect(0px, 16px, 16px, 0px); -moz-image-region: rect(0px, 16px, 16px, 0px);
} }
#command-button-tilt:hover { #command-button-tilt:hover {
@ -89,7 +89,7 @@
} }
#command-button-scratchpad { #command-button-scratchpad {
list-style-image: url(chrome://browser/skin/devtools/command-scratchpad.png); list-style-image: url("chrome://browser/skin/devtools/command-scratchpad.png");
-moz-image-region: rect(0px, 16px, 16px, 0px); -moz-image-region: rect(0px, 16px, 16px, 0px);
} }
@ -106,7 +106,7 @@
.devtools-tabbar { .devtools-tabbar {
-moz-appearance: none; -moz-appearance: none;
background-image: url(background-noise-toolbar.png), background-image: url("background-noise-toolbar.png"),
linear-gradient(#303840, #2d3640); linear-gradient(#303840, #2d3640);
border-top: 1px solid #060a0d; border-top: 1px solid #060a0d;
box-shadow: 0 1px 0 hsla(204,45%,98%,.05) inset, box-shadow: 0 1px 0 hsla(204,45%,98%,.05) inset,
@ -157,7 +157,7 @@
background-image: linear-gradient(hsla(204,45%,98%,.05), hsla(204,45%,98%,.1)), background-image: linear-gradient(hsla(204,45%,98%,.05), hsla(204,45%,98%,.1)),
linear-gradient(hsla(204,45%,98%,.05), hsla(204,45%,98%,.1)), linear-gradient(hsla(204,45%,98%,.05), hsla(204,45%,98%,.1)),
linear-gradient(hsla(206,37%,4%,.1), hsla(206,37%,4%,.2)); linear-gradient(hsla(206,37%,4%,.1), hsla(206,37%,4%,.2));
background size: 1px 100%, background-size: 1px 100%,
1px 100%, 1px 100%,
100%; 100%;
background-repeat: no-repeat, background-repeat: no-repeat,
@ -173,8 +173,8 @@
.devtools-tab[selected=true] { .devtools-tab[selected=true] {
color: #f5f7fa; color: #f5f7fa;
background-image: radial-gradient(ellipse farthest-corner at center top, #9fdfff, hsla(200,100%,70%,.3)), background-image: radial-gradient(farthest-corner at center top, #9fdfff, hsla(200,100%,70%,.3)),
radial-gradient(ellipse farthest-side at center top, hsla(200,100%,70%,.4), hsla(200,100%,70%,0)), radial-gradient(farthest-side at center top, hsla(200,100%,70%,.4), hsla(200,100%,70%,0)),
linear-gradient(hsla(204,45%,98%,.05), hsla(204,45%,98%,.1)), linear-gradient(hsla(204,45%,98%,.05), hsla(204,45%,98%,.1)),
linear-gradient(hsla(204,45%,98%,.02), hsla(204,45%,98%,.04)), linear-gradient(hsla(204,45%,98%,.02), hsla(204,45%,98%,.04)),
linear-gradient(hsla(206,37%,4%,.2), hsla(206,37%,4%,.3)); linear-gradient(hsla(206,37%,4%,.2), hsla(206,37%,4%,.3));

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

@ -4,3 +4,13 @@
@import url("chrome://global/skin/inContentUI.css"); @import url("chrome://global/skin/inContentUI.css");
.downloadButton {
box-shadow: none;
}
.downloadButton:not([disabled="true"]):hover:active,
.downloadButton:not([disabled]):hover:active {
background: transparent;
border: none;
box-shadow: none;
}

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

До

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

После

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

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

До

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

После

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

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

До

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

После

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

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

@ -50,24 +50,24 @@
.tabbrowser-tab:not(:-moz-lwtheme), .tabbrowser-tab:not(:-moz-lwtheme),
.tabs-newtab-button:not(:-moz-lwtheme) { .tabs-newtab-button:not(:-moz-lwtheme) {
background-image: @toolbarShadowOnTab@, @bgTabTexture@, background-image: @toolbarShadowOnTab@, @bgTabTexture@,
-moz-linear-gradient(@customToolbarColor@, @customToolbarColor@); linear-gradient(@customToolbarColor@, @customToolbarColor@);
} }
.tabbrowser-tab:not(:-moz-lwtheme):hover, .tabbrowser-tab:not(:-moz-lwtheme):hover,
.tabs-newtab-button:not(:-moz-lwtheme):hover { .tabs-newtab-button:not(:-moz-lwtheme):hover {
background-image: @toolbarShadowOnTab@, @bgTabTextureHover@, background-image: @toolbarShadowOnTab@, @bgTabTextureHover@,
-moz-linear-gradient(@customToolbarColor@, @customToolbarColor@); linear-gradient(@customToolbarColor@, @customToolbarColor@);
} }
.tabbrowser-tab[selected="true"]:not(:-moz-lwtheme) { .tabbrowser-tab[selected="true"]:not(:-moz-lwtheme) {
background-image: -moz-linear-gradient(white, @toolbarHighlight@ 50%), background-image: linear-gradient(#fff, @toolbarHighlight@ 50%),
-moz-linear-gradient(@customToolbarColor@, @customToolbarColor@); linear-gradient(@customToolbarColor@, @customToolbarColor@);
} }
#main-window[tabsontop=false]:not([disablechrome]) .tabbrowser-tab[selected=true]:not(:-moz-lwtheme) { #main-window[tabsontop=false]:not([disablechrome]) .tabbrowser-tab[selected=true]:not(:-moz-lwtheme) {
background-image: @toolbarShadowOnTab@, background-image: @toolbarShadowOnTab@,
-moz-linear-gradient(white, @toolbarHighlight@ 50%), linear-gradient(#fff, @toolbarHighlight@ 50%),
-moz-linear-gradient(@customToolbarColor@, @customToolbarColor@); linear-gradient(@customToolbarColor@, @customToolbarColor@);
} }
#navigator-toolbox:not(:-moz-lwtheme)::after { #navigator-toolbox:not(:-moz-lwtheme)::after {
@ -246,7 +246,7 @@
#navigator-toolbox[tabsontop=false] > #PersonalToolbar:not(:-moz-lwtheme) { #navigator-toolbox[tabsontop=false] > #PersonalToolbar:not(:-moz-lwtheme) {
margin-top: 2px; margin-top: 2px;
border-top: 1px solid @toolbarShadowColor@; border-top: 1px solid @toolbarShadowColor@;
background-image: -moz-linear-gradient(@toolbarHighlight@, rgba(255,255,255,0)); background-image: linear-gradient(@toolbarHighlight@, rgba(255,255,255,0));
} }
#main-window[sizemode=normal] #TabsToolbar[tabsontop=true] { #main-window[sizemode=normal] #TabsToolbar[tabsontop=true] {
@ -263,7 +263,7 @@
#main-window[sizemode=normal][disablechrome] #navigator-toolbox[tabsontop=true]:not(:-moz-lwtheme)::after { #main-window[sizemode=normal][disablechrome] #navigator-toolbox[tabsontop=true]:not(:-moz-lwtheme)::after {
visibility: visible; visibility: visible;
background-color: @customToolbarColor@; background-color: @customToolbarColor@;
background-image: -moz-linear-gradient(@toolbarHighlight@, @toolbarHighlight@); background-image: linear-gradient(@toolbarHighlight@, @toolbarHighlight@);
height: 4px; height: 4px;
} }
@ -331,7 +331,7 @@
#tab-view:-moz-lwtheme { #tab-view:-moz-lwtheme {
background-image: url("chrome://browser/skin/tabview/grain.png"), background-image: url("chrome://browser/skin/tabview/grain.png"),
-moz-linear-gradient(rgba(255,255,255,0), #CCD9EA 200px, #C7D5E7); linear-gradient(rgba(255,255,255,0), #CCD9EA 200px, #C7D5E7);
background-attachment: fixed; background-attachment: fixed;
} }
} }
@ -444,13 +444,13 @@
.splitmenu-menuitem[_moz-menuactive], .splitmenu-menuitem[_moz-menuactive],
.splitmenu-menu[_moz-menuactive] { .splitmenu-menu[_moz-menuactive] {
background-color: transparent; background-color: transparent;
background-image: -moz-linear-gradient(#fafbfd, #ebf3fd); background-image: linear-gradient(#fafbfd, #ebf3fd);
border-color: #aeccf1; border-color: #aeccf1;
} }
.splitmenu-menuitem[disabled][_moz-menuactive], .splitmenu-menuitem[disabled][_moz-menuactive],
.splitmenu-menu[disabled][_moz-menuactive] { .splitmenu-menu[disabled][_moz-menuactive] {
background-image: -moz-linear-gradient(#f8f9f9, #eaeaea); background-image: linear-gradient(#f8f9f9, #eaeaea);
border-color: #d8d7d7; border-color: #d8d7d7;
} }

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше