The variables involved in the bitwise arithmetic are all of type uint8_t, so
we end up with that type automatically (no need to bother with a static_cast).
Note that we *do* need to declare the type (we can't use `auto`, or else
the compiler wants to upgrade the local variable to have a wider type --
"int", I think -- and that then produces an build warning when we pass
that variable as a uint8_t param further down).
Differential Revision: https://phabricator.services.mozilla.com/D61893
--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
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
I'm not aware of any usage of LogicalPoint and LogicalPoint in frame
tree dump, but I still want to implement them for the sake of
completeness.
Differential Revision: https://phabricator.services.mozilla.com/D52965
--HG--
extra : moz-landing-system : lando
Note: The output format of BaseSize is "3 x 5", so a pair of parentheses
is added around %s in "logical-size=(%s)" to make it looks better.
Differential Revision: https://phabricator.services.mozilla.com/D52964
--HG--
extra : moz-landing-system : lando
This change uses parentheses, i.e. '(' and ')', to enclose the dimension
of LogicalRect. This match the output of BaseRect's operator<<.
Note: This introduces inconsistency in the frame tree dump because some
of the output format still use braces to enclose the data. But in later
patches, I'll gradually change the format to use parentheses.
Differential Revision: https://phabricator.services.mozilla.com/D52963
--HG--
extra : moz-landing-system : lando
WritingMode.h already depends on ostream header implicitly via
nsBidiUtils.h -> nsString.h. For completeness, I still add #include
<ostream>.
While I'm here, I make the format of debug prints in nsLineBox more
consistent with the counter-part in nsFrame. Some of them will be
revised in the later patches.
Differential Revision: https://phabricator.services.mozilla.com/D52962
--HG--
extra : moz-landing-system : lando
I discovered this while improving `ScrollFrameHelper::IsPhysicalLTR()`
in Part 1. Our code base needs a notion of physical direction. Let's add
it to WritingMode.
Differential Revision: https://phabricator.services.mozilla.com/D49818
--HG--
extra : moz-landing-system : lando
Currently, there's no way to tell whether the SIDEWAYS bit is set from
`writing-mode:sideways-*` or `writing-mode:vertical-*; text-orientation:sideways;`.
To be able to tell them apart, split SIDEWAYS bits into VERTICAL_SIDEWAYS
and TEXT_SIDEWAYS. This is needed by my proposed solution in bug 1102175.
Also, provide convenience methods related to sideways writing-mode, and replace
obscure checks in the codebase.
Note that we don't have the use cases to distinguish vertical-rl from
sideways-rl in layout, but for the completeness, IsSidewaysLR() is still
defined.
Differential Revision: https://phabricator.services.mozilla.com/D46321
--HG--
extra : moz-landing-system : lando
Resolution is at:
* https://github.com/w3c/csswg-drafts/issues/3779#issuecomment-481762912
Tests are at https://chromium-review.googlesource.com/c/chromium/src/+/1547974,
I'll make sure to wait until they're in the tree and ensure they're passing.
Note that we need to ensure in the frame constructor that the document element
is styled _before_ calling UpdateViewportScrollStylesOverride(). This saves
duplicated work (since ResolveStyleLazily throws away the style).
ResolveStyleLazily already returns out of date styles, unless the element is not
styled yet, or is in a `display: none` subtree, in which case it computes and
returns a new (up-to-date) style.
So the switch to the FFI call only should change behavior for the display: none
subtree case (since we ensure the unstyled case isn't hit by styling the
document earlier). But that case is one of the cases we're interested in
changing, conveniently.
Depends on D40080
Differential Revision: https://phabricator.services.mozilla.com/D39204
--HG--
extra : moz-landing-system : lando
And move the useful bits of it somewhere else (ServoStyleConstInlines.h for the
inline function definitions, and nsFrame.cpp for the static assertions).
Differential Revision: https://phabricator.services.mozilla.com/D36120
And move the useful bits of it somewhere else (ServoStyleConstInlines.h for the
inline function definitions, and nsFrame.cpp for the static assertions).
Differential Revision: https://phabricator.services.mozilla.com/D36120
--HG--
extra : moz-landing-system : lando
nsUnicodeProperties.h includes into ICU, which has implicit int
truncation, so quarantine this include out of problematic headers.
Depends on D25498
Differential Revision: https://phabricator.services.mozilla.com/D25499
--HG--
extra : moz-landing-system : lando
Really sorry for the size of the patch :(
Only intentional behavior change is in the uses of HasLengthAndPercentage(),
where it's easier to do the right thing. The checks that used to check for
(IsCalcUnit() && CalcHasPercentage()) are wrong since bug 957915.
Differential Revision: https://phabricator.services.mozilla.com/D19553
Also for the intersection observer root margin, since it was easier to fix it
up and clean it up than not doing it.
This is the first big step to get rid of nscoord. It duplicates a bit of logic
in nsLayoutUtils since for now max/min-width/height are still represented with
nsStyleCoord, but I think I prefer to land this incrementally.
I didn't add helpers for the physical accessors of the style rect sides that
nsStyleSides has (top/bottom/left/right) since I think we generally should
encourage the logical versions, but let me know if you want me to do that.
Differential Revision: https://phabricator.services.mozilla.com/D17739
1. Drop {Width|MinWidth|MaxWidh}DependsOnContainer() and
{Height|MinHeight|MaxHeight}DependsOnContainer() because they are bogus
after introducing the writing mode. Dropping these functions needs
update nsLineLayout because it is the only one who still use
these functions.
2. There are still some potential assertions and bugs on handling keywords
in the block size, so we should update them as well.
Depends on D9438
Differential Revision: https://phabricator.services.mozilla.com/D9439
--HG--
extra : moz-landing-system : lando