Skip to content

Commit

Permalink
servo: Merge #19956 - Generate some PropertyDeclaration methods by ha…
Browse files Browse the repository at this point in the history
…nd 🐉🐲 (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
  • Loading branch information
marco-c committed Oct 2, 2019
1 parent 25b6b41 commit 67e317f
Show file tree
Hide file tree
Showing 6 changed files with 2,095 additions and 965 deletions.
10 changes: 10 additions & 0 deletions servo/components/style/properties/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -1263,6 +1263,10 @@
=
None

is_gecko_size_type_hack
=
False

allowed_in_keyframe_block
=
True
Expand Down Expand Up @@ -1621,6 +1625,12 @@
=
vector

self
.
is_gecko_size_type_hack
=
is_gecko_size_type_hack

#
https
:
Expand Down
26 changes: 20 additions & 6 deletions servo/components/style/properties/declaration_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2996,8 +2996,11 @@ PropertyDeclaration
:
CSSWideKeyword
(
WideKeywordDeclaration
{
id
keyword
}
)
;
changed
Expand Down Expand Up @@ -3045,12 +3048,17 @@ PropertyDeclaration
:
WithVariables
(
VariableDeclaration
{
id
value
:
unparsed
.
clone
(
)
}
)
;
changed
Expand Down Expand Up @@ -4325,9 +4333,8 @@ PropertyDeclaration
:
WithVariables
(
id
ref
unparsed
declaration
)
Some
(
Expand All @@ -4338,10 +4345,14 @@ _computed_values
=
>
{
unparsed
declaration
.
value
.
substitute_variables
(
declaration
.
id
custom_properties
.
Expand Down Expand Up @@ -4910,9 +4921,7 @@ PropertyDeclaration
Custom
(
ref
name
ref
value
declaration
)
=
*
Expand All @@ -4922,7 +4931,12 @@ builder
.
cascade
(
&
declaration
.
name
declaration
.
value
.
borrow
Expand Down
13 changes: 10 additions & 3 deletions servo/components/style/properties/helpers.mako.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2230,15 +2230,17 @@ PropertyDeclaration
:
CSSWideKeyword
(
id
value
ref
declaration
)
=
>
{
debug_assert
!
(
declaration
.
id
=
=
Expand All @@ -2257,7 +2259,9 @@ DeclaredValue
:
CSSWideKeyword
(
value
declaration
.
keyword
)
}
PropertyDeclaration
Expand Down Expand Up @@ -6518,6 +6522,9 @@ length_type
logical
=
logical
is_gecko_size_type_hack
=
True
*
*
kwargs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3469,13 +3469,15 @@ PropertyDeclaration
:
CSSWideKeyword
(
id
keyword
ref
declaration
)
=
>
{
match
declaration
.
id
{
/
Expand Down Expand Up @@ -3528,6 +3530,8 @@ let
style_struct
=
match
declaration
.
keyword
{
%
Expand Down Expand Up @@ -3691,9 +3695,8 @@ PropertyDeclaration
:
WithVariables
(
id
ref
unparsed
declaration
)
=
>
Expand Down Expand Up @@ -3722,10 +3725,14 @@ custom_properties
)
)
;
unparsed
declaration
.
value
.
substitute_variables
(
declaration
.
id
custom_properties
context
Expand Down
Loading

0 comments on commit 67e317f

Please sign in to comment.