Closed Bug 1667053 Opened 4 years ago Closed 4 years ago

Convert nsPrintSettingsX to do something like nsPrintSettingsWin::CopyFromNative/CopyToNative

Categories

(Core :: Printing: Setup, task, P2)

task

Tracking

()

VERIFIED FIXED
84 Branch
Tracking Status
firefox83 --- verified
firefox84 --- verified

People

(Reporter: jwatt, Assigned: jfkthame)

References

Details

(Whiteboard: [print2020_v83])

Attachments

(2 files)

nsPrintSettingsX containing an NSPrintInfo is a continued source of bugs and pain, just the latest example being bug 1666473. (Two sources of truth is never good.) We should get rid of nsPrintSettingsX::mPrintInfo and do something like nsPrintSettingsWin::CopyFromNative/CopyToNative instead.

Assignee: nobody → enordin
Status: NEW → ASSIGNED

Proposing to steal this from Erik as I understand he's busy with other things at the moment.

Assignee: enordin → jfkthame
See Also: → 1668037

Uploading the WIP that I had been working on for this.
Feel free to cherrypick anything from it, or start for scratch.
I just want it to be available if it's useful at all.

I was currently trying to figure out why PMPageFormat
was getting messed up and causing tiny, cropped pages.

jfkthame I uploaded the WIP that I had been working on in case it's useful to you.

Thanks! I'll take a look.

Attachment #9180466 - Attachment description: Bug 1667053 - WIP handing off to jfkthame → Bug 1667053 - Refactor macOS print settings implementation for clarity.
Attachment #9180466 - Attachment description: Bug 1667053 - Refactor macOS print settings implementation for clarity. → Bug 1667053 - Refactor macOS print settings implementation for clarity. r=jwatt
Attachment #9180466 - Attachment description: Bug 1667053 - Refactor macOS print settings implementation for clarity. r=jwatt → Bug 1667053 - Refactor macOS print settings implementation for clarity.
Attachment #9182432 - Attachment description: Bug 1667053 patch 2 - If the user runs the system print UI, hold on to and use the printInfo it returns. r=jwatt → Bug 1667053 patch 2 - If the user runs the system print UI, hold on to and use the printInfo it returns.
Pushed by jkew@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/fba6c89ef4cf
Refactor macOS print settings implementation for clarity. r=jwatt
https://hg.mozilla.org/integration/autoland/rev/164586483e97
patch 2 - If the user runs the system print UI, hold on to and use the printInfo it returns. r=jwatt
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 84 Branch

Comment on attachment 9180466 [details]
Bug 1667053 - Refactor macOS print settings implementation for clarity.

Beta/Release Uplift Approval Request

  • User impact if declined: Handling of printer settings on macOS is sometimes unreliable due to complex/flaky code (e.g. bug 1672304); this patch rearchitects the settings management for simpler, clearer, more reliable code. Uplifting this will also simplify uplift of other printing-related patches (e.g. bug 1670943) which will otherwise need significant work to rebase onto the older architecture.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: No
  • Needs manual test from QE?: Yes
  • If yes, steps to reproduce: No specific STR but extensive testing of various print dialog settings such as paper size & orientation, print job destinations, scaling etc (through both the tab-modal and legacy UIs) would be valuable.
  • List of other uplifts needed: None
  • Risk to taking this patch: Medium
  • Why is the change risky/not risky? (and alternatives if risky): This is a major rewrite of how the print job settings are managed, so does come with some risk of its own new bugs; but overall we believe the new code to be a much better foundation, and simpler to debug and maintain.
    The alternative is to continue applying ad hoc fixes to the old code whenever flaky behavior is noted.
  • String changes made/needed:
Attachment #9180466 - Flags: approval-mozilla-beta?
Attachment #9182432 - Flags: approval-mozilla-beta?
Flags: qe-verify+
QA Whiteboard: [qa-triaged]

We have performed an unscheduled test run(https://testrail.stage.mozaws.net/index.php?/reports/view/3612) in order to verify that no regressions were introduced by the macOS print settings refactoring in Firefox 84. We have executed our smoke & sanity test cases as well as an extensive exploratory session targeting both the new and old print UI with an emphasis on different print settings.

During this test run, we have encountered 1 issue (1673586) but it doesn't seem to be caused by this particular code refactor. Marking this as verified fixed for 84.
Leaving a ni? on myself to track this once it gets approved for beta 83. Depending when it lands, this will be covered in our preliminary 83 preliminary feature testing (26-30 Oct) or in our pre-release 83 feature testing (2-6 Nov)

Status: RESOLVED → VERIFIED
Flags: needinfo?(vlad.lucaci)

Comment on attachment 9180466 [details]
Bug 1667053 - Refactor macOS print settings implementation for clarity.

Let's take it in 83 beta 5 now as I'd like to have feedback from QA as early as possible in case we have to fix or back it out before we ship 83.

Attachment #9180466 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Attachment #9182432 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

As per comment 10, we have covered this in our preliminary 83 feature testing(https://testrail.stage.mozaws.net/index.php?/plans/view/36545) and only managed to find one specific macOS issue : 1674155 that does not seem to be related to the refactoring, but instead to a very specific combination of hardware.

Flags: qe-verify+
Flags: needinfo?(vlad.lucaci)
Regressions: 1740421
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: