mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-25 18:07:31 +09:00
fix shit so i can cherry pick
This commit is contained in:
parent
41cd9dbe88
commit
19e946c77e
1 changed files with 15 additions and 19 deletions
|
|
@ -13,6 +13,7 @@
|
||||||
#include "mozilla/ArrayUtils.h"
|
#include "mozilla/ArrayUtils.h"
|
||||||
#include "mozilla/Assertions.h"
|
#include "mozilla/Assertions.h"
|
||||||
#include "mozilla/DebugOnly.h"
|
#include "mozilla/DebugOnly.h"
|
||||||
|
#include "mozilla/FloatingPoint.h"
|
||||||
#include "mozilla/Function.h"
|
#include "mozilla/Function.h"
|
||||||
#include "mozilla/dom/AnimationEffectReadOnlyBinding.h" // for PlaybackDirection
|
#include "mozilla/dom/AnimationEffectReadOnlyBinding.h" // for PlaybackDirection
|
||||||
#include "mozilla/Likely.h"
|
#include "mozilla/Likely.h"
|
||||||
|
|
@ -2037,6 +2038,17 @@ SetValue(const nsCSSValue& aValue, FieldT& aField,
|
||||||
#define SETFCT_UNSET_INHERIT 0x00400000
|
#define SETFCT_UNSET_INHERIT 0x00400000
|
||||||
#define SETFCT_UNSET_INITIAL 0x00800000
|
#define SETFCT_UNSET_INITIAL 0x00800000
|
||||||
|
|
||||||
|
struct RuleNodeReduceNumberCalcOps : public css::BasicFloatCalcOps,
|
||||||
|
public css::CSSValueInputCalcOps,
|
||||||
|
public css::NumbersAlreadyNormalizedOps
|
||||||
|
{
|
||||||
|
result_type ComputeLeafValue(const nsCSSValue& aValue)
|
||||||
|
{
|
||||||
|
MOZ_ASSERT(aValue.GetUnit() == eCSSUnit_Number, "unexpected unit");
|
||||||
|
return aValue.GetFloatValue();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
SetFactor(const nsCSSValue& aValue, float& aField, RuleNodeCacheConditions& aConditions,
|
SetFactor(const nsCSSValue& aValue, float& aField, RuleNodeCacheConditions& aConditions,
|
||||||
float aParentValue, float aInitialValue, uint32_t aFlags = 0)
|
float aParentValue, float aInitialValue, uint32_t aFlags = 0)
|
||||||
|
|
@ -2047,6 +2059,9 @@ SetFactor(const nsCSSValue& aValue, float& aField, RuleNodeCacheConditions& aCon
|
||||||
|
|
||||||
case eCSSUnit_Number:
|
case eCSSUnit_Number:
|
||||||
aField = aValue.GetFloatValue();
|
aField = aValue.GetFloatValue();
|
||||||
|
if (mozilla::IsNaN(aField)) {
|
||||||
|
aField = 0.0f;
|
||||||
|
}
|
||||||
if (aFlags & SETFCT_POSITIVE) {
|
if (aFlags & SETFCT_POSITIVE) {
|
||||||
NS_ASSERTION(aField >= 0.0f, "negative value for positive-only property");
|
NS_ASSERTION(aField >= 0.0f, "negative value for positive-only property");
|
||||||
if (aField < 0.0f) {
|
if (aField < 0.0f) {
|
||||||
|
|
@ -2063,25 +2078,6 @@ SetFactor(const nsCSSValue& aValue, float& aField, RuleNodeCacheConditions& aCon
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#include "CSSCalc.h"
|
|
||||||
|
|
||||||
struct RuleNodeReduceNumberCalcOps
|
|
||||||
: public mozilla::css::BasicFloatCalcOps
|
|
||||||
, public mozilla::css::CSSValueInputCalcOps
|
|
||||||
{
|
|
||||||
float ComputeLeafValue(const nsCSSValue& aValue)
|
|
||||||
{
|
|
||||||
MOZ_ASSERT(aValue.GetUnit() == eCSSUnit_Number,
|
|
||||||
"Expected a number-only calc expression");
|
|
||||||
return aValue.GetFloatValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
float ComputeNumber(const nsCSSValue& aValue)
|
|
||||||
{
|
|
||||||
return mozilla::css::ComputeCalc(aValue, *this);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
case eCSSUnit_Calc: {
|
case eCSSUnit_Calc: {
|
||||||
RuleNodeReduceNumberCalcOps ops;
|
RuleNodeReduceNumberCalcOps ops;
|
||||||
aField = css::ComputeCalc(aValue, ops);
|
aField = css::ComputeCalc(aValue, ops);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue