Bug 1367293 - Don't get parent style for ComputeAnimationValue. r?birtles
MozReview-Commit-ID: 4TskjmoKchD
--- a/layout/style/ServoStyleSet.cpp
+++ b/layout/style/ServoStyleSet.cpp
@@ -1045,21 +1045,21 @@ ServoStyleSet::GetBaseComputedValuesForE
&Snapshots(),
aPseudoType).Consume();
}
already_AddRefed<RawServoAnimationValue>
ServoStyleSet::ComputeAnimationValue(
Element* aElement,
RawServoDeclarationBlock* aDeclarations,
- const ServoComputedValuesWithParent& aComputedValues)
+ ServoComputedValuesBorrowed aComputedValues)
{
return Servo_AnimationValue_Compute(aElement,
aDeclarations,
- aComputedValues.mCurrentStyle,
+ aComputedValues,
mRawSet.get()).Consume();
}
bool
ServoStyleSet::EnsureUniqueInnerOnCSSSheets()
{
AutoTArray<StyleSheet*, 32> queue;
for (auto& entryArray : mSheets) {
--- a/layout/style/ServoStyleSet.h
+++ b/layout/style/ServoStyleSet.h
@@ -375,17 +375,17 @@ public:
*/
already_AddRefed<ServoComputedValues>
ResolveForDeclarations(ServoComputedValuesBorrowedOrNull aParentOrNull,
RawServoDeclarationBlockBorrowed aDeclarations);
already_AddRefed<RawServoAnimationValue>
ComputeAnimationValue(dom::Element* aElement,
RawServoDeclarationBlock* aDeclaration,
- const ServoComputedValuesWithParent& aComputedValues);
+ ServoComputedValuesBorrowed aComputedValues);
void AppendTask(PostTraversalTask aTask)
{
MOZ_ASSERT(IsInServoTraversal());
// We currently only use PostTraversalTasks while the Servo font metrics
// mutex is locked. If we need to use them in other situations during
// a traversal, we should assert that we've taken appropriate
--- a/layout/style/StyleAnimationValue.cpp
+++ b/layout/style/StyleAnimationValue.cpp
@@ -25,17 +25,16 @@
#include "nsStyleSet.h"
#include "nsComputedDOMStyle.h"
#include "nsContentUtils.h"
#include "nsCSSParser.h"
#include "nsCSSPseudoElements.h"
#include "mozilla/css/Declaration.h"
#include "mozilla/dom/Element.h"
#include "mozilla/FloatingPoint.h"
-#include "mozilla/ServoComputedValuesWithParent.h"
#include "mozilla/KeyframeUtils.h" // KeyframeUtils::ParseProperty
#include "mozilla/Likely.h"
#include "mozilla/ServoBindings.h" // RawServoDeclarationBlock
#include "gfxMatrix.h"
#include "gfxQuaternion.h"
#include "nsIDocument.h"
#include "nsIFrame.h"
#include "gfx2DGlue.h"
@@ -5370,32 +5369,23 @@ AnimationValue::FromString(nsCSSProperty
RefPtr<RawServoDeclarationBlock> declarations =
KeyframeUtils::ParseProperty(aProperty, aValue, doc);
if (!declarations) {
return result;
}
- // We use the current ServoComputeValues and its parent ServoComputeValues
- // to reconstruct the Context and then compute the AnimationValue. However,
- // nsStyleContext::GetParentAllowServo() is going away, so if possible, we
- // should find another way to get the parent ServoComputedValues.
- RefPtr<nsStyleContext> parentContext = styleContext->GetParentAllowServo();
- const ServoComputedValuesWithParent styles = {
- styleContext->StyleSource().AsServoComputedValues(),
- parentContext ? parentContext->StyleSource().AsServoComputedValues()
- : nullptr
- };
-
+ const ServoComputedValues* computedValues =
+ styleContext->StyleSource().AsServoComputedValues();
result.mServo = presContext->StyleSet()
->AsServo()
->ComputeAnimationValue(aElement,
declarations,
- styles);
+ computedValues);
return result;
}
if (!StyleAnimationValue::ComputeValue(aProperty, aElement, styleContext,
aValue, false /* |aUseSVGMode| */,
result.mGecko)) {
MOZ_ASSERT(result.IsNull());
}