Skip to content

Commit 5c4f381

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

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+
#[cfg(feature = "gecko")]
233+
if let Ok(second) = input.try_parse(|input| <TextOverflowSide as Parse>::parse(context, input)) {
234+
Self {
235+
first,
236+
second,
237+
sides_are_logical: false,
238+
}
239+
} else {
240+
Self {
241+
first: TextOverflowSide::Clip,
242+
second: first,
243+
sides_are_logical: true,
244+
}
245+
},
246+
247+
#[cfg(feature = "servo")]
248+
Self {
249+
first: TextOverflowSide::Clip,
250+
second: first,
251+
sides_are_logical: true,
252+
}
253+
)
248254
}
249255
}
250256

0 commit comments

Comments
 (0)