The trickiest bits are the PrintTargetCG ones, the rest is just plumbing
and cleanups and tests, but let me know if you want those to be split
out, can do.
The GTK change to nsPrintSettingsGTK::GetResolution is a no-op (we only
read resolution on windows), but I did that because we assume that it
doesn't fail and GTK returns a sane default anyways.
Differential Revision: https://phabricator.services.mozilla.com/D142199
The trickiest bits are the PrintTargetCG ones, the rest is just plumbing
and cleanups and tests, but let me know if you want those to be split
out, can do.
The GTK change to nsPrintSettingsGTK::GetResolution is a no-op (we only
read resolution on windows), but I did that because we assume that it
doesn't fail and GTK returns a sane default anyways.
Differential Revision: https://phabricator.services.mozilla.com/D142199
IsSyncPagePrinting() only had one implementation which unconditionally
returned true.
So, any code that was conditioned on !IsSyncPagePrinting() is necessarily
dead/unreachable.
These are also crashing due to a null deref in mPrintTarget which might
happen if print is aborted.
Differential Revision: https://phabricator.services.mozilla.com/D140988
This is a mechanical change which was performed by a script based on the
contents of direct_call.py, and then manually checked over to fix
various rewriting bugs caused by my glorified sed script. See the
previous part for more context on the change.
Differential Revision: https://phabricator.services.mozilla.com/D137227
This removal fixes the following non-fatal warning which (like some categories of warnings) only appears when you build in non-unified mode:
layout/printing/nsPrintJob.cpp:61:19: warning: unused variable 'kPrintingPromptService' [-Wunused-const-variable]
(Indeed, this variable was entirely unused.)
This patch also removes a bunch of surrounding #includes that looked
likely-unused to me as well. I did some spot-checks to be pretty-sure the
removed headers are all unused at this point, and (most importantly) I made
sure we still successfully build in non-unified mode. This means that, if we
do actually depend on any of these removed includes, we're still getting them
indirectly via some other header, so these removals shouldn't really cause
trouble.
Depends on D138097
Differential Revision: https://phabricator.services.mozilla.com/D138098
The previous patch in this series fixed some sources of non-unified build errors for this directory, and this patch here fixes the only remaining one, which is:
layout/printing/nsPrintJob.cpp:584:22: error: use of undeclared identifier 'do_CreateInstance'
This API is provided by nsComponentManagerUtils.h, which is the include I'm adding here.
Depends on D138096
Differential Revision: https://phabricator.services.mozilla.com/D138097
This fixes a non-unified build error for nsPagePrintTimer's mDocument
member-var being initializated (and getting AddRef'ed) in the constructor's
init list, without its type being defined yet. The .cpp file has the type
definition, so let's just move the constructor definition over there and leave
the header file relatively clean.
While I'm here, I'm also moving nsPagePrintTimer's include for nsPrintObject.h
into its .cpp file, since the header file only needs a forward declaration.
Differential Revision: https://phabricator.services.mozilla.com/D138096
nsPageSequenceFrame does a thing where it grows its desired size to fit the
AvailableISize and ComputedBSize (under the assumption that those are the
actual dimensions of our scrollport, which it wants to make maximal use of).
This behavior causes trouble when it's reflowed under the privileged
'sizeToContent' JS API. That API makes us reflow with nscoord_MAX as the
viewport's ComputedBSize(), and this nscoord_MAX value gets passed down to be
the nsPageSequenceFrame's ComputedBSize as well. When we reach the code in
question, we dutifully grow the desired size to that bogus huge value, which is
clearly wrong.
This patch addresses this issue by simply declining to grow the desired size in
the scenario where ComputedBSize() is unconstrained. This leaves us with
reasonable values for our desired size (which are actually based on the
content, which makes it the right thing to do for the purpose of a
SizeToContent() call).
Differential Revision: https://phabricator.services.mozilla.com/D135762
The background we have on why this exists is in the code comments of the code
that's being removed, and in:
https://bugzilla.mozilla.org/show_bug.cgi?id=193001#c91
It seems very unlikely that this code is necessary. It's run for silent
printing when the new UI is enabled and E10s is disabled. If it was really
necessary it seems likely we'd have seen breakage in our much more common use
cases.
Differential Revision: https://phabricator.services.mozilla.com/D134936
The background we have on why this exists is in the code comments of the code
that's being removed, and in:
https://bugzilla.mozilla.org/show_bug.cgi?id=193001#c91
It seems very unlikely that this code is necessary. It's run for silent
printing when the new UI is enabled and E10s is disabled. If it was really
necessary it seems likely we'd have seen breakage in our much more common use
cases.
Differential Revision: https://phabricator.services.mozilla.com/D134936
It's an internal API corresponding to `Selection.getRangeAt` DOM API.
I think that it should use `uint32_t` rather than `size_t` because of the
consistency with the DOM API and `Selection::RangeCount()`.
This patch fixes all callers of `GetRangeAt()`, and rewrites it with ranged-
loops unless original ones do not refer `RangeCount()` every time and may run
script in the loop.
Differential Revision: https://phabricator.services.mozilla.com/D128848
When a page-size that is not auto or square exists the print preview will use
the orientation of this page-size when doing initial reflow. The frontend
applies the orientation to the print settings without updating settings and
causing a second reflow, and the orientation selector is hidden.
Differential Revision: https://phabricator.services.mozilla.com/D124976
This adds an optional paper orientation to PrintPreviewResultInfo populates it
from the CSS page size when finishing print preview. The value is then placed
in the PrintPreviewSuccessInfo to be sent to the frontend.
Differential Revision: https://phabricator.services.mozilla.com/D124248
Automatically generated path that adds flag `REQUIRES_UNIFIED_BUILD = True` to `moz.build`
when the module governed by the build config file is not buildable outside on the unified environment.
This needs to be done in order to have a hybrid build system that adds the possibility of combing
unified build components with ones that are built outside of the unified eco system.
Differential Revision: https://phabricator.services.mozilla.com/D122345
It's unclear how this can happen (the caller also null-checks, but then
again it also reconstructs a bunch of stuff, so...).
Differential Revision: https://phabricator.services.mozilla.com/D113815
In the DrawTargetRecording case we create new GradientStopsRecording each time
and holding onto them in the content process can mean they take a very large
amount of memory in the GPU process, if a script deliberately creates lots of
unique stops.
In the non-recording case then the GradientStops are cached in the content
process anyway.
Differential Revision: https://phabricator.services.mozilla.com/D109792