Bug 1874684 - Part 17: Fix uninitialised variable warnings from clang-tidy. r=allstarschh
[gecko.git] / editor / libeditor / tests / test_bug616590.xhtml
blob4a4bad7224c8147809e1cc2ff6658ef9f7679ee2
1 <?xml version="1.0"?>
2 <?xml-stylesheet href="chrome://global/skin"
3 type="text/css"?>
4 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
5 type="text/css"?>
6 <!--
7 https://bugzilla.mozilla.org/show_bug.cgi?id=616590
8 -->
9 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
10 title="Mozilla Bug 616590" onload="runTest();">
11 <script src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
12 <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
14 <body xmlns="http://www.w3.org/1999/xhtml">
15 <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=616590"
16 target="_blank">Mozilla Bug 616590</a>
17 <p/>
18 <editor xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
19 id="editor"
20 type="content"
21 editortype="htmlmail"
22 style="width: 400px; height: 100px;"/>
23 <p/>
24 <pre id="test">
25 </pre>
26 </body>
27 <script class="testbody" type="application/javascript">
28 <![CDATA[
30 SimpleTest.waitForExplicitFinish();
32 function EditorContentListener(aEditor)
34 this.init(aEditor);
37 EditorContentListener.prototype = {
38 init(aEditor)
40 this.mEditor = aEditor;
43 QueryInterface: ChromeUtils.generateQI(["nsIWebProgressListener",
44 "nsISupportsWeakReference"]),
46 onStateChange(aWebProgress, aRequest, aStateFlags)
48 if (aStateFlags & Ci.nsIWebProgressListener.STATE_STOP)
50 var editor = this.mEditor.getEditor(this.mEditor.contentWindow);
51 if (editor) {
52 editor.QueryInterface(Ci.nsIEditorMailSupport);
53 editor.insertAsCitedQuotation("<html><body><div contenteditable>foo</div></body></html>", "", true);
54 document.documentElement.clientWidth;
55 progress.removeProgressListener(this);
56 ok(true, "Test complete");
57 SimpleTest.finish();
63 onProgressChange()
67 onLocationChange()
71 onStatusChange()
75 onSecurityChange()
79 onContentBlockingEvent()
83 mEditor: null
86 var progress, progressListener;
88 function runTest() {
89 var editorElement = document.getElementById("editor");
90 editorElement.makeEditable("htmlmail", true);
91 var docShell = editorElement.docShell;
92 progress = docShell.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIWebProgress);
93 progressListener = new EditorContentListener(editorElement);
94 progress.addProgressListener(progressListener, Ci.nsIWebProgress.NOTIFY_ALL);
95 editorElement.setAttribute("src", "data:text/html,");
97 ]]>
98 </script>
99 </window>