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

74039 Коммитов

Автор SHA1 Сообщение Дата
Mihai Alexandru Michis a64de8bf5f Backed out 2 changesets (bug 1663562) for causing bustages in nsPresContext.cpp
CLOSED TREE

Backed out changeset 67cbb5422dbc (bug 1663562)
Backed out changeset 574709176152 (bug 1663562)
2020-09-15 07:22:29 +03:00
Timothy Nikkel 147ca18b99 Bug 1663562. Don't call MaybeReflowForInflationScreenSizeChange with webrender when running mochitests in dom/base/test to work around webrender bug for now. r=botond
This is sad, but seems like the least bad option to enable desktop zooming scrollbars reasonable soon.

Depends on D89409

Differential Revision: https://phabricator.services.mozilla.com/D90181
2020-09-15 04:07:21 +00:00
Timothy Nikkel d1a2ce8468 Bug 1663562. Call MaybeReflowForInflationScreenSizeChange when any prefs that could affect font inflation change. r=kats
When I start setting the pref ui.useOverlayScrollbars in bug 1663537 we trigger this assert

```
###!!! ASSERTION: can't mark frame dirty during reflow: '!mIsReflowing', file /builds/worker/checkouts/gecko/layout/base/PresShell.cpp, line 2677
#01: mozilla::PresShell::MaybeReflowForInflationScreenSizeChange() [layout/base/PresShell.cpp:11148]
#02: mozilla::PresShell::CompleteChangeToVisualViewportSize() [layout/base/PresShell.cpp:11177]
#03: MobileViewportManager::UpdateVisualViewportSize(mozilla::gfx::IntSizeTyped<mozilla::ScreenPixel> const&, mozilla::gfx::ScaleFactor<mozilla::CSSPixel, mozilla::ScreenPixel> const&) [layout/base/MobileViewportManager.cpp:504]
#04: MobileViewportManager::RefreshVisualViewportSize() [layout/base/MobileViewportManager.cpp:557]
#05: nsHTMLScrollFrame::Reflow(nsPresContext*, mozilla::ReflowOutput&, mozilla::ReflowInput const&, nsReflowStatus&) [layout/generic/nsGfxScrollFrame.cpp:1340]
#06: nsContainerFrame::ReflowChild(nsIFrame*, nsPresContext*, mozilla::ReflowOutput&, mozilla::ReflowInput const&, int, int, nsIFrame::ReflowChildFlags, nsReflowStatus&, nsOverflowContinuationTracker*) [layout/generic/nsContainerFrame.cpp:1115]
#07: mozilla::ViewportFrame::Reflow(nsPresContext*, mozilla::ReflowOutput&, mozilla::ReflowInput const&, nsReflowStatus&) [layout/generic/ViewportFrame.cpp:297]
#08: mozilla::PresShell::DoReflow(nsIFrame*, bool, mozilla::OverflowChangedTracker*) [layout/base/PresShell.cpp:9650]
#09: mozilla::PresShell::ProcessReflowCommands(bool) [layout/base/PresShell.cpp:9816]
#10: mozilla::PresShell::DoFlushPendingNotifications(mozilla::ChangesToFlush) [layout/base/PresShell.cpp:4239]
#11: nsRefreshDriver::Tick(mozilla::layers::BaseTransactionId<mozilla::VsyncIdType>, mozilla::TimeStamp) [layout/base/nsRefreshDriver.cpp:2139]
```

This happens after the test is finish when we unset the ui.useOverlayScrollbars pref which (I'm assuming because it must) causes reflow. When running a font-inflation related reftest we also unset the font inflation related prefs that were specified in the reftest.list file. This causes font-inflation to go from enabled to disabled and we detect that for the first time while reflowing the scroll frame.

Instead we should reflow when any pref that could affect font inflation is changed. I scanned the font-inflation code in PresShell and Document::GetViewportInfo for prefs are consulted, but I didn't go a super exhaustive search.

Differential Revision: https://phabricator.services.mozilla.com/D89409
2020-09-14 22:19:09 +00:00
Emilio Cobos Álvarez 8b0177b46a Bug 1664718 - Allow :is() and :where() to have better error recovery. r=xidorn
Adjust is-where-parsing.html to work with both the new and old behavior,
and add a test for the new behavior.

Depends on D90049

Differential Revision: https://phabricator.services.mozilla.com/D90050
2020-09-14 22:33:01 +00:00
Ting-Yu Lin ecca275fc4 Bug 1168478 Part 2 - Combine the border and padding arguments for nsIFrame::ComputeSize(). r=dholbert
Also combine the border and padding arguments for
nsContainerFrame::ComputeSizeWithIntrinsicDimensions(), too. This method
is used as a helper to implement ComputeSize() for various replaced
elements. Its callers are all within nsIFrame's derived classes'
overridden methods, so I'm not bothering to convert them in a separate
patch.

This change shouldn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D90064
2020-09-14 20:42:22 +00:00
Ting-Yu Lin ff5d92f454 Bug 1168478 Part 1 - Combine the border and padding argument for nsIFrame::ComputeAutoSize(). r=dholbert
Also, revise the nsIFrame::ComputeAutoSize()'s documentation.

This change shouldn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D90063
2020-09-14 20:39:17 +00:00
longsonr b516ea3715 Bug 1633038 - Adjust some tests to wait for load event to try to ensure styles are loaded r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D90093
2020-09-14 17:30:06 +00:00
Mihai Alexandru Michis 47b948eabc Backed out 2 changesets (bug 1664718) for causing wpt and bc failures.
CLOSED TREE

Backed out changeset 62e71d3b6b32 (bug 1664718)
Backed out changeset c8a8791a26ed (bug 1664718)
2020-09-14 20:32:50 +03:00
Ting-Yu Lin d85303971b Bug 1664738 - Add a space to break words in a flex log. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D90062
2020-09-14 16:26:37 +00:00
Ting-Yu Lin 64602251d8 Bug 1664738 - Fix ComputeSizeWithIntrinsicDimensions()'s class name in comments and descriptions. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D90061
2020-09-14 16:26:09 +00:00
Ting-Yu Lin 3b98b8696e Bug 1664738 - Remove unused ReflowInput::GetDisplay(). r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D90060
2020-09-14 07:09:26 +00:00
Emilio Cobos Álvarez 4c86d9e159 Bug 1664718 - Allow :is() and :where() to have better error recovery. r=xidorn
Adjust is-where-parsing.html to work with both the new and old behavior,
and add a test for the new behavior.

Depends on D90049

Differential Revision: https://phabricator.services.mozilla.com/D90050
2020-09-14 15:04:22 +00:00
Bas Schouten 343a7ab31c Bug 1661881 - Part 3: Make RefreshDriver's tick call SetInputHandlingStartTime directly. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D89536
2020-09-14 12:13:13 +00:00
Magnus Melin 23789c5a89 Bug 1654620 - fix Crash in [@ nsTreeBodyFrame::GetSelectionRegion]. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D90082
2020-09-14 11:12:18 +00:00
Sylvestre Ledru 6365af6a09 Bug 1664747 - Remove some duplicate if ("bugprone-redundant-branch-condition" warning) r=emilio,andi
Differential Revision: https://phabricator.services.mozilla.com/D90067
2020-09-14 10:52:43 +00:00
Timothy Nikkel 0fd2537d8e Bug 1664661. Make ScrollFrameHelper::UpdateScrollbarPosition use the same calculation for scrollbar attributes as ScrollFrameHelper::ReflowFinished. r=kats
UpdateScrollbarPosition should have been using scroll range and not scrolled rect for a long time. It didn't matter because we only used the top left of the rect which matched until bug 1654933 made GetScrollRangeForUserInputEvents return a rect that wasn't located at 0,0.

Differential Revision: https://phabricator.services.mozilla.com/D90031
2020-09-13 15:27:34 +00:00
Glenn Watson 48436f197b Bug 1644691 - Update fuzziness for bugs/456219-2.html. r=mattwoodrow
Add an extra pixel of fuzziness for this test - a recent unrelated
change to WR thread timing made this intermittent fail more often.

Differential Revision: https://phabricator.services.mozilla.com/D90053
2020-09-14 00:01:17 +00:00
Timothy Nikkel 30f528e804 Bug 1664446. Properly wait to make sure any potential scroll events get fired in several tests. r=kats
Doing rAF rAF flushApzRepaints is not enough to make sure that any potential scroll events are sent to content. The reason is that if the apz repaint request causes us to do scrolling on the main thread then the scrolling will be finished after flushApzRepaints, and the scroll event will be pending, but it's not sent until the next refresh driver tick. So we need to do at least one rAF after flushApzRepaints.

Differential Revision: https://phabricator.services.mozilla.com/D90035
2020-09-13 20:21:11 +00:00
Lee Salzman 7d6987f54e Bug 1664459 - simplify WebRender radial gradient shader. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D89915
2020-09-13 18:26:32 +00:00
Narcis Beleuzu 51c243ddc3 Backed out changeset a3f95f66b7de (bug 1664459) for reftest failures on border-image-radial-gradient-width.html 2020-09-13 18:43:01 +03:00
Delan Azabani 9e07fbde4d Bug 1658121 - Implement padding/border layout for <mspace>. r=emilio
This patch doesn’t try to handle width/height or similar properties ([[ https://github.com/mathml-refresh/mathml/issues/45 | mathml-refresh/mathml#45 ]]) or non-horizontal writing modes ([[ https://bugzilla.mozilla.org/show_bug.cgi?id=1077525 | bug 1077525 ]]).

* [[ https://phabricator.services.mozilla.com/D86471?id=324103 | Diff 1 ]] implements padding well enough to pass WPT’s [[ http://wpt.live/mathml/relations/css-styling/padding-border-margin/padding-002.html | “Padding properties on mspace” ]]
* [[ https://phabricator.services.mozilla.com/D86471?id=324105 | Diff 2 ]] implements border well enough to pass WPT’s [[ http://wpt.live/mathml/relations/css-styling/padding-border-margin/border-002.html | “Border properties on mspace” ]]
* [[ https://phabricator.services.mozilla.com/D86471?id=324110 | Diff 3 ]] adjusts mBlockStartAscent + mBoundingMetrics in the same way as the rest of the ReflowOutput
* [[ https://phabricator.services.mozilla.com/D86471?id=327654 | Diff 4 ]] adjusts MeasureForWidth by IntrinsicISizeOffsets().{padding,border}
* Diff 5 through Diff 8 relate to margin layout, and now live in D87594
* [[ https://phabricator.services.mozilla.com/D86471?id=328587 | Diff 9 ]] + [[ https://phabricator.services.mozilla.com/D86471?id=336839 | Diff 10 ]] mark the relevant WPT cases as passing
* [[ https://phabricator.services.mozilla.com/D86471?id=338658 | Diff 11 ]] adds a workaround for [[ https://bugzilla.mozilla.org/show_bug.cgi?id=1658135 | bug 1658135 ]] to the WPT support script

Differential Revision: https://phabricator.services.mozilla.com/D86471
2020-09-13 11:17:03 +00:00
Emilio Cobos Álvarez 948fa5c6d2 Bug 1664156 - Remove -moz-suppressed. r=edgar
Per spec we shouldn't behave differently depending on how we blocked the
image/object/etc.

This may have made sense in the past when ad blockers were implemented
via nsIContentPolicy, but I think nowadays it doesn't make sense, and
showing fallback is preferred.

There's a couple extra cleanups we can do after this lands, like
removing HTMLImageElement.imageBlockingStatus and simplifying a bit that
code. But I'll do that in a separate bug.

Differential Revision: https://phabricator.services.mozilla.com/D89912
2020-09-13 11:33:13 +00:00
Lee Salzman 16183ea20e Bug 1664459 - simplify WebRender radial gradient shader. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D89915
2020-09-13 08:40:22 +00:00
Noemi Erli 733e3b440c Backed out changeset 64eb902728bc (bug 1664156) for causing mochitest failures in test_meta_csp_self.html CLOSED TREE 2020-09-12 22:56:18 +03:00
Emilio Cobos Álvarez 4b18c556e4 Bug 1664156 - Remove -moz-suppressed. r=edgar
Per spec we shouldn't behave differently depending on how we blocked the
image/object/etc.

This may have made sense in the past when ad blockers were implemented
via nsIContentPolicy, but I think nowadays it doesn't make sense, and
showing fallback is preferred.

There's a couple extra cleanups we can do after this lands, like
removing HTMLImageElement.imageBlockingStatus and simplifying a bit that
code. But I'll do that in a separate bug.

Differential Revision: https://phabricator.services.mozilla.com/D89912
2020-09-12 17:39:18 +00:00
Kartikaya Gupta 6ea98dfe88 Bug 1658169 - Move the origin-based physics computation to APZPublicUtils. r=tnikkel
This is just moving code to make it reusable in APZ. As part of this, I replace
use of Preferences::* with the StaticPrefs::* API, because we can't use
Preferences:: in the GPU process and we'll want to be able to invoke this code
from there.

Differential Revision: https://phabricator.services.mozilla.com/D89665
2020-09-12 14:08:10 +00:00
Kartikaya Gupta 3621cb5408 Bug 1662014 - Drop mRelativeOffset and mLastSmoothScrollOrigin. r=tnikkel,botond
The only place these fields are still read are for detecting if an APZ animation
is pending (not yet submitted in a transaction) and we can replace that code
with something slightly simpler. And then delete the unused fields.

Differential Revision: https://phabricator.services.mozilla.com/D88751
2020-09-12 13:06:41 +00:00
Kartikaya Gupta 8b10d15d15 Bug 1662014 - Remove unused fields/APIs. r=botond,tnikkel
These things are all unused now.

Differential Revision: https://phabricator.services.mozilla.com/D88750
2020-09-12 13:06:39 +00:00
Kartikaya Gupta 80742a3694 Bug 1661903 - Update test expectation to match Chrome and be consistent with other similar scenarios. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D88747
2020-09-12 13:06:22 +00:00
Kartikaya Gupta 0863c04a4d Bug 1662013 - Move some function bodies into .cpp files. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D88746
2020-09-12 13:06:20 +00:00
Kartikaya Gupta 9b69abb395 Bug 1662013 - Make the scroll-behavior-element WPT test pass. r=tnikkel
The previous patches caused the scroll-behavior-element WPT to fail, specificallly
the subtest that does a no-op instant scroll immediately following an APZ smooth
scroll, within the same transaction. In this subtest, the APZ smooth scroll
request gets added to mScrollUpdates but then the instant scroll is a no-op
(destination is same as current position) so we early return and don't add a
scroll update for it. This patch adds a bit of code to the early-exit path to
detect this scenario and let APZ know to cancel the animation. By itself this
causes a different test to fail, because we also hit this codepath when the
main thread internally does a no-op instant scroll to reclamp the scroll offset
after a reflow. That requires further refining the condition with a new scroll
origin used for the clamping call.

This ain't the prettiest thing but I'm hopeful that after untangling more of
the surrounding code in the future we can replace this with something more
elegant.

Differential Revision: https://phabricator.services.mozilla.com/D88745
2020-09-12 13:06:12 +00:00
Kartikaya Gupta c942c614e3 Bug 1662013 - Update NotifyLayersUpdated to use the ScrollPositionUpdates. r=tnikkel,botond
This rewrites a big chunk of the NotifyLayersUpdated code (most of the code that
deals with incoming scroll requests from the main-thread) to instead iterate
through the list of ScrollPositionUpdates on the metadata and apply them in
order. A bunch of the ApplyXXXUpdateFrom functions on FrameMetrics have their
innards deduplicated and boil down to a single line, which is then inlined, so
those functions get removed entirely.

Note that this rewrite doesn't yet handle all the possible types of
ScrollPositionUpdate instances, just the ones that the old code handled. In the
future this support will be fleshed out with tests to exercise the relevant
codepaths.

There is also a change to nsGfxScrollFrame which slightly modifies the semantics
of mApzScrollPos to handle the case where multiple relative scrolls happen in a
single transaction. As the implementation now requires multiple relative
ScrollPositionUpdates rather than a single "unified" relative scroll in the
FrameMetrics, we need to update mApzScrollPos for each relative
ScrollPositionUpdate we generate.

Differential Revision: https://phabricator.services.mozilla.com/D88744
2020-09-12 13:06:10 +00:00
Kartikaya Gupta f334f15463 Bug 1662013 - Replace ScrollUpdateInfo with ScrollPositionUpdate. r=botond
The existing ScrollUpdateInfo that is used to store a "paint-skipped scroll" for
empty transactions is very similar to the new ScrollPositionUpdate class, so
we can delete the former and use the latter instead.

The important part of this change is that when applying the pending info to
a FrameMetrics, we now also append the ScrollUpdateInfo to the mScrollUpdates
list on the ScrollMetadata. This aligns the code with the previous few patches,
where we duplicate the scroll information in both the regular FrameMetrics
fields and the ScrollMetadata::mScrollUpdates array.

Note that the existing code may have a defect when multiple paint-skip scrolls
occur in a single transaction; only the newest one is kept. In the case where
the last paint-skip is an absolute scroll, this is fine, but a relative scroll
may end up clobbering a previous absolute scroll. This patch explicitly detects
the scenario with multiple paint-skip scrolls and bails out to a full paint
transaction. As a followup it should be possible to relax this restriction by
storing an array of pending ScrollPositionUpdate instances.

Differential Revision: https://phabricator.services.mozilla.com/D88743
2020-09-12 13:06:02 +00:00
Kartikaya Gupta 378887e276 Bug 1662013 - Introduce a ScrollPositionUpdate and plumb it in. r=tnikkel,botond
This adds a ScrollPositionUpdate class. Code in nsGfxScrollFrame creates
instances of these classes every time the scroll generation is incremented,
and saves them to an array. The array is sent in the scroll metadata to the
compositor as part of a paint transaction.

Currently this data is not used at all on the APZ side, and exists alongside
(independently of) the existing scroll fields, so this patch should not have
any functional effects.

Differential Revision: https://phabricator.services.mozilla.com/D88741
2020-09-12 13:05:53 +00:00
Emilio Cobos Álvarez 1ef2a5628a Bug 1664432 - Remove -moz-user-disabled. r=edgar
We treat it exactly the same as -moz-broken. The pseudo-class is not
exposed to content, so I don't think we have a reason to keep it around.

Differential Revision: https://phabricator.services.mozilla.com/D89904
2020-09-11 19:26:40 +00:00
Timothy Nikkel 7af5dd6078 Bug 1663537. Use scrollbar-width: none on some reftests that are not trying to test scrollbars. r=botond
These tests only failed on android, probably because the visual viewport size is different so we get a different result from the scrollbar calculation.

These tests seem to have an inconsistent mix of overflow: hidden and scrollbar-width: none. The desktop zooming scrollbars sometimes create scrollbars for overflow hidden now, so overflow hidden isn't enough, we need scrollbar-width: none.

layout/reftests/transform/compound-1-fail.html is the only file modified here that doesn't have overflow hidden or scrollbar-width: none already. Looking at the test it does not seem to be wanting to be anti-ref because of scrollbars (the transformed item looks different), so this seems to be an improvement (ie we won't pass because only the scrollbar differed).

Differential Revision: https://phabricator.services.mozilla.com/D90008
2020-09-12 06:59:53 +00:00
Razvan Maries 8f97d6d022 Backed out changeset b5d0e150491e (bug 1661544) for perma failures on HTMLBody-ScrollArea_quirksmode.html. 2020-09-12 09:48:34 +03:00
Ting-Yu Lin b34bab609c Bug 1657345 - Make grid container aware that its available block-size can be unconstrained in paginated context. r=mats
This happens when nsColumnSetFrame reflows its last column in an
unconstrained available block-size.

The wpt test can trigger the bug in a debug build easily. In opt builds like
Nightly, if one wants to load the test manually, additional incremental reflow
(such as opening devtools) may be needed to trigger the bug.

Co-authored-by: Mats Palmgren <mats@mozilla.com>

Differential Revision: https://phabricator.services.mozilla.com/D86672
2020-09-12 00:54:10 +00:00
Frederic Wang 4f44f0d754 Bug 1664467: Remove runtime preferences for legacy MathML lengths. r=emilio
This commit remove the following preferences, which have been
disabled since Firefox 70:
- mathml.nonzero_unitless_lengths.disabled
- mathml.legacy_number_syntax.disabled

These are edge syntaxes for MathML3 lengths that don't align well
with CSS and we haven't received any bug report about it since they
were disabled. Tests are updated to treat attributes using such
values as invalid.

update tests

Differential Revision: https://phabricator.services.mozilla.com/D89920
2020-09-11 19:48:07 +00:00
Botond Ballo d5b3bf63f9 Bug 1661544 - Ensure initial viewport is computed before reporting innerWidth. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D88947
2020-09-09 21:14:31 +00:00
Ting-Yu Lin 8fb717c256 Bug 1663822 Part 8 - Revise nsIFrame::ComputeSize()'s documentation. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D89643
2020-09-11 18:22:37 +00:00
Ting-Yu Lin 8d19493543 Bug 1663822 Part 7 - Use constructor delegation for SizeComputationInput. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D89546
2020-09-11 17:59:28 +00:00
Ting-Yu Lin 8763701634 Bug 1663822 Part 6 - Convert the anonymous enum controlling ReflowInput's behavior into an EnumSet. r=dholbert
This change shouldn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D89545
2020-09-11 17:59:21 +00:00
Ting-Yu Lin d89dc7f8cc Bug 1663822 Part 5 - Move ReflowInputFlags from SizeComputationInput to ReflowInput. r=dholbert
In previous part, we changed SizeComputationInput::InitOffsets to take a
ComputeSizeFlags parameter instead of ReflowInputFlags. Now there's no
reason to put ReflowInputFlags under SizeComputationInput.

Also rename it to `Flags` because it now lives in `ReflowInput`.

This change shouldn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D89544
2020-09-11 17:59:13 +00:00
Ting-Yu Lin edcb942efd Bug 1663822 Part 4 - Add a ComputeSizeFlags parameter to ReflowInput's constructor, and store it in ReflowInput. r=dholbert
Currently, to set ComputeSizeFlags, the caller uses an anonymous enum as
a parameter to ReflowInput constructor to set ReflowInputFlags fields,
and then ReflowInput creates a ComputeSizeFlags from the relevant
ReflowInputFlags fields in Init().

This patch simplifies this flags handover by adding ComputeSizeFlags
parameter to ReflowInput so that the caller can create the flags and
pass it to ReflowInput directly. The can also simplifies the process
needed to add a new ComputeSizeFlag.

We still need to store ComputeSizeFlags in ReflowInput since there's one
caller in `nsBlockFrame::ComputeFinalSize` wanting to checking
`ComputeSizeFlag::BClampMarginBoxMinSize`.

Note 1: ComputeSizeFlags is added only to the ReflowInput's constructor
that also takes parent ReflowInput. The other constructor's existing
callers don't need it.

Note 2: I don't bother adjust the value of DUMMY_PARENT_REFLOW_INPUT,
CALLER_WILL_INIT, and STATIC_POS_IS_CB_ORIGIN because they are going to
be converted into a enum class in a later patch.

This change shouldn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D89543
2020-09-11 18:17:51 +00:00
Ting-Yu Lin a11075f9e1 Bug 1663822 Part 3 - Move ComputeSizeFlags to LayoutConstants.h, and put it under mozilla namespace. r=dholbert
In the next part, I'm going to use ComputeSizeFlags as the arguments in
some ReflowInput's methods. Because nsIFrame.h includes ReflowInput.h,
to solve the circular dependency, ComputeSizeFlags needs to be moved to
somewhere else.

Also, revise the document for ComputeSizeFlag. The rest of the patch is
just dropping `nsIFrame::` and adding `mozilla::` as needed.

This change shouldn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D89542
2020-09-11 18:32:08 +00:00
Ting-Yu Lin 40a9b68f6b Bug 1663822 Part 2 - Change ComputeSizeFlags into an EnumSet. r=dholbert
This patch does:
1. Rename the original ComputeSizeFlags to ComputeSizeFlag (dropping the
"s"), and make it an enum class.
2. Make ComputeSizeFlags an EnumSet.
3. Adapt the users to use EnumSet's APIs.

The `Default` enum value in ComputeSizeFlag is not needed. It equals to an
empty ComputeSizeFlags.

This change shouldn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D89541
2020-09-11 18:32:16 +00:00
Ting-Yu Lin 160f14be50 Bug 1663822 Part 1 - Drop the "e" prefix from the enum values in ComputeSizeFlags. r=dholbert
This change shouldn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D89540
2020-09-11 18:31:56 +00:00
Oriol Brufau 1a38c1beab Bug 1655581 - [css-grid] Use min-content size for intrinsic maximums resolution. r=mats
By mistake the specification used to say that, for items spanning
multiple tracks, the growth limits of the tracks with an intrinsic max
track sizing function should grow to accommodate the minimum
contribution of the item.

But this was a mistake, because an intrinsic max track sizing function
can only be min-content or max-content. So instead of distributing the
minimum contribution, it should be the min-content contribution.

The spec has been fixed and there is a CSSWG resolution in
https://github.com/w3c/csswg-drafts/issues/4790

This patch fixes the problem by reverting 2b923d48ea7e. The change is
likely web compatible, since it only affects a rare edge case with
'minmax()' where the min sizing function is 'auto' or a fixed value
smaller than the min-content contribution, the max sizing function is
'min-content', and an item whose minimum contribution is forced to be
smaller than the min-content contribution, and spans multiple tracks.

Differential Revision: https://phabricator.services.mozilla.com/D89145
2020-09-11 12:42:07 +00:00
Timothy Nikkel 86ef6eea77 Bug 1663537. Fix various tests for desktop zooming scrollbars. r=kats
The test fixes all fell into the follow categories:

A) The test uses requestAnimationFrame to wait one frame and expects scrolling to be complete. With the desktop zooming scrollbars in order for the scrolling to show up on the main thread we need to send the scroll request to the compositor and then hear back from it via an apz repaint request (apz callback helper). Waiting on requestAnimationFrame will complete the first part, but not necessarily the second part. The fix is to wait for a scroll event.

B) Switching tests to wait for scroll events exposes another problem: the test can do things that cause a scroll in order to setup the test (and that may not be obvious that it causes a scroll) before actually proceeding to do the test and do something that causes a scroll and then checks for the scroll change of the second thing. Waiting for a requestAnimationFrame would include both those scrolls without desktop zooming scrollbars, but if we wait for a scroll event we will get the scroll event for the first thing which we are not interested in. So we need to make sure scroll events are cleared out before waiting for any scroll events. We do this by waiting two requestAnimationFrame's and waiting for apz to be flushed. We also use this when a test does something and it wants to test that scrolling is not performed.

The main thing that causes scrolling that may not be obvious: calling node.focus(). With stacks like:

from test_scroll_per_page.html

```
#01: mozilla::ScrollFrameHelper::CompleteAsyncScroll(nsRect const&, mozilla::ScrollOrigin) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x47d6cc0]
#02: mozilla::ScrollFrameHelper::ScrollToWithOrigin(nsPoint, mozilla::ScrollMode, mozilla::ScrollOrigin, nsRect const*, nsIScrollbarMediator::ScrollSnapMode) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x47d7732]
#03: mozilla::layout::ScrollAnchorContainer::ApplyAdjustments() [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x4742913]
#04: mozilla::PresShell::FlushPendingScrollAnchorAdjustments() [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x4650069]
#05: mozilla::PresShell::ProcessReflowCommands(bool) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x465742b]
#06: mozilla::PresShell::DoFlushPendingNotifications(mozilla::ChangesToFlush) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x4656af8]
#07: mozilla::dom::Document::FlushPendingNotifications(mozilla::ChangesToFlush) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x1a87d3c]
#08: mozilla::PresShell::ScrollContentIntoView(nsIContent*, mozilla::ScrollAxis, mozilla::ScrollAxis, mozilla::ScrollFlags) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x4652b96]
#09: nsFocusManager::ScrollIntoView(mozilla::PresShell*, nsIContent*, unsigned int) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x1bedd1c]
#10: nsFocusManager::Focus(nsPIDOMWindowOuter*, mozilla::dom::Element*, unsigned int, bool, bool, bool, bool, bool, nsIContent*) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x1be6be0]
#11: nsFocusManager::SetFocusInner(mozilla::dom::Element*, int, bool, bool) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x1be212f]
#12: nsFocusManager::SetFocus(mozilla::dom::Element*, unsigned int) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x1be32ba]
#13: mozilla::dom::Element::Focus(mozilla::dom::FocusOptions const&, mozilla::dom::CallerType, mozilla::ErrorResult&) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x1aaf283]
#14: mozilla::dom::HTMLElement_Binding::focus(JSContext*, JS::Handle<JSObject*>, void*, JSJitMethodCallArgs const&) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x2d65f3b]
```

from editor/libeditor/tests/test_bug549262.html

```
#01: mozilla::ScrollFrameHelper::CompleteAsyncScroll(nsRect const&, mozilla::ScrollOrigin) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x47d6cc0]
#02: mozilla::ScrollFrameHelper::ScrollToWithOrigin(nsPoint, mozilla::ScrollMode, mozilla::ScrollOrigin, nsRect const*, nsIScrollbarMediator::ScrollSnapMode) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x47d7732]
#03: mozilla::PresShell::ScrollFrameRectIntoView(nsIFrame*, nsRect const&, mozilla::ScrollAxis, mozilla::ScrollAxis, mozilla::ScrollFlags) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x46541bc]
#04: mozilla::PresShell::DoScrollContentIntoView() [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x4653776]
#05: mozilla::PresShell::DoFlushPendingNotifications(mozilla::ChangesToFlush) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x4656b11]
#06: mozilla::dom::Document::FlushPendingNotifications(mozilla::ChangesToFlush) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x1a87d3c]
#07: mozilla::PresShell::ScrollContentIntoView(nsIContent*, mozilla::ScrollAxis, mozilla::ScrollAxis, mozilla::ScrollFlags) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x4652b96]
#08: nsFocusManager::ScrollIntoView(mozilla::PresShell*, nsIContent*, unsigned int) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x1bedd1c]
#09: nsFocusManager::Focus(nsPIDOMWindowOuter*, mozilla::dom::Element*, unsigned int, bool, bool, bool, bool, bool, nsIContent*) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x1be6be0]
#10: nsFocusManager::SetFocusInner(mozilla::dom::Element*, int, bool, bool) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x1be212f]
#11: nsFocusManager::SetFocus(mozilla::dom::Element*, unsigned int) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x1be32ba]
#12: mozilla::dom::Element::Focus(mozilla::dom::FocusOptions const&, mozilla::dom::CallerType, mozilla::ErrorResult&) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x1aaf283]
#13: mozilla::dom::HTMLElement_Binding::focus(JSContext*, JS::Handle<JSObject*>, void*, JSJitMethodCallArgs const&) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x2d65f3b]
```

C) Several tests use nsIDOMWindowUtils advanceTimeAndRefresh/restoreNormalRefresh and expect scrolling to be done after a call to advanceTimeAndRefresh. This is basically A), advanceTimeAndRefresh does a refresh driver tick but doesn't allow a repaint request to come back to the main thread.

Differential Revision: https://phabricator.services.mozilla.com/D89403
2020-09-11 10:45:28 +00:00