Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Xavier Fung 2012-08-11 10:13:17 +08:00
commit 528382f8ea
3 changed files with 35 additions and 14 deletions

View File

@ -219,9 +219,26 @@ ChromeActions.prototype = {
var strings = getLocalizedStrings('chrome.properties'); var strings = getLocalizedStrings('chrome.properties');
var message = getLocalizedString(strings, 'unsupported_feature'); var message = getLocalizedString(strings, 'unsupported_feature');
var win = Services.wm.getMostRecentWindow('navigator:browser'); var notificationBox = null;
var browser = win.gBrowser.getBrowserForDocument(domWindow.top.document); // Multiple browser windows can be opened, finding one for notification box
var notificationBox = win.gBrowser.getNotificationBox(browser); var windowsEnum = Services.wm
.getZOrderDOMWindowEnumerator('navigator:browser', true);
while (windowsEnum.hasMoreElements()) {
var win = windowsEnum.getNext();
if (win.closed)
continue;
var browser = win.gBrowser.getBrowserForDocument(domWindow.top.document);
if (browser) {
// right window/browser is found, getting the notification box
notificationBox = win.gBrowser.getNotificationBox(browser);
break;
}
}
if (!notificationBox) {
log('Unable to get a notification box for the fallback message');
return;
}
// Flag so we don't call the response callback twice, since if the user // Flag so we don't call the response callback twice, since if the user
// clicks open with different viewer both the button callback and // clicks open with different viewer both the button callback and
// eventCallback will be called. // eventCallback will be called.

View File

@ -1279,14 +1279,17 @@ function checkPutBinaryImageDataCompatibility() {
} catch (e) { } catch (e) {
CanvasGraphics.prototype.putBinaryImageData = CanvasGraphics.prototype.putBinaryImageData =
function CanvasGraphicsPutBinaryImageDataShim(ctx, imgData, w, h) { function CanvasGraphicsPutBinaryImageDataShim(ctx, imgData, w, h) {
var tmpImgData = ctx.getImageData(0, 0, w, h); var tmpImgData = 'createImageData' in ctx ? ctx.createImageData(w, h) :
ctx.getImageData(0, 0, w, h);
// Copy over the imageData pixel by pixel.
var tmpImgDataPixels = tmpImgData.data; var tmpImgDataPixels = tmpImgData.data;
var len = tmpImgDataPixels.length; var data = imgData.data;
if ('set' in tmpImgDataPixels)
while (len--) { tmpImgDataPixels.set(data);
tmpImgDataPixels[len] = imgData.data[len]; else {
// Copy over the imageData pixel by pixel.
for (var i = 0, ii = tmpImgDataPixels.length; i < ii; i++)
tmpImgDataPixels[i] = data[i];
} }
ctx.putImageData(tmpImgData, 0, 0); ctx.putImageData(tmpImgData, 0, 0);

View File

@ -103,11 +103,12 @@ var PDFFunction = (function PDFFunctionClosure() {
var size = dict.get('Size'); var size = dict.get('Size');
var bps = dict.get('BitsPerSample'); var bps = dict.get('BitsPerSample');
var order = dict.get('Order'); var order = dict.get('Order') || 1;
if (!order) if (order !== 1) {
order = 1; // No description how cubic spline interpolation works in PDF32000:2008
if (order !== 1) // As in poppler, ignoring order, linear interpolation may work as good
error('No support for cubic spline interpolation: ' + order); TODO('No support for cubic spline interpolation: ' + order);
}
var encode = dict.get('Encode'); var encode = dict.get('Encode');
if (!encode) { if (!encode) {