style: Generate StyleTimingFunction and drop ns_timing_function.rs.

First, we generate StyleComputedTimingFunction by cbindgen from Rust, and use
it in nsTimingFunction, so we could copy it directly without handling
the different memory layout. However, we have to rewrite the
nsTimingFunction and mozilla::ComputedTimingFunction for this.

Second, the rust-bindgen seems cannot generate the correct generic members
from complex C++ templates, especially for the nested template struct,
(https://github.com/rust-lang-nursery/rust-bindgen/issues/1429)
So we have to hide StyleTimingFunction to avoid the compilation errors.

Differential Revision: https://phabricator.services.mozilla.com/D9313
This commit is contained in:
Boris Chiou 2018-10-26 18:03:35 +00:00 committed by Emilio Cobos Álvarez
parent 2bbcb5c633
commit 3723042937
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
7 changed files with 42 additions and 146 deletions

View file

@ -5,7 +5,10 @@
//! Computed types for CSS Easing functions.
use values::computed::{Integer, Number};
use values::generics::easing::TimingFunction as GenericTimingFunction;
use values::generics::easing;
/// A computed timing function.
pub type TimingFunction = GenericTimingFunction<Integer, Number>;
pub type ComputedTimingFunction = easing::TimingFunction<Integer, Number>;
/// An alias of the computed timing function.
pub type TimingFunction = ComputedTimingFunction;