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
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
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
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
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
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
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
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
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
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
This patch is generated via the rename functionality in my editor; add
`mozilla::` prefix to `OverflowAreas` in headers; and remove the
`OverflowType` alias added in Part 1.
Differential Revision: https://phabricator.services.mozilla.com/D97235
This addressed https://github.com/w3c/csswg-drafts/issues/5257.
The min-block-size or max-block-size should affect the inline size computed
through an aspect ratio.
I intentionally don't implement this for transferred {min|max}
block-size because
1. This is useful only if block-size is indefinite.
2. If block-size is indefinite, we may use the inline-size and aspect-ratio to
get the block-size, which makes block-size definite.
3. This means it is useful when both inline-size and block-size are
indefinite (e.g. auto).
In this case, we still resolve a possible inline-size by clamping it
between specified (and transferred) min and max inline-sizes. Then
we map this inline-size to block-size through aspect-ratio. This
transferred block-size should also be between specified (and
transferred) min and max block-sizes.
Differential Revision: https://phabricator.services.mozilla.com/D94911
It's straightforward to determine which writing mode is required to pass
to ComputedLogicalMargin() by looking at any subsequent method called on
the margin.
For example, if we see
```
ComputedLogicalMargin().BStartEnd(wm);
```
the writing mode needed to pass to `ComputedLogicalMargin()` is `wm`.
Differential Revision: https://phabricator.services.mozilla.com/D95661
Basically, we compute aspect-ratio property only when aspect-ratio is
finite non-zero, so just need to drop the comment and add the wpts.
Differential Revision: https://phabricator.services.mozilla.com/D95411
The one-argument SetComputedLogicalMargin(),
SetComputedLogicalBorderPadding(), and SetComputedLogicalPadding() are
not changed because the next part are going to delete them.
Note that I'm deliberately not making ComputedLogicalMargin() and others
to return `const LogicalMargin&` because the compilers can use RVO to
eliminate unnecessary copy. If we'd like to convert them to accept all
writing mode like `nsIFrame::GetLogicalUsedMargin(WritingMode)` so that
the caller don't need to call `ConvertTo`, they can't return a const
reference anyway.
Differential Revision: https://phabricator.services.mozilla.com/D95370
Similar to the optional aContainingBlockSize parameter, both border and
padding should use logical coordinates in ReflowInput::mFrame's writing
mode.
Table frames that need to override border and padding can be simplified a bit.
However, DR_init_constraints_cookie and DR_init_offsets_cookie become more
complex, but they're only for debugging. I'm not planning to update their
internal APIs.
Differential Revision: https://phabricator.services.mozilla.com/D95369
I favor two-argument SetComputedLogicalMargin() for clarity in this
patch series because it works for any pair of writing mode and logical
margin.
Spoiler alert: the one-argument SetComputedLogicalMargin() will be
removed in a later part.
Differential Revision: https://phabricator.services.mozilla.com/D95366
Flex item's content size suggestion is the min-content size in the main
axis. Quoting from the CSS Sizing spec, section "5.1. Intrinsic Sizes",
The min-content size of a box in each axis is the size it would have
if it was a float given an auto size in that axis (and no minimum or
maximum size in that axis) and if its containing block was
zero-sized in that axis. (In other words, the minimum size it has
when sized as “shrink-to-fit”.)
However, all the frame types' GetMinISize() doesn't consider aspect
ratio (either the intrinsic aspect ratio on images or svg, or the
preferred aspect ratio set by the aspect-ratio property). That is, we
currently don't allow `aspect ratio * definite block-size` as part of
the equation in `inline-size:min-content` (bug 1646100 or bug 1670151).
Luckily, nsIFrame::ComputeSize() already takes care of this [2]. We just
need to add a flag to let ComputeSize() behave as if the flex item had
an auto inline size. The code should be similar to FloatMarginISize() in
BlockReflowInput.cpp except we are calculate the flex item's content-box
size.
[1] https://drafts.csswg.org/css-sizing-3/#intrinsic-sizes
[2] https://searchfox.org/mozilla-central/rev/dbced93f1c57942501c23d4633d01ce59d9087a1/layout/generic/nsContainerFrame.cpp#2732,2735-2736
Differential Revision: https://phabricator.services.mozilla.com/D94802