Bug 1458814: Remove a bit of trivially dead code. r=hiro

MozReview-Commit-ID: GG41v4TejBU

--HG--
extra : rebase_source : 5dc1f255178ae723eed47ec3fdbd6595fa84da62
This commit is contained in:
Emilio Cobos Álvarez 2018-05-03 18:41:17 +02:00
Родитель bac4dc505c
Коммит 0566c42687
3 изменённых файлов: 43 добавлений и 107 удалений

Просмотреть файл

@ -40,11 +40,8 @@ struct ValueWrapper {
ValueWrapper(nsCSSPropertyID aPropID, const AnimationValue& aValue)
: mPropID(aPropID)
{
if (aValue.mServo) {
MOZ_ASSERT(!aValue.IsNull());
mServoValues.AppendElement(aValue.mServo);
return;
}
MOZ_CRASH("old style system disabled");
}
ValueWrapper(nsCSSPropertyID aPropID,
const RefPtr<RawServoAnimationValue>& aValue)
@ -58,7 +55,7 @@ struct ValueWrapper {
return false;
}
if (!mServoValues.IsEmpty()) {
MOZ_ASSERT(!mServoValues.IsEmpty());
size_t len = mServoValues.Length();
if (len != aOther.mServoValues.Length()) {
return false;
@ -72,9 +69,6 @@ struct ValueWrapper {
return true;
}
MOZ_CRASH("old style system disabled");
}
bool operator!=(const ValueWrapper& aOther) const
{
return !(*this == aOther);
@ -306,10 +300,6 @@ AddOrAccumulate(nsSMILValue& aDest, const nsSMILValue& aValueToAdd,
return false;
}
bool isServo = valueToAddWrapper
? !valueToAddWrapper->mServoValues.IsEmpty()
: !destWrapper->mServoValues.IsEmpty();
if (isServo) {
return AddOrAccumulateForServo(aDest,
valueToAddWrapper,
destWrapper,
@ -317,9 +307,6 @@ AddOrAccumulate(nsSMILValue& aDest, const nsSMILValue& aValueToAdd,
aCount);
}
MOZ_CRASH("old style system disabled");
}
nsresult
nsSMILCSSValueType::SandwichAdd(nsSMILValue& aDest,
const nsSMILValue& aValueToAdd) const
@ -389,14 +376,9 @@ nsSMILCSSValueType::ComputeDistance(const nsSMILValue& aFrom,
const ValueWrapper* fromWrapper = ExtractValueWrapper(aFrom);
const ValueWrapper* toWrapper = ExtractValueWrapper(aTo);
MOZ_ASSERT(toWrapper, "expecting non-null endpoint");
if (!toWrapper->mServoValues.IsEmpty()) {
return ComputeDistanceForServo(fromWrapper, *toWrapper, aDistance);
}
MOZ_CRASH("old style system disabled");
}
static nsresult
InterpolateForServo(const ValueWrapper* aStartWrapper,
@ -468,17 +450,12 @@ nsSMILCSSValueType::Interpolate(const nsSMILValue& aStartVal,
const ValueWrapper* startWrapper = ExtractValueWrapper(aStartVal);
const ValueWrapper* endWrapper = ExtractValueWrapper(aEndVal);
MOZ_ASSERT(endWrapper, "expecting non-null endpoint");
if (!endWrapper->mServoValues.IsEmpty()) {
return InterpolateForServo(startWrapper,
*endWrapper,
aUnitDistance,
aResult);
}
MOZ_CRASH("old style system disabled");
}
// Helper function to extract presContext
static nsPresContext*
GetPresContextForElement(Element* aElem)
@ -613,10 +590,6 @@ nsSMILCSSValueType::ValueToString(const nsSMILValue& aValue,
return;
}
if (wrapper->mServoValues.IsEmpty()) {
MOZ_CRASH("old style system disabled");
}
if (nsCSSProps::IsShorthand(wrapper->mPropID)) {
// In case of shorthand on servo, we iterate over all mServoValues array
// since we have multiple AnimationValues in the array for each longhand
@ -691,9 +664,6 @@ nsSMILCSSValueType::FinalizeValue(nsSMILValue& aValue,
return;
}
bool isServo = !valueToMatchWrapper->mServoValues.IsEmpty();
if (isServo) {
ServoAnimationValues zeroValues;
zeroValues.SetCapacity(valueToMatchWrapper->mServoValues.Length());
@ -707,7 +677,4 @@ nsSMILCSSValueType::FinalizeValue(nsSMILValue& aValue,
}
aValue.mU.mPtr = new ValueWrapper(valueToMatchWrapper->mPropID,
Move(zeroValues));
} else {
MOZ_CRASH("old style system disabled");
}
}

Просмотреть файл

@ -118,11 +118,8 @@ float
AnimationValue::GetOpacity() const
{
MOZ_ASSERT(mServo);
if (mServo) {
return Servo_AnimationValue_GetOpacity(mServo);
}
MOZ_CRASH("old style system disabled");
}
already_AddRefed<const nsCSSValueSharedList>
AnimationValue::GetTransformList() const
@ -130,11 +127,7 @@ AnimationValue::GetTransformList() const
MOZ_ASSERT(mServo);
RefPtr<nsCSSValueSharedList> transform;
if (mServo) {
Servo_AnimationValue_GetTransform(mServo, &transform);
} else {
MOZ_CRASH("old style system disabled");
}
return transform.forget();
}
@ -142,27 +135,17 @@ Size
AnimationValue::GetScaleValue(const nsIFrame* aFrame) const
{
MOZ_ASSERT(mServo);
if (mServo) {
RefPtr<nsCSSValueSharedList> list;
Servo_AnimationValue_GetTransform(mServo, &list);
return nsStyleTransformMatrix::GetScaleValue(list, aFrame);
}
MOZ_CRASH("old style system disabled");
}
void
AnimationValue::SerializeSpecifiedValue(nsCSSPropertyID aProperty,
nsAString& aString) const
{
MOZ_ASSERT(mServo);
if (mServo) {
Servo_AnimationValue_Serialize(mServo, aProperty, &aString);
return;
}
MOZ_CRASH("old style system disabled");
}
bool
@ -175,14 +158,9 @@ AnimationValue::IsInterpolableWith(nsCSSPropertyID aProperty,
MOZ_ASSERT(mServo);
MOZ_ASSERT(aToValue.mServo);
if (mServo) {
return Servo_AnimationValues_IsInterpolable(mServo, aToValue.mServo);
}
MOZ_CRASH("old style system disabled");
}
double
AnimationValue::ComputeDistance(nsCSSPropertyID aProperty,
const AnimationValue& aOther,
@ -195,17 +173,13 @@ AnimationValue::ComputeDistance(nsCSSPropertyID aProperty,
MOZ_ASSERT(mServo);
MOZ_ASSERT(aOther.mServo);
double distance= 0.0;
if (mServo) {
distance = Servo_AnimationValues_ComputeDistance(mServo, aOther.mServo);
double distance =
Servo_AnimationValues_ComputeDistance(mServo, aOther.mServo);
return distance < 0.0
? 0.0
: distance;
}
MOZ_CRASH("old style system disabled");
}
/* static */ AnimationValue
AnimationValue::FromString(nsCSSPropertyID aProperty,
const nsAString& aValue,

Просмотреть файл

@ -4520,7 +4520,6 @@ pub extern "C" fn Servo_GetComputedKeyframeValues(
raw_data: RawServoStyleSetBorrowed,
computed_keyframes: RawGeckoComputedKeyframeValuesListBorrowedMut
) {
use std::mem;
use style::properties::LonghandIdSet;
let data = PerDocumentStyleData::from_ffi(raw_data).borrow();
@ -4581,10 +4580,6 @@ pub extern "C" fn Servo_GetComputedKeyframeValues(
// This is safe since we immediately write to the uninitialized values.
unsafe { animation_values.set_len((property_index + 1) as u32) };
animation_values[property_index].mProperty = property.to_nscsspropertyid();
// We only make sure we have enough space for this variable,
// but didn't construct a default value for StyleAnimationValue,
// so we should zero it to avoid getting undefined behaviors.
animation_values[property_index].mValue.mGecko = unsafe { mem::zeroed() };
match value {
Some(v) => {
animation_values[property_index].mValue.mServo.set_arc_leaky(Arc::new(v));