mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
implements nsStyleTextOverflow type properties animatable
This commit is contained in:
parent
6316b7aeb8
commit
7d1374e019
2 changed files with 21 additions and 1 deletions
|
@ -3923,6 +3923,26 @@ fn static_assert() {
|
||||||
self.gecko.mTextOverflow.mLogicalDirections = other.gecko.mTextOverflow.mLogicalDirections;
|
self.gecko.mTextOverflow.mLogicalDirections = other.gecko.mTextOverflow.mLogicalDirections;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn clone_text_overflow(&self) -> longhands::text_overflow::computed_value::T {
|
||||||
|
use gecko_bindings::structs::nsStyleTextOverflowSide;
|
||||||
|
use properties::longhands::text_overflow::Side;
|
||||||
|
|
||||||
|
fn to_servo(side: &nsStyleTextOverflowSide) -> Side {
|
||||||
|
match side.mType as u32 {
|
||||||
|
structs::NS_STYLE_TEXT_OVERFLOW_CLIP => Side::Clip,
|
||||||
|
structs::NS_STYLE_TEXT_OVERFLOW_ELLIPSIS => Side::Ellipsis,
|
||||||
|
structs::NS_STYLE_TEXT_OVERFLOW_STRING => Side::String(side.mString.to_string().into_boxed_str()),
|
||||||
|
x => panic!("Found unexpected value in style struct for text_overflow property: {:?}", x),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
longhands::text_overflow::computed_value::T {
|
||||||
|
first: to_servo(&self.gecko.mTextOverflow.mLeft),
|
||||||
|
second: to_servo(&self.gecko.mTextOverflow.mRight),
|
||||||
|
sides_are_logical: self.gecko.mTextOverflow.mLogicalDirections
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn set_initial_letter(&mut self, v: longhands::initial_letter::computed_value::T) {
|
pub fn set_initial_letter(&mut self, v: longhands::initial_letter::computed_value::T) {
|
||||||
use values::generics::text::InitialLetter;
|
use values::generics::text::InitialLetter;
|
||||||
match v {
|
match v {
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
Method("has_overline", "bool"),
|
Method("has_overline", "bool"),
|
||||||
Method("has_line_through", "bool")]) %>
|
Method("has_line_through", "bool")]) %>
|
||||||
|
|
||||||
<%helpers:longhand name="text-overflow" animation_value_type="none" boxed="True"
|
<%helpers:longhand name="text-overflow" animation_value_type="discrete" boxed="True"
|
||||||
spec="https://drafts.csswg.org/css-ui/#propdef-text-overflow">
|
spec="https://drafts.csswg.org/css-ui/#propdef-text-overflow">
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use style_traits::ToCss;
|
use style_traits::ToCss;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue