Closed Bug 1643418 Opened 2 years ago Closed 2 years ago

[macOS] Selected range is ignored and Firefox prints all the pages


(Core :: Printing: Setup, defect)




Tracking Status
firefox-esr68 --- unaffected
firefox77 --- unaffected
firefox78 --- verified
firefox79 --- verified


(Reporter: emilghitta, Assigned: jwatt)


(Blocks 1 open bug, Regression)


(Keywords: regression)


(1 file)

Affected versions

  • Firefox 79.0a1 (BuildId: 20200604092907)
  • Firefox 78.0b2 (BuildId:20200602134412)

Unaffected versions

  • Firefox 77.0.1 (BuildId:20200602222727)
  • Firefox 68.9.0esr (BuildId:20200527211442)

Affected platforms

  • macOS 10.15
  • macOS 10.14
  • macOS 10.13

Unaffected platforms

  • Windows 10 64bit
  • Ubuntu 18.04 64bit

Steps to reproduce

  1. Launch Firefox.
  2. Access the following webpage.
  3. Press cmd + p.
  4. Click the “Hide Details” button (if the printing details are displayed).
  5. Select “Range” from the “Pages” dropdown menu.
  6. Select a range (ex: 1 to 3).
  7. Print to file.

Expected result

  • Only the first 3 pages are successfully printed.

Actual result

  • All pages are printed

Regression Range
This seems to be a regression


  • Unfortunately, due to the current situation (COVID), I am not able to print actual paper at the moment.

Hi Bob,

It seems that mozregression pointed out Bug 1627577 part 4: Enable printing restests on macOS and Windows. r=emilio for causing this regression.

Can you please have a look?

Thank you!

Flags: needinfo?(bobowencode)

Must be part 3, since the other parts couldn't cause this. I'll take a look.

It turns out the change in bug 1627577 exposed a pre-existing bug in other code.

When we end up under the following:

  -[PrintPanelAccessoryView exportSettings]
  -[PrintPanelAccessoryController exportSettings]

the call to nsPrintSettingsX::SetPrintRange is wrong. At that point we have just finished opening the print dialog in nsPrintDialogServiceX::Show, and then setting the NSPrintInfo data returned from that dialog onto the nsPrintSettingsX. But the SetPrintRange call in [PrintPanelAccessoryView exportSettings] is overriding the range type with nsIPrintSettings::kRangeAllPages if the "Print Selection Only" checkbox is not set. It should be leaving it alone so that the nsIPrintSettings::kRangeSpecifiedPageRange value is not wiped out, unless that checkbox is checked, in which case it should set nsIPrintSettings::kRangeSelection, I guess (if we accept that checking "Print Selection Only" should override the page range).

Assignee: nobody → jwatt
Flags: needinfo?(bobowencode)
Pushed by
Don't overwrite the print range type if 'Print Selection Only' is unchecked. r=nordzilla
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla79

I can confirm that this issue is verified fixed using Firefox 79.0a1 (provided in comment 6) on macOS 10.13 (tested both remote & local pages).

Also, initially the "Single" option was ignored as well but this patch fixes both "Single" and "Range".

Leaving a ni? on myself in case of possible beta uplift request/approval.

Flags: needinfo?(emil.ghitta)

Comment on attachment 9154366 [details]
Bug 1643418. Don't overwrite the print range type if 'Print Selection Only' is unchecked. r=nordzilla

Beta/Release Uplift Approval Request

  • User impact if declined: Users are only able to print entire documents, and selecting to print a page range will be ignored.
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): It fixes an obviously-wrong overwriting of a variable, that variable simply controlling which range of pages we print.
  • String changes made/needed: none
Attachment #9154366 - Flags: approval-mozilla-beta?

Comment on attachment 9154366 [details]
Bug 1643418. Don't overwrite the print range type if 'Print Selection Only' is unchecked. r=nordzilla

regression fix for printing on mac, approved for 78.0b4

Attachment #9154366 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

This issue is verified fixed using Firefox 78.0b4 (BuildID:20200605150717) on macOS 10.14

Flags: needinfo?(emil.ghitta)
Blocks: 1557682
Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.