4 https://bugzilla.mozilla.org/show_bug.cgi?id=468353
7 <title>Test for Bug
468353</title>
8 <script type=
"text/javascript" src=
"/tests/SimpleTest/SimpleTest.js"></script>
9 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css" />
12 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=468353">Mozilla Bug
468353</a>
18 <script class=
"testbody" type=
"text/javascript">
20 var styleSheets = null;
22 function checkStylesheets() {
23 // Evidently RemoveStyleSheet is the only method in nsIEditorStyleSheets
24 // that would throw. RemoveOverrideStyleSheet returns NS_OK even if the
29 styleSheets.removeStyleSheet(
"resource://gre/res/designmode.css");
35 styleSheets.removeStyleSheet(
"resource://gre/res/contenteditable.css");
40 is(removed,
0,
"Should have thrown if stylesheet was not there");
44 const Ci = SpecialPowers.Ci;
46 /** Found while fixing bug
440614 **/
47 var editframe = window.frames[
0];
48 var editdoc = editframe.document;
53 editdoc.designMode='on';
55 // Hold the reference to the editor
56 editor = SpecialPowers.wrap(editframe)
57 .QueryInterface(Ci.nsIInterfaceRequestor)
58 .getInterface(Ci.nsIWebNavigation)
59 .QueryInterface(Ci.nsIInterfaceRequestor)
60 .getInterface(Ci.nsIEditingSession)
61 .getEditorForWindow(editframe);
63 styleSheets = editor.QueryInterface(Ci.nsIEditorStyleSheets);
65 editdoc.designMode='off';
73 editdoc.body.contentEditable = true;
75 // Hold the reference to the editor
76 editor = SpecialPowers.wrap(editframe)
77 .QueryInterface(Ci.nsIInterfaceRequestor)
78 .getInterface(Ci.nsIWebNavigation)
79 .QueryInterface(Ci.nsIInterfaceRequestor)
80 .getInterface(Ci.nsIEditingSession)
81 .getEditorForWindow(editframe);
83 styleSheets = editor.QueryInterface(Ci.nsIEditorStyleSheets);
85 editdoc.body.contentEditable = false;
89 editdoc.designMode =
"on";
90 editdoc.body.contentEditable = true;
91 editdoc.designMode =
"off";
93 // Hold the reference to the editor
94 editor = SpecialPowers.wrap(editframe)
95 .QueryInterface(Ci.nsIInterfaceRequestor)
96 .getInterface(Ci.nsIWebNavigation)
97 .QueryInterface(Ci.nsIInterfaceRequestor)
98 .getInterface(Ci.nsIEditingSession)
99 .getEditorForWindow(editframe);
101 styleSheets = editor.QueryInterface(Ci.nsIEditorStyleSheets);
103 editdoc.body.contentEditable = false;
110 //XXX I don't know if this is necessary, but we're dealing with iframes...
111 SimpleTest.waitForExplicitFinish();
112 addLoadEvent(runTest);