Commit graph

155 commits

Author SHA1 Message Date
Ting-Yu Lin
312f1e800f Bug 1686603 Part 5 - Use StyleSizeOverrides to override flex main size when main size can influence cross size. r=dholbert
FlexItem::StyleCrossSize() hasn't been used in this patch, but it will
be used in a later patch that revises size overrides in flex item's
final reflow.

Differential Revision: https://phabricator.services.mozilla.com/D101796
2021-01-26 02:47:33 +00:00
Ting-Yu Lin
4a76528949 Bug 1686603 Part 4 - Use StyleSizeOverrides to revise flex base size resolution. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D101795
2021-01-26 02:47:36 +00:00
Ting-Yu Lin
a43cae175a Bug 1686603 Part 2 - Add StyleSizeOverrides parameter to ReflowInput's constructor & co. to override data from style system data. r=dholbert
This patch adds the struct as a parameter to various functions.

The struct is cached in ReflowInput so that we don't need to pass it
down to the internal method where nsIFrame::ComputeSize() is called.

In the subsequent patches, we'll use it to revise the implementation of
flex container's flex base size resolution, and size overrides.

Differential Revision: https://phabricator.services.mozilla.com/D101793
2021-01-26 02:47:40 +00:00
Csoregi Natalia
0492d8333a Backed out 8 changesets (bug 1686603) for causing crashtest failures. CLOSED TREE
Backed out changeset 94b5d0986d27 (bug 1686603)
Backed out changeset e7edf6fcc41d (bug 1686603)
Backed out changeset 4c9271f07178 (bug 1686603)
Backed out changeset 7013b95266ae (bug 1686603)
Backed out changeset cf7a55638aef (bug 1686603)
Backed out changeset 7717a0f2a37b (bug 1686603)
Backed out changeset c82593b13a61 (bug 1686603)
Backed out changeset fd1d95a1e706 (bug 1686603)
2021-01-26 04:32:13 +02:00
Ting-Yu Lin
5716640fe2 Bug 1686603 Part 7 - Change two StyleSize variables from pointers to references, and rename them. r=emilio
After Part 5 & Part 6, we don't need to override flex item's flex-basis
proprety or preferred main size in ComputeSize() and
ComputeSizeWithIntrinsicDimensions(), we can change the two style sizes
to references, and give both of them to shorter names.

Differential Revision: https://phabricator.services.mozilla.com/D102475
2021-01-25 22:25:44 +00:00
Ting-Yu Lin
56af7d6040 Bug 1686603 Part 5 - Use StyleSizeOverrides to override flex main size when main size can influence cross size. r=dholbert
FlexItem::StyleCrossSize() hasn't been used in this patch, but it will
be used in a later patch that revises size overrides in flex item's
final reflow.

Differential Revision: https://phabricator.services.mozilla.com/D101796
2021-01-25 22:27:46 +00:00
Ting-Yu Lin
902b99ce81 Bug 1686603 Part 4 - Use StyleSizeOverrides to revise flex base size resolution. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D101795
2021-01-25 22:25:57 +00:00
Ting-Yu Lin
ffce5ed7d6 Bug 1686603 Part 2 - Add StyleSizeOverrides parameter to ReflowInput's constructor & co. to override data from style system data. r=dholbert
This patch adds the struct as a parameter to various functions.

The struct is cached in ReflowInput so that we don't need to pass it
down to the internal method where nsIFrame::ComputeSize() is called.

In the subsequent patches, we'll use it to revise the implementation of
flex container's flex base size resolution, and size overrides.

Differential Revision: https://phabricator.services.mozilla.com/D101793
2021-01-25 22:29:31 +00:00
Mats Palmgren
b41a2b9d21 Bug 1687239 part 2 - Remove plugin support from layout/. r=emilio
Note that there's still a little plugin related code in
widget/ and gfx/ etc after this.  That can be removed
once we remove plugin support from dom/ etc.
The removal from layout/ should be pretty complete though.

Differential Revision: https://phabricator.services.mozilla.com/D102140
2021-01-25 11:53:49 +00:00
Ting-Yu Lin
896140a354 Bug 1688141 - Use AspectRatio instead of StyleAspectRatio in ComputeSize() and ComputeTransferredMinMaxInlineSize(). r=boris
Differential Revision: https://phabricator.services.mozilla.com/D102686
2021-01-22 19:52:30 +00:00
Mihai Alexandru Michis
b6b2f1e5f4 Backed out 7 changesets (bug 1686603) for causing crashtest assertion failures.
CLOSED TREE

Backed out changeset 19cba7d34a7f (bug 1686603)
Backed out changeset 3a0d0155ea5e (bug 1686603)
Backed out changeset f1f672cdd0c6 (bug 1686603)
Backed out changeset 63020922e2fd (bug 1686603)
Backed out changeset 8766ce79ba5e (bug 1686603)
Backed out changeset 965dbe8de1e1 (bug 1686603)
Backed out changeset b1328ee45f43 (bug 1686603)
2021-01-21 09:21:12 +02:00
Ting-Yu Lin
403afe657d Bug 1686603 Part 7 - Change two StyleSize variables from pointers to references, and rename them. r=emilio
After Part 5 & Part 6, we don't need to override flex item's flex-basis
proprety or preferred main size in ComputeSize() and
ComputeSizeWithIntrinsicDimensions(), we can change the two style sizes
to references, and give both of them to shorter names.

Differential Revision: https://phabricator.services.mozilla.com/D102475
2021-01-21 04:34:25 +00:00
Ting-Yu Lin
02e1874759 Bug 1686603 Part 5 - Use StyleSizeOverrides to override flex main size when main size can influence cross size. r=dholbert
FlexItem::StyleCrossSize() hasn't been used in this patch, but it will
be used in a later patch that revises size overrides in flex item's
final reflow.

Differential Revision: https://phabricator.services.mozilla.com/D101796
2021-01-21 04:35:54 +00:00
Ting-Yu Lin
d1b6d1f716 Bug 1686603 Part 4 - Use StyleSizeOverrides to revise flex base size resolution. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D101795
2021-01-21 04:22:08 +00:00
Ting-Yu Lin
d0c462cb81 Bug 1686603 Part 2 - Add StyleSizeOverrides parameter to ReflowInput's constructor & co. to override data from style system data. r=dholbert
This patch adds the struct as a parameter to various functions.

The struct is cached in ReflowInput so that we don't need to pass it
down to the internal method where nsIFrame::ComputeSize() is called.

In the subsequent patches, we'll use it to revise the implementation of
flex container's flex base size resolution, and size overrides.

Differential Revision: https://phabricator.services.mozilla.com/D101793
2021-01-21 04:17:59 +00:00
Boris Chiou
33c0c70a2b Bug 1646100 - min-width:auto together with apect-ratio should take the intrinsic content size into account when width is {min|max|fit}-content or auto. r=TYLin
We have to set the flag, AspectRatioUsage::ToComputedISize if we
resolve the min-content/max-content/fit-content by aspect-ratio, so that
we can handle min-width:auto well.

Differential Revision: https://phabricator.services.mozilla.com/D99406
2021-01-19 21:47:55 +00:00
Boris Chiou
eff538f500 Bug 1646100 - Compute {min|max|fit}-content from the definite block-size and aspect-ratio. r=TYLin,emilio
ComputeISizeValue() takes aspect-ratio into account. Also, add a
ComputeSizeFlag which skips aspect-ratio in ComputeISizeValue(), so
internal table boxes can use this flag to skip aspect-ratio.

Differential Revision: https://phabricator.services.mozilla.com/D99290
2021-01-19 21:44:44 +00:00
Boris Chiou
8d1403f488 Bug 1646100 - Take LogicalSize type for containing block and boxing size adjustment for ComputeISizeValue. r=TYLin
We may use the block size to compute the inline size if there is a
non-auto finite aspect-ratio and definite block size, so we need more
information on the block axis. Therefore, we have to pass LogicalSize
for containing block and boxing size adjustment.

Differential Revision: https://phabricator.services.mozilla.com/D99289
2021-01-19 21:51:04 +00:00
Mirko Brodesser
70265dd25d Bug 1685303: part 13) Move documentation of SelectByTypeAtPoint. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D101761
2021-01-15 09:28:40 +00:00
Mirko Brodesser
0114f7f280 Bug 1685303: part 11) Add some const-correctness to frame code. r=smaug
Helps distinguishing what modifies frames and what doesn't.

Differential Revision: https://phabricator.services.mozilla.com/D101751
2021-01-14 14:45:01 +00:00
Mirko Brodesser
c0d32bffc5 Bug 1685303: part 10) Annotate nsFrameSelection::HandleClick with MOZ_CAN_RUN_SCRIPT. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D101598
2021-01-14 13:24:36 +00:00
Mirko Brodesser
f6f7a6f1aa Bug 1685303: part 8) Annotate nsFrameSelection::SetDragState with MOZ_CAN_RUN_SCRIPT. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D101467
2021-01-14 13:24:16 +00:00
Bogdan Tara
0700454a9e Backed out 4 changesets (bug 1685303) for bustage complaining about offsets CLOSED TREE
Backed out changeset a4640aac6619 (bug 1685303)
Backed out changeset bd2020c26531 (bug 1685303)
Backed out changeset 3f2e96b93f19 (bug 1685303)
Backed out changeset 8cf49a7677c9 (bug 1685303)
2021-01-14 12:58:25 +02:00
Mirko Brodesser
353996bf27 Bug 1685303: part 8) Annotate nsFrameSelection::SetDragState with MOZ_CAN_RUN_SCRIPT. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D101467
2021-01-14 10:20:30 +00:00
Mats Palmgren
51ff79f7fa Bug 1686310 part 7 - Remove ReflowInput::mFrameType and associated code, which is now dead code. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D101554
2021-01-14 03:23:40 +00:00
Mats Palmgren
cd4d90de10 Bug 1686310 part 2 - Replace NS_FRAME_IS_REPLACED* with a bit that caches the corresponding IsFrameOfType result. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D101549
2021-01-14 03:15:31 +00:00
Emilio Cobos Álvarez
dbf895e4c3 Bug 1685078 - Use enum classes and more explicit names for ImageLoader flags. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D101070
2021-01-08 09:44:47 +00:00
Emilio Cobos Álvarez
8558796b8d Bug 1351248 - nsFieldSetFrame should claim to be focusable if its inner scrollframe is. r=smaug
Otherwise we stop moving focus because, when we find the scrollable
area, we determine that we need to focus the fieldset, but then the
focus manager early-returns in `nsFocusManager::SetFocusInner`.

Depends on D100423

Differential Revision: https://phabricator.services.mozilla.com/D100424
2020-12-29 22:28:42 +00:00
Emilio Cobos Álvarez
bd8cffdd58 Bug 1351248 - Simplify nsIFrame::IsFocusable API. r=layout-reviewers,mats
We always compute the tabindex value, so just return it to the caller
all the time. This allows us to use early-returns which makes the code a
bit easier to follow.

This patch shouldn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D100423
2021-01-03 23:30:51 +00:00
Boris Chiou
361f923f82 Bug 1683424 - Add UseBoxSizing for AspectRatio class, and fix non-replaced element usage. r=TYLin
Based on the spec, if the aspect-ratio property value is:
1) auto: we should always use content-box dimensions.
2) <ratio>: the aspect-ratio works with box sizing dimensions.
3) auto && <ratio>: we use content-box dimensions in all cases.

So we need an extra flag to address that we should use box-sizing or
always use content-box dimensions while computing the size in
ratio-dependent axis.

This also updates some wpts for non-replaced elements because we should
use content-box if aspect-ratio is 'auto && <ratio>'.

Differential Revision: https://phabricator.services.mozilla.com/D100072
2020-12-23 22:42:55 +00:00
Edgar Chen
2b16b12d46 Bug 1680405 - Make mouse capture working on OOP iframe; r=smaug
This patch add a way to track remote target for mouse capturing. The tracking
remote target will be reset when capturing content is changed or
ReleaseCapturingContent() is called.

In order to make `mouseup` would also be dispatched to correct remote target, we
do ReleaseCapturingContent in EventSetateManager::PostHandleEvent, instead of
in nsIFrame::HandleRelease.

Differential Revision: https://phabricator.services.mozilla.com/D98592
2020-12-18 18:21:23 +00:00
Ting-Yu Lin
378bde9842 Bug 1585485 Part 2 - Move IsReplacedBoxResolvedAgainstZero() into nsIFrame, and rename it. r=dholbert
We want to call it in nsFlexContainerFrame in the next part.

The method also tests form control elements via the helper
FormControlShrinksForPercentISize, not just replaced boxes, so rename it
for accuracy. We also rename the helper by dropping "I" from the
"PercentISize" because the axis the element contributingx to isn't
necessarily its inline-axis.

Differential Revision: https://phabricator.services.mozilla.com/D99951
2020-12-17 20:01:58 +00:00
Emilio Cobos Álvarez
039592f4d8 Bug 1682003 - Avoid UTF-8 -> UTF-16 conversion during CSSOM serialization. r=heycam
This lifts a bunch of string conversions higher up the stack, but allows
us to make the servo code use utf-8 unconditionally, and seemed faster
in my benchmarking (see comment 0).

It should also make a bunch of attribute setters faster too (like
setting .cssText), now that we use UTF8String for them (we couldn't
because we couldn't specify different string types for the getter and
setters).

Differential Revision: https://phabricator.services.mozilla.com/D99590
2020-12-17 14:04:35 +00:00
Razvan Maries
a7af908f30 Backed out changeset 5e9006d8c218 (bug 1680405) for perma failures on PresShell.cpp and browser_mouse_enterleave_switch_tab.js. CLOSED TREE 2020-12-17 13:24:39 +02:00
Edgar Chen
45ea02297b Bug 1680405 - Make mouse capture working on OOP iframe; r=smaug
This patch add a way to track remote target for mouse capturing. The tracking
remote target will be reset when capturing content is changed or
ReleaseCapturingContent() is called.

In order to make `mouseup` would also be dispatched to correct remote target, we
do ReleaseCapturingContent in EventSetateManager::PostHandleEvent, instead of
in nsIFrame::HandleRelease.

Differential Revision: https://phabricator.services.mozilla.com/D98592
2020-12-17 09:28:00 +00:00
Dorel Luca
c7cf087b6e Backed out changeset 7253a9d881d0 (bug 1680405) for assertion failures in worker/checkouts/gecko/layout/base/PresShell.cpp. CLOSED TREE 2020-12-16 07:19:44 +02:00
Edgar Chen
9b5d278abd Bug 1680405 - Make mouse capture working on OOP iframe; r=smaug
This patch add a way to track remote target for mouse capturing. The tracking
remote target will be reset when capturing content is changed or
ReleaseCapturingContent() is called.

In order to make `mouseup` would also be dispatched to correct remote target, we
do ReleaseCapturingContent in EventSetateManager::PostHandleEvent, instead of
in nsIFrame::HandleRelease.

Differential Revision: https://phabricator.services.mozilla.com/D98592
2020-12-16 00:29:40 +00:00
Matt Woodrow
9650124868 Bug 1680863 - Set the used value of transform-style to flat if the element has mix-blend-mode or isolation. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D99741
2020-12-15 21:44:02 +00:00
Emilio Cobos Álvarez
47a5e9cd5a Bug 1681375 - Allow scrolled-content-block to have a height for editable elements. r=layout-reviewers,mats
Differential Revision: https://phabricator.services.mozilla.com/D99460
2020-12-14 18:15:24 +00:00
Emilio Cobos Álvarez
679bd6efdb Bug 1681022 - Fix the check introduced in the previous patch to actually not override main-size with auto.
MANUAL PUSH: Orange in a CLOSED TREE.
2020-12-07 18:30:53 +01:00
Emilio Cobos Álvarez
0fd0a72af6 Bug 1681022 - Ignore flex-basis: content on a table wrapper. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D98897
2020-12-07 16:29:23 +00:00
Botond Ballo
3695fe3d68 Bug 1673073 - Do not add clip to masked content if a filter applies to the content as well. r=mstange
Depends on D98559

Differential Revision: https://phabricator.services.mozilla.com/D98560
2020-12-03 17:11:40 +00:00
Botond Ballo
755d4c2725 Bug 1673073 - Add a comment to better explain what we're already doing. r=mstange
Depends on D98558

Differential Revision: https://phabricator.services.mozilla.com/D98559
2020-12-03 17:11:22 +00:00
Bogdan Tara
4a649093b9 Backed out changeset 3e90a3759639 (bug 1679208) for scrollbars-no-margin.html failures CLOSED TREE 2020-12-03 01:11:32 +02:00
Emilio Cobos Álvarez
aa15236426 Bug 1679208 - Don't assume int return values in nsITheme. r=mstange
This doesn't hold with fractional scale values. Right now GTK truncates
the scale factor, Windows rounds, and non-native theme rounds as well.

With this native theme will propagate correctly the floating point
values.

I tried to not change behavior meaningfully in any of the other themes,
mostly to avoid risk. GTK and Windows can be trivially tweaked to
support fractional scale factors properly if we wanted to, but seems
better to not do that as part of this patch.

Depends on D98099

Differential Revision: https://phabricator.services.mozilla.com/D98100
2020-12-02 21:40:05 +00:00
Sunita Sen
c95c4ff2ca Bug 1329241 - Add support for touch-action:pinch-zoom - update hittest_touchaction and nsIFrame r=kats
Differential Revision: https://phabricator.services.mozilla.com/D97923
2020-11-24 16:15:57 +00:00
Simon Giesecke
071c7c035f Bug 1676356 - Avoid including PresShell.h from header files. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D96534

Depends on D95184
2020-11-23 16:08:23 +00:00
Boris Chiou
d494534798 Bug 1651776 - Move Compute{Inline|Block}SizeFromAspectRatio() into AspectRatio struct. r=TYLin
We add a new file, AspectRatio.cpp, to definte the method,
ComputeRatioDependentSize. So we don't have to move this function to
WritingModes.h

Besides, we miss the forward declaration of IPC::ParamTraits, so add it
into AspectRatio.h.

Differential Revision: https://phabricator.services.mozilla.com/D95822
2020-11-20 22:38:36 +00:00
Ting-Yu Lin
2151575956 Bug 1677642 - Add a wpt testing an empty box doesn't contribute to parent's scrollable overflow area. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D97513
2020-11-20 01:13:05 +00:00
Ting-Yu Lin
592df41a3f Bug 1678098 - Remove redundant writing mode conversion after calling ReflowOutput::Size(). r=mats
As of bug 1671726, ReflowOutput::Size() accepts any writing mode, so we
don't need to do an extra conversion.

Differential Revision: https://phabricator.services.mozilla.com/D97480
2020-11-19 00:29:45 +00:00