Skip to content

Commit 5878e6b

Browse files
committed
servo: Merge #19956 - Generate some PropertyDeclaration methods by hand 🐉🐲 (from servo:derive-all-the-things); r=emilio
We rely on rust-lang/rfcs#2195 to make some enums share the same discriminants by definition. This fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1428285. Source-Repo: https://github.com/servo/servo Source-Revision: 9faf0cdce50379dfb8125d7a9c913babd56382e2 UltraBlame original commit: 8bd0a2507ccbb5fad4588e43bbca20eead87a2bb
1 parent a2384dd commit 5878e6b

File tree

6 files changed

+2095
-965
lines changed

6 files changed

+2095
-965
lines changed

servo/components/style/properties/data.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1176,6 +1176,10 @@
11761176
=
11771177
None
11781178

1179+
is_gecko_size_type_hack
1180+
=
1181+
False
1182+
11791183
allowed_in_keyframe_block
11801184
=
11811185
True
@@ -1442,6 +1446,12 @@
14421446
=
14431447
vector
14441448

1449+
self
1450+
.
1451+
is_gecko_size_type_hack
1452+
=
1453+
is_gecko_size_type_hack
1454+
14451455
self
14461456
.
14471457
allowed_in_keyframe_block

servo/components/style/properties/declaration_block.rs

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2093,8 +2093,11 @@ PropertyDeclaration
20932093
:
20942094
CSSWideKeyword
20952095
(
2096+
WideKeywordDeclaration
2097+
{
20962098
id
20972099
keyword
2100+
}
20982101
)
20992102
;
21002103
changed
@@ -2142,12 +2145,17 @@ PropertyDeclaration
21422145
:
21432146
WithVariables
21442147
(
2148+
VariableDeclaration
2149+
{
21452150
id
2151+
value
2152+
:
21462153
unparsed
21472154
.
21482155
clone
21492156
(
21502157
)
2158+
}
21512159
)
21522160
;
21532161
changed
@@ -2983,9 +2991,8 @@ PropertyDeclaration
29832991
:
29842992
WithVariables
29852993
(
2986-
id
29872994
ref
2988-
unparsed
2995+
declaration
29892996
)
29902997
Some
29912998
(
@@ -2996,10 +3003,14 @@ _computed_values
29963003
=
29973004
>
29983005
{
2999-
unparsed
3006+
declaration
3007+
.
3008+
value
30003009
.
30013010
substitute_variables
30023011
(
3012+
declaration
3013+
.
30033014
id
30043015
custom_properties
30053016
.
@@ -3473,9 +3484,7 @@ PropertyDeclaration
34733484
Custom
34743485
(
34753486
ref
3476-
name
3477-
ref
3478-
value
3487+
declaration
34793488
)
34803489
=
34813490
*
@@ -3485,7 +3494,12 @@ builder
34853494
.
34863495
cascade
34873496
(
3497+
&
3498+
declaration
3499+
.
34883500
name
3501+
declaration
3502+
.
34893503
value
34903504
.
34913505
borrow

servo/components/style/properties/helpers.mako.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2172,15 +2172,17 @@ PropertyDeclaration
21722172
:
21732173
CSSWideKeyword
21742174
(
2175-
id
2176-
value
2175+
ref
2176+
declaration
21772177
)
21782178
=
21792179
>
21802180
{
21812181
debug_assert
21822182
!
21832183
(
2184+
declaration
2185+
.
21842186
id
21852187
=
21862188
=
@@ -2199,7 +2201,9 @@ DeclaredValue
21992201
:
22002202
CSSWideKeyword
22012203
(
2202-
value
2204+
declaration
2205+
.
2206+
keyword
22032207
)
22042208
}
22052209
PropertyDeclaration
@@ -6460,6 +6464,9 @@ length_type
64606464
logical
64616465
=
64626466
logical
6467+
is_gecko_size_type_hack
6468+
=
6469+
True
64636470
*
64646471
*
64656472
kwargs

servo/components/style/properties/helpers/animated_properties.mako.rs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3411,13 +3411,15 @@ PropertyDeclaration
34113411
:
34123412
CSSWideKeyword
34133413
(
3414-
id
3415-
keyword
3414+
ref
3415+
declaration
34163416
)
34173417
=
34183418
>
34193419
{
34203420
match
3421+
declaration
3422+
.
34213423
id
34223424
{
34233425
/
@@ -3470,6 +3472,8 @@ let
34703472
style_struct
34713473
=
34723474
match
3475+
declaration
3476+
.
34733477
keyword
34743478
{
34753479
%
@@ -3633,9 +3637,8 @@ PropertyDeclaration
36333637
:
36343638
WithVariables
36353639
(
3636-
id
36373640
ref
3638-
unparsed
3641+
declaration
36393642
)
36403643
=
36413644
>
@@ -3664,10 +3667,14 @@ custom_properties
36643667
)
36653668
)
36663669
;
3667-
unparsed
3670+
declaration
3671+
.
3672+
value
36683673
.
36693674
substitute_variables
36703675
(
3676+
declaration
3677+
.
36713678
id
36723679
custom_properties
36733680
context

0 commit comments

Comments
 (0)