@@ -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