Bug 1340033 - Remove dependency from StyleAnimationValue.h to ServoBindings.h. r?hiro
MozReview-Commit-ID: 79czvLmftmv
--- a/dom/animation/KeyframeEffectReadOnly.cpp
+++ b/dom/animation/KeyframeEffectReadOnly.cpp
@@ -13,17 +13,17 @@
#include "mozilla/AnimationRule.h"
#include "mozilla/AnimationUtils.h"
#include "mozilla/AutoRestore.h"
#include "mozilla/EffectSet.h"
#include "mozilla/FloatingPoint.h" // For IsFinite
#include "mozilla/LookAndFeel.h" // For LookAndFeel::GetInt
#include "mozilla/KeyframeUtils.h"
#include "mozilla/ServoBindings.h"
-#include "mozilla/StyleAnimationValue.h"
+#include "mozilla/StyleAnimationValueInlines.h"
#include "Layers.h" // For Layer
#include "nsComputedDOMStyle.h" // nsComputedDOMStyle::GetStyleContextForElement
#include "nsContentUtils.h" // nsContentUtils::ReportToConsole
#include "nsCSSPropertyIDSet.h"
#include "nsCSSProps.h" // For nsCSSProps::PropHasFlags
#include "nsCSSPseudoElements.h" // For CSSPseudoElementType
#include "nsIPresShell.h"
#include "nsIScriptError.h"
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -111,16 +111,17 @@
#include "nsFrameSelection.h"
#include "FrameLayerBuilder.h"
#include "mozilla/layers/APZCTreeManager.h"
#include "mozilla/layers/CompositorBridgeChild.h"
#include "mozilla/Telemetry.h"
#include "mozilla/EventDispatcher.h"
#include "mozilla/EventStateManager.h"
#include "mozilla/RuleNodeCacheConditions.h"
+#include "mozilla/StyleAnimationValueInlines.h"
#include "mozilla/StyleSetHandle.h"
#include "mozilla/StyleSetHandleInlines.h"
#include "RegionBuilder.h"
#include "SVGSVGElement.h"
#ifdef MOZ_XUL
#include "nsXULPopupManager.h"
#endif
@@ -9354,9 +9355,9 @@ nsLayoutUtils::ComputeGeometryBox(nsIFra
}
/* static */ bool
nsLayoutUtils::HasCSSBoxLayout(nsIFrame* aFrame)
{
// Except SVG outer element, all SVG element does not have CSS box layout.
return !aFrame->IsFrameOfType(nsIFrame::eSVG) ||
aFrame->GetType() == nsGkAtoms::svgOuterSVGFrame;
-}
\ No newline at end of file
+}
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -56,16 +56,17 @@
#include "mozilla/AnimationUtils.h"
#include "mozilla/EffectCompositor.h"
#include "mozilla/EffectSet.h"
#include "mozilla/EventStates.h"
#include "mozilla/LookAndFeel.h"
#include "mozilla/OperatorNewExtensions.h"
#include "mozilla/PendingAnimationTracker.h"
#include "mozilla/Preferences.h"
+#include "mozilla/StyleAnimationValueInlines.h"
#include "mozilla/Telemetry.h"
#include "mozilla/UniquePtr.h"
#include "mozilla/Unused.h"
#include "mozilla/ViewportFrame.h"
#include "mozilla/gfx/gfxVars.h"
#include "ActiveLayerTracker.h"
#include "nsContentUtils.h"
#include "nsPrintfCString.h"
--- a/layout/style/StyleAnimationValue.h
+++ b/layout/style/StyleAnimationValue.h
@@ -14,17 +14,16 @@
#include "nsStringFwd.h"
#include "nsStringBuffer.h"
#include "nsCoord.h"
#include "nsColor.h"
#include "nsCSSProps.h"
#include "nsCSSValue.h"
#include "nsStyleCoord.h"
#include "nsStyleTransformMatrix.h"
-#include "ServoBindings.h"
class nsIFrame;
class nsStyleContext;
class gfx3DMatrix;
struct RawServoDeclarationBlock;
namespace mozilla {
@@ -592,47 +591,25 @@ struct AnimationValue
bool operator==(const AnimationValue& aOther) const
{
// FIXME: Bug 1337229: add a deep == impl for RawServoAnimationValue.
return mGecko == aOther.mGecko && mServo == aOther.mServo;
}
bool IsNull() const { return mGecko.IsNull() && !mServo; }
- float GetOpacity() const
- {
- return mServo ? Servo_AnimationValue_GetOpacity(mServo)
- : mGecko.GetFloatValue();
- }
+ inline float GetOpacity() const;
// Returns the scale for mGecko or mServo, which are calculated with
// reference to aFrame.
- gfxSize GetScaleValue(const nsIFrame* aFrame) const
- {
- if (mServo) {
- RefPtr<nsCSSValueSharedList> list;
- Servo_AnimationValue_GetTransform(mServo, &list);
- return nsStyleTransformMatrix::GetScaleValue(list, aFrame);
- }
- return mGecko.GetScaleValue(aFrame);
- }
+ inline gfxSize GetScaleValue(const nsIFrame* aFrame) const;
// Uncompute this AnimationValue and then serialize it.
- void SerializeSpecifiedValue(nsCSSPropertyID aProperty,
- nsAString& aString) const
- {
- if (mServo) {
- Servo_AnimationValue_Serialize(mServo, aProperty, &aString);
- return;
- }
-
- DebugOnly<bool> uncomputeResult =
- StyleAnimationValue::UncomputeValue(aProperty, mGecko, aString);
- MOZ_ASSERT(uncomputeResult, "failed to uncompute StyleAnimationValue");
- }
+ inline void SerializeSpecifiedValue(nsCSSPropertyID aProperty,
+ nsAString& aString) const;
};
struct PropertyStyleAnimationValuePair
{
nsCSSPropertyID mProperty;
AnimationValue mValue;
};
} // namespace mozilla
new file mode 100644
--- /dev/null
+++ b/layout/style/StyleAnimationValueInlines.h
@@ -0,0 +1,48 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#ifndef mozilla_StyleAnimationValueInlines_h_
+#define mozilla_StyleAnimationValueInlines_h_
+
+#include "mozilla/StyleAnimationValue.h"
+#include "mozilla/ServoBindings.h"
+
+namespace mozilla {
+
+float
+AnimationValue::GetOpacity() const
+{
+ return mServo ? Servo_AnimationValue_GetOpacity(mServo)
+ : mGecko.GetFloatValue();
+}
+
+gfxSize
+AnimationValue::GetScaleValue(const nsIFrame* aFrame) const
+{
+ if (mServo) {
+ RefPtr<nsCSSValueSharedList> list;
+ Servo_AnimationValue_GetTransform(mServo, &list);
+ return nsStyleTransformMatrix::GetScaleValue(list, aFrame);
+ }
+ return mGecko.GetScaleValue(aFrame);
+}
+
+void
+AnimationValue::SerializeSpecifiedValue(nsCSSPropertyID aProperty,
+ nsAString& aString) const
+{
+ if (mServo) {
+ Servo_AnimationValue_Serialize(mServo, aProperty, &aString);
+ return;
+ }
+
+ DebugOnly<bool> uncomputeResult =
+ StyleAnimationValue::UncomputeValue(aProperty, mGecko, aString);
+ MOZ_ASSERT(uncomputeResult, "failed to uncompute StyleAnimationValue");
+}
+
+} // namespace mozilla
+
+#endif // mozilla_StyleAnimationValueInlines_h_
--- a/layout/style/moz.build
+++ b/layout/style/moz.build
@@ -104,16 +104,17 @@ EXPORTS.mozilla += [
'ServoPropPrefList.h',
'ServoStyleRule.h',
'ServoStyleSet.h',
'ServoStyleSheet.h',
'ServoTypes.h',
'ServoUtils.h',
'SheetType.h',
'StyleAnimationValue.h',
+ 'StyleAnimationValueInlines.h',
'StyleBackendType.h',
'StyleComplexColor.h',
'StyleContextSource.h',
'StyleSetHandle.h',
'StyleSetHandleInlines.h',
'StyleSheet.h',
'StyleSheetInfo.h',
'StyleSheetInlines.h',