Bug 1402262 - Switch from webconsole.xhtml to webconsole.html; r=nchevobbe draft
authorJan Odvarko <odvarko@gmail.com>
Mon, 02 Oct 2017 10:17:17 +0200
changeset 673306 7d5884d3ffb6c7f6342f8f8bacad87ec4b08b419
parent 673165 44643fce30b43a8981535c335aaccb45006e456b
child 734055 47ff1b2e33c5fa12d7335c7e401cd3bf88fd2b64
push id82524
push userjodvarko@mozilla.com
push dateMon, 02 Oct 2017 08:17:58 +0000
reviewersnchevobbe
bugs1402262
milestone58.0a1
Bug 1402262 - Switch from webconsole.xhtml to webconsole.html; r=nchevobbe MozReview-Commit-ID: FZTxze02tNg
devtools/client/definitions.js
devtools/client/jar.mn
devtools/client/shared/vendor/react-dom.js
devtools/client/webconsole/new-console-output/main.js
devtools/client/webconsole/new-console-output/new-console-output-wrapper.js
devtools/client/webconsole/webconsole.html
devtools/client/webconsole/webconsole.xhtml
--- a/devtools/client/definitions.js
+++ b/devtools/client/definitions.js
@@ -95,17 +95,17 @@ Tools.inspector = {
     return new InspectorPanel(iframeWindow, toolbox);
   }
 };
 Tools.webConsole = {
   id: "webconsole",
   accesskey: l10n("webConsoleCmd.accesskey"),
   ordinal: 2,
   oldWebConsoleURL: "chrome://devtools/content/webconsole/webconsole.xul",
-  newWebConsoleURL: "chrome://devtools/content/webconsole/webconsole.xhtml",
+  newWebConsoleURL: "chrome://devtools/content/webconsole/webconsole.html",
   icon: "chrome://devtools/skin/images/tool-webconsole.svg",
   invertIconForDarkTheme: true,
   label: l10n("ToolboxTabWebconsole.label"),
   menuLabel: l10n("MenuWebconsole.label"),
   panelLabel: l10n("ToolboxWebConsole.panelLabel"),
   get tooltip() {
     return l10n("ToolboxWebconsole.tooltip2",
     (osString == "Darwin" ? "Cmd+Opt+" : "Ctrl+Shift+") +
--- a/devtools/client/jar.mn
+++ b/devtools/client/jar.mn
@@ -5,17 +5,17 @@
 devtools.jar:
 %   content devtools %content/
     content/shared/vendor/d3.js (shared/vendor/d3.js)
     content/shared/vendor/dagre-d3.js (shared/vendor/dagre-d3.js)
     content/shared/widgets/widgets.css (shared/widgets/widgets.css)
     content/netmonitor/src/assets/styles/netmonitor.css (netmonitor/src/assets/styles/netmonitor.css)
     content/shared/widgets/VariablesView.xul (shared/widgets/VariablesView.xul)
     content/netmonitor/index.html (netmonitor/index.html)
-    content/webconsole/webconsole.xhtml (webconsole/webconsole.xhtml)
+    content/webconsole/webconsole.html (webconsole/webconsole.html)
     content/webconsole/webconsole.xul (webconsole/webconsole.xul)
     content/scratchpad/scratchpad.xul (scratchpad/scratchpad.xul)
     content/scratchpad/scratchpad.js (scratchpad/scratchpad.js)
     content/shared/splitview.css (shared/splitview.css)
     content/shared/theme-switching.js (shared/theme-switching.js)
     content/shared/frame-script-utils.js (shared/frame-script-utils.js)
     content/styleeditor/styleeditor.xul (styleeditor/styleeditor.xul)
     content/storage/storage.xul (storage/storage.xul)
--- a/devtools/client/shared/vendor/react-dom.js
+++ b/devtools/client/shared/vendor/react-dom.js
@@ -145,23 +145,17 @@
   function getToolboxDocIfXulOnly(node) {
     // This execution context doesn't know about XULDocuments, so don't get the toolbox.
     if (typeof XULDocument !== "function") {
       return null;
     }
 
     let doc = node.ownerDocument;
     const inspectorUrl = "chrome://devtools/content/inspector/inspector.xhtml";
-    const netMonitorUrl = "chrome://devtools/content/netmonitor/netmonitor.xhtml";
-    const webConsoleUrl = "chrome://devtools/content/webconsole/webconsole.xhtml";
-
-    while (doc instanceof XULDocument ||
-           doc.location.href === inspectorUrl ||
-           doc.location.href === netMonitorUrl ||
-           doc.location.href === webConsoleUrl) {
+    while (doc instanceof XULDocument || doc.location.href === inspectorUrl) {
       const {frameElement} = doc.defaultView;
 
       if (!frameElement) {
         // We're at the root element, and no toolbox was found.
         return null;
       }
 
       doc = frameElement.parentElement.ownerDocument;
--- a/devtools/client/webconsole/new-console-output/main.js
+++ b/devtools/client/webconsole/new-console-output/main.js
@@ -11,16 +11,14 @@ var Cu = Components.utils;
 const { BrowserLoader } = Cu.import("resource://devtools/client/shared/browser-loader.js", {});
 
 this.NewConsoleOutput = function (parentNode, jsterm, toolbox, owner, serviceContainer) {
   // Initialize module loader and load all modules of the new inline
   // preview feature. The entire code-base doesn't need any extra
   // privileges and runs entirely in content scope.
   let NewConsoleOutputWrapper = BrowserLoader({
     baseURI: "resource://devtools/client/webconsole/new-console-output/",
-    // The toolbox is not available for the browser console.
-    commonLibRequire: toolbox ? toolbox.browserRequire : null,
     window
   }).require("./new-console-output-wrapper");
 
   return new NewConsoleOutputWrapper(
     parentNode, jsterm, toolbox, owner, serviceContainer);
 };
--- a/devtools/client/webconsole/new-console-output/new-console-output-wrapper.js
+++ b/devtools/client/webconsole/new-console-output/new-console-output-wrapper.js
@@ -83,17 +83,17 @@ NewConsoleOutputWrapper.prototype = {
           timeStamp,
         }]));
       },
       hudProxy: this.jsterm.hud.proxy,
       openLink: url => {
         this.jsterm.hud.owner.openLink(url);
       },
       createElement: nodename => {
-        return this.document.createElementNS("http://www.w3.org/1999/xhtml", nodename);
+        return this.document.createElement(nodename);
       },
     };
 
     // Set `openContextMenu` this way so, `serviceContainer` variable
     // is available in the current scope and we can pass it into
     // `createContextMenu` method.
     serviceContainer.openContextMenu = (e, message) => {
       let { screenX, screenY, target } = e;
rename from devtools/client/webconsole/webconsole.xhtml
rename to devtools/client/webconsole/webconsole.html
--- a/devtools/client/webconsole/webconsole.xhtml
+++ b/devtools/client/webconsole/webconsole.html
@@ -1,14 +1,13 @@
-<?xml version="1.0" encoding="utf-8"?>
 <!-- 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/. -->
 <!DOCTYPE html>
-<html xmlns="http://www.w3.org/1999/xhtml" dir="">
+<html dir="">
 <head>
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
     <link rel="stylesheet" href="chrome://devtools/skin/widgets.css"/>
     <link rel="stylesheet" href="resource://devtools/client/themes/light-theme.css"/>
     <link rel="stylesheet" href="chrome://devtools/skin/webconsole.css"/>
     <link rel="stylesheet" href="chrome://devtools/skin/components-frame.css"/>
     <link rel="stylesheet" href="resource://devtools/client/shared/components/reps/reps.css"/>
     <link rel="stylesheet" href="resource://devtools/client/shared/components/tabs/Tabs.css"/>
@@ -16,25 +15,25 @@
     <link rel="stylesheet" href="chrome://devtools/content/netmonitor/src/assets/styles/netmonitor.css"/>
 
     <script src="chrome://devtools/content/shared/theme-switching.js"></script>
     <script type="application/javascript"
             src="resource://devtools/client/webconsole/new-console-output/main.js"></script>
   </head>
   <body class="theme-sidebar" role="application">
     <div id="app-wrapper" class="theme-body">
-      <div id="output-container" role="document" aria-live="polite"/>
+      <div id="output-container" role="document" aria-live="polite"></div>
       <div id="jsterm-wrapper">
         <div id="webconsole-notificationbox">
           <div class="jsterm-input-container" style="direction:ltr">
             <div class="jsterm-stack-node">
               <textarea class="jsterm-complete-node devtools-monospace"
-                       tabindex="-1"/>
+                       tabindex="-1"></textarea>
               <textarea class="jsterm-input-node devtools-monospace"
                        rows="1" tabindex="0"
-                       aria-autocomplete="list"/>
+                       aria-autocomplete="list"></textarea>
             </div>
           </div>
         </div>
       </div>
     </div>
   </body>
 </html>