From a8a552beb997f1af3608aa21d325e071fd04074e Mon Sep 17 00:00:00 2001 From: Ricky Chien Date: Wed, 4 Jan 2017 11:52:26 +0800 Subject: [PATCH] Bug 1328498 - Sourceeditor appendTo HTML element supports r=Honza MozReview-Commit-ID: 1gdhH8PdIuc --HG-- extra : rebase_source : f6722997d50d47d7a43e01921af2135b165295d9 --- devtools/client/sourceeditor/editor.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/devtools/client/sourceeditor/editor.js b/devtools/client/sourceeditor/editor.js index eaf6fa04e83a..54fa82abc2a2 100644 --- a/devtools/client/sourceeditor/editor.js +++ b/devtools/client/sourceeditor/editor.js @@ -257,10 +257,12 @@ Editor.prototype = { let cm = editors.get(this); if (!env) { - env = el.ownerDocument.createElementNS(XUL_NS, "iframe"); - } + env = el.ownerDocument.createElementNS(el.namespaceURI, "iframe"); - env.flex = 1; + if (el.namespaceURI === XUL_NS) { + env.flex = 1; + } + } if (cm) { throw new Error("You can append an editor only once.");