`nsIFrame` already provides `GetIntrinsicSize()` for subclasses to override.
Therefore, `nsLeafFrame` doesn't need to introduce another version for its
subclasses.
This patch (hopefully) shouldn't change the behavior.
Differential Revision: https://phabricator.services.mozilla.com/D215998
The overrides were added in bug 1803861. With Part 1 , they are no longer
needed.
Actually, without this patch, the assertion "First descendent of
nsPageSequenceFrame should not have a previous continuation" in
`nsPageFrame::FirstContinuation` will be triggered when constructing frame tree,
because `nsSplittableFrame::SetPrevContinuation` now accesses
`FirstContinuation()`, but the parent-child relationship might not properly set
up yet.
Differential Revision: https://phabricator.services.mozilla.com/D197758
The overrides were added in bug 1803861. With Part 1 , they are no longer
needed.
Actually, without this patch, the assertion "First descendent of
nsPageSequenceFrame should not have a previous continuation" in
`nsPageFrame::FirstContinuation` will be triggered when constructing frame tree,
because `nsSplittableFrame::SetPrevContinuation` now accesses
`FirstContinuation()`, but the parent-child relationship might not properly set
up yet.
Differential Revision: https://phabricator.services.mozilla.com/D197758
Where supported (print preview and print-to-PDF), this implements changing the
orientation and/or rotation of print sheets, as appropriate, in response to CSS
`page-orientation`. When supported we:
- in the single page-per-sheet case, rotate the sheet in order to implement
any `page-orientation` rotation on the sheet. Rotating the sheet is necessary
so that when we output PDF files the pages visually have the correct
orientation.
- in the multiple pages-per-sheet case, we already rotate individual pages in
their grid cell. This commit keeps such pages rotated, as appropriate, but
augments that behavior by switching the orientation of the sheet (based on
the first page on the sheet), if necessary, to make best use of the space on
the sheet. (We can't know what orientation any subsequent pages on the sheet
will have, so we assume the same orientation as the first one.)
Depends on D179423
Differential Revision: https://phabricator.services.mozilla.com/D179448
Where supported (print preview and print-to-PDF), this implements changing the
orientation and/or rotation of print sheets, as appropriate, in response to CSS
`page-orientation`. When supported we:
- in the single page-per-sheet case, rotate the sheet in order to implement
any `page-orientation` rotation on the sheet. Rotating the sheet is necessary
so that when we output PDF files the pages visually have the correct
orientation.
- in the multiple pages-per-sheet case, we already rotate individual pages in
their grid cell. This commit keeps such pages rotated, as appropriate, but
augments that behavior by switching the orientation of the sheet (based on
the first page on the sheet), if necessary, to make best use of the space on
the sheet. (We can't know what orientation any subsequent pages on the sheet
will have, so we assume the same orientation as the first one.)
Depends on D179423
Differential Revision: https://phabricator.services.mozilla.com/D179448
Where supported (print preview and print-to-PDF), this implements changing the
orientation and/or rotation of print sheets, as appropriate, in response to CSS
`page-orientation`. When supported we:
- in the single page-per-sheet case, rotate the sheet in order to implement
any `page-orientation` rotation on the sheet. Rotating the sheet is necessary
so that when we output PDF files the pages visually have the correct
orientation.
- in the multiple pages-per-sheet case, we already rotate individual pages in
their grid cell. This commit keeps such pages rotated, as appropriate, but
augments that behavior by switching the orientation of the sheet (based on
the first page on the sheet), if necessary, to make best use of the space on
the sheet. (We can't know what orientation any subsequent pages on the sheet
will have, so we assume the same orientation as the first one.)
Depends on D179423
Differential Revision: https://phabricator.services.mozilla.com/D179448
Where supported (print preview and print-to-PDF), this implements changing the
orientation and/or rotation of print sheets, as appropriate, in response to CSS
`page-orientation`. When supported we:
- in the single page-per-sheet case, rotate the sheet in order to implement
any `page-orientation` rotation on the sheet. Rotating the sheet is necessary
so that the pages in the PDF files that we output are correct.
- in the multiple pages-per-sheet case, we already rotate individual pages in
their grid cell. This change keeps such pages rotated, as appropriate, but
augments that behavior by switching the orientation of the sheet (based on
the first page on the sheet) if necessary to best place the page to make
maximum use of the space.
Depends on D179423
Differential Revision: https://phabricator.services.mozilla.com/D179448
This code doesn't change behavior itself. The same sheet size is cached on all
sheets. Patches for future bugs will change that.
Differential Revision: https://phabricator.services.mozilla.com/D179395
This code doesn't change behavior itself. The same sheet size is cached on all
sheets. Patches for future bugs will change that.
Differential Revision: https://phabricator.services.mozilla.com/D179395
Prior to this patch, we would place the pages edge-to-edge, then center that
collection of pages in the sheet. Now we create a grid of equally sized cells
that uses as much of the sheet as possible. Each page is then centered in its
grid cell.
Differential Revision: https://phabricator.services.mozilla.com/D179092
Prior to this change, it wasn't at all clear that the single page-per-sheet
calculations are actually very simple. This makes it a lot clearer. It also
changes the transform code to avoid unnecessary mixing of Pre* and Post*
operations, which was making the code more difficult to reason about.
Separating out this change also makes the changes that will be introduced in
bug 1833239 a lot easier to understand.
Differential Revision: https://phabricator.services.mozilla.com/D178351
To support mixed sheet orientations when printing, these calculations need to
be per-sheet. (This change will also be necessary further in the future when we
support saving to PDF with different sheet sizes.)
Differential Revision: https://phabricator.services.mozilla.com/D176914
Setting an at-page size where the width or height is zero is valid CSS but is unprintable, so a size with zero in it will be ignored with this change.
Differential Revision: https://phabricator.services.mozilla.com/D167624
This works with margin and page-size, though we can't properly test mixed
page-size yet due to limitations in both print preview testing (which does not
handle multiple pages) and paged reftests (which ignore page-size).
It may be appropriate to remove the @page { margin } propagation from Servo
after this change.
Differential Revision: https://phabricator.services.mozilla.com/D158227
This works with margin and page-size, though we can't properly test mixed
page-size yet due to limitations in both print preview testing (which does not
handle multiple pages) and paged reftests (which ignore page-size).
It may be appropriate to remove the @page { margin } propagation from Servo
after this change.
Differential Revision: https://phabricator.services.mozilla.com/D158227
The @page rule may contain both 'page-orientation' and 'size' properties. The
'size' property can contain an orientation component which was being
represented as 'PageOrientation' prior to this patch. This patch changes that
to 'PageSizeOrientation' so that 'PageOrientation' can be used for
'page-orientation' in a subsequent patch.
Differential Revision: https://phabricator.services.mozilla.com/D160790
This lets users e.g. print-to-scale where it matters.
Custom margins are still clamped to unwriteable margins, even when all zeroes,
to avoid impacting user-specified & persisted margins.
Differential Revision: https://phabricator.services.mozilla.com/D152900
In the description of the mTruncated bit, its purpose is the same as calling
SetInlineLineBreakBeforeAndReset(). We've removed all its usages in previous
patches, so the bit is no longer needed.
Differential Revision: https://phabricator.services.mozilla.com/D151461
This includes two versions of the function, one which takes an already-computed
page size to avoid computing this multiple times for a caller, and the other
which computes this value itself for convenience.
Differential Revision: https://phabricator.services.mozilla.com/D146601
This includes two versions of the function, one which takes an already-computed
page size to avoid computing this multiple times for a caller, and the other
which computes this value itself for convenience.
Differential Revision: https://phabricator.services.mozilla.com/D146601
There are some mediaqueries-5 features that we still don't support and
explain the remaining failures in at-container-{parsing,serialization}.
Differential Revision: https://phabricator.services.mozilla.com/D144446
This scaling factor is to account for ComputePagesPerSheetAndPageSizeTransform,
but that is not used when printing headers/footers, which resulted in the
reversed scale clipping the header/footer.
Differential Revision: https://phabricator.services.mozilla.com/D136830
This scaling factor is to account for ComputePagesPerSheetAndPageSizeTransform,
but that is not used when printing headers/footers, which resulted in the
reversed scale clipping the header/footer.
Differential Revision: https://phabricator.services.mozilla.com/D136830