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) { if (!aBaseStyleContext) {
Element* animatingElement =
EffectCompositor::GetElementToRestyle(mTarget->mElement,
mTarget->mPseudoType);
aBaseStyleContext = aBaseStyleContext =
aPresContext->StyleSet()->AsServo()->GetBaseContextForElement( aPresContext->StyleSet()->AsServo()->GetBaseContextForElement(
mTarget->mElement, animatingElement,
aPresContext, aPresContext,
mTarget->mPseudoType,
aComputedStyle); aComputedStyle);
} }
RefPtr<RawServoAnimationValue> baseValue = RefPtr<RawServoAnimationValue> baseValue =

View File

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

View File

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

View File

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

View File

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