Bug 1355348 - Add FFI for getting SMIL override styles; r=heycam

MozReview-Commit-ID: 7grK3meDOZD

--HG--
extra : rebase_source : 2abaf2f99b5850f3b1a07c667e9801c8dc14b30b
This commit is contained in:
Brian Birtles 2017-04-27 11:09:55 +09:00
parent 00e718c4d4
commit f8eabbbd4d
2 changed files with 26 additions and 3 deletions

View File

@ -358,10 +358,15 @@ Gecko_DropElementSnapshot(ServoElementSnapshotOwned aSnapshot)
}
}
RawServoDeclarationBlockStrongBorrowedOrNull
Gecko_GetStyleAttrDeclarationBlock(RawGeckoElementBorrowed aElement)
typedef DeclarationBlock*(*DeclarationBlockGetter)(RawGeckoElementBorrowed);
static RawServoDeclarationBlockStrongBorrowedOrNull
UnwrapDeclarationBlock(RawGeckoElementBorrowed aElement,
DeclarationBlockGetter aGetterFunc)
{
DeclarationBlock* decl = aElement->GetInlineStyleDeclaration();
MOZ_ASSERT(aElement, "Invalid GeckoElement");
DeclarationBlock* decl = aGetterFunc(aElement);
if (!decl) {
return nullptr;
}
@ -374,6 +379,22 @@ Gecko_GetStyleAttrDeclarationBlock(RawGeckoElementBorrowed aElement)
return decl->AsServo()->RefRawStrong();
}
RawServoDeclarationBlockStrongBorrowedOrNull
Gecko_GetStyleAttrDeclarationBlock(RawGeckoElementBorrowed aElement)
{
return UnwrapDeclarationBlock(aElement, [](RawGeckoElementBorrowed elem) {
return elem->GetInlineStyleDeclaration();
});
}
RawServoDeclarationBlockStrongBorrowedOrNull
Gecko_GetSMILOverrideDeclarationBlock(RawGeckoElementBorrowed aElement)
{
return UnwrapDeclarationBlock(aElement, [](RawGeckoElementBorrowed elem) {
return const_cast<dom::Element*>(elem)->GetSMILOverrideStyleDeclaration();
});
}
RawServoDeclarationBlockStrongBorrowedOrNull
Gecko_GetHTMLPresentationAttrDeclarationBlock(RawGeckoElementBorrowed aElement)
{

View File

@ -195,6 +195,8 @@ Gecko_GetAnimationRule(RawGeckoElementBorrowed aElement,
nsIAtom* aPseudoTag,
mozilla::EffectCompositor::CascadeLevel aCascadeLevel,
RawServoAnimationValueMapBorrowed aAnimationValues);
RawServoDeclarationBlockStrongBorrowedOrNull
Gecko_GetSMILOverrideDeclarationBlock(RawGeckoElementBorrowed element);
bool Gecko_StyleAnimationsEquals(RawGeckoStyleAnimationListBorrowed,
RawGeckoStyleAnimationListBorrowed);
void Gecko_UpdateAnimations(RawGeckoElementBorrowed aElement,