diff --git a/devtools/.eslintrc.js b/devtools/.eslintrc.js index 76533a40fe1d..0096380f98cb 100644 --- a/devtools/.eslintrc.js +++ b/devtools/.eslintrc.js @@ -107,9 +107,6 @@ module.exports = { } }, { "files": [ - // Note: Bug 1342237 may be removing shadereditor, check before - // doing more work on enabling these rules. - "client/shadereditor/**", // Note: Bug 1403944 may be removing webaudioeditor, check before // doing more work on enabling these rules. "client/webaudioeditor/**", diff --git a/devtools/client/definitions.js b/devtools/client/definitions.js index a8f150a11807..edca5662668b 100644 --- a/devtools/client/definitions.js +++ b/devtools/client/definitions.js @@ -6,7 +6,6 @@ const Services = require("Services"); const osString = Services.appinfo.OS; -const { Cu } = require("chrome"); // Panels loader.lazyGetter(this, "OptionsPanel", () => require("devtools/client/framework/toolbox-options").OptionsPanel); @@ -176,33 +175,6 @@ Tools.styleEditor = { }, }; -Tools.shaderEditor = { - id: "shadereditor", - deprecated: true, - deprecationURL: DEPRECATION_URL, - ordinal: 5, - visibilityswitch: "devtools.shadereditor.enabled", - icon: "chrome://devtools/skin/images/tool-shadereditor.svg", - url: "chrome://devtools/content/shadereditor/index.xul", - label: l10n("ToolboxShaderEditor.label"), - panelLabel: l10n("ToolboxShaderEditor.panelLabel"), - tooltip: l10n("ToolboxShaderEditor.tooltip"), - - isTargetSupported: function(target) { - return target.hasActor("webgl") && !target.chrome; - }, - - build: function(iframeWindow, toolbox) { - const { BrowserLoader } = Cu.import("resource://devtools/client/shared/browser-loader.js", {}); - const browserRequire = BrowserLoader({ - baseURI: "resource://devtools/client/shadereditor/", - window: iframeWindow, - }).require; - const { ShaderEditorPanel } = browserRequire("devtools/client/shadereditor/panel"); - return new ShaderEditorPanel(toolbox); - }, -}; - Tools.performance = { id: "performance", ordinal: 7, @@ -442,7 +414,6 @@ var defaultTools = [ Tools.inspector, Tools.jsdebugger, Tools.styleEditor, - Tools.shaderEditor, Tools.webAudioEditor, Tools.performance, Tools.netMonitor, diff --git a/devtools/client/jar.mn b/devtools/client/jar.mn index f50194a89fc5..23612f1670f9 100644 --- a/devtools/client/jar.mn +++ b/devtools/client/jar.mn @@ -26,7 +26,6 @@ devtools.jar: content/shared/sourceeditor/codemirror/mozilla.css (shared/sourceeditor/codemirror/mozilla.css) content/shared/sourceeditor/codemirror/cmiframe.html (shared/sourceeditor/codemirror/cmiframe.html) content/debugger/new/index.html (debugger/new/index.html) - content/shadereditor/index.xul (shadereditor/index.xul) content/webaudioeditor/index.xul (webaudioeditor/index.xul) content/webaudioeditor/includes.js (webaudioeditor/includes.js) content/webaudioeditor/models.js (webaudioeditor/models.js) @@ -137,7 +136,6 @@ devtools.jar: skin/performance.css (themes/performance.css) skin/memory.css (themes/memory.css) skin/scratchpad.css (themes/scratchpad.css) - skin/shadereditor.css (themes/shadereditor.css) skin/storage.css (themes/storage.css) skin/splitview.css (themes/splitview.css) skin/styleeditor.css (themes/styleeditor.css) @@ -183,7 +181,6 @@ devtools.jar: skin/images/tool-webconsole.svg (themes/images/tool-webconsole.svg) skin/images/tool-debugger.svg (themes/images/tool-debugger.svg) skin/images/tool-inspector.svg (themes/images/tool-inspector.svg) - skin/images/tool-shadereditor.svg (themes/images/tool-shadereditor.svg) skin/images/tool-styleeditor.svg (themes/images/tool-styleeditor.svg) skin/images/tool-storage.svg (themes/images/tool-storage.svg) skin/images/tool-profiler.svg (themes/images/tool-profiler.svg) diff --git a/devtools/client/locales/en-US/shadereditor.dtd b/devtools/client/locales/en-US/shadereditor.dtd deleted file mode 100644 index 9773e6ccc778..000000000000 --- a/devtools/client/locales/en-US/shadereditor.dtd +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/devtools/client/locales/en-US/shadereditor.properties b/devtools/client/locales/en-US/shadereditor.properties deleted file mode 100644 index 899833c17eed..000000000000 --- a/devtools/client/locales/en-US/shadereditor.properties +++ /dev/null @@ -1,22 +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/. - -# LOCALIZATION NOTE These strings are used inside the Debugger -# which is available from the Web Developer sub-menu -> 'Debugger'. -# The correct localization of this file might be to keep it in -# English, or another language commonly spoken among web developers. -# You want to make that choice consistent across the developer tools. -# A good criteria is the language in which you'd find the best -# documentation on web development on the web. - -# LOCALIZATION NOTE (shadersList.programLabel): -# This string is displayed in the programs list of the Shader Editor, -# identifying a set of linked GLSL shaders. -shadersList.programLabel=Program %S - -# LOCALIZATION NOTE (shadersList.blackboxLabel): -# This string is displayed in the programs list of the Shader Editor, while -# the user hovers over the checkbox used to toggle blackboxing of a program's -# associated fragment shader. -shadersList.blackboxLabel=Toggle geometry visibility diff --git a/devtools/client/locales/en-US/startup.properties b/devtools/client/locales/en-US/startup.properties index a61f347df104..0ba66473b931 100644 --- a/devtools/client/locales/en-US/startup.properties +++ b/devtools/client/locales/en-US/startup.properties @@ -98,20 +98,6 @@ ToolboxStyleEditor.tooltip3=Stylesheet Editor (CSS) (%S) # editor. open.accesskey=l -# LOCALIZATION NOTE (ToolboxShaderEditor.label): -# This string is displayed in the title of the tab when the Shader Editor is -# displayed inside the developer tools window and in the Developer Tools Menu. -ToolboxShaderEditor.label=Shader Editor - -# LOCALIZATION NOTE (ToolboxShaderEditor.panelLabel): -# This is used as the label for the toolbox panel. -ToolboxShaderEditor.panelLabel=Shader Editor Panel - -# LOCALIZATION NOTE (ToolboxShaderEditor.tooltip): -# This string is displayed in the tooltip of the tab when the Shader Editor is -# displayed inside the developer tools window. -ToolboxShaderEditor.tooltip=Live GLSL shader language editor for WebGL - # LOCALIZATION NOTE (ToolboxWebAudioEditor1.label): # This string is displayed in the title of the tab when the Web Audio Editor # is displayed inside the developer tools window and in the Developer Tools Menu. diff --git a/devtools/client/moz.build b/devtools/client/moz.build index b2975ce1459c..0dffddbf3c16 100644 --- a/devtools/client/moz.build +++ b/devtools/client/moz.build @@ -24,7 +24,6 @@ DIRS += [ 'preferences', 'responsive.html', 'scratchpad', - 'shadereditor', 'shared', 'storage', 'styleeditor', diff --git a/devtools/client/preferences/devtools-client.js b/devtools/client/preferences/devtools-client.js index 72d7899f8553..26ef692452bf 100644 --- a/devtools/client/preferences/devtools-client.js +++ b/devtools/client/preferences/devtools-client.js @@ -229,9 +229,6 @@ pref("devtools.styleeditor.transitions", true); pref("devtools.screenshot.clipboard.enabled", false); pref("devtools.screenshot.audio.enabled", true); -// Enable the Shader Editor. -pref("devtools.shadereditor.enabled", false); - // Enable the Web Audio Editor pref("devtools.webaudioeditor.enabled", false); diff --git a/devtools/client/shadereditor/index.xul b/devtools/client/shadereditor/index.xul deleted file mode 100644 index e42a06f94b5f..000000000000 --- a/devtools/client/shadereditor/index.xul +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - %debuggerDTD; -]> - - - - - - - - - - - - - - - - - diff --git a/devtools/client/shadereditor/test/doc_multiple-contexts.html b/devtools/client/shadereditor/test/doc_multiple-contexts.html deleted file mode 100644 index e2b74018b978..000000000000 --- a/devtools/client/shadereditor/test/doc_multiple-contexts.html +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - - WebGL editor test page - - - - - - - - - - - - - - diff --git a/devtools/client/shadereditor/test/doc_overlapping-geometry.html b/devtools/client/shadereditor/test/doc_overlapping-geometry.html deleted file mode 100644 index f779622c0c4c..000000000000 --- a/devtools/client/shadereditor/test/doc_overlapping-geometry.html +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - WebGL editor test page - - - - - - - - - - - - - - - diff --git a/devtools/client/shadereditor/test/doc_shader-order.html b/devtools/client/shadereditor/test/doc_shader-order.html deleted file mode 100644 index 4d0cfad80b27..000000000000 --- a/devtools/client/shadereditor/test/doc_shader-order.html +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - WebGL editor test page - - - - - - - - - - - - - diff --git a/devtools/client/shadereditor/test/doc_simple-canvas.html b/devtools/client/shadereditor/test/doc_simple-canvas.html deleted file mode 100644 index ac9aaf1ef457..000000000000 --- a/devtools/client/shadereditor/test/doc_simple-canvas.html +++ /dev/null @@ -1,125 +0,0 @@ - - - - - - - WebGL editor test page - - - - - - - - - - - - - diff --git a/devtools/client/shadereditor/test/head.js b/devtools/client/shadereditor/test/head.js deleted file mode 100644 index c57254e30f2c..000000000000 --- a/devtools/client/shadereditor/test/head.js +++ /dev/null @@ -1,208 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - http://creativecommons.org/publicdomain/zero/1.0/ */ - -/* eslint no-unused-vars: [2, {"vars": "local"}] */ -/* import-globals-from ../../shared/test/shared-head.js */ - -"use strict"; - -// Load the shared-head file first. -Services.scriptloader.loadSubScript( - "chrome://mochitests/content/browser/devtools/client/shared/test/shared-head.js", - this); - -var { DebuggerClient } = require("devtools/shared/client/debugger-client"); -var { DebuggerServer } = require("devtools/server/main"); -var { Toolbox } = require("devtools/client/framework/toolbox"); -var { isWebGLSupported } = require("devtools/client/shared/webgl-utils"); - -const EXAMPLE_URL = "http://example.com/browser/devtools/client/shadereditor/test/"; -const SIMPLE_CANVAS_URL = EXAMPLE_URL + "doc_simple-canvas.html"; -const SHADER_ORDER_URL = EXAMPLE_URL + "doc_shader-order.html"; -const MULTIPLE_CONTEXTS_URL = EXAMPLE_URL + "doc_multiple-contexts.html"; -const OVERLAPPING_GEOMETRY_CANVAS_URL = EXAMPLE_URL + "doc_overlapping-geometry.html"; -const BLENDED_GEOMETRY_CANVAS_URL = EXAMPLE_URL + "doc_blended-geometry.html"; - -var gEnableLogging = Services.prefs.getBoolPref("devtools.debugger.log"); -// To enable logging for try runs, just set the pref to true. -Services.prefs.setBoolPref("devtools.debugger.log", false); - -var gToolEnabled = Services.prefs.getBoolPref("devtools.shadereditor.enabled"); - -registerCleanupFunction(() => { - Services.prefs.setBoolPref("devtools.debugger.log", gEnableLogging); - Services.prefs.setBoolPref("devtools.shadereditor.enabled", gToolEnabled); - - // These tests use a lot of memory due to GL contexts, so force a GC to help - // fragmentation. - info("Forcing GC after shadereditor test."); - Cu.forceGC(); -}); - -/** - * Call manually in tests that use frame script utils after initializing - * the shader editor. Must be called after initializing so we can detect - * whether or not `content` is a CPOW or not. Call after init but before navigating - * to different pages, as bfcache and thus shader caching gets really strange if - * frame script attached in the middle of the test. - */ -function loadFrameScripts() { - if (!content) { - loadFrameScriptUtils(); - } -} - -function handleError(aError) { - ok(false, "Got an error: " + aError.message + "\n" + aError.stack); - finish(); -} - -function ifWebGLSupported() { - ok(false, "You need to define a 'ifWebGLSupported' function."); - finish(); -} - -function ifWebGLUnsupported() { - todo(false, "Skipping test because WebGL isn't supported."); - finish(); -} - -async function test() { - const generator = isWebGLSupported(document) ? ifWebGLSupported : ifWebGLUnsupported; - try { - await generator(); - } catch (e) { - handleError(e); - } -} - -function createCanvas() { - return document.createElementNS("http://www.w3.org/1999/xhtml", "canvas"); -} - -function observe(aNotificationName, aOwnsWeak = false) { - info("Waiting for observer notification: '" + aNotificationName + "."); - return new Promise(resolve =>{ - Services.obs.addObserver(function onNotification(...aArgs) { - Services.obs.removeObserver(onNotification, aNotificationName); - resolve.apply(deferred, aArgs); - }, aNotificationName, aOwnsWeak); - }); -} - -function isApprox(aFirst, aSecond, aMargin = 1) { - return Math.abs(aFirst - aSecond) <= aMargin; -} - -function isApproxColor(aFirst, aSecond, aMargin) { - return isApprox(aFirst.r, aSecond.r, aMargin) && - isApprox(aFirst.g, aSecond.g, aMargin) && - isApprox(aFirst.b, aSecond.b, aMargin) && - isApprox(aFirst.a, aSecond.a, aMargin); -} - -function ensurePixelIs(aFront, aPosition, aColor, aWaitFlag = false, aSelector = "canvas") { - return (async function() { - const pixel = await aFront.getPixel({ selector: aSelector, position: aPosition }); - if (isApproxColor(pixel, aColor)) { - ok(true, "Expected pixel is shown at: " + aPosition.toSource()); - return; - } - - if (aWaitFlag) { - await aFront.waitForFrame(); - await ensurePixelIs(aFront, aPosition, aColor, aWaitFlag, aSelector); - return; - } - - ok(false, "Expected pixel was not already shown at: " + aPosition.toSource()); - throw new Error("Expected pixel was not already shown at: " + aPosition.toSource()); - })(); -} - -function navigateInHistory(aTarget, aDirection, aWaitForTargetEvent = "navigate") { - if (!content) { - const mm = gBrowser.selectedBrowser.messageManager; - mm.sendAsyncMessage("devtools:test:history", { direction: aDirection }); - } else { - executeSoon(() => content.history[aDirection]()); - } - return once(aTarget, aWaitForTargetEvent); -} - -function navigate(aTarget, aUrl, aWaitForTargetEvent = "navigate") { - executeSoon(() => aTarget.navigateTo({ url: aUrl })); - return once(aTarget, aWaitForTargetEvent); -} - -async function reload(aTarget, aWaitForTargetEvent = "navigate") { - const onTargetEvent = once(aTarget, aWaitForTargetEvent); - await aTarget.reload(); - return onTargetEvent; -} - -function initBackend(aUrl) { - info("Initializing a shader editor front."); - - DebuggerServer.init(); - DebuggerServer.registerAllActors(); - - return (async function() { - const tab = await addTab(aUrl); - const target = await TargetFactory.forTab(tab); - - await target.attach(); - - const front = await target.getFront("webgl"); - return { target, front }; - })(); -} - -function initShaderEditor(aUrl) { - info("Initializing a shader editor pane."); - - return (async function() { - const tab = await addTab(aUrl); - const target = await TargetFactory.forTab(tab); - - Services.prefs.setBoolPref("devtools.shadereditor.enabled", true); - const toolbox = await gDevTools.showToolbox(target, "shadereditor"); - const panel = toolbox.getCurrentPanel(); - return { target, panel }; - })(); -} - -function teardown(aPanel) { - info("Destroying the specified shader editor."); - - return promise.all([ - once(aPanel, "destroyed"), - removeTab(aPanel.target.tab), - ]); -} - -// Due to `program-linked` events firing synchronously, we cannot -// just yield/chain them together, as then we miss all actors after the -// first event since they're fired consecutively. This allows us to capture -// all actors and returns an array containing them. -// -// Takes a `front` object that is an event emitter, the number of -// programs that should be listened to and waited on, and an optional -// `onAdd` function that calls with the entire actors array on program link -function getPrograms(front, count, onAdd) { - return new Promise(resolve => { - const actors = []; - front.on("program-linked", function onLink(actor) { - if (actors.length !== count) { - actors.push(actor); - if (typeof onAdd === "function") { - onAdd(actors); - } - } - if (actors.length === count) { - front.off("program-linked", onLink); - resolve(actors); - } - }); - }); -} diff --git a/devtools/client/shared/telemetry.js b/devtools/client/shared/telemetry.js index c8d68f9aeee0..39607bc6e47d 100644 --- a/devtools/client/shared/telemetry.js +++ b/devtools/client/shared/telemetry.js @@ -703,7 +703,6 @@ function getChartsFromToolId(id) { case "PAINTFLASHING": case "RESPONSIVE": case "SCRATCHPAD": - case "SHADEREDITOR": case "STORAGE": case "STYLEEDITOR": case "TOOLBOX": diff --git a/devtools/client/shared/test/browser.ini b/devtools/client/shared/test/browser.ini index 439b4828739b..777f32d25061 100644 --- a/devtools/client/shared/test/browser.ini +++ b/devtools/client/shared/test/browser.ini @@ -220,7 +220,6 @@ skip-if = !e10s || os == "win" # RDM only works for remote tabs, Win: bug 140419 [browser_telemetry_toolboxtabs_jsprofiler.js] [browser_telemetry_toolboxtabs_netmonitor.js] [browser_telemetry_toolboxtabs_options.js] -[browser_telemetry_toolboxtabs_shadereditor.js] [browser_telemetry_toolboxtabs_storage.js] [browser_telemetry_toolboxtabs_styleeditor.js] [browser_telemetry_toolboxtabs_webaudioeditor.js] diff --git a/devtools/client/shared/test/browser_telemetry_toolboxtabs_shadereditor.js b/devtools/client/shared/test/browser_telemetry_toolboxtabs_shadereditor.js deleted file mode 100644 index 224cb3ab90e3..000000000000 --- a/devtools/client/shared/test/browser_telemetry_toolboxtabs_shadereditor.js +++ /dev/null @@ -1,36 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - http://creativecommons.org/publicdomain/zero/1.0/ */ - -"use strict"; - -const TEST_URI = "data:text/html;charset=utf-8," + - "

browser_telemetry_toolboxtabs_shadereditor.js

"; - -// Because we need to gather stats for the period of time that a tool has been -// opened we make use of setTimeout() to create tool active times. -const TOOL_DELAY = 200; -const TOOL_PREF = "devtools.shadereditor.enabled"; - -add_task(async function() { - info("Active the sharer editor"); - const originalPref = Services.prefs.getBoolPref(TOOL_PREF); - Services.prefs.setBoolPref(TOOL_PREF, true); - - await addTab(TEST_URI); - startTelemetry(); - - await openAndCloseToolbox(2, TOOL_DELAY, "shadereditor"); - checkResults(); - - gBrowser.removeCurrentTab(); - - info("De-activate the sharer editor"); - Services.prefs.setBoolPref(TOOL_PREF, originalPref); -}); - -function checkResults() { - // For help generating these tests use generateTelemetryTests("DEVTOOLS_SHADEREDITOR_") - // here. - checkTelemetry("DEVTOOLS_SHADEREDITOR_OPENED_COUNT", "", {0: 2, 1: 0}, "array"); - checkTelemetry("DEVTOOLS_SHADEREDITOR_TIME_ACTIVE_SECONDS", "", null, "hasentries"); -} diff --git a/devtools/client/themes/images/tool-shadereditor.svg b/devtools/client/themes/images/tool-shadereditor.svg deleted file mode 100644 index 80de8d5a4849..000000000000 --- a/devtools/client/themes/images/tool-shadereditor.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - diff --git a/devtools/client/themes/shadereditor.css b/devtools/client/themes/shadereditor.css deleted file mode 100644 index b312df8150e2..000000000000 --- a/devtools/client/themes/shadereditor.css +++ /dev/null @@ -1,119 +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/. */ - -/* Reload and waiting notices */ - -.notice-container { - margin-top: -50vh; - color: var(--theme-body-color-alt); -} - -#reload-notice { - font-size: 120%; -} - -#waiting-notice { - font-size: 110%; -} - -/* Shaders pane */ - -#shaders-pane { - min-width: 150px; -} - -.program-item { - padding: 2px 0px; -} - -.side-menu-widget-item-checkbox { - -moz-appearance: none; - opacity: 0; - transition: opacity .15s ease-out 0s; -} - -/* Only show the checkbox when the source is hovered over, is selected, or if it - * is not checked. */ -.side-menu-widget-item:hover > .side-menu-widget-item-checkbox, -.side-menu-widget-item.selected > .side-menu-widget-item-checkbox, -.side-menu-widget-item-checkbox:not([checked]) { - opacity: 1; - transition: opacity .15s ease-out 0s; -} - -.side-menu-widget-item-checkbox .checkbox-check { - -moz-appearance: none; - background-image: url(images/item-toggle.svg); - background-color: transparent; - width: 16px; - height: 16px; - border: 0; - -moz-context-properties: fill; -} - -.side-menu-widget-item-checkbox:not([checked]) .checkbox-check, -.side-menu-widget-item-checkbox:not([checked]) + vbox { - opacity: 0.3; -} - -.side-menu-widget-item:not(.selected) .checkbox-check { - fill: var(--theme-icon-color); -} - -/* Make sure icon is white when the item is selected */ -.side-menu-widget-item.selected .checkbox-check { - fill: var(--theme-selection-color); -} - -/* Shader source editors */ - -.editor-label { - padding: 1px 12px; - border-top: 1px solid; -} - -.editor-label { - background: var(--theme-toolbar-background); - border-color: var(--theme-splitter-color); - color: var(--theme-body-color-alt); -} - -.editor-label[selected] { - background-color: var(--theme-selection-background); - color: var(--theme-selection-color); -} - -.devtools-shader-tooltip-container .devtools-tooltip-simple-text { - color: var(--theme-content-color1); - border-bottom: 1px solid var(--theme-splitter-color); -} - -.devtools-shader-tooltip-container .devtools-tooltip-simple-text:last-child { - border-bottom: 0; -} - -/* Responsive sidebar */ - -@media (max-width: 700px) { - #shaders-pane { - max-height: 60vh; - } - - #editors-splitter { - border-color: transparent; - } - - .side-menu-widget-container { - box-shadow: none !important; - } - - .side-menu-widget-item-arrow { - background-image: none !important; - } - - .editor-label { - -moz-box-ordinal-group: 0; - border-bottom: 1px solid; - } -}