diff --git a/layout/style/ServoBindingList.h b/layout/style/ServoBindingList.h index 323775a03107..39acb36c0fda 100644 --- a/layout/style/ServoBindingList.h +++ b/layout/style/ServoBindingList.h @@ -338,7 +338,8 @@ SERVO_BINDING_FUNC(Servo_ComputedValues_GetForAnonymousBox, RawServoStyleSetBorrowed set) SERVO_BINDING_FUNC(Servo_ComputedValues_Inherit, ServoComputedValuesStrong, RawServoStyleSetBorrowed set, - ServoComputedValuesBorrowedOrNull parent_style) + ServoComputedValuesBorrowedOrNull parent_style, + mozilla::InheritTarget target) // Initialize Servo components. Should be called exactly once at startup. SERVO_BINDING_FUNC(Servo_Initialize, void, diff --git a/layout/style/ServoStyleSet.cpp b/layout/style/ServoStyleSet.cpp index 7f4c01374f25..d799a6318cf8 100644 --- a/layout/style/ServoStyleSet.cpp +++ b/layout/style/ServoStyleSet.cpp @@ -366,7 +366,9 @@ ServoStyleSet::ResolveStyleForText(nsIContent* aTextNode, const ServoComputedValues* parentComputedValues = aParentContext->StyleSource().AsServoComputedValues(); RefPtr computedValues = - Servo_ComputedValues_Inherit(mRawSet.get(), parentComputedValues).Consume(); + Servo_ComputedValues_Inherit(mRawSet.get(), + parentComputedValues, + InheritTarget::Text).Consume(); return GetContext(computedValues.forget(), aParentContext, nsCSSAnonBoxes::mozText, @@ -377,9 +379,13 @@ ServoStyleSet::ResolveStyleForText(nsIContent* aTextNode, already_AddRefed ServoStyleSet::ResolveStyleForFirstLetterContinuation(nsStyleContext* aParentContext) { - const ServoComputedValues* parent = aParentContext->StyleSource().AsServoComputedValues(); + const ServoComputedValues* parent = + aParentContext->StyleSource().AsServoComputedValues(); RefPtr computedValues = - Servo_ComputedValues_Inherit(mRawSet.get(), parent).Consume(); + Servo_ComputedValues_Inherit(mRawSet.get(), + parent, + InheritTarget::FirstLetterContinuation) + .Consume(); MOZ_ASSERT(computedValues); return GetContext(computedValues.forget(), aParentContext, @@ -399,7 +405,10 @@ ServoStyleSet::ResolveStyleForPlaceholder() } RefPtr computedValues = - Servo_ComputedValues_Inherit(mRawSet.get(), nullptr).Consume(); + Servo_ComputedValues_Inherit(mRawSet.get(), + nullptr, + InheritTarget::PlaceholderFrame) + .Consume(); MOZ_ASSERT(computedValues); RefPtr retval = diff --git a/layout/style/ServoTypes.h b/layout/style/ServoTypes.h index 2b6acb488544..10320660f78e 100644 --- a/layout/style/ServoTypes.h +++ b/layout/style/ServoTypes.h @@ -71,6 +71,8 @@ enum class UpdateAnimationsTasks : uint8_t { CascadeResults = 1 << 3, }; +MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(UpdateAnimationsTasks) + // The mode to use when parsing lengths. enum class LengthParsingMode { // In CSS, lengths must have units, except for zero values, where the unit can @@ -83,7 +85,16 @@ enum class LengthParsingMode { SVG, }; -MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(UpdateAnimationsTasks) +// The kind of style we're generating when requesting Servo to give us an +// inherited style. +enum class InheritTarget { + // We're requesting a text style. + Text, + // We're requesting a first-letter continuation frame style. + FirstLetterContinuation, + // We're requesting a style for a placeholder frame. + PlaceholderFrame, +}; } // namespace mozilla