Skip to content

Commit 67e317f

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 25b6b41 commit 67e317f

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
@@ -1263,6 +1263,10 @@
12631263
=
12641264
None
12651265

1266+
is_gecko_size_type_hack
1267+
=
1268+
False
1269+
12661270
allowed_in_keyframe_block
12671271
=
12681272
True
@@ -1621,6 +1625,12 @@
16211625
=
16221626
vector
16231627

1628+
self
1629+
.
1630+
is_gecko_size_type_hack
1631+
=
1632+
is_gecko_size_type_hack
1633+
16241634
#
16251635
https
16261636
:

servo/components/style/properties/declaration_block.rs

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2996,8 +2996,11 @@ PropertyDeclaration
29962996
:
29972997
CSSWideKeyword
29982998
(
2999+
WideKeywordDeclaration
3000+
{
29993001
id
30003002
keyword
3003+
}
30013004
)
30023005
;
30033006
changed
@@ -3045,12 +3048,17 @@ PropertyDeclaration
30453048
:
30463049
WithVariables
30473050
(
3051+
VariableDeclaration
3052+
{
30483053
id
3054+
value
3055+
:
30493056
unparsed
30503057
.
30513058
clone
30523059
(
30533060
)
3061+
}
30543062
)
30553063
;
30563064
changed
@@ -4325,9 +4333,8 @@ PropertyDeclaration
43254333
:
43264334
WithVariables
43274335
(
4328-
id
43294336
ref
4330-
unparsed
4337+
declaration
43314338
)
43324339
Some
43334340
(
@@ -4338,10 +4345,14 @@ _computed_values
43384345
=
43394346
>
43404347
{
4341-
unparsed
4348+
declaration
4349+
.
4350+
value
43424351
.
43434352
substitute_variables
43444353
(
4354+
declaration
4355+
.
43454356
id
43464357
custom_properties
43474358
.
@@ -4910,9 +4921,7 @@ PropertyDeclaration
49104921
Custom
49114922
(
49124923
ref
4913-
name
4914-
ref
4915-
value
4924+
declaration
49164925
)
49174926
=
49184927
*
@@ -4922,7 +4931,12 @@ builder
49224931
.
49234932
cascade
49244933
(
4934+
&
4935+
declaration
4936+
.
49254937
name
4938+
declaration
4939+
.
49264940
value
49274941
.
49284942
borrow

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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2230,15 +2230,17 @@ PropertyDeclaration
22302230
:
22312231
CSSWideKeyword
22322232
(
2233-
id
2234-
value
2233+
ref
2234+
declaration
22352235
)
22362236
=
22372237
>
22382238
{
22392239
debug_assert
22402240
!
22412241
(
2242+
declaration
2243+
.
22422244
id
22432245
=
22442246
=
@@ -2257,7 +2259,9 @@ DeclaredValue
22572259
:
22582260
CSSWideKeyword
22592261
(
2260-
value
2262+
declaration
2263+
.
2264+
keyword
22612265
)
22622266
}
22632267
PropertyDeclaration
@@ -6518,6 +6522,9 @@ length_type
65186522
logical
65196523
=
65206524
logical
6525+
is_gecko_size_type_hack
6526+
=
6527+
True
65216528
*
65226529
*
65236530
kwargs

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

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3469,13 +3469,15 @@ PropertyDeclaration
34693469
:
34703470
CSSWideKeyword
34713471
(
3472-
id
3473-
keyword
3472+
ref
3473+
declaration
34743474
)
34753475
=
34763476
>
34773477
{
34783478
match
3479+
declaration
3480+
.
34793481
id
34803482
{
34813483
/
@@ -3528,6 +3530,8 @@ let
35283530
style_struct
35293531
=
35303532
match
3533+
declaration
3534+
.
35313535
keyword
35323536
{
35333537
%
@@ -3691,9 +3695,8 @@ PropertyDeclaration
36913695
:
36923696
WithVariables
36933697
(
3694-
id
36953698
ref
3696-
unparsed
3699+
declaration
36973700
)
36983701
=
36993702
>
@@ -3722,10 +3725,14 @@ custom_properties
37223725
)
37233726
)
37243727
;
3725-
unparsed
3728+
declaration
3729+
.
3730+
value
37263731
.
37273732
substitute_variables
37283733
(
3734+
declaration
3735+
.
37293736
id
37303737
custom_properties
37313738
context

0 commit comments

Comments
 (0)