mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
style: Add a temporary workaround for geckolib animations.
With needs_borrow we will be able to remove this, though we'll have to implement clone_ and borrow_ methods for a bunch of properties.
This commit is contained in:
parent
2faaf952c7
commit
bc4e670c5a
3 changed files with 11 additions and 0 deletions
|
@ -1259,6 +1259,7 @@ pub trait ComputedValues : Debug + Clone + Send + Sync + 'static {
|
|||
// yet - panics for non-Servo implementations.
|
||||
//
|
||||
// Used only for animations. Don't use it in other places.
|
||||
fn is_servo(&self) -> bool;
|
||||
fn as_servo<'a>(&'a self) -> &'a ServoComputedValues;
|
||||
fn as_servo_mut<'a>(&'a mut self) -> &'a mut ServoComputedValues;
|
||||
|
||||
|
@ -1310,7 +1311,11 @@ impl ComputedValues for ServoComputedValues {
|
|||
type Concrete${style_struct.trait_name} = style_structs::${style_struct.servo_struct_name};
|
||||
% endfor
|
||||
|
||||
#[inline]
|
||||
fn is_servo(&self) -> bool { true }
|
||||
#[inline]
|
||||
fn as_servo<'a>(&'a self) -> &'a ServoComputedValues { self }
|
||||
#[inline]
|
||||
fn as_servo_mut<'a>(&'a mut self) -> &'a mut ServoComputedValues { self }
|
||||
|
||||
fn new(custom_properties: Option<Arc<::custom_properties::ComputedValuesMap>>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue