Bug 1334036 - Part 3: Support pseudo for finding properties overriding animatinos.
MozReview-Commit-ID: BPd1le2mp9e
--- a/dom/animation/EffectCompositor.cpp
+++ b/dom/animation/EffectCompositor.cpp
@@ -794,16 +794,17 @@ EffectCompositor::GetOverriddenPropertie
if (aStyleContext->PresContext()->RestyleManager()->IsGecko()) {
nsRuleNode::ComputePropertiesOverridingAnimation(propertiesToTrack,
aStyleContext,
aPropertiesOverridden);
} else {
MOZ_ASSERT(aElement);
Servo_GetProperties_Overriding_Animation(aElement,
+ aStyleContext->GetPseudo(),
&propertiesToTrack,
&aPropertiesOverridden);
}
}
/* static */ void
EffectCompositor::UpdateCascadeResults(EffectSet& aEffectSet,
Element* aElement,
--- a/layout/style/ServoBindingList.h
+++ b/layout/style/ServoBindingList.h
@@ -101,17 +101,17 @@ SERVO_BINDING_FUNC(Servo_StyleRule_GetSe
// Animations API
SERVO_BINDING_FUNC(Servo_ParseProperty,
RawServoDeclarationBlockStrong,
const nsACString* property, const nsACString* value,
const nsACString* base_url, ThreadSafeURIHolder* base,
ThreadSafeURIHolder* referrer,
ThreadSafePrincipalHolder* principal)
SERVO_BINDING_FUNC(Servo_GetProperties_Overriding_Animation, void,
- RawGeckoElementBorrowed,
+ RawGeckoElementBorrowed, nsIAtom*,
nsTArrayBorrowed_nsCSSPropertyID,
nsCSSPropertyIDSetBorrowedMut)
// AnimationValues handling
SERVO_BINDING_FUNC(Servo_AnimationValues_Populate, void,
RawGeckoAnimationValueListBorrowedMut,
RawServoDeclarationBlockBorrowed,
ServoComputedValuesBorrowed,
--- a/servo/components/style/gecko_bindings/bindings.rs
+++ b/servo/components/style/gecko_bindings/bindings.rs
@@ -1323,19 +1323,20 @@ extern "C" {
base: *mut ThreadSafeURIHolder,
referrer: *mut ThreadSafeURIHolder,
principal: *mut ThreadSafePrincipalHolder)
-> RawServoDeclarationBlockStrong;
}
extern "C" {
pub fn Servo_GetProperties_Overriding_Animation(arg1:
RawGeckoElementBorrowed,
- arg2:
+ arg2: *mut nsIAtom,
+ arg3:
nsTArrayBorrowed_nsCSSPropertyID,
- arg3:
+ arg4:
nsCSSPropertyIDSetBorrowedMut);
}
extern "C" {
pub fn Servo_AnimationValues_Populate(arg1:
RawGeckoAnimationValueListBorrowedMut,
arg2:
RawServoDeclarationBlockBorrowed,
arg3: ServoComputedValuesBorrowed,
--- a/servo/ports/geckolib/glue.rs
+++ b/servo/ports/geckolib/glue.rs
@@ -796,21 +796,30 @@ pub extern "C" fn Servo_ParseProperty(pr
Arc::new(RwLock::new(PropertyDeclarationBlock {
declarations: results,
important_count: 0,
})).into_strong()
}
#[no_mangle]
pub extern "C" fn Servo_GetProperties_Overriding_Animation(element: RawGeckoElementBorrowed,
+ pseudo_tag: *mut nsIAtom,
list: nsTArrayBorrowed_nsCSSPropertyID,
set: nsCSSPropertyIDSetBorrowedMut) {
let element = GeckoElement(element);
let elementData = element.borrow_data().unwrap();
- let overridden = elementData.styles().primary.rules.get_properties_overriding_animations();
+ let overridden = if pseudo_tag.is_null() {
+ elementData.styles().primary.rules.get_properties_overriding_animations()
+ } else {
+ let pseudoElement = PseudoElement::from_atom_unchecked(Atom::from(pseudo_tag), false);
+ let pseudoStyle = elementData.styles().pseudos
+ .get(&pseudoElement)
+ .expect("Should have pseudo style");
+ pseudoStyle.rules.get_properties_overriding_animations()
+ };
for p in list.iter() {
if overridden.contains(p) {
unsafe { Gecko_AddPropertyToSet(set, *p) };
}
}
}