Skip to content

Commit

Permalink
[Bug 1331081] omit addEventListener/removeEventListener's third param…
Browse files Browse the repository at this point in the history
…eter when it's false

Upstream changes from https://bugzilla.mozilla.org/show_bug.cgi?id=1331081; this patch also covers one file, `pdf_print_service.js`, that's not present in mozilla-central.

Fixes 7962.
  • Loading branch information
Snuffleupagus committed Jan 17, 2017
1 parent c1703e9 commit 70c1a6b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
6 changes: 3 additions & 3 deletions web/debugger.js
Original file line number Diff line number Diff line change
Expand Up @@ -403,21 +403,21 @@ var Stepper = (function StepperClosure() {
var listener = function(e) {
switch (e.keyCode) {
case 83: // step
dom.removeEventListener('keydown', listener, false);
dom.removeEventListener('keydown', listener);
self.nextBreakPoint = self.currentIdx + 1;
self.goTo(-1);
callback();
break;
case 67: // continue
dom.removeEventListener('keydown', listener, false);
dom.removeEventListener('keydown', listener);
var breakPoint = self.getNextBreakPoint();
self.nextBreakPoint = breakPoint;
self.goTo(-1);
callback();
break;
}
};
dom.addEventListener('keydown', listener, false);
dom.addEventListener('keydown', listener);
self.goTo(idx);
},
goTo: function goTo(idx) {
Expand Down
4 changes: 2 additions & 2 deletions web/firefoxcom.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ var FirefoxCom = (function FirefoxComClosure() {

document.documentElement.removeChild(node);

document.removeEventListener('pdf.js.response', listener, false);
document.removeEventListener('pdf.js.response', listener);
return callback(response);
}, false);
});
}
document.documentElement.appendChild(request);

Expand Down
11 changes: 5 additions & 6 deletions web/pdf_history.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
} else {
updateHistoryWithCurrentHash();
}
}, false);
});


function updateHistoryWithCurrentHash() {
Expand Down Expand Up @@ -162,18 +162,17 @@
}
// Remove the event listener when navigating away from the document,
// since 'beforeunload' prevents Firefox from caching the document.
window.removeEventListener('beforeunload', pdfHistoryBeforeUnload,
false);
window.removeEventListener('beforeunload', pdfHistoryBeforeUnload);
}

window.addEventListener('beforeunload', pdfHistoryBeforeUnload, false);
window.addEventListener('beforeunload', pdfHistoryBeforeUnload);

window.addEventListener('pageshow', function pdfHistoryPageShow(evt) {
// If the entire viewer (including the PDF file) is cached in
// the browser, we need to reattach the 'beforeunload' event listener
// since the 'DOMContentLoaded' event is not fired on 'pageshow'.
window.addEventListener('beforeunload', pdfHistoryBeforeUnload, false);
}, false);
window.addEventListener('beforeunload', pdfHistoryBeforeUnload);
});

self.eventBus.on('presentationmodechanged', function(e) {
self.isViewerInPresentationMode = e.active;
Expand Down
4 changes: 2 additions & 2 deletions web/pdf_print_service.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,8 @@
event.stopImmediatePropagation();
}
};
window.addEventListener('beforeprint', stopPropagationIfNeeded, false);
window.addEventListener('afterprint', stopPropagationIfNeeded, false);
window.addEventListener('beforeprint', stopPropagationIfNeeded);
window.addEventListener('afterprint', stopPropagationIfNeeded);
}

var overlayPromise;
Expand Down

0 comments on commit 70c1a6b

Please sign in to comment.