Bug 1328498 - Sourceeditor appendTo HTML element supports r?honza
MozReview-Commit-ID: 1gdhH8PdIuc
--- a/devtools/client/sourceeditor/editor.js
+++ b/devtools/client/sourceeditor/editor.js
@@ -252,21 +252,23 @@ Editor.prototype = {
*
* This method is asynchronous and returns a promise.
*/
appendTo: function (el, env) {
let def = promise.defer();
let cm = editors.get(this);
if (!env) {
- env = el.ownerDocument.createElementNS(XUL_NS, "iframe");
+ env = el.ownerDocument.createElementNS(el.namespaceURI, "iframe");
+
+ if (el.namespaceURI === XUL_NS) {
+ env.flex = 1;
+ }
}
- env.flex = 1;
-
if (cm) {
throw new Error("You can append an editor only once.");
}
let onLoad = () => {
let win = env.contentWindow.wrappedJSObject;
if (!this.config.themeSwitching) {