Bug 1455330 - Remove unsafeSetInnerHTML from test_bug570192.xul. r?johannh draft
authorPrathiksha <prathikshaprasadsuman@gmail.com>
Sun, 22 Apr 2018 17:13:01 +0530
changeset 786277 677e16a7a6fe4228f66f17afc320bf7cad971a42
parent 782895 6276ec7ebbf33e3484997b189f20fc1511534187
push id107422
push userbmo:prathikshaprasadsuman@gmail.com
push dateSun, 22 Apr 2018 11:27:56 +0000
reviewersjohannh
bugs1455330, 570192
milestone61.0a1
Bug 1455330 - Remove unsafeSetInnerHTML from test_bug570192.xul. r?johannh MozReview-Commit-ID: FuS9PfR3tqv
toolkit/content/tests/chrome/test_bug570192.xul
--- a/toolkit/content/tests/chrome/test_bug570192.xul
+++ b/toolkit/content/tests/chrome/test_bug570192.xul
@@ -27,25 +27,26 @@ https://bugzilla.mozilla.org/show_bug.cg
     <div id="content" style="display: none">
     </div>
     <pre id="test">
     </pre>
   </body>
 
   <script type="application/javascript">
     <![CDATA[
+    const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
 
     addLoadEvent(function() {
       try {
         var content = document.getElementById("content");
-        content.unsafeSetInnerHTML('<textbox newlines="pasteintact" ' +
-          'xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"/>');
-        var textbox = content.firstChild;
-        ok(textbox, "created the textbox");
-        ok(!textbox.editor, "do we have an editor?");
+        let textbox = document.createElementNS(XUL_NS, "textbox");
+        textbox.setAttribute("newlines", "pasteintact");
+        content.appendChild(textbox);
+        ok(content.firstChild, "created the textbox");
+        ok(!content.firstChild.editor, "do we have an editor?");
       } catch (e) {
         ok(false, "Got an exception: " + e);
       }
       SimpleTest.finish();
     });
     SimpleTest.waitForExplicitFinish();
 
    ]]>