This simplifies a bit the code, and guarantees that all calc()s have percentages
and lengths.
I also wanted to remove unclamped_length() / specified_percentage() (for the
same reason as the above patch), but they're needed for animations for now. When
I implement min() / max() for <length-percentage> they'll be fixed.
Differential Revision: https://phabricator.services.mozilla.com/D60194
--HG--
extra : moz-landing-system : lando
This is just not a thing you can do if you have min() / max() / etc, as the min
/ max value may depend on the percentage basis.
Differential Revision: https://phabricator.services.mozilla.com/D60168
--HG--
extra : moz-landing-system : lando
The gradient code is the only one that does a really weird thing with
LengthPercentage values, by getting the percentage and length separately and
turning the length into a percentage relative to the line length (which is in
device pixels).
This won't work once we have min() / max() / etc. in CSS (as we can't access
the length and percentage components separately, as which one you choose may
depend on the percentage basis). So instead of that, use the regular
ResolveToCssPixels there are lengths involved.
We change a bit the surrounding code to work in CSS pixels, so as to avoid
unneeded CSS -> device pixel conversions.
Differential Revision: https://phabricator.services.mozilla.com/D60159
--HG--
extra : moz-landing-system : lando
This patch changes the zoom behavior to always be routed through the frontend
Zoom Actor. In the existing code, the ZoomChangeUsingMouseWheel event is sent
as an after-the-fact notification of the zoom being modified directly. This
part of the patch supplements the existing event with 2 new events that
trigger the frontend to do the +/- 10% math in ChangeFullZoom and
ChangeTextZoom. The next part of the patch supplies that logic in the frontend
Zoom Actor.
This also changes the handling of events from the zoom in/out keys. Before,
those keys would only change full zoom levels. Now, they will respect the
full zoom vs text zoom toggle.
Differential Revision: https://phabricator.services.mozilla.com/D59259
--HG--
extra : moz-landing-system : lando
We generate ByteBuf by rust bindgen, so we can drop StyleVecU8.
One potential follow-up is that we can merge this together with WrVecU8.
Differential Revision: https://phabricator.services.mozilla.com/D60328
--HG--
rename : ipc/glue/ByteBuf.h => ipc/glue/ByteBufUtils.h
extra : moz-landing-system : lando
Though this may make us use more space when serializing
StyleTransform, but we don't have to do extra conversion on the compostior
side, and this makes us easier to maintain the Rust type.
Differential Revision: https://phabricator.services.mozilla.com/D60045
--HG--
extra : moz-landing-system : lando
The only drawback is: we resolve LengthPercentage value before passing
translate property through IPC, so its percentage part is redundant.
However, this makes us easier to maintain the Rust type.
Differential Revision: https://phabricator.services.mozilla.com/D60044
--HG--
extra : moz-landing-system : lando
We generate ByteBuf by rust bindgen, so we can drop StyleVecU8.
One potential follow-up is that we can merge this together with WrVecU8.
Differential Revision: https://phabricator.services.mozilla.com/D60328
--HG--
rename : ipc/glue/ByteBuf.h => ipc/glue/ByteBufUtils.h
extra : moz-landing-system : lando
Though this may make us use more space when serializing
StyleTransform, but we don't have to do extra conversion on the compostior
side, and this makes us easier to maintain the Rust type.
Differential Revision: https://phabricator.services.mozilla.com/D60045
--HG--
extra : moz-landing-system : lando
The only drawback is: we resolve LengthPercentage value before passing
translate property through IPC, so its percentage part is redundant.
However, this makes us easier to maintain the Rust type.
Differential Revision: https://phabricator.services.mozilla.com/D60044
--HG--
extra : moz-landing-system : lando
There are a number of issues with the current gradient dithering
implementation, that cause many test failures and also fuzziness
rendering when enabling DirectComposition virtual surfaces. In
particular, the dither result is dependent on the offset of the
update rect within a render target.
For now, this patch disables gradient dithering by default. This
gives us:
- A heap of new test PASS results (or reduced fuzziness).
- Fixes a number of non-deterministic fuzziness bugs with DC.
- Improves performance of gradient rendering by a reasonable amount.
We can fix gradient dithering as a follow up, and re-enable if/when
we find content that would benefit from it significantly (we may
be able to improve gradients in other ways than dithering too).
Differential Revision: https://phabricator.services.mozilla.com/D60460
--HG--
extra : moz-landing-system : lando
The original physical axis AxisOrientationType contains direction
information, which can be replaced by physical start side
straightforwardly.
Differential Revision: https://phabricator.services.mozilla.com/D59055
--HG--
extra : moz-landing-system : lando
Note that I return LogicalMargin by value for GetMargin(). It is
considered a suboptimal practice to return a constant reference to a
member variable. We won't gain performance by returning a reference
because the compiler can optimize the return value. If it were assigned
to a new variable, the copy/move constructor is called anyway.
As noted in FIXME(TYLin), the AxisOrientationType argument in
GetMarginBorderPaddingSizeInMainAxis() and many other methods can be
removed. However, to make the patch size manageable, I'll remove them in
a later part.
Differential Revision: https://phabricator.services.mozilla.com/D59051
--HG--
extra : moz-landing-system : lando
Also, use GetPhysicalMargin() instead of mMargin in
FlexItem::GetBaselineOffsetFromOuterCrossEdge() to ease the transition
when converting FlexItem::mMargin to LogicalMargin in the later parts.
Differential Revision: https://phabricator.services.mozilla.com/D59050
--HG--
extra : moz-landing-system : lando
These new added member variables and mWM are going to be used in the
following parts that convert border/padding/margin to use logical
layout, so they are added to the place prior to mBorderPadding and
mMargin.
For "strut" constructor, we can use the default values for mMainAxis,
mCrossAxis, and mIsInlineAxisMainAxis initialized in the class
declaration.
Differential Revision: https://phabricator.services.mozilla.com/D59048
--HG--
extra : moz-landing-system : lando
This includes renaming aAxis to aPhysicalAxis in PositionTracker's
constructor.
Differential Revision: https://phabricator.services.mozilla.com/D59046
--HG--
extra : moz-landing-system : lando
I'm going to add logical accessors and variables in the next patch, so
it's better the rename the old ones first.
Differential Revision: https://phabricator.services.mozilla.com/D59044
--HG--
extra : moz-landing-system : lando
Fix "warning: deleted member function should be public", which can be
reproduced by
`./mach static-analysis check layout/generic/nsFlexContainerFrame.cpp`
If a private delete method is called, the compiler shows two error
messages: the method is deleted, and a private methods is called. By
declaring the method as public, only the former message is shown, which
should be more readable.
Differential Revision: https://phabricator.services.mozilla.com/D59043
--HG--
extra : moz-landing-system : lando
The original physical axis AxisOrientationType contains direction
information, which can be replaced by physical start side
straightforwardly.
Differential Revision: https://phabricator.services.mozilla.com/D59055
--HG--
extra : moz-landing-system : lando