Removed the Reflow Input in nsIFrame. Added includes for ReflowInput as
necessary in cpp files. Also Forward Declared nsLineLayout in 3 header
files.
Differential Revision: https://phabricator.services.mozilla.com/D298203
In order for the struct tree to be useful, we need to associate printed content with the various nodes in the struct tree.
1. Add an AccessibleId command to DrawTarget.
2. Add a nsDisplayAccessibleId display list item.
3. Make layout frames output nsDisplayAccessibleId items to associate painted content with accessibility tree nodes.
4. Support plumbing the AccessibleId DrawTarget command from the content process to the parent process.
5. Implement AccessibleId for DrawTargetSkia, associating subsequent content drawn to the canvas with the relevant node in the struct tree built by PdfStructTreeBuilder.
Differential Revision: https://phabricator.services.mozilla.com/D285961
This reverts commit 864e3ed1ca.
Revert "Bug 1657973 part 5: Hook up PdfStructTreeBuilder to the layout and gfx code. r=emilio,lsalzman,layout-reviewers"
This reverts commit 50abf9d6c3.
Revert "Bug 1657973 part 4: Hook up PdfStructTreeBuilder to the printing and PDF code. r=layout-reviewers,dshin"
This reverts commit f600fda75a.
Revert "Bug 1657973 part 3: Accessibility engine changes required for PdfStructTreeBuilder. r=eeejay"
This reverts commit 5a036cc26e.
Revert "Bug 1657973 part 2: Add PdfStructTreeBuilder. r=eeejay"
This reverts commit 8d98b7bed1.
Revert "Bug 1657973 part 1: Plumb BrowsingContext id to PrintTargetSkPDF::BeginPrinting and make it available to nsDeviceContext::End/AbortDocument. r=emilio,geckoview-reviewers,win-reviewers,layout-reviewers,gstoll,m_kato"
This reverts commit cc79f1945a.
In order for the struct tree to be useful, we need to associate printed content with the various nodes in the struct tree.
1. Add an AccessibleId command to DrawTarget.
2. Add a nsDisplayAccessibleId display list item.
3. Make layout frames output nsDisplayAccessibleId items to associate painted content with accessibility tree nodes.
4. Support plumbing the AccessibleId DrawTarget command from the content process to the parent process.
5. Implement AccessibleId for DrawTargetSkia, associating subsequent content drawn to the canvas with the relevant node in the struct tree built by PdfStructTreeBuilder.
Differential Revision: https://phabricator.services.mozilla.com/D285961
This extends the measuring reflow mechanism from multicol (Bug 1994346) to
printing scenarios. When absolutely positioned elements exist, we now perform
an initial measuring reflow with an unconstrained page height to compute
unfragmented positions, sizes, etc.
Each frame type (nsPageSequenceFrame, nsPageFrame, PrintedSheetFrame,
nsPageContentFrame) has their own logic to calculate the available size for its
child, and they do not derive the size from their own reflow input's available
size. To avoid substantial refactoring, this patch checks
`mIsInFragmentainerMeasuringReflow` and overrides the available block-size to
unconstrained when running a measuring reflow.
Differential Revision: https://phabricator.services.mozilla.com/D284550
I looked at this because in bug 2014331 I need to mark more pseudos as
element-backed, and it's kinda silly the state our setup is in right
now.
This is all a somewhat historical mess, because in the old style system
pseudo-elements were just atoms, and we had that different types of atom
setup. The source of truth for these right now lives in a header macro
file, which isn't very flexible.
But now we have PseudoStyleType which represents both pseudos and anon
boxes, and is similar to the rust side PseudoElement enum.
Plus, the ::-moz-tree pseudo-elements are defined as anon boxes which
doesn't make any sense, so move them to pseudo-elements while at it.
Unify this in a similar way we treat CSS properties: Source of truth is
in pseudo_elements.toml / anon_boxes.toml, and we generate Rust and C++
as needed. This allows removing the nsStaticAtom subclass thing from
XPCOM, too.
This avoids some nasty duplication around which pseudos are pref-gated
and what not as well.
Differential Revision: https://phabricator.services.mozilla.com/D282076
I looked at this because in bug 2014331 I need to mark more pseudos as
element-backed, and it's kinda silly the state our setup is in right
now.
This is all a somewhat historical mess, because in the old style system
pseudo-elements were just atoms, and we had that different types of atom
setup. The source of truth for these right now lives in a header macro
file, which isn't very flexible.
But now we have PseudoStyleType which represents both pseudos and anon
boxes, and is similar to the rust side PseudoElement enum.
Plus, the ::-moz-tree pseudo-elements are defined as anon boxes which
doesn't make any sense, so move them to pseudo-elements while at it.
Unify this in a similar way we treat CSS properties: Source of truth is
in pseudo_elements.toml / anon_boxes.toml, and we generate Rust and C++
as needed. This allows removing the nsStaticAtom subclass thing from
XPCOM, too.
This avoids some nasty duplication around which pseudos are pref-gated
and what not as well.
Differential Revision: https://phabricator.services.mozilla.com/D282076
`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