зеркало из https://github.com/mozilla/gecko-dev.git
Revert "Backed out changeset edc506b37439 (bug 1495300) for failing at /browser_toolbox_options_disable_buttons.js on a CLOSED TREE"
This reverts commit f42585540c95dd9a2874a75f0a10125a313979f9.
This commit is contained in:
Родитель
bb74f2ee6a
Коммит
23c04604af
|
@ -1601,6 +1601,8 @@ window._gBrowser = {
|
|||
// Web Replay middleman processes need the default URL to be loaded in
|
||||
// order to set up their rendering state.
|
||||
aBrowser.setAttribute("nodefaultsrc", "false");
|
||||
} else if (aBrowser.hasAttribute("recordExecution")) {
|
||||
aBrowser.removeAttribute("recordExecution");
|
||||
}
|
||||
|
||||
// NB: This works with the hack in the browser constructor that
|
||||
|
|
|
@ -26,6 +26,8 @@ loader.lazyGetter(this, "ScratchpadPanel", () => require("devtools/client/scratc
|
|||
loader.lazyGetter(this, "DomPanel", () => require("devtools/client/dom/panel").DomPanel);
|
||||
loader.lazyGetter(this, "AccessibilityPanel", () => require("devtools/client/accessibility/panel").AccessibilityPanel);
|
||||
loader.lazyGetter(this, "ApplicationPanel", () => require("devtools/client/application/panel").ApplicationPanel);
|
||||
loader.lazyGetter(this, "reloadAndRecordTab", () => require("devtools/client/webreplay/menu.js").reloadAndRecordTab);
|
||||
loader.lazyGetter(this, "reloadAndStopRecordingTab", () => require("devtools/client/webreplay/menu.js").reloadAndStopRecordingTab);
|
||||
|
||||
// Other dependencies
|
||||
loader.lazyRequireGetter(this, "AccessibilityStartup", "devtools/client/accessibility/accessibility-startup", true);
|
||||
|
@ -534,6 +536,26 @@ exports.ToolboxButtons = [
|
|||
ScratchpadManager.openScratchpad();
|
||||
}
|
||||
},
|
||||
{
|
||||
id: "command-button-replay",
|
||||
description: l10n("toolbox.buttons.replay"),
|
||||
isTargetSupported: target =>
|
||||
Services.prefs.getBoolPref("devtools.recordreplay.mvp.enabled")
|
||||
&& !target.canRewind
|
||||
&& target.isLocalTab,
|
||||
onClick: () => reloadAndRecordTab(),
|
||||
isChecked: () => false
|
||||
},
|
||||
{
|
||||
id: "command-button-stop-replay",
|
||||
description: l10n("toolbox.buttons.stopReplay"),
|
||||
isTargetSupported: target =>
|
||||
Services.prefs.getBoolPref("devtools.recordreplay.mvp.enabled")
|
||||
&& target.canRewind
|
||||
&& target.isLocalTab,
|
||||
onClick: () => reloadAndStopRecordingTab(),
|
||||
isChecked: () => true
|
||||
},
|
||||
{ id: "command-button-responsive",
|
||||
description: l10n("toolbox.buttons.responsive",
|
||||
osString == "Darwin" ? "Cmd+Opt+M" : "Ctrl+Shift+M"),
|
||||
|
|
|
@ -446,6 +446,10 @@ TabTarget.prototype = {
|
|||
return !this.window;
|
||||
},
|
||||
|
||||
get canRewind() {
|
||||
return this.activeTab.traits.canRewind;
|
||||
},
|
||||
|
||||
getExtensionPathName(url) {
|
||||
// Return the url if the target is not a webextension.
|
||||
if (!this.isWebExtension) {
|
||||
|
@ -847,6 +851,10 @@ WorkerTarget.prototype = {
|
|||
return this._workerClient.client;
|
||||
},
|
||||
|
||||
get canRewind() {
|
||||
return false;
|
||||
},
|
||||
|
||||
destroy: function() {
|
||||
this._workerClient.detach();
|
||||
},
|
||||
|
|
|
@ -72,8 +72,10 @@ function testPreferenceAndUIStateIsConsistent() {
|
|||
"Button visibility matches pref for " + tool.id);
|
||||
|
||||
const check = checkNodes.filter(node => node.id === tool.id)[0];
|
||||
is(check.checked, isVisible,
|
||||
"Checkbox should be selected based on current pref for " + tool.id);
|
||||
if (check) {
|
||||
is(check.checked, isVisible,
|
||||
"Checkbox should be selected based on current pref for " + tool.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -85,7 +87,8 @@ function testToggleToolboxButtons() {
|
|||
|
||||
const toolbarButtonNodes = [...doc.querySelectorAll(".command-button")];
|
||||
|
||||
is(checkNodes.length, toolbox.toolbarButtons.length,
|
||||
// NOTE: the web-replay buttons are not checkboxes
|
||||
is(checkNodes.length + 2, toolbox.toolbarButtons.length,
|
||||
"All of the buttons are toggleable.");
|
||||
is(visibleToolbarButtons.length, toolbarButtonNodes.length,
|
||||
"All of the DOM buttons are toggleable.");
|
||||
|
@ -94,9 +97,11 @@ function testToggleToolboxButtons() {
|
|||
const id = tool.id;
|
||||
const matchedCheckboxes = checkNodes.filter(node => node.id === id);
|
||||
const matchedButtons = toolbarButtonNodes.filter(button => button.id === id);
|
||||
is(matchedCheckboxes.length, 1,
|
||||
"There should be a single toggle checkbox for: " + id);
|
||||
if (tool.isVisible) {
|
||||
is(matchedCheckboxes.length, 1,
|
||||
"There should be a single toggle checkbox for: " + id);
|
||||
is(matchedCheckboxes[0].nextSibling.textContent, tool.description,
|
||||
"The label for checkbox matches the tool definition.");
|
||||
is(matchedButtons.length, 1,
|
||||
"There should be a DOM button for the visible: " + id);
|
||||
is(matchedButtons[0].getAttribute("title"), tool.description,
|
||||
|
@ -105,9 +110,6 @@ function testToggleToolboxButtons() {
|
|||
is(matchedButtons.length, 0,
|
||||
"There should not be a DOM button for the invisible: " + id);
|
||||
}
|
||||
|
||||
is(matchedCheckboxes[0].nextSibling.textContent, tool.description,
|
||||
"The label for checkbox matches the tool definition.");
|
||||
}
|
||||
|
||||
// Store modified pref names so that they can be cleared on error.
|
||||
|
@ -137,7 +139,11 @@ function testToggleToolboxButtons() {
|
|||
}
|
||||
|
||||
function getBoolPref(key) {
|
||||
return Services.prefs.getBoolPref(key);
|
||||
try {
|
||||
return Services.prefs.getBoolPref(key);
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function cleanup() {
|
||||
|
|
|
@ -144,6 +144,7 @@ devtools.jar:
|
|||
skin/images/command-paintflashing.svg (themes/images/command-paintflashing.svg)
|
||||
skin/images/command-screenshot.svg (themes/images/command-screenshot.svg)
|
||||
skin/images/command-responsivemode.svg (themes/images/command-responsivemode.svg)
|
||||
skin/images/command-replay.svg (themes/images/command-replay.svg)
|
||||
skin/images/command-pick.svg (themes/images/command-pick.svg)
|
||||
skin/images/command-pick-accessibility.svg (themes/images/command-pick-accessibility.svg)
|
||||
skin/images/command-frames.svg (themes/images/command-frames.svg)
|
||||
|
|
|
@ -288,6 +288,16 @@ application.tooltip=Application Panel
|
|||
# Keyboard shortcut will be shown inside brackets.
|
||||
toolbox.buttons.responsive = Responsive Design Mode (%S)
|
||||
|
||||
# LOCALIZATION NOTE (toolbox.buttons.replay):
|
||||
# This is the tooltip of the button in the toolbox toolbar that enables
|
||||
# the web replay record feature.
|
||||
toolbox.buttons.replay = Enable WebReplay
|
||||
|
||||
# LOCALIZATION NOTE (toolbox.buttons.stopReplay):
|
||||
# This is the tooltip of the button in the toolbox toolbar that dissables
|
||||
# the web replay feature.
|
||||
toolbox.buttons.stopReplay = Disable WebReplay
|
||||
|
||||
# LOCALIZATION NOTE (toolbox.buttons.paintflashing):
|
||||
# This is the tooltip of the paintflashing button in the toolbox toolbar
|
||||
# that toggles paintflashing.
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
<!-- 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/. -->
|
||||
<svg width="20px" height="20px" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" fill="context-fill #0b0b0b">
|
||||
<circle id="Oval" cx="10" cy="10" r="6"></circle>
|
||||
<path d="M10,20 C4.4771525,20 0,15.5228475 0,10 C0,4.4771525 4.4771525,0 10,0 C15.5228475,0 20,4.4771525 20,10 C20,15.5228475 15.5228475,20 10,20 Z M10,18 C14.418278,18 18,14.418278 18,10 C18,5.581722 14.418278,2 10,2 C5.581722,2 2,5.581722 2,10 C2,14.418278 5.581722,18 10,18 Z" id="Combined-Shape"></path>
|
||||
</svg>
|
После Ширина: | Высота: | Размер: 694 B |
|
@ -17,6 +17,7 @@
|
|||
--command-paintflashing-image: url(images/command-paintflashing.svg);
|
||||
--command-screenshot-image: url(images/command-screenshot.svg);
|
||||
--command-responsive-image: url(images/command-responsivemode.svg);
|
||||
--command-replay-image: url(images/command-replay.svg);
|
||||
--command-scratchpad-image: url(images/tool-scratchpad.svg);
|
||||
--command-pick-image: url(images/command-pick.svg);
|
||||
--command-pick-accessibility-image: url(images/command-pick-accessibility.svg);
|
||||
|
@ -291,6 +292,27 @@
|
|||
fill: currentColor;
|
||||
}
|
||||
|
||||
#command-button-stop-replay::before, #command-button-replay::before {
|
||||
background-image: var(--command-replay-image);
|
||||
fill: var(--theme-toolbar-photon-icon-color);
|
||||
-moz-context-properties: fill;
|
||||
background-repeat: no-repeat;
|
||||
height: 16px;
|
||||
background-size: contain;
|
||||
}
|
||||
|
||||
#command-button-replay, #command-button-stop-replay {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
#command-button-replay:hover, #command-button-stop-replay:hover {
|
||||
background: var(--toolbarbutton-background);
|
||||
}
|
||||
|
||||
#command-button-stop-replay::before {
|
||||
fill: currentColor;
|
||||
}
|
||||
|
||||
#command-button-scratchpad::before {
|
||||
background-image: var(--command-scratchpad-image);
|
||||
}
|
||||
|
|
|
@ -33,6 +33,16 @@ function ReloadAndRecordTab() {
|
|||
});
|
||||
}
|
||||
|
||||
function ReloadAndStopRecordingTab() {
|
||||
const { gBrowser } = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
const url = gBrowser.currentURI.spec;
|
||||
gBrowser.updateBrowserRemoteness(gBrowser.selectedBrowser, true,
|
||||
{ newFrameloader: true });
|
||||
gBrowser.loadURI(url, {
|
||||
triggeringPrincipal: gBrowser.selectedBrowser.contentPrincipal,
|
||||
});
|
||||
}
|
||||
|
||||
function SaveRecording() {
|
||||
const { gBrowser } = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
const fp = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker);
|
||||
|
@ -90,3 +100,6 @@ exports.addWebReplayMenu = function(doc) {
|
|||
mds.parentNode.insertBefore(menu, mds);
|
||||
}
|
||||
};
|
||||
|
||||
exports.reloadAndRecordTab = ReloadAndRecordTab;
|
||||
exports.reloadAndStopRecordingTab = ReloadAndStopRecordingTab;
|
||||
|
|
|
@ -1091,6 +1091,8 @@ pref("devtools.recordreplay.enabled", true);
|
|||
pref("devtools.recordreplay.enableRewinding", true);
|
||||
#endif
|
||||
|
||||
pref("devtools.recordreplay.mvp.enabled", false);
|
||||
|
||||
// view source
|
||||
pref("view_source.syntax_highlight", true);
|
||||
pref("view_source.wrap_long_lines", false);
|
||||
|
|
Загрузка…
Ссылка в новой задаче