style: Remove some unneeded cfg(..).

The less not-compiled code in common builds, the better for everybody.
This commit is contained in:
Emilio Cobos Álvarez 2018-05-05 17:28:58 +02:00
parent cb48a837bf
commit 921c389247
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
3 changed files with 8 additions and 8 deletions

View file

@ -3,7 +3,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
//! CSS transitions and animations. //! CSS transitions and animations.
#![deny(missing_docs)]
use Atom; use Atom;
use bezier::Bezier; use bezier::Bezier;
@ -409,7 +408,6 @@ impl PropertyAnimation {
/// Inserts transitions into the queue of running animations as applicable for /// Inserts transitions into the queue of running animations as applicable for
/// the given style difference. This is called from the layout worker threads. /// the given style difference. This is called from the layout worker threads.
/// Returns true if any animations were kicked off and false otherwise. /// Returns true if any animations were kicked off and false otherwise.
#[cfg(feature = "servo")]
pub fn start_transitions_if_applicable( pub fn start_transitions_if_applicable(
new_animations_sender: &Sender<Animation>, new_animations_sender: &Sender<Animation>,
opaque_node: OpaqueNode, opaque_node: OpaqueNode,
@ -629,6 +627,7 @@ pub fn update_style_for_animation_frame(
true true
} }
/// Updates a single animation and associated style based on the current time. /// Updates a single animation and associated style based on the current time.
pub fn update_style_for_animation<E>( pub fn update_style_for_animation<E>(
context: &SharedStyleContext, context: &SharedStyleContext,

View file

@ -103,7 +103,6 @@ extern crate void;
#[macro_use] #[macro_use]
mod macros; mod macros;
#[cfg(feature = "servo")]
pub mod animation; pub mod animation;
pub mod applicable_declarations; pub mod applicable_declarations;
#[allow(missing_docs)] // TODO. #[allow(missing_docs)] // TODO.

View file

@ -196,7 +196,6 @@ pub fn nscsspropertyid_is_transitionable(property: nsCSSPropertyID) -> bool {
/// An animated property interpolation between two computed values for that /// An animated property interpolation between two computed values for that
/// property. /// property.
#[cfg(feature = "servo")]
#[derive(Clone, Debug, PartialEq)] #[derive(Clone, Debug, PartialEq)]
#[cfg_attr(feature = "servo", derive(MallocSizeOf))] #[cfg_attr(feature = "servo", derive(MallocSizeOf))]
pub enum AnimatedProperty { pub enum AnimatedProperty {
@ -213,7 +212,6 @@ pub enum AnimatedProperty {
% endfor % endfor
} }
#[cfg(feature = "servo")]
impl AnimatedProperty { impl AnimatedProperty {
/// Get the name of this property. /// Get the name of this property.
pub fn name(&self) -> &'static str { pub fn name(&self) -> &'static str {
@ -255,9 +253,12 @@ impl AnimatedProperty {
/// Update `style` with the proper computed style corresponding to this /// Update `style` with the proper computed style corresponding to this
/// animation at `progress`. /// animation at `progress`.
#[cfg_attr(feature = "gecko", allow(unused))]
pub fn update(&self, style: &mut ComputedValues, progress: f64) { pub fn update(&self, style: &mut ComputedValues, progress: f64) {
match *self { #[cfg(feature = "servo")]
% for prop in data.longhands: {
match *self {
% for prop in data.longhands:
% if prop.animatable: % if prop.animatable:
AnimatedProperty::${prop.camel_case}(ref from, ref to) => { AnimatedProperty::${prop.camel_case}(ref from, ref to) => {
// https://drafts.csswg.org/web-animations/#discrete-animation-type // https://drafts.csswg.org/web-animations/#discrete-animation-type
@ -276,7 +277,8 @@ impl AnimatedProperty {
style.mutate_${prop.style_struct.name_lower}().set_${prop.ident}(value); style.mutate_${prop.style_struct.name_lower}().set_${prop.ident}(value);
} }
% endif % endif
% endfor % endfor
}
} }
} }