Bug 1292592 - load sourceeditor in inspector without iframe;r=bgrins
MozReview-Commit-ID: K3ptp0g4RP8
--- a/devtools/client/inspector/markup/html-editor.js
+++ b/devtools/client/inspector/markup/html-editor.js
@@ -52,20 +52,18 @@ function HTMLEditor(htmlDocument) {
config.extraKeys[ctrl("Enter")] = this.hide;
config.extraKeys.F2 = this.hide;
config.extraKeys.Esc = this.hide.bind(this, false);
this.container.addEventListener("click", this.hide, false);
this.editorInner.addEventListener("click", stopPropagation, false);
this.editor = new Editor(config);
- let iframe = this.editorInner.ownerDocument.createElement("iframe");
- this.editor.appendTo(this.editorInner, iframe).then(() => {
- this.hide(false);
- }).then(null, (err) => console.log(err.message));
+ this.editor.appendToLocalElement(this.editorInner);
+ this.hide(false);
}
HTMLEditor.prototype = {
/**
* Need to refresh position by manually setting CSS values, so this will
* need to be called on resizes and other sizing changes.
*/
--- a/devtools/client/inspector/markup/markup.xhtml
+++ b/devtools/client/inspector/markup/markup.xhtml
@@ -3,19 +3,24 @@
- 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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link rel="stylesheet" href="chrome://devtools/skin/markup.css" type="text/css"/>
+ <link rel="stylesheet" href="chrome://devtools/content/sourceeditor/codemirror/lib/codemirror.css" type="text/css"/>
+ <link rel="stylesheet" href="chrome://devtools/content/sourceeditor/codemirror/addon/dialog/dialog.css" type="text/css"/>
+ <link rel="stylesheet" href="chrome://devtools/content/sourceeditor/codemirror/mozilla.css" type="text/css"/>
<script type="application/javascript;version=1.8"
- src="chrome://devtools/content/shared/theme-switching.js"/>
+ src="chrome://devtools/content/shared/theme-switching.js"></script>
+ <script type="application/javascript;version=1.8"
+ src="chrome://devtools/content/sourceeditor/codemirror/codemirror.bundle.js"></script>
</head>
<body class="theme-body devtools-monospace" role="application">
<!-- NOTE THAT WE MAKE EXTENSIVE USE OF HTML COMMENTS IN THIS FILE IN ORDER -->
<!-- TO MAKE SPANS READABLE WHILST AVOIDING SIGNIFICANT WHITESPACE -->
<div id="root-wrapper" role="presentation">