Skip to content

Commit

Permalink
Bug 1133288 - Remove nonstandard expression closures from editor. r=e…
Browse files Browse the repository at this point in the history
…hsan
  • Loading branch information
cpeterso committed Jan 25, 2015
1 parent 01c1407 commit 48957d0
Show file tree
Hide file tree
Showing 5 changed files with 119 additions and 119 deletions.
14 changes: 7 additions & 7 deletions editor/composer/test/test_bug519928.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,16 @@

var iframe = document.getElementById("load-frame");

function enableJS() allowJS(true, iframe);
function disableJS() allowJS(false, iframe);
function enableJS() { allowJS(true, iframe); }
function disableJS() { allowJS(false, iframe); }
function allowJS(allow, frame) {
SpecialPowers.wrap(frame.contentWindow)
.QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor)
.getInterface(SpecialPowers.Ci.nsIWebNavigation)
.QueryInterface(SpecialPowers.Ci.nsIDocShell)
.allowJavascript = allow;
}

function expectJSAllowed(allowed, testCondition, callback) {
window.ICanRunMyJS = false;
var self_ = window;
Expand All @@ -49,8 +50,8 @@

SimpleTest.waitForExplicitFinish();
addLoadEvent(function() {
var enterDesignMode = function() document.designMode = "on";
var leaveDesignMode = function() document.designMode = "off";
var enterDesignMode = function() { document.designMode = "on"; };
var leaveDesignMode = function() { document.designMode = "off"; };
expectJSAllowed(false, disableJS, function() {
expectJSAllowed(true, enableJS, function() {
expectJSAllowed(true, enterDesignMode, function() {
Expand All @@ -59,8 +60,8 @@
expectJSAllowed(false, enterDesignMode, function() {
expectJSAllowed(false, leaveDesignMode, function() {
expectJSAllowed(true, enableJS, function() {
enterDesignMode = function() iframe.contentDocument.designMode = "on";
leaveDesignMode = function() iframe.contentDocument.designMode = "off";
enterDesignMode = function() { iframe.contentDocument.designMode = "on"; };
leaveDesignMode = function() { iframe.contentDocument.designMode = "off"; };
expectJSAllowed(false, disableJS, function() {
expectJSAllowed(true, enableJS, function() {
expectJSAllowed(true, enterDesignMode, function() {
Expand Down Expand Up @@ -120,4 +121,3 @@
</pre>
</body>
</html>

4 changes: 2 additions & 2 deletions editor/libeditor/tests/test_CF_HTML_clipboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

var flavors = [CF_HTML];
if (!cb.hasDataMatchingFlavors(flavors, flavors.length, cb.kGlobalClipboard)) {
setTimeout(function() copyCF_HTML_worker(success, failure), 100);
setTimeout(function() { copyCF_HTML_worker(success, failure); }, 100);
return;
}

Expand All @@ -59,7 +59,7 @@
trans.getTransferData(CF_HTML, data, {});
data = SpecialPowers.wrap(data).value.QueryInterface(Ci.nsISupportsCString).data;
} catch (e) {
setTimeout(function() copyCF_HTML_worker(success, failure), 100);
setTimeout(function() { copyCF_HTML_worker(success, failure); }, 100);
return;
}
success();
Expand Down
Loading

0 comments on commit 48957d0

Please sign in to comment.