When print previewing, use the content-viewer bounds as the visible area of the
document.
We used to get this fixed up via BrowserChild::RecvUpdateDimensions, but no
longer do.
Setting the page size without pixel scaling as the visible size makes no sense.
This code is generally pretty messy, it'd be good to try to unify it somehow
with the non-printing code.
Differential Revision: https://phabricator.services.mozilla.com/D57154
--HG--
extra : moz-landing-system : lando
It calls `Document::FlushPendingNotification()` so that we should mark it
as `MOZ_CAN_RUN_SCRIPT`.
And the method calls it of `mDocument` and `mDocument` is never modified
after it's initialized. Therefore, we can move the initializer to the
constructor and make `RefPtr<Document>` to `RefPtr<Document> const`. Thus,
we can avoid unnecessary auto `RefPtr`.
Differential Revision: https://phabricator.services.mozilla.com/D55803
--HG--
extra : moz-landing-system : lando
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.
find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
if [ -n "$interfaces" ]; then
if [[ "$interfaces" == *$'\n'* ]]; then
regexp="\("
for i in $interfaces; do regexp="$regexp$i\|"; done
regexp="${regexp%%\\\|}\)"
else
regexp="$interfaces"
fi
interface=$(basename "$path")
rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
if [ $hits -eq 0 ]; then
echo "Removing ${interface} from ${path2}"
grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
mv -f "$path2".tmp "$path2"
fi
done
fi
done
Differential Revision: https://phabricator.services.mozilla.com/D55443
--HG--
extra : moz-landing-system : lando
It's a better name, and will avoid confusion when I add other stylesheet caches
outside of the CSS loader.
Depends on D54556
Differential Revision: https://phabricator.services.mozilla.com/D54557
--HG--
rename : layout/style/nsLayoutStylesheetCache.cpp => layout/style/GlobalStyleSheetCache.cpp
rename : layout/style/nsLayoutStylesheetCache.h => layout/style/GlobalStyleSheetCache.h
extra : moz-landing-system : lando
nsPrintData::mBrandName never changes over the lifetime of a Firefox instance.
It is wasteful to have nsPrintData obtain and store it, since we can replace
an nsPrintJob's nsPrintData object multiple times over the lifetime of the
nsPrintJob and nsPrintJob is the only consumer.
Differential Revision: https://phabricator.services.mozilla.com/D51689
--HG--
extra : moz-landing-system : lando
This is done by delaying the code within nsFrameLoader::CreateStaticClone until
after the document has been created. The nsFrameLoader is re-discovered using
the subframe BrowsingContext's mEmbedderElement.
Differential Revision: https://phabricator.services.mozilla.com/D44586
--HG--
extra : moz-landing-system : lando
This change was causing issues with images not displaying and iframes not
displaying correctly after multiple print preview calls.
Differential Revision: https://phabricator.services.mozilla.com/D44585
--HG--
extra : moz-landing-system : lando
Most other overrides of nsIDOMEventListener::HandleEvent don't null check
aEvent at all. This method should never be called without an event.
Differential Revision: https://phabricator.services.mozilla.com/D38906
--HG--
extra : moz-landing-system : lando
This also renames the existing infallible nsDocShell:GetBrowsingContext()
getter to BrowsingContextRef(), and changes the return type, since several
callers rely on it returning a raw pointer rather than an already_AddRefed.
Differential Revision: https://phabricator.services.mozilla.com/D40312
--HG--
extra : moz-landing-system : lando
This should ensure that the inner window for each document is set up correctly
before iframe elements are created in them during a static clone. Other,
non-static-clone cases are not affected because they cannot load subframes.
Differential Revision: https://phabricator.services.mozilla.com/D38931
--HG--
extra : moz-landing-system : lando
For avoiding confusion between API of `nsRange` and `StaticRange`, I'd like to
rename `nsRange::CreateRange()` to `nsRange::Create()` because
`StaticRange::CreateStaticRange()` is too long name and
`StaticRange::CreateRange()` sounds odd. This patch renames it and changes
related methods to template methods to avoid runtime cost of temporary
`RawRangeBoundary` instance creation.
Differential Revision: https://phabricator.services.mozilla.com/D35141
--HG--
extra : moz-landing-system : lando
Also removes two unused (not even defined) method declarations.
Differential Revision: https://phabricator.services.mozilla.com/D34357
--HG--
extra : rebase_source : bd03bbe8f6a532aa38f9ae871e0b60ca9fa088a7
extra : amend_source : 758bb89dbe6413116647f78ced8afa41b9ce422e
This shows that this variable has never been read going back all the way to
the original Mercurial import in 2007:
hg grep -f --diff mDocWasToBeDestroyed layout/printing/ns*
Differential Revision: https://phabricator.services.mozilla.com/D34143
--HG--
extra : rebase_source : c14a51dab1825e26fb8031d291d2c69e78931c84
extra : amend_source : 73794b07d703987db8d2eb49dd97d74b1a9be325
"Cancelled" sounds like it's a query and should return a bool. In fact this
method sets state in response to a nsIWebBrowserPrint.cancel() being called.
Differential Revision: https://phabricator.services.mozilla.com/D34137
--HG--
extra : rebase_source : 97797d906b84ed18a258881a31722179d50943f7
extra : amend_source : c0e1b61f13b2a8ccaec7cc995841948deabbe041
The previous splitting of nsPrintObject::Init made clear that in fact this
method does not create documents at all! This new name better describes what
it does.
Differential Revision: https://phabricator.services.mozilla.com/D34118
--HG--
extra : rebase_source : 143812a4b5438dff24a7f38b07f0a95660e139ce
extra : amend_source : 209937ec2d638bcd60929c6ac3840ee7e0209b73
This patch modifies DoWithEvent so that we can more easily have a
DoWithEventFromStream callable from outside of Moz2D similar to
LoadEventFromStream. We will add that in a later patch for the new
EventRingBuffer. It also changes the only user of LoadEventFromStream
over to it, so we can can get rid of it and LoadEvent entirely.
Make nsIWebBrowserPrint included unconditionally for addressing nsIDocShell.rs build failure.
Remove direct_call of PPrinting and PRemotePrintJob. Their ipdl are built unconditionally, but their derived classes are not built with --disable-printing.
Differential Revision: https://phabricator.services.mozilla.com/D33391
--HG--
extra : moz-landing-system : lando
kFrameEnableNone is synonymous with having a non-frameset document. This makes
what is going on here explicit. It also gets rid of the kRangeSelection based
override and makes that explicit too.
Differential Revision: https://phabricator.services.mozilla.com/D33684
--HG--
extra : rebase_source : 7cb1c4be168816f13f01189f672c43b80ab9bbe0
...and have nsPrintJob::Print use that instead of mOriginalDoc, which we want
to get rid of.
When nsPrintJob::Print is called and mPrtPreview is nullptr, we know that we
have been called to print a page directly without print preview. In that case
we know that we're printing the nsPrintJob's docViewer's document. I.e. the
document of the caller of nsPrintJob::Print. So in this case mOriginalDoc and
the passed doc are always the same thing.
Differential Revision: https://phabricator.services.mozilla.com/D31874
--HG--
extra : rebase_source : 54f3afd8dc51d02ccd19436d39b570f66fa242d7
extra : amend_source : 49fa445dff1d19eb4faee868ddacda76916af778