mirror of
https://github.com/servo/servo.git
synced 2025-08-10 16:05:43 +01:00
Use 2018-style paths in code generated by Mako
This commit is contained in:
parent
ede79a6a5d
commit
e1fcffb336
26 changed files with 598 additions and 597 deletions
|
@ -9,40 +9,40 @@
|
|||
from itertools import groupby
|
||||
%>
|
||||
|
||||
#[cfg(feature = "gecko")] use gecko_bindings::structs::RawServoAnimationValueMap;
|
||||
#[cfg(feature = "gecko")] use gecko_bindings::structs::RawGeckoGfxMatrix4x4;
|
||||
#[cfg(feature = "gecko")] use gecko_bindings::structs::nsCSSPropertyID;
|
||||
#[cfg(feature = "gecko")] use gecko_bindings::sugar::ownership::{HasFFI, HasSimpleFFI};
|
||||
#[cfg(feature = "gecko")] use crate::gecko_bindings::structs::RawServoAnimationValueMap;
|
||||
#[cfg(feature = "gecko")] use crate::gecko_bindings::structs::RawGeckoGfxMatrix4x4;
|
||||
#[cfg(feature = "gecko")] use crate::gecko_bindings::structs::nsCSSPropertyID;
|
||||
#[cfg(feature = "gecko")] use crate::gecko_bindings::sugar::ownership::{HasFFI, HasSimpleFFI};
|
||||
use itertools::{EitherOrBoth, Itertools};
|
||||
use num_traits::Zero;
|
||||
use properties::{CSSWideKeyword, PropertyDeclaration};
|
||||
use properties::longhands;
|
||||
use properties::longhands::visibility::computed_value::T as Visibility;
|
||||
use properties::LonghandId;
|
||||
use crate::properties::{CSSWideKeyword, PropertyDeclaration};
|
||||
use crate::properties::longhands;
|
||||
use crate::properties::longhands::visibility::computed_value::T as Visibility;
|
||||
use crate::properties::LonghandId;
|
||||
use servo_arc::Arc;
|
||||
use smallvec::SmallVec;
|
||||
use std::{cmp, ptr};
|
||||
use std::mem::{self, ManuallyDrop};
|
||||
use hash::FxHashMap;
|
||||
use crate::hash::FxHashMap;
|
||||
use super::ComputedValues;
|
||||
use values::CSSFloat;
|
||||
use values::animated::{Animate, Procedure, ToAnimatedValue, ToAnimatedZero};
|
||||
use values::animated::effects::Filter as AnimatedFilter;
|
||||
#[cfg(feature = "gecko")] use values::computed::TransitionProperty;
|
||||
use values::computed::Angle;
|
||||
use values::computed::{ClipRect, Context};
|
||||
use values::computed::{Length, LengthOrPercentage};
|
||||
use values::computed::{Number, Percentage};
|
||||
use values::computed::ToComputedValue;
|
||||
use values::computed::transform::{DirectionVector, Matrix, Matrix3D};
|
||||
use values::computed::transform::TransformOperation as ComputedTransformOperation;
|
||||
use values::computed::transform::Transform as ComputedTransform;
|
||||
use values::computed::transform::Rotate as ComputedRotate;
|
||||
use values::computed::transform::Translate as ComputedTranslate;
|
||||
use values::computed::transform::Scale as ComputedScale;
|
||||
use values::generics::transform::{self, Rotate, Translate, Scale, Transform, TransformOperation};
|
||||
use values::distance::{ComputeSquaredDistance, SquaredDistance};
|
||||
use values::generics::effects::Filter;
|
||||
use crate::values::CSSFloat;
|
||||
use crate::values::animated::{Animate, Procedure, ToAnimatedValue, ToAnimatedZero};
|
||||
use crate::values::animated::effects::Filter as AnimatedFilter;
|
||||
#[cfg(feature = "gecko")] use crate::values::computed::TransitionProperty;
|
||||
use crate::values::computed::Angle;
|
||||
use crate::values::computed::{ClipRect, Context};
|
||||
use crate::values::computed::{Length, LengthOrPercentage};
|
||||
use crate::values::computed::{Number, Percentage};
|
||||
use crate::values::computed::ToComputedValue;
|
||||
use crate::values::computed::transform::{DirectionVector, Matrix, Matrix3D};
|
||||
use crate::values::computed::transform::TransformOperation as ComputedTransformOperation;
|
||||
use crate::values::computed::transform::Transform as ComputedTransform;
|
||||
use crate::values::computed::transform::Rotate as ComputedRotate;
|
||||
use crate::values::computed::transform::Translate as ComputedTranslate;
|
||||
use crate::values::computed::transform::Scale as ComputedScale;
|
||||
use crate::values::generics::transform::{self, Rotate, Translate, Scale, Transform, TransformOperation};
|
||||
use crate::values::distance::{ComputeSquaredDistance, SquaredDistance};
|
||||
use crate::values::generics::effects::Filter;
|
||||
use void::{self, Void};
|
||||
|
||||
/// Convert nsCSSPropertyID to TransitionProperty
|
||||
|
@ -357,7 +357,7 @@ impl AnimationValue {
|
|||
/// "Uncompute" this animation value in order to be used inside the CSS
|
||||
/// cascade.
|
||||
pub fn uncompute(&self) -> PropertyDeclaration {
|
||||
use properties::longhands;
|
||||
use crate::properties::longhands;
|
||||
use self::AnimationValue::*;
|
||||
|
||||
use super::PropertyDeclarationVariantRepr;
|
||||
|
@ -401,7 +401,7 @@ impl AnimationValue {
|
|||
pub fn from_declaration(
|
||||
decl: &PropertyDeclaration,
|
||||
context: &mut Context,
|
||||
extra_custom_properties: Option<<&Arc<::custom_properties::CustomPropertiesMap>>,
|
||||
extra_custom_properties: Option<<&Arc<crate::custom_properties::CustomPropertiesMap>>,
|
||||
initial: &ComputedValues
|
||||
) -> Option<Self> {
|
||||
use super::PropertyDeclarationVariantRepr;
|
||||
|
@ -815,7 +815,7 @@ impl ToAnimatedZero for Visibility {
|
|||
impl Animate for ClipRect {
|
||||
#[inline]
|
||||
fn animate(&self, other: &Self, procedure: Procedure) -> Result<Self, ()> {
|
||||
use values::computed::Length;
|
||||
use crate::values::computed::Length;
|
||||
let animate_component = |this: &Option<Length>, other: &Option<Length>| {
|
||||
match (this.animate(other, procedure)?, procedure) {
|
||||
(None, Procedure::Interpolate { .. }) => Ok(None),
|
||||
|
@ -1070,8 +1070,8 @@ impl Animate for ComputedTransformOperation {
|
|||
&TransformOperation::Perspective(ref fd),
|
||||
&TransformOperation::Perspective(ref td),
|
||||
) => {
|
||||
use values::computed::CSSPixelLength;
|
||||
use values::generics::transform::create_perspective_matrix;
|
||||
use crate::values::computed::CSSPixelLength;
|
||||
use crate::values::generics::transform::create_perspective_matrix;
|
||||
|
||||
// From https://drafts.csswg.org/css-transforms-2/#interpolation-of-transform-functions:
|
||||
//
|
||||
|
@ -1246,7 +1246,7 @@ impl ComputeSquaredDistance for MatrixDecomposed2D {
|
|||
#[inline]
|
||||
fn compute_squared_distance(&self, other: &Self) -> Result<SquaredDistance, ()> {
|
||||
// Use Radian to compute the distance.
|
||||
const RAD_PER_DEG: f64 = ::std::f64::consts::PI / 180.0;
|
||||
const RAD_PER_DEG: f64 = std::f64::consts::PI / 180.0;
|
||||
let angle1 = self.angle as f64 * RAD_PER_DEG;
|
||||
let angle2 = other.angle as f64 * RAD_PER_DEG;
|
||||
Ok(self.translate.compute_squared_distance(&other.translate)? +
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue