mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-04 23:08:39 +09:00
Issue #1925 - Convert NS_FULL_TO_HALF_CORNER to a constexpr function.
Note: Because the new function checks types, we need to change the fullCorner type in `nsComputedDOMStyle::GetEllipseRadii()` and `StyleAnimationValue::ExtractComputedValue()` to `Corner` instead of the underlying base type.
This commit is contained in:
parent
31badb0f2e
commit
8a2bc8ef4d
7 changed files with 28 additions and 25 deletions
|
|
@ -354,7 +354,7 @@ CASE(eCornerBottomLeftY, false);
|
|||
|
||||
// Validation of HalfToFullCorner.
|
||||
#define CASE(corner, result) \
|
||||
static_assert(HalfToFullCorner(corner) == result, \
|
||||
static_assert(HalfToFullCorner(corner) == result, \
|
||||
"HalfToFullCorner is wrong")
|
||||
CASE(eCornerTopLeftX, eCornerTopLeft);
|
||||
CASE(eCornerTopLeftY, eCornerTopLeft);
|
||||
|
|
@ -366,10 +366,10 @@ CASE(eCornerBottomLeftX, eCornerBottomLeft);
|
|||
CASE(eCornerBottomLeftY, eCornerBottomLeft);
|
||||
#undef CASE
|
||||
|
||||
// Validation of NS_FULL_TO_HALF_CORNER.
|
||||
// Validation of FullToHalfCorner.
|
||||
#define CASE(corner, vert, result) \
|
||||
static_assert(NS_FULL_TO_HALF_CORNER(corner, vert) == result, \
|
||||
"NS_FULL_TO_HALF_CORNER is wrong")
|
||||
static_assert(FullToHalfCorner(corner, vert) == result, \
|
||||
"FullToHalfCorner is wrong")
|
||||
CASE(eCornerTopLeft, false, eCornerTopLeftX);
|
||||
CASE(eCornerTopLeft, true, eCornerTopLeftY);
|
||||
CASE(eCornerTopRight, false, eCornerTopRightX);
|
||||
|
|
@ -382,7 +382,7 @@ CASE(eCornerBottomLeft, true, eCornerBottomLeftY);
|
|||
|
||||
// Validation of NS_SIDE_TO_{FULL,HALF}_CORNER.
|
||||
#define CASE(side, second, result) \
|
||||
static_assert(NS_SIDE_TO_FULL_CORNER(side, second) == result, \
|
||||
static_assert(NS_SIDE_TO_FULL_CORNER(side, second) == result, \
|
||||
"NS_SIDE_TO_FULL_CORNER is wrong")
|
||||
CASE(eSideTop, false, eCornerTopLeft);
|
||||
CASE(eSideTop, true, eCornerTopRight);
|
||||
|
|
@ -398,7 +398,7 @@ CASE(eSideLeft, true, eCornerTopLeft);
|
|||
#undef CASE
|
||||
|
||||
#define CASE(side, second, parallel, result) \
|
||||
static_assert(NS_SIDE_TO_HALF_CORNER(side, second, parallel) == result, \
|
||||
static_assert(NS_SIDE_TO_HALF_CORNER(side, second, parallel) == result, \
|
||||
"NS_SIDE_TO_HALF_CORNER is wrong")
|
||||
CASE(eSideTop, false, true, eCornerTopLeftX);
|
||||
CASE(eSideTop, false, false, eCornerTopLeftY);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue