|
|
|
Lines 5045-5065
CountTransitionProps(const TransitionPropInfo* aInfo,
|
Link Here
|
|---|
|
| 5045 |
numTransitions = data.num; |
5045 |
numTransitions = data.num; |
| 5046 |
} |
5046 |
} |
| 5047 |
|
5047 |
|
| 5048 |
return numTransitions; |
5048 |
return numTransitions; |
| 5049 |
} |
5049 |
} |
| 5050 |
|
5050 |
|
| 5051 |
/* static */ void |
5051 |
/* static */ void |
| 5052 |
nsRuleNode::ComputeTimingFunction(const nsCSSValue& aValue, |
5052 |
nsRuleNode::ComputeTimingFunction(const nsCSSValue& aValue, |
| 5053 |
nsTimingFunction& aResult) |
5053 |
nsTimingFunction& aResult, |
|
|
5054 |
bool aAllowStepMiddle) |
| 5054 |
{ |
5055 |
{ |
| 5055 |
switch (aValue.GetUnit()) { |
5056 |
switch (aValue.GetUnit()) { |
| 5056 |
case eCSSUnit_Enumerated: |
5057 |
case eCSSUnit_Enumerated: |
| 5057 |
aResult = nsTimingFunction(aValue.GetIntValue()); |
5058 |
{ |
|
|
5059 |
int type = aValue.GetIntValue(); |
| 5060 |
if (type == NS_STYLE_TRANSITION_TIMING_FUNCTION_STEP_MIDDLE && |
| 5061 |
!aAllowStepMiddle) { |
| 5062 |
type = NS_STYLE_TRANSITION_TIMING_FUNCTION_EASE; |
| 5063 |
} |
| 5064 |
aResult = nsTimingFunction(type); |
| 5065 |
} |
| 5058 |
break; |
5066 |
break; |
| 5059 |
case eCSSUnit_Cubic_Bezier: |
5067 |
case eCSSUnit_Cubic_Bezier: |
| 5060 |
{ |
5068 |
{ |
| 5061 |
nsCSSValue::Array* array = aValue.GetArrayValue(); |
5069 |
nsCSSValue::Array* array = aValue.GetArrayValue(); |
| 5062 |
NS_ASSERTION(array && array->Count() == 4, |
5070 |
NS_ASSERTION(array && array->Count() == 4, |
| 5063 |
"Need 4 control points"); |
5071 |
"Need 4 control points"); |
| 5064 |
aResult = nsTimingFunction(array->Item(0).GetFloatValue(), |
5072 |
aResult = nsTimingFunction(array->Item(0).GetFloatValue(), |
| 5065 |
array->Item(1).GetFloatValue(), |
5073 |
array->Item(1).GetFloatValue(), |
|
Lines 5080-5099
nsRuleNode::ComputeTimingFunction(const nsCSSValue& aValue,
|
Link Here
|
|---|
|
| 5080 |
array->Item(1).GetIntValue() == |
5088 |
array->Item(1).GetIntValue() == |
| 5081 |
NS_STYLE_TRANSITION_TIMING_FUNCTION_STEP_MIDDLE || |
5089 |
NS_STYLE_TRANSITION_TIMING_FUNCTION_STEP_MIDDLE || |
| 5082 |
array->Item(1).GetIntValue() == |
5090 |
array->Item(1).GetIntValue() == |
| 5083 |
NS_STYLE_TRANSITION_TIMING_FUNCTION_STEP_END || |
5091 |
NS_STYLE_TRANSITION_TIMING_FUNCTION_STEP_END || |
| 5084 |
array->Item(1).GetIntValue() == -1), |
5092 |
array->Item(1).GetIntValue() == -1), |
| 5085 |
"unexpected second value"); |
5093 |
"unexpected second value"); |
| 5086 |
nsTimingFunction::Type type = |
5094 |
nsTimingFunction::Type type = |
| 5087 |
nsTimingFunction::GetStepFunctionType(array->Item(1).GetIntValue()); |
5095 |
nsTimingFunction::GetStepFunctionType(array->Item(1).GetIntValue()); |
| 5088 |
aResult = nsTimingFunction(type, array->Item(0).GetIntValue(), |
5096 |
if (type == nsTimingFunction::Type::StepMiddle && !aAllowStepMiddle) { |
| 5089 |
array->Item(1).GetIntValue() == -1 ? |
5097 |
aResult = nsTimingFunction(NS_STYLE_TRANSITION_TIMING_FUNCTION_EASE); |
| 5090 |
nsTimingFunction::Keyword::Implicit : |
5098 |
} else { |
| 5091 |
nsTimingFunction::Keyword::Explicit); |
5099 |
aResult = nsTimingFunction(type, array->Item(0).GetIntValue(), |
|
|
5100 |
array->Item(1).GetIntValue() == -1 ? |
| 5101 |
nsTimingFunction::Keyword::Implicit : |
| 5102 |
nsTimingFunction::Keyword::Explicit); |
| 5103 |
} |
| 5092 |
} |
5104 |
} |
| 5093 |
break; |
5105 |
break; |
| 5094 |
default: |
5106 |
default: |
| 5095 |
NS_NOTREACHED("Invalid transition property unit"); |
5107 |
NS_NOTREACHED("Invalid transition property unit"); |
| 5096 |
} |
5108 |
} |
| 5097 |
} |
5109 |
} |
| 5098 |
|
5110 |
|
| 5099 |
static uint8_t |
5111 |
static uint8_t |