Update stylo code to work on nightly

This commit is contained in:
Manish Goregaokar 2017-08-03 14:01:33 -07:00
parent a59a8f8355
commit 3947e2f698
3 changed files with 17 additions and 5 deletions

View file

@ -8,6 +8,7 @@ type nsAString_internal = nsAString;
pub type ServoStyleContextBorrowed<'a> = &'a ::properties::ComputedValues; pub type ServoStyleContextBorrowed<'a> = &'a ::properties::ComputedValues;
pub type ServoStyleContextBorrowedOrNull<'a> = Option<&'a ::properties::ComputedValues>; pub type ServoStyleContextBorrowedOrNull<'a> = Option<&'a ::properties::ComputedValues>;
pub type ServoComputedDataBorrowed<'a> = &'a ServoComputedData; pub type ServoComputedDataBorrowed<'a> = &'a ServoComputedData;
pub type RawServoAnimationValueTableBorrowed<'a> = &'a ();
use gecko_bindings::structs::mozilla::css::GridTemplateAreasValue; use gecko_bindings::structs::mozilla::css::GridTemplateAreasValue;
use gecko_bindings::structs::mozilla::css::ErrorReporter; use gecko_bindings::structs::mozilla::css::ErrorReporter;
use gecko_bindings::structs::mozilla::css::ImageValue; use gecko_bindings::structs::mozilla::css::ImageValue;
@ -37,7 +38,7 @@ use gecko_bindings::structs::RawServoStyleRule;
use gecko_bindings::structs::RawGeckoPresContext; use gecko_bindings::structs::RawGeckoPresContext;
use gecko_bindings::structs::RawGeckoPresContextOwned; use gecko_bindings::structs::RawGeckoPresContextOwned;
use gecko_bindings::structs::RawGeckoStyleAnimationList; use gecko_bindings::structs::RawGeckoStyleAnimationList;
use gecko_bindings::structs::RawGeckoStyleChildrenIteratorBorrowedMut; use gecko_bindings::structs::RawGeckoStyleChildrenIterator;
use gecko_bindings::structs::RawGeckoServoStyleRuleList; use gecko_bindings::structs::RawGeckoServoStyleRuleList;
use gecko_bindings::structs::RawGeckoURLExtraData; use gecko_bindings::structs::RawGeckoURLExtraData;
use gecko_bindings::structs::RawGeckoXBLBinding; use gecko_bindings::structs::RawGeckoXBLBinding;
@ -320,6 +321,10 @@ pub type RawGeckoServoAnimationValueListBorrowed<'a> = &'a RawGeckoServoAnimatio
pub type RawGeckoServoAnimationValueListBorrowedOrNull<'a> = Option<&'a RawGeckoServoAnimationValueList>; pub type RawGeckoServoAnimationValueListBorrowedOrNull<'a> = Option<&'a RawGeckoServoAnimationValueList>;
pub type RawGeckoServoAnimationValueListBorrowedMut<'a> = &'a mut RawGeckoServoAnimationValueList; pub type RawGeckoServoAnimationValueListBorrowedMut<'a> = &'a mut RawGeckoServoAnimationValueList;
pub type RawGeckoServoAnimationValueListBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoServoAnimationValueList>; pub type RawGeckoServoAnimationValueListBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoServoAnimationValueList>;
pub type RawGeckoStyleChildrenIteratorBorrowed<'a> = &'a RawGeckoStyleChildrenIterator;
pub type RawGeckoStyleChildrenIteratorBorrowedOrNull<'a> = Option<&'a RawGeckoStyleChildrenIterator>;
pub type RawGeckoStyleChildrenIteratorBorrowedMut<'a> = &'a mut RawGeckoStyleChildrenIterator;
pub type RawGeckoStyleChildrenIteratorBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoStyleChildrenIterator>;
pub type ServoCssRulesStrong = ::gecko_bindings::sugar::ownership::Strong<ServoCssRules>; pub type ServoCssRulesStrong = ::gecko_bindings::sugar::ownership::Strong<ServoCssRules>;
pub type ServoCssRulesBorrowed<'a> = &'a ServoCssRules; pub type ServoCssRulesBorrowed<'a> = &'a ServoCssRules;
pub type ServoCssRulesBorrowedOrNull<'a> = Option<&'a ServoCssRules>; pub type ServoCssRulesBorrowedOrNull<'a> = Option<&'a ServoCssRules>;
@ -840,7 +845,7 @@ extern "C" {
} }
extern "C" { extern "C" {
pub fn Gecko_AnimationGetBaseStyle(aBaseStyles: pub fn Gecko_AnimationGetBaseStyle(aBaseStyles:
*mut ::std::os::raw::c_void, RawServoAnimationValueTableBorrowed,
aProperty: nsCSSPropertyID) aProperty: nsCSSPropertyID)
-> RawServoAnimationValueBorrowedOrNull; -> RawServoAnimationValueBorrowedOrNull;
} }
@ -2602,7 +2607,8 @@ extern "C" {
extern "C" { extern "C" {
pub fn Servo_AnimationCompose(animation_values: pub fn Servo_AnimationCompose(animation_values:
RawServoAnimationValueMapBorrowedMut, RawServoAnimationValueMapBorrowedMut,
base_values: *mut ::std::os::raw::c_void, base_values:
RawServoAnimationValueTableBorrowed,
property: nsCSSPropertyID, property: nsCSSPropertyID,
animation_segment: animation_segment:
RawGeckoAnimationPropertySegmentBorrowed, RawGeckoAnimationPropertySegmentBorrowed,

View file

@ -387,7 +387,12 @@ impl<'a> Iterator for GeckoChildrenIterator<'a> {
curr curr
}, },
GeckoChildrenIterator::GeckoIterator(ref mut it) => unsafe { GeckoChildrenIterator::GeckoIterator(ref mut it) => unsafe {
Gecko_GetNextStyleChild(it).map(GeckoNode) // We do this unsafe lengthening of the lifetime here because
// structs::StyleChildrenIterator is actually StyleChildrenIterator<'a>,
// however we can't express this easily with bindgen, and it would
// introduce functions with two input lifetimes into bindgen,
// which would be out of scope for elision.
Gecko_GetNextStyleChild(&mut * (it as *mut _)).map(GeckoNode)
} }
} }
} }

View file

@ -59,6 +59,7 @@ use style::gecko_bindings::bindings::RawGeckoServoStyleRuleListBorrowedMut;
use style::gecko_bindings::bindings::RawServoAnimationValueBorrowed; use style::gecko_bindings::bindings::RawServoAnimationValueBorrowed;
use style::gecko_bindings::bindings::RawServoAnimationValueMapBorrowedMut; use style::gecko_bindings::bindings::RawServoAnimationValueMapBorrowedMut;
use style::gecko_bindings::bindings::RawServoAnimationValueStrong; use style::gecko_bindings::bindings::RawServoAnimationValueStrong;
use style::gecko_bindings::bindings::RawServoAnimationValueTableBorrowed;
use style::gecko_bindings::bindings::RawServoStyleRuleBorrowed; use style::gecko_bindings::bindings::RawServoStyleRuleBorrowed;
use style::gecko_bindings::bindings::ServoStyleContextBorrowedOrNull; use style::gecko_bindings::bindings::ServoStyleContextBorrowedOrNull;
use style::gecko_bindings::bindings::nsTArrayBorrowed_uintptr_t; use style::gecko_bindings::bindings::nsTArrayBorrowed_uintptr_t;
@ -374,7 +375,7 @@ pub extern "C" fn Servo_AnimationValues_ComputeDistance(from: RawServoAnimationV
#[no_mangle] #[no_mangle]
pub extern "C" fn Servo_AnimationCompose(raw_value_map: RawServoAnimationValueMapBorrowedMut, pub extern "C" fn Servo_AnimationCompose(raw_value_map: RawServoAnimationValueMapBorrowedMut,
base_values: *mut ::std::os::raw::c_void, base_values: RawServoAnimationValueTableBorrowed,
css_property: nsCSSPropertyID, css_property: nsCSSPropertyID,
segment: RawGeckoAnimationPropertySegmentBorrowed, segment: RawGeckoAnimationPropertySegmentBorrowed,
last_segment: RawGeckoAnimationPropertySegmentBorrowed, last_segment: RawGeckoAnimationPropertySegmentBorrowed,