зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1360508: Adjust text-combine properly. r=jryans
Text style is always resolved via ServoStyleSet::ResolveStyleForText, either from the frame constructor initially, or from ServoRestyleManager::ProcessPostTraversalForText. So text-only adjustments should go there instead. Since that doesn't call into cascade(), all the code that passes `pseudo` there is dead code we can remove. MozReview-Commit-ID: jpbBYpLlUL Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
This commit is contained in:
Родитель
e723d98949
Коммит
2e7660653c
|
@ -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,
|
||||
|
|
|
@ -366,7 +366,9 @@ ServoStyleSet::ResolveStyleForText(nsIContent* aTextNode,
|
|||
const ServoComputedValues* parentComputedValues =
|
||||
aParentContext->StyleSource().AsServoComputedValues();
|
||||
RefPtr<ServoComputedValues> 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<nsStyleContext>
|
||||
ServoStyleSet::ResolveStyleForFirstLetterContinuation(nsStyleContext* aParentContext)
|
||||
{
|
||||
const ServoComputedValues* parent = aParentContext->StyleSource().AsServoComputedValues();
|
||||
const ServoComputedValues* parent =
|
||||
aParentContext->StyleSource().AsServoComputedValues();
|
||||
RefPtr<ServoComputedValues> 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<ServoComputedValues> computedValues =
|
||||
Servo_ComputedValues_Inherit(mRawSet.get(), nullptr).Consume();
|
||||
Servo_ComputedValues_Inherit(mRawSet.get(),
|
||||
nullptr,
|
||||
InheritTarget::PlaceholderFrame)
|
||||
.Consume();
|
||||
MOZ_ASSERT(computedValues);
|
||||
|
||||
RefPtr<nsStyleContext> retval =
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче