Closed Bug 1652278 Opened 4 years ago Closed 4 years ago

Create a frame class to represent a virtual sheet of paper

Categories

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

task

Tracking

()

RESOLVED FIXED
81 Branch
Tracking Status
firefox81 --- fixed

People

(Reporter: dholbert, Assigned: dholbert)

References

Details

(Whiteboard: [print2020_v81])

Attachments

(2 files, 1 obsolete file)

As an incremental step towards "pages-per-sheet" (bug 1631452), we need a frame class to represent a printed/print-previewed sheet of paper. nsPageFrame is sort of that class right now, but it represents both the page and the sheet of paper, and we want to decouple those.

In this bug, I'll create that new class to represent a sheet of paper (tentatively called "nsSheetFrame", so that e.g. "9 pages-per-sheet" will literally be "9 nsPageFrame instances on a nsSheetFrame").

For now, nsSheetFrame will just be container for a single nsPageFrame and will coopt some of its existing responsibility (in particular: nsSheetFrame will be responsible for rendering each virtual sheet of paper in Print Preview, as well as managing offsets from the edge of a printed sheet of paper).

So: this bug here isn't intended to change behavior. A subsequent bug will enhance nsSheetFrame to hold more than one nsPageFrame, to actually get multiple pages per sheet.

(In reply to Daniel Holbert [:dholbert] from comment #0)

In this bug, I'll create that new class to represent a sheet of paper (tentatively called "nsSheetFrame"

Actually: I'm leaning towards naming it "nsPrintedSheetFrame", and use "printed sheet" for naming in general, to reduce ambiguity & potential confusion with "stylesheets" (which are a completely unrelated sort of "sheet").

Case in point: the styles for drawing the print-preview rendering for a piece of paper currently live in the :-moz-page pseudoclass, and those will need to move to a pseudoclass for this new thing. And if we named the new pseudoclass :-moz-sheet, I worry that that'd be too confusing/ambiguous of a name -- whereas -moz-printed-sheet is a bit more specific & harder to misunderstand.

Whiteboard: [print2020] → [print2020_v80]

As of this patch, this frame class is compiled, but it doesn't do anything and
it's never instantiated. Subsequent patches in this series will change that.

(This patch is just to get the "new frame class" boilerplate out of the way.)

Depends on: 1652788
Whiteboard: [print2020_v80] → [print2020_v81]
Attachment #9163403 - Attachment description: Bug 1652278 part 1: Add stub implementation for new frame class "PrintedSheetFrame", whose instances represent an individual printed sheet of paper. → Bug 1652278 part 1: Add stub implementation for new frame class "PrintedSheetFrame", to represent an individual printed sheet of paper.
Attachment #9163404 - Attachment description: Bug 1652278 part 2: Change frame hierarchy so that PrintedSheet is the container for nsPageFrame (but doesn't do anything beyond that yet). → Bug 1652278 part 2: Change frame hierarchy so that PrintedSheet is the container for nsPageFrame.
Attachment #9163403 - Attachment description: Bug 1652278 part 1: Add stub implementation for new frame class "PrintedSheetFrame", to represent an individual printed sheet of paper. → Bug 1652278 part 1: Add stub implementation for new frame class "PrintedSheetFrame", to represent an individual printed sheet of paper. r?TYLin
Attachment #9163404 - Attachment description: Bug 1652278 part 2: Change frame hierarchy so that PrintedSheet is the container for nsPageFrame. → Bug 1652278 part 2: Change frame hierarchy so that PrintedSheetFrame is the container for nsPageFrame.
Attachment #9163404 - Attachment description: Bug 1652278 part 2: Change frame hierarchy so that PrintedSheetFrame is the container for nsPageFrame. → Bug 1652278 part 2: Build out PrintedSheetFrame so that it serves as the container for nsPageFrame.
Attachment #9163404 - Attachment description: Bug 1652278 part 2: Build out PrintedSheetFrame so that it serves as the container for nsPageFrame. → Bug 1652278 part 2: Flesh out PrintedSheetFrame implementation so that it serves as the container for nsPageFrame.
Depends on: 1655608

Sorry, disregard comment 4-5 -- I copypasted the wrong bug number into a commit message.

Attachment #9163404 - Attachment description: Bug 1652278 part 2: Flesh out PrintedSheetFrame implementation so that it serves as the container for nsPageFrame. → Bug 1652278 part 2: Flesh out PrintedSheetFrame implementation so that it serves as the container for nsPageFrame. r?TYLin
Depends on: 1657024
Pushed by dholbert@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/bcd829a3b3f9 part 1: Add stub implementation for new frame class "PrintedSheetFrame", to represent an individual printed sheet of paper. r=TYLin https://hg.mozilla.org/integration/autoland/rev/026ae02537a3 part 2: Flesh out PrintedSheetFrame implementation so that it serves as the container for nsPageFrame. r=TYLin
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 81 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: