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

74039 Коммитов

Автор SHA1 Сообщение Дата
Emilio Cobos Álvarez 0cc4b1a206 Bug 1663231 - Make @font-face and @counter-style serialization closer other browsers and style rules. r=xidorn
Style rules serialize on one line and so should @font-face blocks.

Part of https://github.com/w3c/csswg-drafts/issues/4828.

Differential Revision: https://phabricator.services.mozilla.com/D89302
2020-09-05 00:42:43 +00:00
longsonr 1d904c3e45 Bug 1603629 - fix dominant-baseline hanging and mathematical r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D88877
2020-09-04 11:00:40 +00:00
Kagami Sascha Rosylight 11ef0ef23e Bug 1623413 - Part 2: Rename Collapse() to CollapseInLimiter() r=masayuki
Depends on D88702

Differential Revision: https://phabricator.services.mozilla.com/D88920
2020-09-03 03:45:26 +00:00
lonocvb ac824cbee2 Bug 1662655 - Elements with pointer event are considered clickable. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D89236
2020-09-03 08:03:32 +00:00
Emma Malysz 08d48cb10a Bug 1661852, honor printRange option and update startRange when the number of pages changes r=emalysz
Differential Revision: https://phabricator.services.mozilla.com/D89084
2020-09-03 03:03:05 +00:00
Mihai Alexandru Michis 0600dacd03 Backed out 3 changesets (bug 1623413) for causing failures in Selection_collapse.html
CLOSED TREE

Backed out changeset d3d67293f115 (bug 1623413)
Backed out changeset 75ed1b8a5c67 (bug 1623413)
Backed out changeset 0eef32d6a454 (bug 1623413)
2020-09-03 05:37:49 +03: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
Hiroyuki Ikezoe b15a8fe457 Bug 1661873 - Add wpts and mochitests to make sure downloadable font is properly printed or rendered in print preview. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D89095
2020-09-03 01:31:36 +00:00
Ting-Yu Lin 1f00be3d53 Bug 1652112 Part 6 - Move remaining shape-outside reftests to wpt, and delete w3c-css/submitted/shapes1 folder. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D85020
2020-09-02 20:24:51 +00:00
Ting-Yu Lin f7a0b67ef8 Bug 1652112 Part 5 - Move shape-outside polygon reftests into wpt. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D85019
2020-09-02 20:23:55 +00:00
Ting-Yu Lin 3e3e17c3f6 Bug 1652112 Part 4 - Move shape-outside inset reftests into wpt. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D85018
2020-09-02 20:18:14 +00:00
Ting-Yu Lin ff2b86c068 Bug 1652112 Part 3 - Move shape-outside ellipse reftests into wpt. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D85017
2020-09-02 20:17:16 +00:00
Ting-Yu Lin 93ad2862e1 Bug 1652112 Part 2 - Move shape-outside circle reftests into wpt. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D85016
2020-09-02 21:32:10 +00:00
Ting-Yu Lin 2d4f738f49 Bug 1652112 Part 1 - Move shape-outside shape-box reftests into wpt. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D85014
2020-09-02 20:10:07 +00:00
Emilio Cobos Álvarez 97ac4d259f Bug 1662456 - Remove HTMLCanvasElement::CountContexts and related code. r=nical
Canvas only has one context, and that assumption is pretty baked into
the code, so having an API that pretends otherwise is silly.

Differential Revision: https://phabricator.services.mozilla.com/D88990
2020-09-02 14:20:50 +00:00
Kagami Sascha Rosylight 010d7de462 Bug 1623413 - Part 2: Rename Collapse() to CollapseInLimiter() r=masayuki
Depends on D88702

Differential Revision: https://phabricator.services.mozilla.com/D88920
2020-09-02 23:42:27 +00:00
Daniel Holbert 9f9527f388 Bug 1662880: Fix typo in reftest reference-case meta tag, for vert-block-size-small-or-larger-than-container-with-min-or-max-content-2b.html. r=boris
Differential Revision: https://phabricator.services.mozilla.com/D89210
2020-09-02 20:57:15 +00:00
Geoff Brown a2e1392505 Bug 1390884 - Enable all test-verify chaos modes except TimerScheduling; r=jmaher
Differential Revision: https://phabricator.services.mozilla.com/D89214
2020-09-02 21:13:40 +00:00
Emilio Cobos Álvarez 0680c18f72 Bug 1662813 - Factor out the "should print backgrounds" checks to nsIFrame. r=mats
I had written this on one of my attempts to fix the missing text on
reddit when printing, but I think it's worth landing anyways not only
because it's slightly cleaner, but because it avoids the virtual call
and style checks when we're not printing.

This should be an idempotent change.

Differential Revision: https://phabricator.services.mozilla.com/D89171
2020-09-02 21:30:59 +00:00
Ting-Yu Lin a37d0b0a85 Bug 1662837 - Rename variables names in PartiallyResolveAutoMinSize(). r=boris
Make the variable names closer to the terms in the spec.
https://drafts.csswg.org/css-flexbox-1/#min-size-auto

This patch shouldn't change the behavior.

Differential Revision: https://phabricator.services.mozilla.com/D89184
2020-09-02 20:39:02 +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
Emilio Cobos Álvarez 33caaa4bbb Bug 1661838 - Fix builds with --disable-printing. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D89166
2020-09-02 16:13:01 +00:00
Jonathan Watt 7422304c17 Bug 1657220. Add telemetry for new print UI. r=bobowen,mbalfanz
Differential Revision: https://phabricator.services.mozilla.com/D87303
2020-09-01 18:47:15 +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
Emilio Cobos Álvarez 80baa86532 Bug 1662426 - When destroying an HTML <canvas> frame, reset its print callback data. r=jwatt
This ensures that we call the callback again if the canvas becomes
displayed later. This is important because a callback may run after
destroying the frame tree, and in that case some canvas operations may
fail. Without this there's no guarantee that the callback runs ever
again.

Depends on D89111

Differential Revision: https://phabricator.services.mozilla.com/D89112
2020-09-02 10:01:00 +00:00
Emilio Cobos Álvarez a29afe9b5a Bug 1658302 - Don't reframe for changes to the placeholder attribute value. r=masayuki
We still reframe for additions / removals of the attribute because that
makes us create the placeholder <div>. We could avoid it if we created
it independently of the presence of the attribute but that seems like it
could regress perf for the case where there's no placeholder attribute,
which is probably common enough.

Differential Revision: https://phabricator.services.mozilla.com/D88724
2020-09-01 23:03:36 +00:00
Emilio Cobos Álvarez 03baee9d8a Bug 1662478 - Rename ::file-chooser-button to ::file-selector-button, and enable it in all channels. r=jwatt
See https://github.com/w3c/csswg-drafts/issues/5049

Differential Revision: https://phabricator.services.mozilla.com/D88995
2020-09-01 22:58:10 +00:00
Andreea Pavel 2692897b74 Merge mozilla-central to autoland on a CLOSED TREE 2020-09-02 00:52:53 +03:00
Andreea Pavel b976f57ba6 Backed out changeset 0e94014166b3 (bug 1658302) for causing bug 1662483 2020-09-02 00:44:18 +03: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
Kartikaya Gupta ba7397a11e Bug 1661897 - Acknowledge pending visual scroll updates for any RSF. r=botond
We set pending visual scroll updates even for RSFs that are on subdocuments,
so we should ensure they get acknowledged and cleared on paints. Otherwise
the pending visual scroll update can get "stuck" and it affects things that
depend on it, such as the drag-selection code.

Differential Revision: https://phabricator.services.mozilla.com/D88893
2020-09-01 18:18:01 +00:00
Edgar Chen 2990a39c60 Bug 1662124 - element.setPointerCapture should throw NotFoundError if the pointer id is invalid; r=smaug
https://github.com/w3c/pointerevents/issues/256

Differential Revision: https://phabricator.services.mozilla.com/D88859
2020-09-01 09:13:56 +00:00
Narcis Beleuzu b4560d9e94 Backed out 2 changesets (bug 1661897) for mochitest failures on test_group_mouseevents.html . CLOSED TREE
Backed out changeset 34ee0403ab1e (bug 1661897)
Backed out changeset f83db4b41bf6 (bug 1661897)
2020-09-01 07:47:59 +03:00
Emilio Cobos Álvarez 8a9cac4917 Bug 1662277 - Make IntersectionObserver entries have the same timestamp as other timestamp-returning things during the "update the rendering steps". r=sefeng
This is per spec, see the link in the test. I wouldn't see much point on
doing this for IntersectionObserver on its own, see:

  https://bugzilla.mozilla.org/show_bug.cgi?id=1518999#c28

Though I see the point of doing this for the paint timing API, and I
guess for consistency we should do it here too.

Differential Revision: https://phabricator.services.mozilla.com/D88926
2020-09-01 15:02:54 +00:00
Emilio Cobos Álvarez 6a183a94f4 Bug 1660774 - Masks shouldn't be suppressed for print. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D88899
2020-09-01 13:43:54 +00:00
Kartikaya Gupta 447dd12c94 Bug 1661897 - Acknowledge pending visual scroll updates for any RSF. r=botond
We set pending visual scroll updates even for RSFs that are on subdocuments,
so we should ensure they get acknowledged and cleared on paints. Otherwise
the pending visual scroll update can get "stuck" and it affects things that
depend on it, such as the drag-selection code.

Differential Revision: https://phabricator.services.mozilla.com/D88893
2020-08-31 20:34:34 +00:00
Emilio Cobos Álvarez 28231ea1e1 Bug 1662204 - Prevent all printed documents, not just print preview, from getting a regular non-print presentation. r=jwatt
Before bug 1636728 this couldn't happen because print documents weren't
hosted in an <browser>. The presentation of documents that are being
printed should be managed by the print job.

We should, in fact, probably just make mDocument->IsStaticDocument() the
condition, or such.

Differential Revision: https://phabricator.services.mozilla.com/D88901
2020-08-31 20:16:11 +00:00
Ting-Yu Lin ad069fecf2 Bug 1657256 - Always update the cached mImaginaryCaretRect in SetPosition(). r=marionette-reviewers,mats,whimboo
During scrolling, the caret's position relative to the
custom-content-container (cached in mImaginaryCaretRectInContainerFrame)
may not change, but its position relative to root frame can (cached in
mImaginaryCaretRect).

We need to update mImaginaryCaret each time we are in SetPosition().
Otherwise, the caret still remembers its pre-scrolling old position next
time when we drag it, resulting the caret jumping to its old
pre-scrolling position suddenly.

Note this bug only occurs on the root scroll frame where the APZ is
enabled, not in any sub-scroll frames where APZ is disable when the
caret is shown.

Differential Revision: https://phabricator.services.mozilla.com/D88638
2020-08-31 17:54:19 +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
Emilio Cobos Álvarez 534c76762a Bug 1658302 - Don't reframe for changes to the placeholder attribute value. r=masayuki
We still reframe for additions / removals of the attribute because that
makes us create the placeholder <div>. We could avoid it if we created
it independently of the presence of the attribute but that seems like it
could regress perf for the case where there's no placeholder attribute,
which is probably common enough.

Differential Revision: https://phabricator.services.mozilla.com/D88724
2020-08-31 07:46:56 +00:00
Sylvestre Ledru 9c192aa9ca Bug 1519636 - Reformat recent changes to the Google coding style r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D88713
2020-08-31 09:23:02 +00:00
Mihai Alexandru Michis 261d01524b Backed out changeset d0f173a90792 (bug 1519636) for causing bustages.
CLOSED TREE
2020-08-31 10:14:58 +03:00
Sylvestre Ledru 939dd426e6 Bug 1519636 - Reformat recent changes to the Google coding style r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D88713
2020-08-31 06:51:21 +00:00
Makoto Kato 21e3ca0fea Bug 1661621 - Add more emoji reftests for keycap and skintone. r=jfkthame
This is follow up issue of bug 1371386.

After landing it, some reftests for keycap and skintone are successful.

Differential Revision: https://phabricator.services.mozilla.com/D88539
2020-08-31 04:46:17 +00:00
Ting-Yu Lin a4ceb26acb Bug 1641085 Part 7 - Simplify the definition of FrameListPropertyDescriptor. r=mats
It's easier to jump to the definition of FrameListPropertyDescriptor in editors
without too many indirections.

Differential Revision: https://phabricator.services.mozilla.com/D88461
2020-08-29 00:22:45 +00:00
Ting-Yu Lin 71a0063df5 Bug 1641085 Part 6 - Remove GetPropTableFrames() and RemovePropTableFrames() in nsContainerFrame. r=mats
Differential Revision: https://phabricator.services.mozilla.com/D88460
2020-08-29 00:22:43 +00:00
Ting-Yu Lin a69c3e6644 Bug 1641085 Part 5 - Remove SetPropTableFrames() in nsContainerFrame. r=mats
We already use SetProperty() extensively for nsFrameList properties like
OutsideMarkerProperty(), BackdropProperty(), etc, so we can simplify the
interface by removing SetPropTableFrames().

Differential Revision: https://phabricator.services.mozilla.com/D88459
2020-08-29 00:22:41 +00:00
Ting-Yu Lin f6a350f66e Bug 1641085 Part 4 - Revise DrainAndMergeSelfOverflowList() so that it's free of explicit allocation and deletion of nsFrameList. r=mats,emilio
Because the frame property look-up is expensive, change the
SetOverflowFrames(), SetOverflowContainers(), and
SetExcessOverflowContainers() to return the frame list so that the
caller don't need to use Get methods to retrieve it again.

Differential Revision: https://phabricator.services.mozilla.com/D88458
2020-08-31 04:06:26 +00:00
Ting-Yu Lin 9cb3f93c40 Bug 1641085 Part 3 - Add APIs to manipulate excess overflow containers list. r=mats
This patch is similar to Part 2, but for adding APIs for
ExcessOverflowContainersProperty().

Differential Revision: https://phabricator.services.mozilla.com/D88457
2020-08-29 00:22:31 +00:00
Ting-Yu Lin 45b86ae08f Bug 1641085 Part 2 - Add APIs to manipulate overflow containers list. r=mats
Not all APIs added in this patch are used immediately, but for the sake of
completeness, they are all added.

Their document will be updated in Part 3 after adding the relevant APIs for
ExcessOverflowContainersProperty().

nsContainerFrame::DrainExcessOverflowContainersList() has several calls to set
OverflowContainersProperty() whose life cycle need special attention. We will
deal with them later in Part 4.

Differential Revision: https://phabricator.services.mozilla.com/D88456
2020-08-29 00:22:23 +00:00
Ting-Yu Lin 0076add365 Bug 1641085 Part 1 - Add move semantic to nsFrameList, and use it on SetOverflowFrames(). r=mats
It's useful to use `std::move()` to indicate the frames' ownership in one list
is transferred to the another list.

For a frame list managed by AutoFrameListPtr, after moving its frames to
another list, it can be automatically deleted when it is going out of
scope.

Differential Revision: https://phabricator.services.mozilla.com/D88455
2020-08-29 00:22:16 +00:00
Ting-Yu Lin e7a3e6870c Bug 1661874 Part 4 - Simplify the condition to set colData.mHasExcessBSize to true. r=heycam
nsColumnSetFrame's ComputedBSize() and ComputedMaxBSize() are always
NS_UNCONSTRAINEDSIZE.

Differential Revision: https://phabricator.services.mozilla.com/D88700
2020-08-31 03:45:38 +00:00
Ting-Yu Lin 7ffc02eb41 Bug 1661874 Part 3 - Reverse the meaning of skipIncremental and rename it. r=heycam
I feel skipIncremental is hard to reasoning. It's easier to list all the
possible reasons that the child needs to be reflowed again.

Differential Revision: https://phabricator.services.mozilla.com/D88699
2020-08-31 03:45:23 +00:00
Ting-Yu Lin be1519920a Bug 1661874 Part 2 - Remove the support of ColumnSetFrame being an abs.pos container. r=heycam
The support of this was added in
https://hg.mozilla.org/mozilla-central/rev/fb0790d28846

After supporting column-span, ColumnSetFrame isn't the top-level
multicol container anymore, and is not served as an abs.pos container.
Thus, we can simply the reflow code a bit.

Differential Revision: https://phabricator.services.mozilla.com/D88698
2020-08-31 03:45:15 +00:00
Ting-Yu Lin 218e47c67f Bug 1661874 Part 1 - Rename mColMaxBSize to mColBSize in ReflowConfig. r=heycam
Rename so that its naming is consistent with ReflowConfig::mColISize,
and to avoid confusion with ColumnBalanceData::mMaxBSize.

Differential Revision: https://phabricator.services.mozilla.com/D88697
2020-08-31 03:45:13 +00:00
Jonathan Kew b7d6067688 Bug 1533462 - Run font-info loader immediately for accessiblecaret and forms tests, for more consistent behavior. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D88545
2020-08-30 22:59:57 +00:00
Jonathan Kew 936d5b55b1 Bug 1533462 - Execute the deferred font-info loader immediately when running reftests, to avoid intermittent issues due to async completion triggering an extra reflow mid-test. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D87194
2020-08-21 14:28:50 +00:00
Kartikaya Gupta bff55b334f Bug 1661745 - Defer calls to NotifyApzTransaction until all the metadata are built. r=mattwoodrow
There are cases where the code rebuilds the ScrollMetadata for a scrollframe
multiple times. This violates implicit assumptions in the NotifyApzTransaction
code that it will only be called after the ScrollMetadata is built for a particular
transaction. This patch moves the NotifyApzTransaction call to the end of the
metadata-building phase so that those assumptions are upheld.

Differential Revision: https://phabricator.services.mozilla.com/D88650
2020-08-30 05:11:38 +00:00
Edgar Chen e4efe37095 Bug 1653949 - Part 4: Add MouseExitFromWidget event to the delayed event queue if event handling is suppressed; r=smaug
So that we won't lost it if it happens in nested event loop.

Differential Revision: https://phabricator.services.mozilla.com/D86953
2020-08-27 17:19:07 +00:00
Edgar Chen 55691da377 Bug 1653949 - Part 2: Add ePuppet to WidgetMouseEvent::ExitFrom; r=smaug
eTopLevel is reused in content process to indicates that the mouse leaves
the puppet widget rendering area, now we add a separated type, ePuppet, for it.

Differential Revision: https://phabricator.services.mozilla.com/D84748
2020-08-27 17:19:14 +00:00
Edgar Chen 36ccda1d13 Bug 1653949 - Part 1: Change mExitFrom in WidgetMouseEvent to be Maybe<ExitFrom>; r=smaug
mExitFrom now contains a value only when mMessage is eMouseExitFromWidget

Differential Revision: https://phabricator.services.mozilla.com/D88225
2020-08-27 17:19:03 +00:00
longsonr 226b57059c Bug 1661912 - Convert remaining typedefs in SVG code to 'using' r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D88718
2020-08-29 14:24:37 +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
Ting-Yu Lin 0cdadc6d83 Bug 1365982 followup - Update FrameProperties::Has() document. r=jfkthame
The `HasSkippingBitCheck` variant has been removed in
https://hg.mozilla.org/mozilla-central/rev/b37e4d256cd6

DONTBUILD NPOTB because this is a comment-only change.

Differential Revision: https://phabricator.services.mozilla.com/D88687
2020-08-29 00:04:18 +00:00
Daniel Holbert 1a45a89182 Bug 1659005 part 3: Remove checks for a hypothetical pre-existing pageFrame next-in-flow (which can't happen, in practice). r=TYLin
This patch shouldn't change behavior at all.

Since our print reflow pipeline doesn't try to handle incremental reflow (per
the early return in nsPageSequenceFrame::Reflow), we can safely assume that our
page frames don't have a preexisting next-in-flow (until we explicitly create
one for them).

This simplifies the logic & the number of scenarios that we need to consider.

Differential Revision: https://phabricator.services.mozilla.com/D88470
2020-08-28 22:31:50 +00:00
Daniel Holbert f2ab159f03 Bug 1659005 part 2: Make nsPageSequenceFrame determine its page range information earlier on, at the start of reflow. r=TYLin
This patch shouldn't change behavior.

After this change, we'll be able to reason about the page range during reflow
(in a later patch in this series). The old place where we determine the
page-range information -- in nsPageSequenceFrame::StartPrint -- unfortunately
runs *after* reflow.  So that was running too late for the information to be
useful when we're laying out pages on sheets.

Differential Revision: https://phabricator.services.mozilla.com/D88469
2020-08-28 22:27:42 +00:00
Daniel Holbert 2e3917b1b1 Bug 1659005 part 1: Move nsPageSequenceFrame's page-range-specific members into nsSharedPrintData. r=TYLin
This patch shouldn't change behavior at all; it's just moving some member
variables to a new home on a helper-struct (and the struct's lifetime is the
same as the lifetime of the nsPageSequenceFrame where these member variables
lived, prior to this patch).

These members need to move so that PrintedSheetFrame can have access to them.
PrintedSheetFrame is now where pages are generated, and it will handle our
page-range-induced page skipping, as of a later patch in this series.

Differential Revision: https://phabricator.services.mozilla.com/D88468
2020-08-28 22:27:34 +00:00
Botond Ballo 35448ccbee Bug 1661608 - Use correct viewport type in RecordMouseLocation(). r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D88676
2020-08-28 21:44:16 +00:00
Kartikaya Gupta cc022528e0 Bug 1661755 - Don't store a NotSpecified value, use the equivalent None value instead. r=tnikkel
This should not have any functional effects, but it maintains a useful invariant
that the stored field is never NotSpecified. NotSpecified should only be used
as a default value for function parameters, and converted to some other origin
when "at rest" in the field.

Differential Revision: https://phabricator.services.mozilla.com/D88665
2020-08-28 20:34:41 +00:00
Kartikaya Gupta 8223de6eea Bug 1661755 - Flip the ref and test setups for scroll-behavior-6.html. r=tnikkel
For all the other scroll-behavior-* tests, the "complex" behaviour is the "test"
and the "let's scroll these things to their intended destination" behaviour is
the "ref", as one would expect. Except for some reason in scroll-behavior-6, the
"ref" branch is the one doing all the tricky scrolling things and the other
branch has the simple intended outcomes. This patch inverts the branches so
that the test behaves more as expected.

Differential Revision: https://phabricator.services.mozilla.com/D88648
2020-08-28 20:43:47 +00:00
Anny Gakhokidze abc4db9fa9 Bug 1589102 - Part 10: Fix tests failing due to not waiting for the window load events, r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D87328
2020-08-28 17:21:09 +00:00
Anny Gakhokidze 19d0babe24 Bug 1589102 - Part 2: Fix tests that were broken as a result of about:srcdoc going via DocumentChannel, r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D85080
2020-08-28 17:20:33 +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
Emilio Cobos Álvarez 1e6084fb60 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-28 11:33:18 +00:00
Cosmin Sabou 2a9db10f24 Backed out 7 changesets (bug 1518999) for causing browsertime failures. CLOSED TREE
Backed out changeset d93cb254eef5 (bug 1518999)
Backed out changeset a9715e73e862 (bug 1518999)
Backed out changeset e28081d16e3c (bug 1518999)
Backed out changeset c9d88f3f1f5b (bug 1518999)
Backed out changeset 9836adcc4e83 (bug 1518999)
Backed out changeset 9f01755d327f (bug 1518999)
Backed out changeset ef494065b8e2 (bug 1518999)
2020-08-28 06:27:11 +03:00
Emilio Cobos Álvarez f1b7a3ca58 Bug 1661509 - Fix SVGSVGElement::QueryInterface. r=longsonr
Differential Revision: https://phabricator.services.mozilla.com/D88475
2020-08-27 20:56:04 +00:00
Mats Palmgren bb86544bb1 Bug 1548753 - [css-lists] Prefer an ancestor's counter scope over a sibling's scope. r=emilio
https://github.com/w3c/csswg-drafts/issues/5477

Differential Revision: https://phabricator.services.mozilla.com/D87991
2020-08-27 18:26:38 +00:00
Sean Feng 61ec0bd3c3 Bug 1518999 - Implement PerformancePaintTiming for FirstContentfulPaint r=smaug,mstange
Spec: https://w3c.github.io/paint-timing/#sec-PerformancePaintTiming
We only support FirstContentfulPaint at the moment.

Differential Revision: https://phabricator.services.mozilla.com/D66463
2020-08-27 14:50:43 +00:00
Cosmin Sabou 403893bc7e Backed out 5 changesets (bug 1653949) for assertion failures on EventStateManager.cpp. CLOSED TREE
Backed out changeset ad7c35ab2a40 (bug 1653949)
Backed out changeset 31cb90ef998a (bug 1653949)
Backed out changeset 03e65cbd2a11 (bug 1653949)
Backed out changeset a87ac2a7db70 (bug 1653949)
Backed out changeset 390dd2c04cd4 (bug 1653949)
2020-08-27 20:13:20 +03:00
Emilio Cobos Álvarez 27590dfe0b Bug 1661123 - Make LightWeightThemeConsumer.jsm sanitize colors faster. r=Gijs,jwatt
Instead of creating an element, flushing styles and getting the computed
value back just to receive, use the existing InspectorUtils.colorToRGBA.

With some refactoring, we can completely get rid of parsing rgba strings
in LightWeightThemeConsumer too, as a benefit. This should be much
faster.

This patch tweaks the InspectorUtils API to allow taking a document, so
that system colors keep working. We could probably get away without
supporting system colors, but it'd technically be a regression, and
since we want this patch to be uplifted, and it's easy, let's avoid
breaking changes.

Differential Revision: https://phabricator.services.mozilla.com/D88200
2020-08-27 12:33:11 +00:00
Edgar Chen bc49d1ce72 Bug 1653949 - Part 4: Add MouseExitFromWidget event to the delayed event queue if event handling is suppressed; r=smaug
So that we won't lost it if it happens in nested event loop.

Differential Revision: https://phabricator.services.mozilla.com/D86953
2020-08-25 23:27:21 +00:00
Edgar Chen c4125fd9d4 Bug 1653949 - Part 2: Add ePuppet to WidgetMouseEvent::ExitFrom; r=smaug
eTopLevel is reused in content process to indicates that the mouse leaves
the puppet widget rendering area, now we add a separated type, ePuppet, for it.

Differential Revision: https://phabricator.services.mozilla.com/D84748
2020-08-26 20:31:46 +00:00
Edgar Chen 363e80d673 Bug 1653949 - Part 1: Change mExitFrom in WidgetMouseEvent to be Maybe<ExitFrom>; r=smaug
mExitFrom now contains a value only when mMessage is eMouseExitFromWidget

Differential Revision: https://phabricator.services.mozilla.com/D88225
2020-08-26 14:19:46 +00:00
Emilio Cobos Álvarez 4f9baab75a Bug 1661437 - Convert print.show_print_progress into an static pref. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D88400
2020-08-27 12:27:49 +00:00
Emilio Cobos Álvarez 19fd1264ab Bug 1661388 - Factor out the default print settings code. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D88397
2020-08-27 10:58:19 +00:00
Bogdan Tara f22b74fc65 Backed out changeset 8fe9ffffccda (bug 1661123) for browser_ext_themes_experiment.js failures CLOSED TREE 2020-08-27 14:57:07 +03:00
Emilio Cobos Álvarez 4282f1752b Bug 1661123 - Make LightWeightThemeConsumer.jsm sanitize colors faster. r=Gijs,jwatt
Instead of creating an element, flushing styles and getting the computed
value back just to receive, use the existing InspectorUtils.colorToRGBA.

With some refactoring, we can completely get rid of parsing rgba strings
in LightWeightThemeConsumer too, as a benefit. This should be much
faster.

This patch tweaks the InspectorUtils API to allow taking a document, so
that system colors keep working. We could probably get away without
supporting system colors, but it'd technically be a regression, and
since we want this patch to be uplifted, and it's easy, let's avoid
breaking changes.

Differential Revision: https://phabricator.services.mozilla.com/D88200
2020-08-27 10:50:54 +00:00
Emilio Cobos Álvarez 063c081360 Bug 1660857 - Only apply grayscale filter for printing on print preview. r=jwatt,dholbert
Differential Revision: https://phabricator.services.mozilla.com/D88065
2020-08-27 09:37:31 +00:00
James Teh 39c32ba853 Bug 1660363: Don't treat elements inside print preview documents as focusable. r=emilio,mstriemer
Previously, IsFocusable returned true on elements in print preview documents, but the element wouldn't accept focus.
This meant that when you tried to tab, focus would get stuck on the document.
Now, IsFocusable returns false.
Thus, tab doesn't try to stop on these elements and can move out of the document.

Differential Revision: https://phabricator.services.mozilla.com/D88000
2020-08-27 00:41:42 +00:00
Narcis Beleuzu c6ea928240 Backed out changeset d8a3ede94c32 (bug 1660363) for bc failures on browser_modal_print.js . CLOSED TREE 2020-08-27 06:08:03 +03:00
Botond Ballo 42b8e92f8c Bug 1659761 - Restrict the fix of bug 1650488 to desktop only. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D88356
2020-08-27 00:01:07 +00:00
Botond Ballo 9be0302277 Bug 1661356 - Change nsLayoutUtils::ComputeScrollMetadata() to take a scrollport size instead of a scrollport rect. r=kats
No one meaningfully uses the scrollport rect's origin, so there's no
point in having callers compute it.

Differential Revision: https://phabricator.services.mozilla.com/D88337
2020-08-27 01:40:19 +00:00
James Teh c364e2dd5d Bug 1660363: Don't treat elements inside print preview documents as focusable. r=emilio,mstriemer
Previously, IsFocusable returned true on elements in print preview documents, but the element wouldn't accept focus.
This meant that when you tried to tab, focus would get stuck on the document.
Now, IsFocusable returns false.
Thus, tab doesn't try to stop on these elements and can move out of the document.

Differential Revision: https://phabricator.services.mozilla.com/D88000
2020-08-27 00:41:42 +00:00
Hiroyuki Ikezoe 3fc3e2d805 Bug 1660089 - Use the nearest scrollable frame as the clip frame if the scrollable frame is overflow:hidden. r=botond
Without this change, the transition in the reftest in this commit has never
been composited because it's misrecognized as __jank__.
(Note that a tricky part to understand the jank is that we expand the pre-render
region based on the transformed frame size [1], in this case it's 400px width,
so that the expanded area will be smaller than the size based on 800px.)

[1] https://searchfox.org/mozilla-central/rev/73a14f1b367948faa571ed2fe5d7eb29460787c1/layout/base/nsLayoutUtils.cpp#10043,10045

Differential Revision: https://phabricator.services.mozilla.com/D88199
2020-08-27 00:09:59 +00:00
Kartikaya Gupta d046d2b406 Bug 1660933 - Respect wheel migration value. r=botond
This introduces a linear interpolation when computing the wheel animation
durations, based on the migration percentage of the user. Initially the
migration percentage defaults to 100 (fully migrated) for new users and for
existing users who have customized these prefs. The migration percentage
defaults to zero for existing users without customizations, so they will
still get the old default values of min=200,max=400. Over time we can adjust
the migration pref clamping to move that percentage up and migrate those
users to get the new values.

Differential Revision: https://phabricator.services.mozilla.com/D88163
2020-08-26 20:31:20 +00:00
Narcis Beleuzu 77bc01a5e1 Backed out 2 changesets (bug 1660857) for bc failures on browser_parsable_css.js . CLOSED TREE
Backed out changeset 1378546cc0db (bug 1660857)
Backed out changeset 6c8985ac1d4c (bug 1660857)
2020-08-27 00:28:58 +03:00
Emilio Cobos Álvarez 0686e31ea8 Bug 1660857 - Only apply grayscale filter for printing on print preview. r=jwatt,dholbert
Depends on D88064

Differential Revision: https://phabricator.services.mozilla.com/D88065
2020-08-26 19:12:15 +00:00
Jonathan Kew 1dde07b021 Bug 1659259 - Don't reconstruct frames as a result of font-list refresh if we're in a printing or print-preview context. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D87177
2020-08-26 15:09:54 +00:00
Jonathan Kew 3c2cb7fd1a Bug 1371386 - Take account of requirements for emoji-style or text-style presentation during font selection & fallback. r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D87304
2020-08-26 09:31:58 +00:00
Masayuki Nakano 5bca4199fb Bug 1660378 - part 9: Avoid QI for getting `nsStyledElement` pointer r=smaug
The editor modules does QI too many times when it sets or removes some style
with `execCommand` or XPCOM API.  Therefore, there should be an API to
retrieve `nsStyledElement` pointer from `nsINode*`.

Differential Revision: https://phabricator.services.mozilla.com/D87990
2020-08-26 05:29:06 +00:00
Mihai Alexandru Michis 6d6f67bc0b Backed out changeset 44d25518ea20 (bug 1660363) for causing bc failures in browser_modal_print.js
CLOSED TREE
2020-08-26 09:07:18 +03:00
James Teh f30d80c39a Bug 1660363: Don't treat elements inside print preview documents as focusable. r=emilio,mstriemer
Previously, IsFocusable returned true on elements in print preview documents, but the element wouldn't accept focus.
This meant that when you tried to tab, focus would get stuck on the document.
Now, IsFocusable returns false.
Thus, tab doesn't try to stop on these elements and can move out of the document.

Differential Revision: https://phabricator.services.mozilla.com/D88000
2020-08-26 04:59:27 +00:00
longsonr 61fc7b177e Bug 1648550 - Fix getBoundingClientRect for use element position r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D83256
2020-08-25 23:36:18 +00:00
Emilio Cobos Álvarez 72730e8e3d Bug 1636728 - Make calling window.print() before load keep deferring the actual printing and closing the window until load. r=smaug
Other engines also do this, but with my previous patch breaks it
(because we only hit print() on the print-content-viewer _after_ doing
the clone).

So move it before triggering all the machinery, and only for
window.print().  Given we didn't check this for print preview etc, I
think it's fine to carry on for user-triggered loads.

Trivial test-case (which I'm not quite sure how to turn into an
automated test...)

    <!doctype html>
    <h1>I do get printed but...</h1>

    <script>
      window.print();
    </script>

    <h2>Do I?</h2>

Note that this is broken with the new print preview UI already, this
fixes it.

Differential Revision: https://phabricator.services.mozilla.com/D87898
2020-08-25 17:45:24 +00:00
Emilio Cobos Álvarez 044b3c4332 Bug 1636728 - Centralize printing entry points in nsGlobalWindowOuter, and move cloning out of nsPrintJob. r=jwatt,geckoview-reviewers,smaug,agi
This centralizes our print and preview setup in nsGlobalWindowOuter so
that we never re-clone a clone, and so that we reuse the window.open()
codepath to create the browsing context to clone into.

For window.print, for both old print dialog / silent printing and new
print preview UI, we now create a hidden browser (as in with visibility:
collapse, which takes no space but still gets a layout box).

 * In the modern UI case, this browser is swapped with the actual print
   preview clone, and the UI takes care of removing the browser.

 * In the print dialog / silent printing case, the printing code calls
   window.close() from nsDocumentViewer::OnDonePrinting().

 * We don't need to care about the old print preview UI for this case
   because it can't be open from window.print().

We need to fall back to an actual window when there's no
nsIBrowserDOMWindow around for WPT print tests and the like, which don't
have one. That seems fine, we could special-case this code path more if
needed but it doesn't seem worth it.

Differential Revision: https://phabricator.services.mozilla.com/D87063
2020-08-25 17:45:12 +00:00
longsonr 4f8808ae6f Bug 1459905 - Merge DOMSVGTranslatePoint and DOMSVGPoint and fix updates r=emilio
SVGSVGElement::SetCurrentScaleTranslate checks that things have changed but if we
manage to update both translate values before we get here then we'll skip the screen update
that we need.

Also
- introduces a tear off for SVGSVGElement.currentTranslate so we hand out the same object as required by the SVG idl
- removes SVGSVGElement::SetCurrentTranslate as dead code
- removes mPreviousScale and mPreviousTranslate from SVGSVGElement as they are no longer necessary

Differential Revision: https://phabricator.services.mozilla.com/D84796
2020-08-25 14:38:32 +00:00
Timothy Nikkel 69aaaddd9c Bug 1656711. Support hardware accelerated <feGaussianBlur> SVG filters if the x and y radius are not equal with webrender. r=gw
Pretty straight forward, mostly just plumbing stuff through.

Differential Revision: https://phabricator.services.mozilla.com/D85666
2020-08-25 07:26:21 +00:00
Daniel Holbert b8192a4fc2 Bug 1660502 part 2: Rename nsSharedPageData::mTotNumPages to mRawNumPages, for consistency. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D87887
2020-08-24 23:53:27 +00:00
Daniel Holbert e3a6a51032 Bug 1660502 part 1: Give nsIWebBrowserPrint a "rawNumPages" attribute. r=TYLin
This is backed by an existing nsPageSequenceFrame API, which this patch also
renames to use the word "Raw" for consistency across the full callstack.

Differential Revision: https://phabricator.services.mozilla.com/D87886
2020-08-24 23:53:11 +00:00
Stephen A Pohl 4c95e75c52 Bug 1656264: Adjust default font size for non-native theming. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D85415
2020-08-24 14:42:46 +00:00
Cosmin Sabou 7b214fd81a Backed out 6 changesets (bug 1518999) for geckoview failures on scrollToVerticalOnZoomedContentAuto.
Backed out changeset 10bf1552e301 (bug 1518999)
Backed out changeset e62cd63e3595 (bug 1518999)
Backed out changeset 1bf0b02bb0e0 (bug 1518999)
Backed out changeset 2203a9c52afa (bug 1518999)
Backed out changeset 10f07ca7a246 (bug 1518999)
Backed out changeset b90cf6b54c09 (bug 1518999)
2020-08-25 01:02:36 +03:00
Anny G b79310d312 Bug 1660345 - Remove unnecessary process checks from BrowserParent, r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D88066
2020-08-24 20:24:04 +00:00
Sean Feng 517cde9bae Bug 1518999 - Implement PerformancePaintTiming for FirstContentfulPaint r=smaug,mstange
Spec: https://w3c.github.io/paint-timing/#sec-PerformancePaintTiming
We only support FirstContentfulPaint at the moment.

Differential Revision: https://phabricator.services.mozilla.com/D66463
2020-08-24 16:03:31 +00:00
Mihai Alexandru Michis b162701621 Backed out changeset 0cad1ef724ee (bug 1371386) for causing failures in emoji-fallback-3.html
CLOSED TREE
2020-08-24 21:02:10 +03:00
Jonathan Kew ba87878325 Bug 1371386 - Take account of requirements for emoji-style or text-style presentation during font selection & fallback. r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D87304
2020-08-24 14:24:12 +00:00
Bob Owen ec09c21cdd Bug 1660463: Only allow printing of a selection when mDisallowSelectionPrint is false. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D88028
2020-08-24 14:29:29 +00:00
Emilio Cobos Álvarez 6e52b0c1c7 Bug 1636728 - Request a longer timeout in test_printpreview.xhtml. r=jwatt
The first patch in this bug makes this test a bit more heavy-weight.

Instead of rendering the print-preview document in an iframe, and
snapshotting the 400x400 pixels in the top left corner, we open a window
and snapshot the whole print preview document.

I could keep it doing the same if needed by passing the docshell
argument to window.printPreview. But this test wasn't great to begin
with, and the changes in part 1 are a net improvement imo.

The bad part is that they cause the test to become slower such as it can
time out in some debug builds. Request a longer timeout because of this.

Differential Revision: https://phabricator.services.mozilla.com/D87966
2020-08-24 11:14:27 +00:00
Joel Maher 5371bf42c5 Bug 166061 - Bug 1660661 - adjust svg alpha reftest expectations for windows 10 on hardware. r=kats
adjust svg alpha reftest expectations for windows 10 on hardware

Differential Revision: https://phabricator.services.mozilla.com/D87968
2020-08-23 16:04:52 +00:00
Botond Ballo 3a5e8351c5 Bug 1659973 - Bring back FrameMetrics::mVisualViewportOffset (but call it mVisualDestination). r=kats
Differential Revision: https://phabricator.services.mozilla.com/D87941
2020-08-22 22:59:47 +00:00
Stephen A Pohl f6a573510f Bug 1657743: Fix reftests. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D86721
2020-08-21 14:01:44 +00:00
Honza Bambas 2bc91fef35 Bug 1657974 - MOZ_LOG schedule and run of `FrameRequestCallback`, r=froydnj
Depends on D86740

Differential Revision: https://phabricator.services.mozilla.com/D86741
2020-08-13 14:41:16 +00:00
Honza Bambas 13026539fa Bug 1657960 - MOZ_LOG schedule and run of `mStyleFlushObservers` and `mLayoutFlushObservers`, r=froydnj
Depends on D86737

Differential Revision: https://phabricator.services.mozilla.com/D86738
2020-08-13 14:41:15 +00:00
Honza Bambas 8c06001afd Bug 1657941 - Log the first paint in `PresShell::Paint`, r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D86737
2020-08-13 14:39:45 +00:00
Hiroyuki Ikezoe c3e70abe26 Bug 1660189 - Bail out from nsPrintJob::DoCommonPrint if the docshell was destroyed in beforeprint event handlers. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D87827
2020-08-21 04:58:49 +00:00
Botond Ballo a621152a3c Bug 1543485 - Also update the code in ScrollToImpl() that proactively updates the callback transform and main thread visual viewport offset. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D87692
2020-08-21 01:24:59 +00:00
Botond Ballo 27cd351633 Bug 1543485 - Back out the hacky fix for bug 1549625. r=kats
Now that main thread scroll updates preserve the relative scroll offset
in APZ, this hacky fix is no longer necessary.

Differential Revision: https://phabricator.services.mozilla.com/D87687
2020-08-20 23:30:13 +00:00
Bob Owen 72fd7de5a6 Bug 1658299 Part 2: Add createDefaultSettings() to nsIPrinter for Windows. r=jwatt,jfkthame
This retrieves the same settings from the printer as
InitPrintSettingsFromPrinter.
There is probably a lot of scope for de-duplication of code here, but I decided
to try and protect the old fallback paths.

Depends on D87125

Differential Revision: https://phabricator.services.mozilla.com/D87604
2020-08-20 23:25:10 +00:00
Ting-Yu Lin b91e219fd9 Bug 1412687 Part 2 - Consider an overflow container's scrollable overflow when deciding whether to reflow it. r=dholbert
This patch is similar to Bug 1559961 Part 2 [1]. That is, we want to reflow
an overflow container again if its scrollable overflow block-end exceeds
the available block-size constraint.

[1] https://hg.mozilla.org/mozilla-central/rev/d377ce300d0349c1b7dc562bcf5343851d36c6ed

Differential Revision: https://phabricator.services.mozilla.com/D87630
2020-08-20 22:29:59 +00:00
Ting-Yu Lin 1308ebb070 Bug 1412687 Part 1 - Make const-cast clearer in nsTableRowGroupFrame::Reflow(). r=dholbert
ReflowInputFlags is a struct of bitfields, so we cannot use AutoRestore to
restore its member bitfield.

Differential Revision: https://phabricator.services.mozilla.com/D87629
2020-08-20 22:24:58 +00:00
Hiroyuki Ikezoe d19326f840 Bug 1660213 - Fixed an used variable error in nsDocumentViewer::GetCurrentSheetFrameAndPageNumber. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D87806
2020-08-20 22:02:54 +00:00
Daniel Holbert 8d972cd5cd Bug 1660294 part 0: Directly initialize nsSharedPageData member-var, and adjust its documentation. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D86797
2020-08-20 17:57:45 +00:00
Erik Nordin 352e314767 Bug 1660285 - Improve Print Paper Size Test Assertions r=dholbert
This improves the paper assertions to check for attribute type, rather
than checking if the attribute is null, since undefined is not null and
can cause false positives.

Also updates the formatting to be congruent with other related tests.

Differential Revision: https://phabricator.services.mozilla.com/D87783
2020-08-20 17:52:20 +00:00
Emilio Cobos Álvarez b17bb7ed34 Bug 1660251 - After bug 1658173 we need to re-center pages if any dimensions change, not just if width changes. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D87757
2020-08-20 16:23:48 +00:00
Daniel Holbert e90fd447e6 Bug 1660166 followup: Mark nsPageFrame::GetPageNum as 'const'. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D87753
2020-08-20 15:05:54 +00:00
Emilio Cobos Álvarez 54b5a9f5f5 Bug 1659457 - Do clone xml-pretty-printer's UA widget. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D87714
2020-08-20 11:29:45 +00:00
Daniel Holbert 335b4750cb Bug 1660166 part 3: Remove a redundant member-variable that represents the total number of pages. r=hiro
Before this patch stack, nsPageSequenceFrame and every nsPageFrame each
individually tracked the number of pages.

As of the previous patch, we've coalesced the nsPageFrame variables into a
single variable that lives on nsSharedPageData.  This patch here replaces
nsPageSequenceFrame's member-var with that nsSharedPageData variable, too.

Depends on D87696

Differential Revision: https://phabricator.services.mozilla.com/D87697
2020-08-20 06:16:04 +00:00
Daniel Holbert b39ca4f982 Bug 1660166 part 2: Let nsPageFrame determine its own page number, and store total number of pages in one central spot. r=hiro
Depends on D87695

Differential Revision: https://phabricator.services.mozilla.com/D87696
2020-08-20 06:12:33 +00:00
Daniel Holbert 16dd33822d Bug 1660166 part 1: In PrintedSheetFrame's reflow loop, cast the child frame to nsPageFrame (which is the concrete type that we know it has). r=hiro
We already do this static_cast'ing before this patch, for a single
nsPageFrame-specific method call.  This patch just captures the result of that
static_cast in a reusable variable, so that I can easily add another
nsPageFrame-specific function call in the next patch of this patch series.

(We can be confident this casting is valid, because we only ever give
PrintedSheetFrame this one type of child frame.)

Differential Revision: https://phabricator.services.mozilla.com/D87695
2020-08-20 06:12:32 +00:00
Erik Nordin b81a2922ac Bug 1658299 - Part 1: Add createDefaultSettings() to nsIPrinter for CUPS r=jwatt,emilio,geckoview-reviewers,owlish
This patch adds a createDefaultSettings() method to nsIPrinter to
initialize a default print settings object specific to that printer.
It implements the functionality for Linux and macOS but adds only stubs
for Windows.

Differential Revision: https://phabricator.services.mozilla.com/D87125
2020-08-20 06:11:08 +00:00
Bogdan Tara 48d00fff60 Backed out changeset ebf8dfa204ea (bug 1658299) for test_printer_default_settings.html failures CLOSED TREE 2020-08-20 05:36:37 +03:00
Ting-Yu Lin a594ed407c Bug 1633031 Part 3 - Remove unused parameters from DoFlexLayout(), ComputeMainSize(), and ComputeCrossSize(). r=dholbert
We do the flex algorithm by assuming the available block-size is
unconstrained. Thus, we can remove `availableBSizeForContent` and
`aStatus` passing to DoFlexLayout(), ComputeMainSize(), and
ComputeCrossSize().

Differential Revision: https://phabricator.services.mozilla.com/D87109
2020-08-19 21:10:48 +00:00
Ting-Yu Lin 290f578f8a Bug 1633031 Part 2 - Add reftests for fragmenting multi-line column-oriented flex containers. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D87108
2020-08-19 21:22:34 +00:00
Ting-Yu Lin 7cb8492735 Bug 1633031 Part 1 - Stop considering available block-size when wrapping flex lines in multi-line column-oriented flex container. r=dholbert
Although this goes against the suggestion of the sample algorithm in the
spec, this brings the layout of the multi-line column-oriented flex
container in paginated context closer to the layout with no
fragmentation. This also matches Google Chrome's behavior.

Tweak flexbox-unbreakable-child-2.html so that it matches the rendering
as of this patch. Change the height of `.muticol` and the removal of
border in `flexContainer` to let two flex items fit exactly into the
flex container's height, making reference easier to write.

Differential Revision: https://phabricator.services.mozilla.com/D87107
2020-08-19 21:10:01 +00:00
Erik Nordin 851b8f7c70 Bug 1658299 - Part 1: Add createDefaultSettings() to nsIPrinter for CUPS r=jwatt,emilio,geckoview-reviewers,owlish
This patch adds a createDefaultSettings() method to nsIPrinter to
initialize a default print settings object specific to that printer.
It implements the functionality for Linux and macOS but adds only stubs
for Windows.

Differential Revision: https://phabricator.services.mozilla.com/D87125
2020-08-20 00:23:59 +00:00
Hiroyuki Ikezoe 50f539d050 Bug 1657550 - Rewrite nsDocumentViewer::PrintPreviewScrollToPage. r=emilio
This change consists of;

1) Use switch statement for the given PrintPreview Navigation type.
2) Simply iterate over the children of nsPageSequenceFrame for
   PRINTPREVIEW_GOTO_PAGENUM
3) Use GetCurrentSheetFrameAndPageNumber for PRINTPREVIEW_PREV_PAGE and
   PRINTPREVIEW_NEXT_PAGE so that it should now match
   printPreviewCurrentPageNumber
   (that means the edge case where the current scroll position is in
    the gap between pages has been fixed by this change)
4) Scroll to the position where the target frame is positioned at the center of
   the print preview scroll port in the cases of PRINTPREVIEW_PREV_PAGE,
   PRINTPREVIEW_NEXT_PAGE and PRINTPREVIEW_GOTO_PAGENUM

4) is a bit debatable but it can be now easily modified by changing
ComputeScrollPositionFrameAtCenter later if it turns out the current way is not
reasonable.

Differential Revision: https://phabricator.services.mozilla.com/D87548
2020-08-19 22:50:54 +00:00
Hiroyuki Ikezoe 1f301a0a87 Bug 1657550 - Make GetCurrentPageNumberInPrintPreview return the current sheet frame along with the current page. r=emilio
We need the current sheet frame for PRINTPREVIEW_NEXT_PAGE and
PRINTPREVIEW_PREV_PAGE cases.

Differential Revision: https://phabricator.services.mozilla.com/D87547
2020-08-19 22:50:39 +00:00
Hiroyuki Ikezoe 692b6393c2 Bug 1657550 - Factor out the function to get the current page number in the print preview. r=emilio
We have to use the logic in the function for
nsDocumentViewer::PrintPreviewScrollToPage in subsequent changes.

Differential Revision: https://phabricator.services.mozilla.com/D87546
2020-08-19 22:50:29 +00:00
Hiroyuki Ikezoe ce091f13c6 Bug 1657550 - Preserve x-axis scroll position on printPreviewScrollToPage call in any cases. r=emilio
That's what we've done for PRINTPREVIEW_PREV_PAGE, PRINTPREVIEW_NEXT_PAGE
and PRINTPREVIEW_GOTO_PAGENUM.

Differential Revision: https://phabricator.services.mozilla.com/D87545
2020-08-19 22:50:15 +00:00