servo: Merge #15234 - Regenerate bindings and tweak some geckolib code for it (from heycam:bindings-update-19); r=emilio

<!-- Please describe your changes on the following line: -->

Regenerate bindings for latest mozilla-central -> stylo merge.  I had to tweak somethings in build_gecko.rs to get it to compile with the new bindgen, which then resulted in me having to tweak a bit in glue.rs.  Not sure if there's a better way than what I've done here.  (Note that the name `RawServoAnimationValueBorrowedList` is a little misleading, since it's naming a Gecko type (nsTArray) with Servo types (ServoAnimationValue pointers) inside it.)

r? @emilio

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: 17953740071b97074b836523b3a3e8f733f58423
This commit is contained in:
Cameron McCormack 2017-01-27 00:36:30 -08:00
Родитель cc42f7e760
Коммит 88a8529ff2
5 изменённых файлов: 902 добавлений и 466 удалений

Просмотреть файл

@ -377,6 +377,7 @@ mod bindings {
"mozilla::DefaultDelete", "mozilla::DefaultDelete",
"mozilla::Side", "mozilla::Side",
"mozilla::binding_danger::AssertAndSuppressCleanupPolicy", "mozilla::binding_danger::AssertAndSuppressCleanupPolicy",
"RawServoAnimationValueBorrowedListBorrowed",
]; ];
let opaque_types = [ let opaque_types = [
"std::pair__PCCP", "std::pair__PCCP",
@ -491,7 +492,6 @@ mod bindings {
"RawGeckoNode", "RawGeckoNode",
"RawGeckoAnimationValueList", "RawGeckoAnimationValueList",
"RawServoAnimationValue", "RawServoAnimationValue",
"RawServoAnimationValueList",
"RawGeckoPresContext", "RawGeckoPresContext",
"RawGeckoPresContextOwned", "RawGeckoPresContextOwned",
"ThreadSafeURIHolder", "ThreadSafeURIHolder",
@ -558,6 +558,8 @@ mod bindings {
"nsresult", "nsresult",
"Loader", "Loader",
"ServoStyleSheet", "ServoStyleSheet",
"EffectCompositor_CascadeLevel",
"RawServoAnimationValueBorrowedListBorrowed",
]; ];
struct ArrayType { struct ArrayType {
cpp_type: &'static str, cpp_type: &'static str,
@ -594,7 +596,6 @@ mod bindings {
let servo_borrow_types = [ let servo_borrow_types = [
"nsCSSValue", "nsCSSValue",
"RawGeckoAnimationValueList", "RawGeckoAnimationValueList",
"RawServoAnimationValueList",
]; ];
for &ty in structs_types.iter() { for &ty in structs_types.iter() {
builder = builder.hide_type(ty) builder = builder.hide_type(ty)

Просмотреть файл

@ -3,13 +3,11 @@
pub use nsstring::{nsACString, nsAString}; pub use nsstring::{nsACString, nsAString};
type nsACString_internal = nsACString; type nsACString_internal = nsACString;
type nsAString_internal = nsAString; type nsAString_internal = nsAString;
use gecko_bindings::structs::EffectCompositor_CascadeLevel;
use gecko_bindings::structs::RawGeckoDocument; use gecko_bindings::structs::RawGeckoDocument;
use gecko_bindings::structs::RawGeckoElement; use gecko_bindings::structs::RawGeckoElement;
use gecko_bindings::structs::RawGeckoNode; use gecko_bindings::structs::RawGeckoNode;
use gecko_bindings::structs::RawGeckoAnimationValueList; use gecko_bindings::structs::RawGeckoAnimationValueList;
use gecko_bindings::structs::RawServoAnimationValue; use gecko_bindings::structs::RawServoAnimationValue;
use gecko_bindings::structs::RawServoAnimationValueBorrowedList;
use gecko_bindings::structs::RawGeckoPresContext; use gecko_bindings::structs::RawGeckoPresContext;
use gecko_bindings::structs::RawGeckoPresContextOwned; use gecko_bindings::structs::RawGeckoPresContextOwned;
use gecko_bindings::structs::ThreadSafeURIHolder; use gecko_bindings::structs::ThreadSafeURIHolder;
@ -152,6 +150,8 @@ use gecko_bindings::structs::nscoord;
use gecko_bindings::structs::nsresult; use gecko_bindings::structs::nsresult;
use gecko_bindings::structs::Loader; use gecko_bindings::structs::Loader;
use gecko_bindings::structs::ServoStyleSheet; use gecko_bindings::structs::ServoStyleSheet;
use gecko_bindings::structs::EffectCompositor_CascadeLevel;
use gecko_bindings::structs::RawServoAnimationValueBorrowedListBorrowed;
pub type nsTArrayBorrowed_uintptr_t<'a> = &'a mut ::gecko_bindings::structs::nsTArray<usize>; pub type nsTArrayBorrowed_uintptr_t<'a> = &'a mut ::gecko_bindings::structs::nsTArray<usize>;
pub type ServoComputedValuesStrong = ::gecko_bindings::sugar::ownership::Strong<ServoComputedValues>; pub type ServoComputedValuesStrong = ::gecko_bindings::sugar::ownership::Strong<ServoComputedValues>;
pub type ServoComputedValuesBorrowed<'a> = &'a ServoComputedValues; pub type ServoComputedValuesBorrowed<'a> = &'a ServoComputedValues;
@ -226,8 +226,6 @@ pub type RawGeckoAnimationValueListBorrowed<'a> = &'a RawGeckoAnimationValueList
pub type RawGeckoAnimationValueListBorrowedOrNull<'a> = Option<&'a RawGeckoAnimationValueList>; pub type RawGeckoAnimationValueListBorrowedOrNull<'a> = Option<&'a RawGeckoAnimationValueList>;
pub type RawGeckoAnimationValueListBorrowedMut<'a> = &'a mut RawGeckoAnimationValueList; pub type RawGeckoAnimationValueListBorrowedMut<'a> = &'a mut RawGeckoAnimationValueList;
pub type RawGeckoAnimationValueListBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoAnimationValueList>; pub type RawGeckoAnimationValueListBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoAnimationValueList>;
pub type RawServoAnimationValueBorrowedListBorrowed<'a> = &'a RawServoAnimationValueBorrowedList;
pub type RawServoAnimationValueBorrowedListBorrowedOrNull<'a> = Option<&'a RawServoAnimationValueBorrowedList>;
extern "C" { extern "C" {
pub fn Gecko_EnsureTArrayCapacity(aArray: *mut ::std::os::raw::c_void, pub fn Gecko_EnsureTArrayCapacity(aArray: *mut ::std::os::raw::c_void,
@ -503,9 +501,10 @@ extern "C" {
-> RawServoDeclarationBlockStrongBorrowedOrNull; -> RawServoDeclarationBlockStrongBorrowedOrNull;
} }
extern "C" { extern "C" {
pub fn Gecko_GetAnimationRule(element: RawGeckoElementBorrowed, pub fn Gecko_GetAnimationRule(aElement: RawGeckoElementBorrowed,
aAtom: *mut nsIAtom, aPseudoTag: *mut nsIAtom,
aCascadeLevel: EffectCompositor_CascadeLevel) aCascadeLevel:
EffectCompositor_CascadeLevel)
-> RawServoDeclarationBlockStrong; -> RawServoDeclarationBlockStrong;
} }
extern "C" { extern "C" {
@ -1227,16 +1226,6 @@ extern "C" {
ServoComputedValuesBorrowed) ServoComputedValuesBorrowed)
-> ServoComputedValuesStrong; -> ServoComputedValuesStrong;
} }
extern "C" {
pub fn Servo_AnimationValues_Interpolate(from: RawServoAnimationValueBorrowed,
to: RawServoAnimationValueBorrowed,
progress: f64)
-> RawServoAnimationValueStrong;
}
extern "C" {
pub fn Servo_AnimationValues_Uncompute(value: RawServoAnimationValueBorrowedListBorrowed)
-> RawServoDeclarationBlockStrong;
}
extern "C" { extern "C" {
pub fn Servo_AnimationValues_Populate(arg1: pub fn Servo_AnimationValues_Populate(arg1:
RawGeckoAnimationValueListBorrowedMut, RawGeckoAnimationValueListBorrowedMut,
@ -1247,6 +1236,19 @@ extern "C" {
ServoComputedValuesBorrowedOrNull, ServoComputedValuesBorrowedOrNull,
arg5: RawGeckoPresContextBorrowed); arg5: RawGeckoPresContextBorrowed);
} }
extern "C" {
pub fn Servo_AnimationValues_Interpolate(from:
RawServoAnimationValueBorrowed,
to:
RawServoAnimationValueBorrowed,
progress: f64)
-> RawServoAnimationValueStrong;
}
extern "C" {
pub fn Servo_AnimationValues_Uncompute(value:
RawServoAnimationValueBorrowedListBorrowed)
-> RawServoDeclarationBlockStrong;
}
extern "C" { extern "C" {
pub fn Servo_ParseStyleAttribute(data: *const nsACString_internal) pub fn Servo_ParseStyleAttribute(data: *const nsACString_internal)
-> RawServoDeclarationBlockStrong; -> RawServoDeclarationBlockStrong;

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -39,7 +39,6 @@ use style::gecko_bindings::bindings::RawGeckoAnimationValueListBorrowedMut;
use style::gecko_bindings::bindings::RawGeckoElementBorrowed; use style::gecko_bindings::bindings::RawGeckoElementBorrowed;
use style::gecko_bindings::bindings::RawGeckoPresContextBorrowed; use style::gecko_bindings::bindings::RawGeckoPresContextBorrowed;
use style::gecko_bindings::bindings::RawServoAnimationValueBorrowed; use style::gecko_bindings::bindings::RawServoAnimationValueBorrowed;
use style::gecko_bindings::bindings::RawServoAnimationValueBorrowedListBorrowed;
use style::gecko_bindings::bindings::RawServoAnimationValueStrong; use style::gecko_bindings::bindings::RawServoAnimationValueStrong;
use style::gecko_bindings::bindings::RawServoImportRuleBorrowed; use style::gecko_bindings::bindings::RawServoImportRuleBorrowed;
use style::gecko_bindings::bindings::ServoComputedValuesBorrowedOrNull; use style::gecko_bindings::bindings::ServoComputedValuesBorrowedOrNull;
@ -50,6 +49,7 @@ use style::gecko_bindings::structs::{ThreadSafePrincipalHolder, ThreadSafeURIHol
use style::gecko_bindings::structs::{nsRestyleHint, nsChangeHint}; use style::gecko_bindings::structs::{nsRestyleHint, nsChangeHint};
use style::gecko_bindings::structs::Loader; use style::gecko_bindings::structs::Loader;
use style::gecko_bindings::structs::RawGeckoPresContextOwned; use style::gecko_bindings::structs::RawGeckoPresContextOwned;
use style::gecko_bindings::structs::RawServoAnimationValueBorrowedListBorrowed;
use style::gecko_bindings::structs::ServoStyleSheet; use style::gecko_bindings::structs::ServoStyleSheet;
use style::gecko_bindings::structs::nsresult; use style::gecko_bindings::structs::nsresult;
use style::gecko_bindings::sugar::ownership::{FFIArcHelpers, HasArcFFI, HasBoxFFI}; use style::gecko_bindings::sugar::ownership::{FFIArcHelpers, HasArcFFI, HasBoxFFI};
@ -186,6 +186,7 @@ pub extern "C" fn Servo_AnimationValues_Interpolate(from: RawServoAnimationValue
pub extern "C" fn Servo_AnimationValues_Uncompute(value: RawServoAnimationValueBorrowedListBorrowed) pub extern "C" fn Servo_AnimationValues_Uncompute(value: RawServoAnimationValueBorrowedListBorrowed)
-> RawServoDeclarationBlockStrong -> RawServoDeclarationBlockStrong
{ {
let value = unsafe { value.as_ref().unwrap() };
let uncomputed_values = value.into_iter() let uncomputed_values = value.into_iter()
.map(|v| { .map(|v| {
let raw_anim = unsafe { v.as_ref().unwrap() }; let raw_anim = unsafe { v.as_ref().unwrap() };