diff --git a/browser/components/extensions/parent/ext-tabs.js b/browser/components/extensions/parent/ext-tabs.js index c14df61416eee..b455b0d9d0459 100644 --- a/browser/components/extensions/parent/ext-tabs.js +++ b/browser/components/extensions/parent/ext-tabs.js @@ -1292,11 +1292,6 @@ this.tabs = class extends ExtensionAPI { let title = strBundle.GetStringFromName( "saveaspdf.saveasdialog.title" ); - - if (AppConstants.platform === "macosx") { - return Promise.reject({ message: "Not supported on Mac OS X" }); - } - let filename; if ( pageSettings.toFileName !== null && diff --git a/browser/components/extensions/test/browser/browser.ini b/browser/components/extensions/test/browser/browser.ini index 7e0a42be26294..a0bb887e7acd3 100644 --- a/browser/components/extensions/test/browser/browser.ini +++ b/browser/components/extensions/test/browser/browser.ini @@ -264,7 +264,6 @@ skip-if = !e10s [browser_ext_tabs_reload.js] [browser_ext_tabs_reload_bypass_cache.js] [browser_ext_tabs_saveAsPDF.js] -skip-if = os == 'mac' # Save as PDF not supported on Mac OS X [browser_ext_tabs_sendMessage.js] [browser_ext_tabs_sharingState.js] [browser_ext_tabs_successors.js] diff --git a/widget/cocoa/nsPrintSettingsServiceX.mm b/widget/cocoa/nsPrintSettingsServiceX.mm index cbaa959e98a04..59d6b350c6e4b 100644 --- a/widget/cocoa/nsPrintSettingsServiceX.mm +++ b/widget/cocoa/nsPrintSettingsServiceX.mm @@ -65,7 +65,11 @@ NSURL* printToFileURL = [dict objectForKey:NSPrintJobSavingURL]; if (printToFileURL) { - nsCocoaUtils::GetStringForNSString([printToFileURL absoluteString], data -> toFileName()); + if ([printToFileURL isFileURL]) { + nsCocoaUtils::GetStringForNSString([printToFileURL path], data->toFileName()); + } else { + MOZ_ASSERT_UNREACHABLE("expected a file URL"); + } } NSDate* printTime = [dict objectForKey:NSPrintTime]; diff --git a/widget/cocoa/nsPrintSettingsX.mm b/widget/cocoa/nsPrintSettingsX.mm index 8323339e86600..60c5c6777fefc 100644 --- a/widget/cocoa/nsPrintSettingsX.mm +++ b/widget/cocoa/nsPrintSettingsX.mm @@ -235,8 +235,16 @@ NS_IMETHODIMP nsPrintSettingsX::GetEffectivePageSize(double* aWidth, double* aHeight) { - *aWidth = NS_INCHES_TO_TWIPS(mAdjustedPaperWidth / mWidthScale); - *aHeight = NS_INCHES_TO_TWIPS(mAdjustedPaperHeight / mHeightScale); + if (kPaperSizeInches == GetCocoaUnit(mPaperSizeUnit)) { + *aWidth = NS_INCHES_TO_TWIPS(mAdjustedPaperWidth / mWidthScale); + *aHeight = NS_INCHES_TO_TWIPS(mAdjustedPaperHeight / mHeightScale); + } else { + *aWidth = NS_MILLIMETERS_TO_TWIPS(mAdjustedPaperWidth / mWidthScale); + *aHeight = NS_MILLIMETERS_TO_TWIPS(mAdjustedPaperHeight / mHeightScale); + } + if (kLandscapeOrientation == mOrientation) { + std::swap(*aWidth, *aHeight); + } return NS_OK; }