@@ -1227,56 +1227,23 @@ impl Clone for ${style_struct.gecko_struct_name} {
1227
1227
1228
1228
# Types used with predefined_type ( ) -defined properties that we can auto-generate.
1229
1229
predefined_types = {
1230
- "Appearance" : impl_simple,
1231
- "OverscrollBehavior" : impl_simple,
1232
- "OverflowClipBox" : impl_simple,
1233
- "ScrollSnapAlign" : impl_simple,
1234
- "ScrollSnapType" : impl_simple,
1235
- "Float" : impl_simple,
1236
- "Overflow" : impl_simple,
1237
- "BreakBetween" : impl_simple,
1238
- "BreakWithin" : impl_simple,
1239
- "Resize" : impl_simple,
1240
1230
"Color" : impl_color,
1241
1231
"ColorOrAuto" : impl_color,
1242
- "GreaterThanOrEqualToOneNumber" : impl_simple,
1243
- "Integer" : impl_simple,
1244
1232
"length::LengthOrAuto" : impl_style_coord,
1245
1233
"length::LengthOrNormal" : impl_style_coord,
1246
1234
"length::NonNegativeLengthOrAuto" : impl_style_coord,
1247
1235
"length::NonNegativeLengthPercentageOrNormal" : impl_style_coord,
1248
- "FillRule" : impl_simple,
1249
- "FlexBasis" : impl_simple,
1250
1236
"Length" : impl_absolute_length,
1251
1237
"LengthOrNormal" : impl_style_coord,
1252
- "LengthPercentage" : impl_simple,
1253
1238
"LengthPercentageOrAuto" : impl_style_coord,
1254
- "MaxSize" : impl_simple,
1255
- "Size" : impl_simple,
1256
1239
"MozScriptMinSize" : impl_absolute_length,
1257
- "MozScriptSizeMultiplier" : impl_simple,
1258
- "NonNegativeLengthPercentage" : impl_simple,
1259
- "NonNegativeLengthOrNumber" : impl_simple,
1260
- "NonNegativeLengthOrNumberRect" : impl_simple,
1261
- "BorderImageSlice" : impl_simple,
1262
- "NonNegativeNumber" : impl_simple,
1263
- "Number" : impl_simple,
1264
- "Opacity" : impl_simple,
1265
- "OverflowWrap" : impl_simple,
1266
- "OverflowAnchor" : impl_simple,
1267
- "Perspective" : impl_simple,
1268
- "Position" : impl_simple,
1269
1240
"RGBAColor" : impl_rgba_color,
1270
1241
"SVGLength" : impl_svg_length,
1271
1242
"SVGOpacity" : impl_svg_opacity,
1272
1243
"SVGPaint" : impl_svg_paint,
1273
1244
"SVGWidth" : impl_svg_length,
1274
1245
"Transform" : impl_transform,
1275
- "TransformOrigin" : impl_simple,
1276
- "UserSelect" : impl_simple,
1277
1246
"url::UrlOrNone" : impl_css_url,
1278
- "WordBreak" : impl_simple,
1279
- "ZIndex" : impl_simple,
1280
1247
}
1281
1248
1282
1249
def longhand_method( longhand) :
@@ -1291,15 +1258,12 @@ impl Clone for ${style_struct.gecko_struct_name} {
1291
1258
args. update ( keyword=longhand. keyword )
1292
1259
if "font" in longhand. ident:
1293
1260
args . update ( cast_type=longhand. cast_type )
1294
- else :
1261
+ elif longhand . predefined_type in predefined_types :
1295
1262
method = predefined_types[ longhand. predefined_type ]
1263
+ else :
1264
+ method = impl_simple
1296
1265
1297
1266
method( * * args)
1298
-
1299
- picked_longhands = [ ]
1300
- for x in longhands:
1301
- if x. keyword or x. predefined_type in predefined_types or x . logical:
1302
- picked_longhands . append ( x)
1303
1267
%>
1304
1268
impl ${ style_struct. gecko_struct_name } {
1305
1269
/*
@@ -1311,7 +1275,7 @@ impl ${style_struct.gecko_struct_name} {
1311
1275
* Auto-Generated Methods.
1312
1276
*/
1313
1277
<%
1314
- for longhand in picked_longhands :
1278
+ for longhand in longhands :
1315
1279
longhand_method ( longhand )
1316
1280
%>
1317
1281
}
@@ -1992,6 +1956,7 @@ fn static_assert() {
1992
1956
1993
1957
<%
1994
1958
skip_font_longhands = "" "font-family font-size font-size-adjust font-weight
1959
+ font-style font-stretch -moz-script-level
1995
1960
font-synthesis -x-lang font-variant-alternates
1996
1961
font-variant-east-asian font-variant-ligatures
1997
1962
font-variant-numeric font-language-override
@@ -2783,6 +2748,7 @@ fn static_assert() {
2783
2748
animation-iteration-count animation-timing-function
2784
2749
clear transition-duration transition-delay
2785
2750
transition-timing-function transition-property
2751
+ transform-style
2786
2752
rotate scroll-snap-points-x scroll-snap-points-y
2787
2753
scroll-snap-coordinate -moz-binding will-change
2788
2754
offset-path shape-outside contain touch-action
@@ -4158,7 +4124,7 @@ fn static_assert() {
4158
4124
4159
4125
4160
4126
<%self : impl_trait style_struct_name="InheritedText"
4161
- skip_longhands="text-align text-emphasis-style text-shadow line-height letter-spacing word-spacing
4127
+ skip_longhands="text-align text-emphasis-style text-shadow
4162
4128
-webkit-text-stroke-width text-emphasis-position" >
4163
4129
4164
4130
<% text_align_keyword = Keyword ( "text-align" ,
@@ -4190,78 +4156,6 @@ fn static_assert() {
4190
4156
longhands:: text_shadow:: computed_value:: List ( buf)
4191
4157
}
4192
4158
4193
- pub fn set_line_height( & mut self , v: longhands:: line_height:: computed_value:: T ) {
4194
- use crate :: values:: generics:: text:: LineHeight ;
4195
- // FIXME: Align binary representations and ditch |match| for cast + static_asserts
4196
- let en = match v {
4197
- LineHeight :: Normal => CoordDataValue :: Normal ,
4198
- LineHeight :: Length ( val) => CoordDataValue :: Coord ( val. 0 . to_i32_au( ) ) ,
4199
- LineHeight :: Number ( val) => CoordDataValue :: Factor ( val. 0 ) ,
4200
- LineHeight :: MozBlockHeight =>
4201
- CoordDataValue :: Enumerated ( structs:: NS_STYLE_LINE_HEIGHT_BLOCK_HEIGHT ) ,
4202
- } ;
4203
- self . gecko. mLineHeight. set_value( en) ;
4204
- }
4205
-
4206
- pub fn clone_line_height( & self ) -> longhands:: line_height:: computed_value:: T {
4207
- use crate :: values:: generics:: text:: LineHeight ;
4208
- return match self . gecko. mLineHeight. as_value( ) {
4209
- CoordDataValue :: Normal => LineHeight :: Normal ,
4210
- CoordDataValue :: Coord ( coord) => LineHeight :: Length ( Au ( coord) . into( ) ) ,
4211
- CoordDataValue :: Factor ( n) => LineHeight :: Number ( n. into( ) ) ,
4212
- CoordDataValue :: Enumerated ( val) if val == structs:: NS_STYLE_LINE_HEIGHT_BLOCK_HEIGHT =>
4213
- LineHeight :: MozBlockHeight ,
4214
- _ => panic!( "this should not happen" ) ,
4215
- }
4216
- }
4217
-
4218
- <%call expr="impl_coord_copy('line_height', 'mLineHeight')" ></%call>
4219
-
4220
- pub fn set_letter_spacing( & mut self , v: longhands:: letter_spacing:: computed_value:: T ) {
4221
- use crate :: values:: generics:: text:: Spacing ;
4222
- match v {
4223
- Spacing :: Value ( value) => self . gecko. mLetterSpacing. set( value) ,
4224
- Spacing :: Normal => self . gecko. mLetterSpacing. set_value( CoordDataValue :: Normal )
4225
- }
4226
- }
4227
-
4228
- pub fn clone_letter_spacing( & self ) -> longhands:: letter_spacing:: computed_value:: T {
4229
- use crate :: values:: computed:: Length ;
4230
- use crate :: values:: generics:: text:: Spacing ;
4231
- debug_assert!(
4232
- matches!( self . gecko. mLetterSpacing. as_value( ) ,
4233
- CoordDataValue :: Normal |
4234
- CoordDataValue :: Coord ( _) ) ,
4235
- "Unexpected computed value for letter-spacing" ) ;
4236
- Length :: from_gecko_style_coord( & self . gecko. mLetterSpacing) . map_or( Spacing :: Normal , Spacing :: Value )
4237
- }
4238
-
4239
- <%call expr="impl_coord_copy('letter_spacing', 'mLetterSpacing')" ></%call>
4240
-
4241
- pub fn set_word_spacing( & mut self , v: longhands:: word_spacing:: computed_value:: T ) {
4242
- use crate :: values:: generics:: text:: Spacing ;
4243
- match v {
4244
- Spacing :: Value ( lp) => self . gecko. mWordSpacing. set( lp) ,
4245
- // https://drafts.csswg.org/css-text-3/#valdef-word-spacing-normal
4246
- Spacing :: Normal => self . gecko. mWordSpacing. set_value( CoordDataValue :: Coord ( 0 ) ) ,
4247
- }
4248
- }
4249
-
4250
- pub fn clone_word_spacing( & self ) -> longhands:: word_spacing:: computed_value:: T {
4251
- use crate :: values:: computed:: LengthPercentage ;
4252
- use crate :: values:: generics:: text:: Spacing ;
4253
- debug_assert!(
4254
- matches!( self . gecko. mWordSpacing. as_value( ) ,
4255
- CoordDataValue :: Normal |
4256
- CoordDataValue :: Coord ( _) |
4257
- CoordDataValue :: Percent ( _) |
4258
- CoordDataValue :: Calc ( _) ) ,
4259
- "Unexpected computed value for word-spacing" ) ;
4260
- LengthPercentage :: from_gecko_style_coord( & self . gecko. mWordSpacing) . map_or( Spacing :: Normal , Spacing :: Value )
4261
- }
4262
-
4263
- <%call expr="impl_coord_copy('word_spacing', 'mWordSpacing')" ></%call>
4264
-
4265
4159
fn clear_text_emphasis_style_if_string( & mut self ) {
4266
4160
if self . gecko. mTextEmphasisStyle == structs:: NS_STYLE_TEXT_EMPHASIS_STYLE_STRING as u8 {
4267
4161
self . gecko. mTextEmphasisStyleString. truncate( ) ;
0 commit comments