зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1324700 - Add an FFI which returns computed values for a given declaration block with/without parent_style. r=heycam
The function uses document's default computed values if the parent style is not specified. MozReview-Commit-ID: ICd3phAi0C6 --HG-- extra : rebase_source : 343dee682096b75cd7f905db7207823f7e3624b5
This commit is contained in:
Родитель
175655448b
Коммит
51d6b62cb0
|
@ -70,6 +70,11 @@ SERVO_BINDING_FUNC(Servo_StyleSet_FillKeyframesForName, bool,
|
|||
SERVO_BINDING_FUNC(Servo_StyleSet_GetFontFaceRules, void,
|
||||
RawServoStyleSetBorrowed set,
|
||||
RawGeckoFontFaceRuleListBorrowedMut list)
|
||||
SERVO_BINDING_FUNC(Servo_StyleSet_ResolveForDeclarations,
|
||||
ServoComputedValuesStrong,
|
||||
RawServoStyleSetBorrowed set,
|
||||
ServoComputedValuesBorrowedOrNull parent_style,
|
||||
RawServoDeclarationBlockBorrowed declarations)
|
||||
|
||||
// CSSRuleList
|
||||
SERVO_BINDING_FUNC(Servo_CssRules_ListTypes, void,
|
||||
|
|
|
@ -924,4 +924,14 @@ ServoStyleSet::AppendFontFaceRules(nsTArray<nsFontFaceRuleContainer>& aArray)
|
|||
return true;
|
||||
}
|
||||
|
||||
already_AddRefed<ServoComputedValues>
|
||||
ServoStyleSet::ResolveForDeclarations(
|
||||
ServoComputedValuesBorrowedOrNull aParentOrNull,
|
||||
RawServoDeclarationBlockBorrowed aDeclarations)
|
||||
{
|
||||
return Servo_StyleSet_ResolveForDeclarations(mRawSet.get(),
|
||||
aParentOrNull,
|
||||
aDeclarations).Consume();
|
||||
}
|
||||
|
||||
bool ServoStyleSet::sInServoTraversal = false;
|
||||
|
|
|
@ -297,6 +297,15 @@ public:
|
|||
already_AddRefed<ServoComputedValues>
|
||||
GetBaseComputedValuesForElement(dom::Element* aElement, nsIAtom* aPseudoTag);
|
||||
|
||||
/**
|
||||
* Resolve style for a given declaration block with/without the parent style.
|
||||
* If the parent style is not specified, the document default computed values
|
||||
* is used.
|
||||
*/
|
||||
already_AddRefed<ServoComputedValues>
|
||||
ResolveForDeclarations(ServoComputedValuesBorrowedOrNull aParentOrNull,
|
||||
RawServoDeclarationBlockBorrowed aDeclarations);
|
||||
|
||||
private:
|
||||
already_AddRefed<nsStyleContext> GetContext(already_AddRefed<ServoComputedValues>,
|
||||
nsStyleContext* aParentContext,
|
||||
|
|
Загрузка…
Ссылка в новой задаче