Bug 1449400 part 4 - Split some inline functions from ServoStyleSet.h into an Inlines header. r?emilio
To remove the dependency from ServoStyleSet.h to ServoBindings.h.
MozReview-Commit-ID: 6YJ71AnQklL
--- a/dom/base/ResponsiveImageSelector.cpp
+++ b/dom/base/ResponsiveImageSelector.cpp
@@ -1,16 +1,16 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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/. */
#include "mozilla/dom/ResponsiveImageSelector.h"
-#include "mozilla/ServoStyleSet.h"
+#include "mozilla/ServoStyleSetInlines.h"
#include "nsIURI.h"
#include "nsIDocument.h"
#include "nsContentUtils.h"
#include "nsPresContext.h"
#include "nsCSSParser.h"
#include "nsCSSProps.h"
--- a/layout/base/RestyleManager.cpp
+++ b/layout/base/RestyleManager.cpp
@@ -5,16 +5,17 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozilla/RestyleManager.h"
#include "mozilla/RestyleManagerInlines.h"
#include "Layers.h"
#include "LayerAnimationInfo.h" // For LayerAnimationInfo::sRecords
#include "mozilla/StyleSetHandleInlines.h"
+#include "mozilla/ServoStyleSetInlines.h"
#include "nsAnimationManager.h"
#include "nsCSSFrameConstructor.h"
#include "nsCSSRendering.h"
#include "nsIFrame.h"
#include "nsIFrameInlines.h"
#include "nsIPresShellInlines.h"
#include "nsPlaceholderFrame.h"
#include "nsStyleChangeList.h"
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -19,16 +19,17 @@
#include "mozilla/dom/HTMLSelectElement.h"
#include "mozilla/dom/HTMLSummaryElement.h"
#include "mozilla/EventStates.h"
#include "mozilla/Likely.h"
#include "mozilla/LinkedList.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/PresShell.h"
#include "mozilla/ServoBindings.h"
+#include "mozilla/ServoStyleSetInlines.h"
#include "nsAbsoluteContainingBlock.h"
#include "nsCSSPseudoElements.h"
#include "nsAtom.h"
#include "nsIFrameInlines.h"
#include "nsGkAtoms.h"
#include "nsPresContext.h"
#include "nsIDocument.h"
#include "nsIDocumentInlines.h"
--- a/layout/style/ServoStyleSet.cpp
+++ b/layout/style/ServoStyleSet.cpp
@@ -1,15 +1,16 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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/. */
#include "mozilla/ServoStyleSet.h"
+#include "mozilla/ServoStyleSetInlines.h"
#include "gfxPlatformFontList.h"
#include "mozilla/AutoRestyleTimelineMarker.h"
#include "mozilla/DocumentStyleRootIterator.h"
#include "mozilla/IntegerRange.h"
#include "mozilla/LookAndFeel.h"
#include "mozilla/RestyleManagerInlines.h"
#include "mozilla/ServoBindings.h"
--- a/layout/style/ServoStyleSet.h
+++ b/layout/style/ServoStyleSet.h
@@ -8,17 +8,16 @@
#define mozilla_ServoStyleSet_h
#include "mozilla/AtomArray.h"
#include "mozilla/EnumeratedArray.h"
#include "mozilla/EventStates.h"
#include "mozilla/MediaFeatureChange.h"
#include "mozilla/PostTraversalTask.h"
#include "mozilla/ServoBindingTypes.h"
-#include "mozilla/ServoBindings.h"
#include "mozilla/ServoUtils.h"
#include "mozilla/SheetType.h"
#include "mozilla/UniquePtr.h"
#include "MainThreadUtils.h"
#include "nsCSSPseudoElements.h"
#include "nsCSSAnonBoxes.h"
#include "nsChangeHint.h"
#include "nsCoord.h"
@@ -128,19 +127,18 @@ public:
nsRestyleHint MediumFeaturesChanged(MediaFeatureChangeReason);
// Evaluates a given SourceSizeList, returning the optimal viewport width in
// app units.
//
// The SourceSizeList parameter can be null, in which case it will return
// 100vw.
- nscoord EvaluateSourceSizeList(const RawServoSourceSizeList* aSourceSizeList) const {
- return Servo_SourceSizeList_Evaluate(mRawSet.get(), aSourceSizeList);
- }
+ inline nscoord EvaluateSourceSizeList(
+ const RawServoSourceSizeList* aSourceSizeList) const;
void InvalidateStyleForCSSRuleChanges();
void AddSizeOfIncludingThis(nsWindowSizes& aSizes) const;
const RawServoStyleSet* RawSet() const {
return mRawSet.get();
}
@@ -337,20 +335,18 @@ public:
void CompatibilityModeChanged();
/**
* Resolve style for the given element, and return it as a
* ComputedStyle.
*
* FIXME(emilio): Is there a point in this after bug 1367904?
*/
- already_AddRefed<ComputedStyle> ResolveServoStyle(dom::Element* aElement)
- {
- return Servo_ResolveStyle(aElement, mRawSet.get()).Consume();
- }
+ inline already_AddRefed<ComputedStyle>
+ ResolveServoStyle(dom::Element* aElement);
bool GetKeyframesForName(nsAtom* aName,
const nsTimingFunction& aTimingFunction,
nsTArray<Keyframe>& aKeyframes);
nsTArray<ComputedKeyframeValues>
GetComputedKeyframeValuesFor(const nsTArray<Keyframe>& aKeyframes,
dom::Element* aElement,
new file mode 100644
--- /dev/null
+++ b/layout/style/ServoStyleSetInlines.h
@@ -0,0 +1,26 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set ts=8 sts=2 et sw=2 tw=80: */
+/* 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_ServoStyleSetInlines_h
+#define mozilla_ServoStyleSetInlines_h
+
+#include "mozilla/ServoStyleSet.h"
+#include "mozilla/ServoBindings.h"
+
+nscoord
+ServoStyleSet::EvaluateSourceSizeList(
+ const RawServoSourceSizeList* aSourceSizeList) const
+{
+ return Servo_SourceSizeList_Evaluate(mRawSet.get(), aSourceSizeList);
+}
+
+already_AddRefed<ComputedStyle>
+ServoStyleSet::ResolveServoStyle(dom::Element* aElement)
+{
+ return Servo_ResolveStyle(aElement, mRawSet.get()).Consume();
+}
+
+#endif // mozilla_ServoStyleSetInlines_h
--- a/layout/style/moz.build
+++ b/layout/style/moz.build
@@ -97,16 +97,17 @@ EXPORTS.mozilla += [
'ServoMediaList.h',
'ServoMediaRule.h',
'ServoNamespaceRule.h',
'ServoPageRule.h',
'ServoPropPrefList.h',
'ServoSpecifiedValues.h',
'ServoStyleRule.h',
'ServoStyleSet.h',
+ 'ServoStyleSetInlines.h',
'ServoStyleSheet.h',
'ServoSupportsRule.h',
'ServoTraversalStatistics.h',
'ServoTypes.h',
'ServoUtils.h',
'SheetType.h',
'StyleAnimationValue.h',
'StyleComplexColor.h',