Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

Commit

Permalink
Bug 1449400 part 4 - Split some inline functions from ServoStyleSet.h…
Browse files Browse the repository at this point in the history
… into an Inlines header. r=emilio

To remove the dependency from ServoStyleSet.h to ServoBindings.h.

MozReview-Commit-ID: 6YJ71AnQklL
  • Loading branch information
upsuper committed Mar 29, 2018
1 parent e2a9ca1 commit c626a4a
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 9 deletions.
2 changes: 1 addition & 1 deletion dom/base/ResponsiveImageSelector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 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"
Expand Down
1 change: 1 addition & 0 deletions layout/base/RestyleManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#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"
Expand Down
1 change: 1 addition & 0 deletions layout/base/nsCSSFrameConstructor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#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"
Expand Down
1 change: 1 addition & 0 deletions layout/style/ServoStyleSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* 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"
Expand Down
12 changes: 4 additions & 8 deletions layout/style/ServoStyleSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#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"
Expand Down Expand Up @@ -133,9 +132,8 @@ class ServoStyleSet
//
// 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();

Expand Down Expand Up @@ -342,10 +340,8 @@ class ServoStyleSet
*
* 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,
Expand Down
26 changes: 26 additions & 0 deletions layout/style/ServoStyleSetInlines.h
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions layout/style/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ EXPORTS.mozilla += [
'ServoSpecifiedValues.h',
'ServoStyleRule.h',
'ServoStyleSet.h',
'ServoStyleSetInlines.h',
'ServoStyleSheet.h',
'ServoSupportsRule.h',
'ServoTraversalStatistics.h',
Expand Down

0 comments on commit c626a4a

Please sign in to comment.