Skip to content

Commit cb461f6

Browse files
enable text-overflow: ellipsis & string for servo
Signed-off-by: Richard Tjokroutomo <[email protected]>
1 parent ef113b1 commit cb461f6

File tree

1 file changed

+24
-18
lines changed

1 file changed

+24
-18
lines changed

style/values/specified/text.rs

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -227,24 +227,30 @@ impl Parse for TextOverflow {
227227
context: &ParserContext,
228228
input: &mut Parser<'i, 't>,
229229
) -> Result<TextOverflow, ParseError<'i>> {
230-
let first = TextOverflowSide::parse(context, input)?;
231-
#[cfg(feature = "servo")]
232-
if matches!(first, TextOverflowSide::String(_)) {
233-
return Err(input.new_custom_error(StyleParseErrorKind::UnspecifiedError));
234-
}
235-
#[cfg(feature = "gecko")]
236-
if let Ok(second) = input.try_parse(|input| TextOverflowSide::parse(context, input)) {
237-
return Ok(Self {
238-
first,
239-
second,
240-
sides_are_logical: false,
241-
});
242-
}
243-
Ok(Self {
244-
first: TextOverflowSide::Clip,
245-
second: first,
246-
sides_are_logical: true,
247-
})
230+
let first = <TextOverflowSide as Parse>::parse(context, input)?;
231+
Ok(
232+
if let Ok(second) = input.try_parse(|input| <TextOverflowSide as Parse>::parse(context, input)) {
233+
if cfg!(feature = "servo") {
234+
Self {
235+
first: TextOverflowSide::Clip,
236+
second: first,
237+
sides_are_logical: true,
238+
}
239+
} else {
240+
Self {
241+
first,
242+
second,
243+
sides_are_logical: false,
244+
}
245+
}
246+
} else {
247+
Self {
248+
first: TextOverflowSide::Clip,
249+
second: first,
250+
sides_are_logical: true,
251+
}
252+
},
253+
)
248254
}
249255
}
250256

0 commit comments

Comments
 (0)