Bug 1418867 - Pass element or pseudo element to Servo_StyleSet_GetBaseComputedValuesForElement(). r=emilio

MozReview-Commit-ID: Ae3iZ6g3x3c

--HG--
extra : rebase_source : 8d07ac08d63cfdb96cb07a73ed86b268d6b5026e
This commit is contained in:
Hiroyuki Ikezoe 2017-11-22 11:03:40 +09:00
parent 1646278bfe
commit 33e7b8838f
5 changed files with 12 additions and 12 deletions

View File

@ -560,11 +560,13 @@ KeyframeEffectReadOnly::EnsureBaseStyle(
}
if (!aBaseStyleContext) {
Element* animatingElement =
EffectCompositor::GetElementToRestyle(mTarget->mElement,
mTarget->mPseudoType);
aBaseStyleContext =
aPresContext->StyleSet()->AsServo()->GetBaseContextForElement(
mTarget->mElement,
animatingElement,
aPresContext,
mTarget->mPseudoType,
aComputedStyle);
}
RefPtr<RawServoAnimationValue> baseValue =

View File

@ -694,8 +694,7 @@ SERVO_BINDING_FUNC(Servo_StyleSet_GetBaseComputedValuesForElement,
RawServoStyleSetBorrowed set,
RawGeckoElementBorrowed element,
ServoStyleContextBorrowed existing_style,
const mozilla::ServoElementSnapshotTable* snapshots,
mozilla::CSSPseudoElementType pseudo_type)
const mozilla::ServoElementSnapshotTable* snapshots)
// Returns computed values for the given element by adding an animation value.
SERVO_BINDING_FUNC(Servo_StyleSet_GetComputedValuesByAddingAnimation,
ServoStyleContextStrong,

View File

@ -1109,14 +1109,12 @@ already_AddRefed<ServoStyleContext>
ServoStyleSet::GetBaseContextForElement(
Element* aElement,
nsPresContext* aPresContext,
CSSPseudoElementType aPseudoType,
const ServoStyleContext* aStyle)
{
return Servo_StyleSet_GetBaseComputedValuesForElement(mRawSet.get(),
aElement,
aStyle,
&Snapshots(),
aPseudoType).Consume();
&Snapshots()).Consume();
}
already_AddRefed<ServoStyleContext>

View File

@ -392,7 +392,6 @@ public:
already_AddRefed<ServoStyleContext>
GetBaseContextForElement(dom::Element* aElement,
nsPresContext* aPresContext,
CSSPseudoElementType aPseudoType,
const ServoStyleContext* aStyle);
// Get a style context that represents |aStyle|, but as though

View File

@ -749,8 +749,9 @@ nsComputedDOMStyle::DoGetStyleContextNoFlush(Element* aElement,
return nullptr;
}
return presContext->StyleSet()->AsServo()->
GetBaseContextForElement(aElement, presContext,
pseudoType, result->AsServo());
GetBaseContextForElement(elementOrPseudoElement,
presContext,
result->AsServo());
}
}
@ -787,8 +788,9 @@ nsComputedDOMStyle::DoGetStyleContextNoFlush(Element* aElement,
if (!elementOrPseudoElement) {
return nullptr;
}
return servoSet->GetBaseContextForElement(aElement, presContext,
pseudoType, result);
return servoSet->GetBaseContextForElement(elementOrPseudoElement,
presContext,
result);
}
RefPtr<GeckoStyleContext> parentContext;