[Pkg-javascript-commits] [pdf.js] 54/119: Address review comments from Bug 1148192 - Update pdf.js to version 1.1.24
David Prévot
taffit at moszumanska.debian.org
Wed May 13 21:27:41 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository pdf.js.
commit 9f63fa4b07a834c3abd50163b3816d06db6abbfc
Author: Jonas Jenwald <jonas.jenwald at gmail.com>
Date: Mon Apr 6 16:26:23 2015 +0200
Address review comments from Bug 1148192 - Update pdf.js to version 1.1.24
See https://bugzilla.mozilla.org/show_bug.cgi?id=1148192#c3.
---
extensions/firefox/content/PdfStreamConverter.jsm | 4 ----
extensions/firefox/content/PdfjsChromeUtils.jsm | 23 +++++++++++------------
2 files changed, 11 insertions(+), 16 deletions(-)
diff --git a/extensions/firefox/content/PdfStreamConverter.jsm b/extensions/firefox/content/PdfStreamConverter.jsm
index 611c0e9..0acce8e 100644
--- a/extensions/firefox/content/PdfStreamConverter.jsm
+++ b/extensions/firefox/content/PdfStreamConverter.jsm
@@ -501,8 +501,6 @@ ChromeActions.prototype = {
var winmm = this.domWindow.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDocShell)
- .sameTypeRootTreeItem
- .QueryInterface(Ci.nsIDocShell)
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIContentFrameMessageManager);
@@ -815,8 +813,6 @@ function FindEventManager(contentWindow) {
this.contentWindow = contentWindow;
this.winmm = contentWindow.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDocShell)
- .sameTypeRootTreeItem
- .QueryInterface(Ci.nsIDocShell)
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIContentFrameMessageManager);
}
diff --git a/extensions/firefox/content/PdfjsChromeUtils.jsm b/extensions/firefox/content/PdfjsChromeUtils.jsm
index ed49732..d74da68 100644
--- a/extensions/firefox/content/PdfjsChromeUtils.jsm
+++ b/extensions/firefox/content/PdfjsChromeUtils.jsm
@@ -179,9 +179,8 @@ let PdfjsChromeUtils = {
},
handleEvent: function(aEvent) {
- // We cannot just forward the message as a CPOW without setting up
- // __exposedProps__ on it. Instead, let's just create a structured
- // cloneable version of the event for performance and for the ease of usage.
+ // To avoid forwarding the message as a CPOW, create a structured cloneable
+ // version of the event for both performance, and ease of usage, reasons.
let type = aEvent.type;
let detail = {
query: aEvent.detail.query,
@@ -190,16 +189,16 @@ let PdfjsChromeUtils = {
findPrevious: aEvent.detail.findPrevious
};
- let chromeWindow = aEvent.target.ownerDocument.defaultView;
- let browser = chromeWindow.gBrowser.selectedBrowser;
- if (this._browsers.has(browser)) {
- // Only forward the events if the selected browser is a registered
- // browser.
- let mm = browser.messageManager;
- mm.sendAsyncMessage('PDFJS:Child:handleEvent',
- { type: type, detail: detail });
- aEvent.preventDefault();
+ let browser = aEvent.currentTarget.browser;
+ if (!this._browsers.has(browser)) {
+ throw new Error('FindEventManager was not bound ' +
+ 'for the current browser.');
}
+ // Only forward the events if the current browser is a registered browser.
+ let mm = browser.messageManager;
+ mm.sendAsyncMessage('PDFJS:Child:handleEvent',
+ { type: type, detail: detail });
+ aEvent.preventDefault();
},
_types: ['find',
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git
More information about the Pkg-javascript-commits
mailing list