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

19240 Коммитов

Автор SHA1 Сообщение Дата
Norisz Fay ce587cb281 Backed out 3 changesets (bug 1766805) for causing build bustage on AsyncPanZoomController.cpp CLOSED TREE
Backed out changeset e35a130f2bce (bug 1766805)
Backed out changeset 9f9e2030fbc1 (bug 1766805)
Backed out changeset 898bd12a5da8 (bug 1766805)
2022-05-12 13:42:36 +03:00
Hiroyuki Ikezoe c578fe6929 Bug 1766805 - Ignore snap points behind scroll direction on intended direction scroll operations. r=botond
Depends on D145191

Differential Revision: https://phabricator.services.mozilla.com/D145192
2022-05-12 07:45:59 +00:00
Hiroyuki Ikezoe 098b8bc1a5 Bug 1766805 - Introduce intended direction and intended end position concepts. r=botond
The scroll snap spec defines the concepts [1]. There are three type of scroll
operations. 1) intended end position, 2) intended direction and end position
and 3) intended direction.

Basically our existing ScrollUnits types correspond;

1) DEVICE_PIXELS, WHOLE => intended end position
2) PAGES => intended direction and end position
3) LINES => intended direction

There are two exceptions in the `intended direction and end position` case,
scrollBy() and fling gestures (on Linux). They were defined as scroll operations
with DEVICE_PIXELS unit, but the spec cleary says they are `intended direction
and end position` operations.

Note that we will also use this information for scroll-snap-stop property since
the properly will only have effects on both 2) and 3) cases.

[1] https://drafts.csswg.org/css-scroll-snap/#scroll-types

Depends on D145190

Differential Revision: https://phabricator.services.mozilla.com/D145191
2022-05-12 07:45:59 +00:00
Hiroyuki Ikezoe fbbbe95ea6 Bug 1766805 - Give the proper destination to GetSnapPointForDestination for ScrollUnit::WHOLE on the main-thread. r=botond
Now the proper destination is same as what we do for ScrollUnit::WHOLE [1].

With the proper points we no longer need special handlings in
CalcSnapPoints::AddEdge for ScrollUnit::WHOLE. In my sense the special handling
wasn't necessary though.

[1] https://searchfox.org/mozilla-central/rev/dc09246dfbfd8dafeb6d55ebee18a6294d525443/gfx/layers/apz/src/AsyncPanZoomController.cpp#2105-2112

Differential Revision: https://phabricator.services.mozilla.com/D145190
2022-05-12 07:45:58 +00:00
Emilio Cobos Álvarez f260713835 Bug 1768846 - Don't compute transform matrix twice while untransforming dirty / visible rects. r=boris
This code can appear in profiles as seen in bug 1768766.

No behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D146070
2022-05-11 19:20:04 +00:00
Hiroyuki Ikezoe c73cba8151 Bug 1766192 - Do `snap-scope` with the snapped point rather than the destination point. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D144533
2022-05-10 08:51:38 +00:00
Hiroyuki Ikezoe 9de4521753 Bug 1766192 - Introduce SnapTarget struct along with snap-area for each element. r=botond
In the next change we will use the snap-area to implement `snap-score`
properly.

Differential Revision: https://phabricator.services.mozilla.com/D144532
2022-05-10 08:51:37 +00:00
Hiroyuki Ikezoe 84149416a9 Bug 1766192 - Choose the second best edge on the opposite side of the best edge. r=botond
The second best edge is used for `snap-overflow` feature [1]. The
`snap-overflow` is applied when the following conditions are met.
 1) A scroll snap target element is larger than the snapport (e.g. scrollport)
    in an axis
 2) The distance between the best edge and the second best edge (on the opposite
    side of the best edge) is later than the snapport size in the axis

There was a problem in our implementation. For example, in below diagram, D is
the original destination of the given scroll operation, 1 is the best edge, 2 is
the second best in our original implementation and 3 is of of the other snap
points. In this case if there's an element larger than the distance between 1
and 3 and if the snapport size is larger than the distance between 1 and 2 but
smaller than the distance between 1 and 3, we should apply `snap-overflow`.

2 1   D     3
|-|---|-----|

There are a couple of test cases in wpt for this condition, for example there's
one of them in oveflowing-snap-area.html [2]. That test case have been passed
incorrectly due to our incorrect `snap-scope` implementation which will be fixed
a subsequent change in this commit series.

[1] https://drafts.csswg.org/css-scroll-snap-1/#snap-overflow
[2] https://searchfox.org/mozilla-central/rev/13d69189a8abfc5064fe44944550b9b6eb4544f5/testing/web-platform/tests/css/css-scroll-snap/overflowing-snap-areas.html#131-137

Differential Revision: https://phabricator.services.mozilla.com/D144531
2022-05-10 08:51:37 +00:00
Hiroyuki Ikezoe c6b806d1b3 Bug 1766192 - Drop CalcSnapPoints::AddEdgeInterval. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D144530
2022-05-10 08:51:37 +00:00
Narcis Beleuzu 1298f7b978 Merge autoland to Mozilla-Central. a=merge 2022-05-07 12:41:16 +03:00
Emilio Cobos Álvarez c9e3177022 Bug 1768157 - Remove kSelectPopupList. r=jwatt
It's unused since bug 1744009 at least, so no behavior change.

Depends on D145714

Differential Revision: https://phabricator.services.mozilla.com/D145715
2022-05-06 15:46:49 +00:00
Daniel Holbert 738efcb1cc Bug 1745310 part 1: Account for the impact of negative margins when determining how much space a float-avoiding box will need in order to fit alongside a float. r=emilio
Note: The WPT test included in this test is intended to excercise cases that
are (newly) interoperable between WebKit, Blink, and Gecko (with this patch).

There are other related cases where browsers still disagree; I'll add
additional WPT tests for those cases in a later patch in this series.

Differential Revision: https://phabricator.services.mozilla.com/D145159
2022-05-06 06:05:38 +00:00
Glenn Watson 4626506ead Bug 1765862 - Skip backdrop-filter if `nsIFrame` reports not visible for painting r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D145526
2022-05-06 01:12:05 +00:00
Emily McDonough 7ef34b67fa Bug 1765011 - Ensure we do not truncate header/footer text in between surrogate pair characters r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D143855
2022-05-05 19:13:24 +00:00
Narcis Beleuzu 609a0387b8 Backed out changeset bcc1a29ee9c8 (bug 1765525) for wr failure on backdrop-filter-svg-foreignObject.html 2022-05-05 03:42:35 +03:00
Glenn Watson 7dfd66fe8a Bug 1765525 - Fix gecko DL creation for backdrop-filters with clips r=gfx-reviewers,lsalzman
Change to derive from nsDisplayEffectsBase, since the backdrop-filter
can still have a visual bounds (and effect) even if the child
stacking context has no items. Also use the same approach to get
the bounding rect and implement GetBounds as nsDisplayFilters uses.

Differential Revision: https://phabricator.services.mozilla.com/D145295
2022-05-04 19:08:31 +00:00
Tooru Fujisawa 2130db6a12 Bug 1765167 - Part 6: Stop using Cu.import in layout/. r=mossop
Differential Revision: https://phabricator.services.mozilla.com/D144099
2022-05-03 06:32:31 +00:00
Boris Chiou e3d089f302 Bug 1760658 - Part 2: Apply automatic content-based minimum on grid container. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D144899
2022-05-02 20:06:33 +00:00
Boris Chiou 035220bf4c Bug 1760658 - Part 1: Apply automatic content-based minimum on flex container. r=emilio
Basides, factor out the utility function to AspectRatio so everyone can
use it.

Differential Revision: https://phabricator.services.mozilla.com/D144891
2022-05-02 20:06:32 +00:00
Daniel Holbert 968d8951a4 Bug 1767069 part 3: Modernize naming for some SizeComputationInput variables in float layout code. r=emilio
This patch does not impact behavior.

Before this patch, these variables' names are abbreviations of their original
type-name, "nsCSSOffsetState".  We renamed that type to SizeComputationInput in
bug 1277129, and this patch just updates the variable-names to reflect that
renaming, so that now they're abbreviations of the new type-name, rather than
the old one.

This patch also takes this opportunity to move these variables declarations
closer to their usage, and in one case we convert a variable to be a temporary
anonymous value in the middle of another assignment.

Differential Revision: https://phabricator.services.mozilla.com/D145137
2022-05-02 18:49:17 +00:00
Daniel Holbert 85eff7ef92 Bug 1767069 part 2: Remove unneeded "mozilla::" prefixes inside BlockReflowState's "namespace mozilla {}" section. r=emilio
This patch doesn't impact behavior.

The namespace prefix is unnecessary, given the fact that this code is all
inside `namespace mozilla {...}`.

Differential Revision: https://phabricator.services.mozilla.com/D145136
2022-05-02 18:49:17 +00:00
Daniel Holbert 92a40a8db1 Bug 1767069 part 1: Standardize on "float-avoiding block" in var/function names to refer to block-level elements that cannot intersect floats. r=emilio
This patch does not impact behavior; it's just a handful of renamings and
documentation-updates.

Before this patch, our float-handling code has a bunch of variables and
functions with "replaced" in the name. But in fact these aren't necessarily
replaced; they're just block-level frames that elicit a "false" return-value
from "BlockCanIntersectFloats".  This category *includes* replaced boxes, and
it also includes frames that establish a formatting context, e.g.:
scrollframes, flex/grid containers, flow-root, table.

This patch seeks to clarify things by renaming these to refer to the fact that
they "avoid" floats, e.g. s/replacedBlock/floatAvoidingBlock/.

I've included a comment to reference this term in the BlockCanIntersectFloats()
documentation (note that the "can intersect" concept is the opposite of
"avoids").  I've also renamed a few "aFrame" variables to
"aFloatAvoidingBlock", for a few functions that are explicitly dealing with
this scenario and only expect to be passed frames that are in this category.

Differential Revision: https://phabricator.services.mozilla.com/D145131
2022-05-02 18:49:16 +00:00
Daniel Holbert bb5d1b73f6 Bug 1767131: run clang-format on the layout/ directory. r=emilio DONTBUILD
This patch does not impact behavior; it's just formatting changes.

This patch was automatically generated by the following command:
    ./mach clang-format -p layout

Differential Revision: https://phabricator.services.mozilla.com/D145163
2022-04-30 15:25:29 +00:00
Razvan Cojocaru 90b9d8fa09 Bug 1766078 - Add a ViewAs overload for casting an untyped ScaleFactors2D to a typed one. r=botond
Please note that ScaleFactors2D is missing operator*=() for now,
hence the "resolutionToScreen = resolutionToScreen * X" formula.

Differential Revision: https://phabricator.services.mozilla.com/D144883
2022-04-30 00:24:46 +00:00
Morgan Reschenberg 99932a8cb7 Bug 1735101: Adjust GetCharacterRectsInRange to return physical coordinates for RtL text r=emilio,Jamie
Differential Revision: https://phabricator.services.mozilla.com/D144767
2022-04-29 17:30:59 +00:00
Emily McDonough f7af34aa62 Bug 1740366 - Implement paginated fragmentation on page-name boundaries r=dholbert
This has a TODO about empty page names on previous sibling frames, to match
Chrome's behavior of page break coalescing we should be looking to the frame
before that sibling and check for page breaks there instead.

Differential Revision: https://phabricator.services.mozilla.com/D140423
2022-04-28 00:03:19 +00:00
David Shin 834cc0ea32 Bug 1765654 - Simplify audio/video frame intrinsic sizing, and make audio elements report the correct intrinsic width during layout r=dholbert,emilio
Fix regression from returning zero intrinsic size for audio
elements, which caused the element to be positioned incorrectly
in absolutely positioned, orthogonal flow situations.

Differential Revision: https://phabricator.services.mozilla.com/D144182
2022-04-27 16:20:05 +00:00
Emilio Cobos Álvarez 0f45f078ef Bug 1766020 - Add support for parsing container-query-specific features. r=firefox-style-system-reviewers,layout-reviewers,boris
There are some mediaqueries-5 features that we still don't support and
explain the remaining failures in at-container-{parsing,serialization}.

Differential Revision: https://phabricator.services.mozilla.com/D144446
2022-04-27 10:52:32 +00:00
Boris Chiou a3949a5f7a Bug 1696560 - Apply transferred min & max sizes for flex base size if main is the inline axis. r=dholbert
Basically, the transferred min & max sizes shouldn't override the min &
max sizing properties, so applying it earlier than these properties
should be identical. This just makes the flex base size and main size be
more correct at the beginning (and so other adjustments of sizes
in flex algorithm can override the transferred min/max sizes), for
non-replaced elements.

Note:
In Chromium code, it clamps the flex items' base size by transferred min &
max sizes, but the computation of items' used min & used max sizes doesn't
include the transferred min & max sizes.

So in this patch, I'm trying to make this patch simple: we let minimum &
maximum sizes only taken into account for flex base size and only for
non-replaced elements for now. So the behavior should be similar to other
browsers.

And we may have to update this tentative solution once these spec words get
updated.

Differential Revision: https://phabricator.services.mozilla.com/D144499
2022-04-26 19:31:25 +00:00
Martin Robinson 3df3e47b53 Bug 1764721 - Content skipped via `content-visibility` should not be focusable r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D143723
2022-04-26 08:35:53 +00:00
Razvan Cojocaru 9788952c5a Bug 1733313 - Change EffectsInfo::mScaleX/Y into a Scale2D and rename to mRasterScale. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D144274
2022-04-26 03:12:38 +00:00
Emilio Cobos Álvarez 9cdc416fdd Bug 1695139 - Remove a warning that nobody is looking into. r=tnikkel
This can happen on regular content (I see it when loading google.com on
a debug build for example). Given there's no action to take it seems
only noise atm. No strong opinion into whether it's better to ifdef the
code or just remove it.

Differential Revision: https://phabricator.services.mozilla.com/D144415
2022-04-22 10:57:02 +00:00
Daniel Holbert e0100e2b76 Bug 1765632: Coalesce two variables into one Maybe<> variable, in ReflowInput::CalculateHypotheticalPosition. r=dshin
This patch shouldn't change behavior; it's just refactoring/simplifying
existing code, without changing the logic.

Differential Revision: https://phabricator.services.mozilla.com/D144221
2022-04-20 22:35:20 +00:00
Noemi Erli 276b91ca80 Backed out changeset 7985a1fa0789 (bug 1764768) for causing multiple failures CLOSED TREE 2022-04-20 22:25:02 +03:00
Emilio Cobos Álvarez 485bae6d11 Bug 1764768 - Don't truncate viewport units at computed value time. r=dholbert
Instead, make the behavior consistent across all <length-percentage>
values (by truncating instead of rounding). This is the already-existing
behavior for calc() and percentages, but with this patch we also apply
it to plain length-flavored <length-percentage> values (this is needed
to avoid regressing things like bug 989802).

Regular <length>s keep rounding, to preserve existing behavior. We can
consider changing that in a follow-up if need be.

Differential Revision: https://phabricator.services.mozilla.com/D143857
2022-04-20 17:22:36 +00:00
Emilio Cobos Álvarez 8de3540b68 Bug 1765331 - Account for dest rect correctly in nsDisplayRemote painting. r=tnikkel
The in-process code does this here:

  https://searchfox.org/mozilla-central/rev/4b3039b48c3cb67774270ebcc2a7d8624d888092/layout/generic/nsSubDocumentFrame.cpp#729-742

This doesn't do much for regular iframes because they have no meaningful
intrinsic ratio, but this will matter for bug 1595491.

Differential Revision: https://phabricator.services.mozilla.com/D144000
2022-04-20 11:00:58 +00:00
David Shin ec93876623 Bug 1755565 - Implement `contain: inline-size`. r=emilio,dholbert
Differential Revision: https://phabricator.services.mozilla.com/D143501
2022-04-19 17:44:16 +00:00
Cosmin Sabou 7b5d2f5901 Backed out changeset 5d53e0ca638d (bug 1765331) for causing reftest assertion failures on APZCTreeManager.cpp. CLOSED TREE 2022-04-19 19:50:18 +03:00
Emilio Cobos Álvarez b1750b3184 Bug 1765331 - Account for dest rect correctly in nsDisplayRemote painting. r=tnikkel
The in-process code does this here:

  https://searchfox.org/mozilla-central/rev/4b3039b48c3cb67774270ebcc2a7d8624d888092/layout/generic/nsSubDocumentFrame.cpp#729-742

This doesn't do much for regular iframes because they have no meaningful
intrinsic ratio, but this will matter for bug 1595491.

Differential Revision: https://phabricator.services.mozilla.com/D144000
2022-04-19 13:46:02 +00:00
Daniel Holbert 3bbf376319 Bug 1765209: Add braces to unbraced 'if' expressions in nsBlockFrame.cpp. r=emilio
This patch doesn't change behavior; it just improves coding-style
correctness. Our C++ coding style guide says "Always brace controlled
statements, even a single-line consequent of if else else."
https://firefox-source-docs.mozilla.org/code-quality/coding-style/coding_style_cpp.html#control-structures

Differential Revision: https://phabricator.services.mozilla.com/D143940
2022-04-18 21:14:06 +00:00
Peter Van der Beken 926498605f Bug 1763598 - Fix docshell_helpers.js for session history in the parent. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D143159
2022-04-15 20:44:38 +00:00
Boris Chiou 993c59ddf8 Bug 1716612 - Don't apply aspect-ratio to audio elements with controls. r=emilio
There are two cases for the audio element:
1. audio element with "controls" - replaced element (but UA shouldn't
   show the content. Only control UI there.)
2. audio element without "controls" - UA sets display:none.

Per spec, if a replaced element’s only natural dimension is a natural width or
a natural height, giving it a preferred aspect ratio also gives it an natural
height or width, whichever was missing, by transferring the existing size
through the preferred aspect ratio.

However, the audio element (with or without "controls") doesn't have the
natural ratio and natural size. I think it's a special case and it doesn't
make sense to apply aspect-ratio to it even though we specify a width or
height.

Blink and Webkit don't apply aspect-ratio to audio element, either. So
let's follow other browsers' behavior.

Differential Revision: https://phabricator.services.mozilla.com/D118245
2022-04-14 02:10:34 +00:00
Emilio Cobos Álvarez 21c7930924 Bug 1751961 - Account for cross-process paint scale in nsSubDocumentFrame::Paint. r=tnikkel
This is the real fix.

Depends on D142908

Differential Revision: https://phabricator.services.mozilla.com/D142909
2022-04-13 11:32:55 +00:00
Emilio Cobos Álvarez 85598ec315 Bug 1764224 - Don't assert primary frame on printing docs. r=dholbert
ReplicateFixedFrames can create extra frames, but we don't particularly
care about this.

Differential Revision: https://phabricator.services.mozilla.com/D143471
2022-04-12 21:25:05 +00:00
Olli Pettay b9a8518c6b Bug 1764212, track reflow callbacks in videoframe, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D143452
2022-04-12 09:07:16 +00:00
Emilio Cobos Álvarez 55392c2e73 Bug 1733232 - Use reflow callbacks to properly track video control / caption sizes. r=dholbert
This ensures not to fire dummy events for measuring reflows for example.

Needs a test, maybe Alwu can help with that?

Differential Revision: https://phabricator.services.mozilla.com/D142897
2022-04-07 21:46:03 +00:00
Martin Robinson 2893cfed87 Bug 1762407 - Do not scroll content with `content-visibility: hidden` ancestors into view r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D142563
2022-04-07 10:38:27 +00:00
Glenn Watson 8c9fe85287 Bug 1762810 - Ensure backdrop root containers get placed inside APZ container r=gfx-reviewers,lsalzman
This change applies the same fix in the code above for mix-blend
containers to backdrop roots. Without this, the backdrop-root is
the viewport, so it includes things like the fixed position background
rects used for checkerboarding.

Differential Revision: https://phabricator.services.mozilla.com/D142772
2022-04-05 23:50:52 +00:00
Martin Robinson b24fd95192 Bug 1761995 - Skip `content-visibility: hidden` content in display lists r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D142341
2022-04-05 09:10:42 +00:00
Emilio Cobos Álvarez a18fdda05d Bug 1762298 - GCC build bustage and reftest fixes.
MANUAL PUSH: Orange fix CLOSED TREE
2022-04-04 22:14:24 +02:00