Граф коммитов

1024 Коммитов

Автор SHA1 Сообщение Дата
Simon Giesecke d10d03d076 Bug 1676365 - Move SpinEventLoopUntil to separate header. r=#xpcom-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D96556

Depends on D96554
2020-11-23 16:10:41 +00:00
Simon Giesecke 971b645fe3 Bug 1660470 - Add missing include directives/forward declarations. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D87865
2020-11-23 16:21:38 +00:00
Emilio Cobos Álvarez 771dd03229 Bug 1669854 - Add a single pageRanges print setting. r=nordzilla
... which is an array of pairs of ranges, and use it instead of the
existing printRange / startPage / endPage settings.

Differential Revision: https://phabricator.services.mozilla.com/D96093
2020-11-07 16:01:57 +00:00
Ricky Stewart 02a7b4ebdf Bug 1654103: Standardize on Black for Python code in `mozilla-central`.
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.

5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-26 18:34:53 +00:00
Emilio Cobos Álvarez a68a0e6e0e Bug 1672864 - Don't resume printing too early. r=jfkthame
When we do the initial reflow, we remove nodes from the document if
we're printing the selection. If these operations cause one iframe to be
removed, for example, then we may get hit with an nsIWebProgress
notification synchronously, which may cause us to go through
MaybeResumePrintAfterResourcesLoaded too early (and thus twice), which
messes up our state.

The ideal solution would be to add us as a listener a bit later, but we
can't because we need to know whether we did load anything during the
initial reflow.

So instead of that, just avoid resuming print while we're doing the
reflow. We'll call MaybeResumePrintAfterResourcesLoaded a few lines
below.

Differential Revision: https://phabricator.services.mozilla.com/D94586
2020-10-23 18:34:05 +00:00
Bogdan Tara da1098d4aa Backed out 10 changesets (bug 1654103, bug 1672023, bug 1518999) for PanZoomControllerTest.touchEventForResult gv-junit failures CLOSED TREE
Backed out changeset ff3fb0b4a512 (bug 1672023)
Backed out changeset e7834b600201 (bug 1654103)
Backed out changeset 807893ca8069 (bug 1518999)
Backed out changeset 13e6b92440e9 (bug 1518999)
Backed out changeset 8b2ac5a6c98a (bug 1518999)
Backed out changeset 575748295752 (bug 1518999)
Backed out changeset 65f07ce7b39b (bug 1518999)
Backed out changeset 4bb80556158d (bug 1518999)
Backed out changeset 8ac8461d7bd7 (bug 1518999)
Backed out changeset e8ba13ee17f5 (bug 1518999)
2020-10-24 03:36:18 +03:00
Ricky Stewart c0cea3b0fa Bug 1654103: Standardize on Black for Python code in `mozilla-central`. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.

5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-23 20:40:42 +00:00
Dorel Luca 1ff59cb7a3 Backed out changeset 7558c8821a07 (bug 1654103) for multiple failures. CLOSED TREE 2020-10-22 03:51:06 +03:00
Ricky Stewart 50762dacab Bug 1654103: Standardize on Black for Python code in `mozilla-central`. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-21 21:27:27 +00:00
Emilio Cobos Álvarez 21a0be097f Bug 1671503 - Handle documents from iframes that haven't changed remoteness yet correctly. r=nordzilla
See the comment. A bit racy, but some of the time crashtest crashes
without the patch.

Null-check is just paranoia.

Differential Revision: https://phabricator.services.mozilla.com/D93756
2020-10-16 20:46:00 +00:00
Dorel Luca 44946f3402 Backed out changeset 6d63e8bc04bf (bug 1671503) for Crashtest failures in layout/printing/crashtests/1671503.html. CLOSED TREE 2020-10-16 22:13:43 +03:00
Emilio Cobos Álvarez 9cad68877b Bug 1670876 - Add support for printing selection in shadow dom. r=nordzilla
Recursive the things all :^)

The fix to the "corresponding node" bits in Document.cpp should be
pretty straight-forward. The fix in nsPrintJob is a bit more subtle:

The way printing selection works is literally "select everything else,
then call Selection.deleteFromDocument on that". We need to do the same
with shadow DOM, which involves skipping over shadow trees, and dealing
with selecting bits in ancestor trees as needed.

Note that for multi-range-selection case this technically relies on the
order of the ranges being shadow-tree-inclusive. We don't support
multi-range selection in shadow dom well, afaict, but I've added a
comment to the code to that effect.

Differential Revision: https://phabricator.services.mozilla.com/D93357
2020-10-16 17:36:37 +00:00
Emilio Cobos Álvarez 09c912b47a Bug 1671503 - Handle documents from iframes that haven't changed remoteness yet correctly. r=nordzilla
See the comment. A bit racy, but some of the time crashtest crashes
without the patch.

Null-check is just paranoia.

Differential Revision: https://phabricator.services.mozilla.com/D93756
2020-10-16 17:37:00 +00:00
Emilio Cobos Álvarez dc6e67221c Bug 1670816 - Handle remote subframe clones slightly earlier. r=nika
Otherwise we end up creating an in-process docshell and an initial,
non-static subdocument. This usually won't cause badness, but is wrong
and _can_ cause badness when printing selection etc.

The assertion I added is hit on existing tests and would've caught this.

Also fix another violation by grabbing the original docshell to clone
from before actually performing the clone, which could be null (and we'd
leave an initial document there). That would cause failures in
layout/printing/crashtests/1662259.html.

Differential Revision: https://phabricator.services.mozilla.com/D93279
2020-10-13 18:13:30 +00:00
Matt Woodrow 92c3e52975 Bug 1662336 - Pass print recording dependency list across to parent process and use CrossProcessPaint to resolve it. r=bobowen
Differential Revision: https://phabricator.services.mozilla.com/D90807
2020-10-08 08:40:15 +00:00
Matt Woodrow 2786819db1 Bug 1662336 - Make PRemotePrintJob refcounted. r=bobowen
Differential Revision: https://phabricator.services.mozilla.com/D90806
2020-10-08 19:19:51 +00:00
Matt Woodrow 3f9723aef2 Bug 1662336 - Implement dependent surface support in the print recording code. r=bobowen
Differential Revision: https://phabricator.services.mozilla.com/D90805
2020-10-08 19:19:39 +00:00
Daniel Holbert 3e52de68f4 Bug 1669774 part 2: Rename some APIs and variables for accuracy (s/page/sheet/) in nsPrintJob, nsPagePrintTimer, and nsDocumentViewer. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D92791
2020-10-07 21:00:26 +00:00
Daniel Holbert fd2a60b29e Bug 1669774 part 1: Rename some nsPageSequenceFrame APIs and vars with s/page/sheet/for accuracy. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D92789
2020-10-07 20:59:05 +00:00
Daniel Holbert 06a402acb0 Bug 1661868 part 2: Unify page-range handling logic, to assume all PrintedSheetFrames should be printed (and let them manage page-range-based skipping during layout). r=TYLin
This patch does the following things:

(1) It removes the legacy page-range-handling function
"DetermineWhetherToPrintPage()", and it now will always print every
PrintedSheetFrame.

(2) It activates PrintedSheetFrame's page-range handling function so that it
can take over responsibility for skipping pages during print operations.

(3) It adjusts the nsPrintJob code that kicks off individual asynchronous
"print the next page" operations (which is now really "print the next
PrintedSheetFrame).  This nsPrintJob code used to have page-range-related
handling interwoven into it, and that handling isn't necessary anymore now that
we're handling page-skipping up front at layout time.

(4) It replaces the mPageNum member-var (which tracks which page we're about to
print or are currently printing) with mCurrentSheetIdx, which is now a 0-based
index into the list of PrintedSheetFrame instances.

(5) It removes nsPrintData:mNumPagesPrinted, which was only used for
progress-bar-completion updates & which basically tracked the same information
that I'm tracking in the new mCurrentSheetIdx variable.

There's some additional cleanup that we should do after this lands (e.g. some
s/page/sheet/ renamings) but I'm holding off on that for now, to keep this
patch relatively targeted.

Differential Revision: https://phabricator.services.mozilla.com/D92660
2020-10-07 20:51:56 +00:00
Daniel Holbert 675e1e5b28 Bug 1669409: Convert the nsIPrintSettings:kEnableSelectionRB flag into a boolean, since it's the only entry in a bitfield. r=jwatt,emilio
This was the last flag that the PrintOptions bitfield was tracking.

So, this patch is effectively converting that bitfield (and its alias
"PrintOptionsBits") into a new, simpler boolean field named
"isPrintSelectionRBEnabled".

Differential Revision: https://phabricator.services.mozilla.com/D92542
2020-10-07 00:36:51 +00:00
Jonathan Watt 7ea14b32ec Bug 1669390. Fix silent printing telemetry when print.tab_modal.enabled is true. r=bobowen
Differential Revision: https://phabricator.services.mozilla.com/D92531
2020-10-06 10:02:49 +00:00
Emilio Cobos Álvarez 941e868780 Bug 1668767 - Make "print selection" setting independent of page range. r=jfkthame
It conceptually is, and this will allow to have UI independent of the
page range in bug 140718.

Differential Revision: https://phabricator.services.mozilla.com/D92201
2020-10-02 13:59:48 +00:00
Jonathan Watt 9663c812c7 Bug 1668301. Merge the 'printing-widget' NSPR module into the 'printing' module. r=bobowen
Differential Revision: https://phabricator.services.mozilla.com/D91949
2020-09-30 16:36:29 +00:00
Edgar Chen 3af8ce6d7a Bug 1667081 - Part 1: Replace usage of nsIFocusManager with nsFocusManager; r=hsivonen
This patch is bascially done by:
perl -p -i -e "s/nsIFocusManager\* /nsFocusManager* /g;" $( find . -name *.cpp )
perl -p -i -e "s/nsCOMPtr<nsIFocusManager>/RefPtr<nsFocusManager>/g;" $( find . -name *.cpp )

Differential Revision: https://phabricator.services.mozilla.com/D91287
2020-09-29 07:21:09 +00:00
Bogdan Tara 8f6c53bdf5 Backed out 9 changesets (bug 1667081) for assertion failure on nsFocusManager CLOSED TREE
Backed out changeset 156ab3eba505 (bug 1667081)
Backed out changeset 2e37f347082c (bug 1667081)
Backed out changeset 8f59cef879ae (bug 1667081)
Backed out changeset 1298ff140218 (bug 1667081)
Backed out changeset 91342c822425 (bug 1667081)
Backed out changeset aafb1878c590 (bug 1667081)
Backed out changeset 2252e975f0d7 (bug 1667081)
Backed out changeset c3bac5f407d2 (bug 1667081)
Backed out changeset b1e6e81396ae (bug 1667081)
2020-09-28 20:02:52 +03:00
Edgar Chen 6abd74544d Bug 1667081 - Part 1: Replace usage of nsIFocusManager with nsFocusManager; r=hsivonen
This patch is bascially done by:
perl -p -i -e "s/nsIFocusManager\* /nsFocusManager* /g;" $( find . -name *.cpp )
perl -p -i -e "s/nsCOMPtr<nsIFocusManager>/RefPtr<nsFocusManager>/g;" $( find . -name *.cpp )

Differential Revision: https://phabricator.services.mozilla.com/D91287
2020-09-28 14:04:12 +00:00
Jonathan Kew 2d346ebd7e Bug 1666110 - Add telemetry for paper size used when printing. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D91105
2020-09-25 22:19:40 +00:00
Emilio Cobos Álvarez 72936d9e85 Bug 1667400 - Remove PrintPreviewUserEventSuppressor. r=jwatt
Doesn't work at all with e10s / fission.

Differential Revision: https://phabricator.services.mozilla.com/D91440
2020-09-25 14:58:17 +00:00
Emilio Cobos Álvarez 722ad5b0f7 Bug 1665779 - Null-check mPrt in nsPrintJob::InitPrintDocConstruction. r=bobowen
Differential Revision: https://phabricator.services.mozilla.com/D91056
2020-09-22 21:28:15 +00:00
Emilio Cobos Álvarez a4e300194a Bug 1557645 - Clone OOP iframes in the right process. r=nika
This works, though probably we want to do some follow-up tweaks, like
the adding of the onload blocker and so on, so that we can avoid the
UpdateDimensions hack.

We may also want a PrintObject in the nsPrintJob tree, perhaps...

Differential Revision: https://phabricator.services.mozilla.com/D90310
2020-09-22 09:57:27 +00:00
Emilio Cobos Álvarez 567d300760 Bug 1663826 - Keep freezing navigation during window.print() for compat. r=smaug
This broke in bug 1636728 because we started setting the bit in the
cloned docshell rather than the original one.

Behavior in other browsers seems to be a bit all over the place, but for
now keeping our behavior during window.print() seems sane.

Differential Revision: https://phabricator.services.mozilla.com/D90456
2020-09-16 22:55:19 +00:00
Emilio Cobos Álvarez e6b821e340 Bug 968753 - Save per-printer settings on GTK. r=jwatt
I don't see any reason why this shouldn't work off-hand, there's no
gtk globals or such that fundamentally avoid sharing settings.

The PSPrinters stuff is gone so it's not needed to mess up with PS/CUPS
names.

The last used printer name stuff is now just a pref read, so there
shouldn't be sandbox violation shenanigans...

There are some restrictions on what can be set or what not (like, if you
set the paper name that may also override the paper size).

But these are problems that we have when restoring from prefs already,
so there's no reason we shouldn't do this, afaict.

Differential Revision: https://phabricator.services.mozilla.com/D90418
2020-09-16 15:31:45 +00:00
Emilio Cobos Álvarez 706ceffb4b Bug 1665125 - Make print background settings infallible. r=bobowen
This makes callers simpler.

Differential Revision: https://phabricator.services.mozilla.com/D90285
2020-09-16 11:21:41 +00:00
Narcis Beleuzu 38f63aa9b6 Backed out changeset 0834b634ea07 (bug 1665125) for reftest failures. CLOSED TREE 2020-09-15 23:32:11 +03:00
Emilio Cobos Álvarez f3927b672a Bug 1665125 - Make print background settings infallible. r=bobowen
This makes callers simpler.

Differential Revision: https://phabricator.services.mozilla.com/D90285
2020-09-15 16:19:20 +00:00
Jonathan Watt 42f409de3c Bug 1662222. Don't spin a nested event loop in nsPrintJob::DoCommonPrint when called by extensions. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D89681
2020-09-10 00:12:48 +00:00
Bob Owen 1cd21daff6 Bug 1662938: Notify RemotePrintJobParent's listeners of the error when we fail to initialize the print. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D89490
2020-09-08 20:50:02 +00:00
Emilio Cobos Álvarez 938d1e79b0 Bug 1662259 - Don't create a non-extant docshell when doing static clones. r=kmag
If the docshell is not there already, it's probably not displayed or
what not.

Differential Revision: https://phabricator.services.mozilla.com/D89161
2020-09-07 00:54:38 +00:00
Dorel Luca 2c75053824 Backed out changeset e4e4c1c090c5 (bug 1662259) as requested by dev. 2020-09-07 02:47:01 +03:00
Emilio Cobos Álvarez f3c0650b5b Bug 1662259 - Don't create a non-extant docshell when doing static clones. r=kmag
If the docshell is not there already, it's probably not displayed or
what not.

Differential Revision: https://phabricator.services.mozilla.com/D89161
2020-09-02 23:16:34 +00:00
Hiroyuki Ikezoe c9ac4c645c Bug 1661873 - Generate nsRootPresShell for printing ducuments only if the document has no parent OR the parent is not going to be printed AND GetParentViewForRoot() is not null. r=smaug
Though there is no automated test for this change, I think the test cases in the
previous commit well cover the original issue (bug 468568) that downloadable
fonts are not rendered in printing.

Depends on D89095

Differential Revision: https://phabricator.services.mozilla.com/D89096
2020-09-03 01:39:11 +00:00
Nathan Froyd cfb8fb313f Bug 1662251 - stop assigning from NS_Convert* values, mostly; r=sg
This patch was generated by running:

```
perl -p -i \
     -e 's/^(\s+)([a-zA-Z0-9.]+) = NS_ConvertUTF8toUTF16\((.*)\);/\1CopyUTF8toUTF16(\3, \2);/;' \
     -e 's/^(\s+)([a-zA-Z0-9.]+) = NS_ConvertUTF16toUTF8\((.*)\);/\1CopyUTF16toUTF8(\3, \2);/;' \
     $FILE
```

against every .cpp and .h in mozilla-central, and then fixing up the
inevitable errors that happen as a result of matching C++ expressions with
regexes.  The errors fell into three categories:

1. Calling the convert functions with `std::string::c_str()`; these were
   changed to simply pass the string instead, relying on implicit conversion
   to `mozilla::Span`.
2. Calling the convert functions with raw pointers, which is not permitted
   with the copy functions; these were changed to invoke `MakeStringSpan` first.
3. Other miscellaneous errors resulting from over-eager regexes and/or the
   replacement not being type-aware.  These changes were reverted.

Differential Revision: https://phabricator.services.mozilla.com/D88903
2020-09-02 09:54:37 +00:00
Bob Owen 0c55d42a71 Bug 1661975 part 2: Follow-up to fix nsPrintJob::FirePrintingErrorEvent. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D89160
2020-09-02 15:47:10 +00:00
Bob Owen 5cb94890b3 Bug 1661975: Add whether we have a selection to PrintPreviewResultInfo. r=jwatt
This is then used in the front end to set the option in the settings.

Differential Revision: https://phabricator.services.mozilla.com/D89045
2020-09-02 08:15:35 +00:00
Jonathan Watt 937e0617f0 Bug 1653319. Use the new FrameLoader.printPreview API in the frontend. r=mstriemer,emalysz,emilio
Differential Revision: https://phabricator.services.mozilla.com/D88704
2020-09-02 15:13:14 +00:00
Jonathan Watt ad76c1dcba Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D88703
2020-09-01 11:00:36 +00:00
Emilio Cobos Álvarez 4953377ea0 Bug 1661137 - Decrement the document viewer's destroy blocker earlier. r=bobowen
Do it as soon as we're done printing, rather than waiting until the
print timer dies.

Differential Revision: https://phabricator.services.mozilla.com/D88569
2020-08-31 10:44:19 +00:00
Daniel Holbert c2ab752d47 Bug 1659005 part 4: Check for page-range-skipped pages for tab-modal print preview, and group them as unpainted additional children on the nearest PrintedSheetFrame. r=TYLin
For now, we *only* use this new page-skipping code during print preview, via a
PresContext::IsScreen() check.  There's a separate legacy codepath that we'll
continue to use for skipping pages during actual printing; see e.g.
nsPageSequenceFrame::DetermineWhetherToPrintPage().  I intend to replace that
codepath soon, but for now I'm leaving it intact, in the interests of making
this patch minimally invasive & low-risk for beta uplift.

Differential Revision: https://phabricator.services.mozilla.com/D87394
2020-08-29 00:58:14 +00:00
Razvan Maries 5aaae306d7 Backed out changeset ede12aa1b8b5 (bug 1661137) for perma failures on printcmd.py and browser_ext_tabs_saveAsPDF.js. CLOSED TREE 2020-08-28 16:31:40 +03:00