mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 723281 - Add the ability to enable/disable paint flashing as a [gcli] command. r=jwalker
This commit is contained in:
parent
6ccf7fbf2e
commit
196f09ccb6
@ -1042,7 +1042,7 @@ pref("devtools.toolbox.footer.height", 250);
|
|||||||
pref("devtools.toolbox.sidebar.width", 500);
|
pref("devtools.toolbox.sidebar.width", 500);
|
||||||
pref("devtools.toolbox.host", "bottom");
|
pref("devtools.toolbox.host", "bottom");
|
||||||
pref("devtools.toolbox.selectedTool", "webconsole");
|
pref("devtools.toolbox.selectedTool", "webconsole");
|
||||||
pref("devtools.toolbox.toolbarSpec", '["tilt toggle","scratchpad","resize toggle"]');
|
pref("devtools.toolbox.toolbarSpec", '["paintflashing toggle","tilt toggle","scratchpad","resize toggle"]');
|
||||||
pref("devtools.toolbox.sideEnabled", false);
|
pref("devtools.toolbox.sideEnabled", false);
|
||||||
|
|
||||||
// Enable the Inspector
|
// Enable the Inspector
|
||||||
|
@ -15,6 +15,7 @@ Cu.import("resource:///modules/devtools/gcli.jsm");
|
|||||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
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/osfile.jsm")
|
Cu.import("resource://gre/modules/osfile.jsm")
|
||||||
|
Cu.import("resource:///modules/devtools/EventEmitter.jsm");
|
||||||
|
|
||||||
XPCOMUtils.defineLazyModuleGetter(this, "gDevTools",
|
XPCOMUtils.defineLazyModuleGetter(this, "gDevTools",
|
||||||
"resource:///modules/devtools/gDevTools.jsm");
|
"resource:///modules/devtools/gDevTools.jsm");
|
||||||
@ -2061,3 +2062,112 @@ XPCOMUtils.defineLazyModuleGetter(this, "TargetFactory",
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}(this));
|
}(this));
|
||||||
|
|
||||||
|
/* CmdPaintFlashing ------------------------------------------------------- */
|
||||||
|
|
||||||
|
(function(module) {
|
||||||
|
/**
|
||||||
|
* 'paintflashing' command
|
||||||
|
*/
|
||||||
|
|
||||||
|
gcli.addCommand({
|
||||||
|
name: 'paintflashing',
|
||||||
|
description: gcli.lookup('paintflashingDesc')
|
||||||
|
});
|
||||||
|
|
||||||
|
gcli.addCommand({
|
||||||
|
name: 'paintflashing on',
|
||||||
|
description: gcli.lookup('paintflashingOnDesc'),
|
||||||
|
manual: gcli.lookup('paintflashingManual'),
|
||||||
|
params: [{
|
||||||
|
type: "boolean",
|
||||||
|
name: "chrome",
|
||||||
|
get hidden() gcli.hiddenByChromePref(),
|
||||||
|
description: gcli.lookup("paintflashingChromeDesc"),
|
||||||
|
}],
|
||||||
|
exec: function(args, context) {
|
||||||
|
var window;
|
||||||
|
if (args.chrome) {
|
||||||
|
window = context.environment.chromeDocument.defaultView;
|
||||||
|
} else {
|
||||||
|
window = context.environment.contentDocument.defaultView;
|
||||||
|
}
|
||||||
|
window.QueryInterface(Ci.nsIInterfaceRequestor).
|
||||||
|
getInterface(Ci.nsIDOMWindowUtils).
|
||||||
|
paintFlashing = true;
|
||||||
|
onPaintFlashingChanged(context);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
gcli.addCommand({
|
||||||
|
name: 'paintflashing off',
|
||||||
|
description: gcli.lookup('paintflashingOffDesc'),
|
||||||
|
manual: gcli.lookup('paintflashingManual'),
|
||||||
|
params: [{
|
||||||
|
type: "boolean",
|
||||||
|
name: "chrome",
|
||||||
|
get hidden() gcli.hiddenByChromePref(),
|
||||||
|
description: gcli.lookup("paintflashingChromeDesc"),
|
||||||
|
}],
|
||||||
|
exec: function(args, context) {
|
||||||
|
if (args.chrome) {
|
||||||
|
var window = context.environment.chromeDocument.defaultView;
|
||||||
|
} else {
|
||||||
|
var window = context.environment.contentDocument.defaultView;
|
||||||
|
}
|
||||||
|
window.QueryInterface(Ci.nsIInterfaceRequestor).
|
||||||
|
getInterface(Ci.nsIDOMWindowUtils).
|
||||||
|
paintFlashing = false;
|
||||||
|
onPaintFlashingChanged(context);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
gcli.addCommand({
|
||||||
|
name: 'paintflashing toggle',
|
||||||
|
hidden: true,
|
||||||
|
buttonId: "command-button-paintflashing",
|
||||||
|
buttonClass: "command-button",
|
||||||
|
state: {
|
||||||
|
isChecked: function(aTarget) {
|
||||||
|
if (aTarget.isLocalTab) {
|
||||||
|
let window = aTarget.tab.linkedBrowser.contentWindow;
|
||||||
|
let wUtils = window.QueryInterface(Ci.nsIInterfaceRequestor).
|
||||||
|
getInterface(Ci.nsIDOMWindowUtils);
|
||||||
|
return wUtils.paintFlashing;
|
||||||
|
} else {
|
||||||
|
throw new Error("Unsupported target");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onChange: function(aTarget, aChangeHandler) {
|
||||||
|
eventEmitter.on("changed", aChangeHandler);
|
||||||
|
},
|
||||||
|
offChange: function(aTarget, aChangeHandler) {
|
||||||
|
eventEmitter.off("changed", aChangeHandler);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
tooltipText: gcli.lookup("paintflashingTooltip"),
|
||||||
|
description: gcli.lookup('paintflashingOnDesc'),
|
||||||
|
manual: gcli.lookup('paintflashingManual'),
|
||||||
|
exec: function(args, context) {
|
||||||
|
var gBrowser = context.environment.chromeDocument.defaultView.gBrowser;
|
||||||
|
var window = gBrowser.contentWindow;
|
||||||
|
var wUtils = window.QueryInterface(Ci.nsIInterfaceRequestor).
|
||||||
|
getInterface(Ci.nsIDOMWindowUtils);
|
||||||
|
wUtils.paintFlashing = !wUtils.paintFlashing;
|
||||||
|
onPaintFlashingChanged(context);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
let eventEmitter = new EventEmitter();
|
||||||
|
function onPaintFlashingChanged(context) {
|
||||||
|
var gBrowser = context.environment.chromeDocument.defaultView.gBrowser;
|
||||||
|
var tab = gBrowser.selectedTab;
|
||||||
|
eventEmitter.emit("changed", tab);
|
||||||
|
function fireChange() {
|
||||||
|
eventEmitter.emit("changed", tab);
|
||||||
|
}
|
||||||
|
var target = TargetFactory.forTab(tab);
|
||||||
|
target.off("navigate", fireChange);
|
||||||
|
target.once("navigate", fireChange);
|
||||||
|
}
|
||||||
|
}(this));
|
||||||
|
@ -1006,3 +1006,27 @@ callLogChromeEvalNeedsObject=The JavaScript source must evaluate to an object wh
|
|||||||
# LOCALIZATION NOTE (scratchpadOpenTooltip) A string displayed as the
|
# LOCALIZATION NOTE (scratchpadOpenTooltip) A string displayed as the
|
||||||
# tooltip of button in devtools toolbox which opens Scratchpad.
|
# tooltip of button in devtools toolbox which opens Scratchpad.
|
||||||
scratchpadOpenTooltip=Scratchpad
|
scratchpadOpenTooltip=Scratchpad
|
||||||
|
|
||||||
|
# LOCALIZATION NOTE (paintflashingDesc) A very short string used to describe the
|
||||||
|
# function of the "paintflashing" command
|
||||||
|
paintflashingDesc=Highlight painted area
|
||||||
|
|
||||||
|
# LOCALIZATION NOTE (paintflashingOnDesc) A very short string used to describe the
|
||||||
|
# function of the "paintflashing on" command.
|
||||||
|
paintflashingOnDesc=Turn on paint flashing
|
||||||
|
|
||||||
|
# LOCALIZATION NOTE (paintflashingOffDesc) A very short string used to describe the
|
||||||
|
# function of the "paintflashing off" command.
|
||||||
|
paintflashingOffDesc=Turn off paint flashing
|
||||||
|
|
||||||
|
# LOCALIZATION NOTE (paintflashingChrome) A very short string used to describe the
|
||||||
|
# function of the "paintflashing on/off chrome" command.
|
||||||
|
paintflashingChromeDesc=chrome frames
|
||||||
|
|
||||||
|
# LOCALIZATION NOTE (paintflashingManual) A longer description describing the
|
||||||
|
# set of commands that control paint flashing.
|
||||||
|
paintflashingManual=Draw repainted areas in different colors
|
||||||
|
|
||||||
|
# LOCALIZATION NOTE (paintflashingTooltip) A string displayed as the
|
||||||
|
# tooltip of button in devtools toolbox which toggles paint flashing.
|
||||||
|
paintflashingTooltip=Highlight painted area
|
||||||
|
BIN
browser/themes/linux/devtools/command-paintflashing.png
Normal file
BIN
browser/themes/linux/devtools/command-paintflashing.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 961 B |
@ -71,6 +71,20 @@
|
|||||||
background-color: hsla(206,37%,4%,.4);
|
background-color: hsla(206,37%,4%,.4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#command-button-paintflashing {
|
||||||
|
list-style-image: url("chrome://browser/skin/devtools/command-paintflashing.png");
|
||||||
|
-moz-image-region: rect(0px, 16px, 16px, 0px);
|
||||||
|
}
|
||||||
|
#command-button-paintflashing:hover {
|
||||||
|
-moz-image-region: rect(0px, 32px, 16px, 16px);
|
||||||
|
}
|
||||||
|
#command-button-paintflashing:hover:active {
|
||||||
|
-moz-image-region: rect(0px, 48px, 16px, 32px);
|
||||||
|
}
|
||||||
|
#command-button-paintflashing[checked=true] {
|
||||||
|
-moz-image-region: rect(0px, 64px, 16px, 48px);
|
||||||
|
}
|
||||||
|
|
||||||
#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);
|
||||||
|
@ -114,6 +114,7 @@ browser.jar:
|
|||||||
skin/classic/browser/devtools/arrows.png (devtools/arrows.png)
|
skin/classic/browser/devtools/arrows.png (devtools/arrows.png)
|
||||||
skin/classic/browser/devtools/widgets.css (devtools/widgets.css)
|
skin/classic/browser/devtools/widgets.css (devtools/widgets.css)
|
||||||
skin/classic/browser/devtools/commandline.png (devtools/commandline.png)
|
skin/classic/browser/devtools/commandline.png (devtools/commandline.png)
|
||||||
|
skin/classic/browser/devtools/command-paintflashing.png (devtools/command-paintflashing.png)
|
||||||
skin/classic/browser/devtools/command-responsivemode.png (devtools/command-responsivemode.png)
|
skin/classic/browser/devtools/command-responsivemode.png (devtools/command-responsivemode.png)
|
||||||
skin/classic/browser/devtools/command-scratchpad.png (devtools/command-scratchpad.png)
|
skin/classic/browser/devtools/command-scratchpad.png (devtools/command-scratchpad.png)
|
||||||
skin/classic/browser/devtools/command-tilt.png (devtools/command-tilt.png)
|
skin/classic/browser/devtools/command-tilt.png (devtools/command-tilt.png)
|
||||||
|
BIN
browser/themes/osx/devtools/command-paintflashing.png
Normal file
BIN
browser/themes/osx/devtools/command-paintflashing.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 961 B |
@ -59,6 +59,20 @@
|
|||||||
background-color: hsla(206,37%,4%,.4);
|
background-color: hsla(206,37%,4%,.4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#command-button-paintflashing {
|
||||||
|
list-style-image: url("chrome://browser/skin/devtools/command-paintflashing.png");
|
||||||
|
-moz-image-region: rect(0px, 16px, 16px, 0px);
|
||||||
|
}
|
||||||
|
#command-button-paintflashing:hover {
|
||||||
|
-moz-image-region: rect(0px, 32px, 16px, 16px);
|
||||||
|
}
|
||||||
|
#command-button-paintflashing:hover:active {
|
||||||
|
-moz-image-region: rect(0px, 48px, 16px, 32px);
|
||||||
|
}
|
||||||
|
#command-button-paintflashing[checked=true] {
|
||||||
|
-moz-image-region: rect(0px, 64px, 16px, 48px);
|
||||||
|
}
|
||||||
|
|
||||||
#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);
|
||||||
|
@ -194,6 +194,7 @@ browser.jar:
|
|||||||
skin/classic/browser/devtools/widgets.css (devtools/widgets.css)
|
skin/classic/browser/devtools/widgets.css (devtools/widgets.css)
|
||||||
skin/classic/browser/devtools/arrows.png (devtools/arrows.png)
|
skin/classic/browser/devtools/arrows.png (devtools/arrows.png)
|
||||||
skin/classic/browser/devtools/commandline.png (devtools/commandline.png)
|
skin/classic/browser/devtools/commandline.png (devtools/commandline.png)
|
||||||
|
skin/classic/browser/devtools/command-paintflashing.png (devtools/command-paintflashing.png)
|
||||||
skin/classic/browser/devtools/command-responsivemode.png (devtools/command-responsivemode.png)
|
skin/classic/browser/devtools/command-responsivemode.png (devtools/command-responsivemode.png)
|
||||||
skin/classic/browser/devtools/command-scratchpad.png (devtools/command-scratchpad.png)
|
skin/classic/browser/devtools/command-scratchpad.png (devtools/command-scratchpad.png)
|
||||||
skin/classic/browser/devtools/command-tilt.png (devtools/command-tilt.png)
|
skin/classic/browser/devtools/command-tilt.png (devtools/command-tilt.png)
|
||||||
|
BIN
browser/themes/windows/devtools/command-paintflashing.png
Normal file
BIN
browser/themes/windows/devtools/command-paintflashing.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 961 B |
@ -74,6 +74,20 @@
|
|||||||
background-color: hsla(206,37%,4%,.4);
|
background-color: hsla(206,37%,4%,.4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#command-button-paintflashing {
|
||||||
|
list-style-image: url("chrome://browser/skin/devtools/command-paintflashing.png");
|
||||||
|
-moz-image-region: rect(0px, 16px, 16px, 0px);
|
||||||
|
}
|
||||||
|
#command-button-paintflashing:hover {
|
||||||
|
-moz-image-region: rect(0px, 32px, 16px, 16px);
|
||||||
|
}
|
||||||
|
#command-button-paintflashing:hover:active {
|
||||||
|
-moz-image-region: rect(0px, 48px, 16px, 32px);
|
||||||
|
}
|
||||||
|
#command-button-paintflashing[checked=true] {
|
||||||
|
-moz-image-region: rect(0px, 64px, 16px, 48px);
|
||||||
|
}
|
||||||
|
|
||||||
#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);
|
||||||
|
@ -144,6 +144,7 @@ browser.jar:
|
|||||||
skin/classic/browser/devtools/goto-mdn.png (devtools/goto-mdn.png)
|
skin/classic/browser/devtools/goto-mdn.png (devtools/goto-mdn.png)
|
||||||
skin/classic/browser/devtools/csshtmltree.css (devtools/csshtmltree.css)
|
skin/classic/browser/devtools/csshtmltree.css (devtools/csshtmltree.css)
|
||||||
skin/classic/browser/devtools/commandline.css (devtools/commandline.css)
|
skin/classic/browser/devtools/commandline.css (devtools/commandline.css)
|
||||||
|
skin/classic/browser/devtools/command-paintflashing.png (devtools/command-paintflashing.png)
|
||||||
skin/classic/browser/devtools/command-responsivemode.png (devtools/command-responsivemode.png)
|
skin/classic/browser/devtools/command-responsivemode.png (devtools/command-responsivemode.png)
|
||||||
skin/classic/browser/devtools/command-scratchpad.png (devtools/command-scratchpad.png)
|
skin/classic/browser/devtools/command-scratchpad.png (devtools/command-scratchpad.png)
|
||||||
skin/classic/browser/devtools/command-tilt.png (devtools/command-tilt.png)
|
skin/classic/browser/devtools/command-tilt.png (devtools/command-tilt.png)
|
||||||
@ -370,6 +371,7 @@ browser.jar:
|
|||||||
skin/classic/aero/browser/devtools/widgets.css (devtools/widgets.css)
|
skin/classic/aero/browser/devtools/widgets.css (devtools/widgets.css)
|
||||||
skin/classic/aero/browser/devtools/arrows.png (devtools/arrows.png)
|
skin/classic/aero/browser/devtools/arrows.png (devtools/arrows.png)
|
||||||
skin/classic/aero/browser/devtools/commandline.png (devtools/commandline.png)
|
skin/classic/aero/browser/devtools/commandline.png (devtools/commandline.png)
|
||||||
|
skin/classic/aero/browser/devtools/command-paintflashing.png (devtools/command-paintflashing.png)
|
||||||
skin/classic/aero/browser/devtools/command-responsivemode.png (devtools/command-responsivemode.png)
|
skin/classic/aero/browser/devtools/command-responsivemode.png (devtools/command-responsivemode.png)
|
||||||
skin/classic/aero/browser/devtools/command-scratchpad.png (devtools/command-scratchpad.png)
|
skin/classic/aero/browser/devtools/command-scratchpad.png (devtools/command-scratchpad.png)
|
||||||
skin/classic/aero/browser/devtools/command-tilt.png (devtools/command-tilt.png)
|
skin/classic/aero/browser/devtools/command-tilt.png (devtools/command-tilt.png)
|
||||||
|
Loading…
Reference in New Issue
Block a user