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 a2384dd commit 5878e6b
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 @@ -1176,6 +1176,10 @@
=
None

is_gecko_size_type_hack
=
False

allowed_in_keyframe_block
=
True
Expand Down Expand Up @@ -1442,6 +1446,12 @@
=
vector

self
.
is_gecko_size_type_hack
=
is_gecko_size_type_hack

self
.
allowed_in_keyframe_block
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 @@ -2093,8 +2093,11 @@ PropertyDeclaration
:
CSSWideKeyword
(
WideKeywordDeclaration
{
id
keyword
}
)
;
changed
Expand Down Expand Up @@ -2142,12 +2145,17 @@ PropertyDeclaration
:
WithVariables
(
VariableDeclaration
{
id
value
:
unparsed
.
clone
(
)
}
)
;
changed
Expand Down Expand Up @@ -2983,9 +2991,8 @@ PropertyDeclaration
:
WithVariables
(
id
ref
unparsed
declaration
)
Some
(
Expand All @@ -2996,10 +3003,14 @@ _computed_values
=
>
{
unparsed
declaration
.
value
.
substitute_variables
(
declaration
.
id
custom_properties
.
Expand Down Expand Up @@ -3473,9 +3484,7 @@ PropertyDeclaration
Custom
(
ref
name
ref
value
declaration
)
=
*
Expand All @@ -3485,7 +3494,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 @@ -2172,15 +2172,17 @@ PropertyDeclaration
:
CSSWideKeyword
(
id
value
ref
declaration
)
=
>
{
debug_assert
!
(
declaration
.
id
=
=
Expand All @@ -2199,7 +2201,9 @@ DeclaredValue
:
CSSWideKeyword
(
value
declaration
.
keyword
)
}
PropertyDeclaration
Expand Down Expand Up @@ -6460,6 +6464,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 @@ -3411,13 +3411,15 @@ PropertyDeclaration
:
CSSWideKeyword
(
id
keyword
ref
declaration
)
=
>
{
match
declaration
.
id
{
/
Expand Down Expand Up @@ -3470,6 +3472,8 @@ let
style_struct
=
match
declaration
.
keyword
{
%
Expand Down Expand Up @@ -3633,9 +3637,8 @@ PropertyDeclaration
:
WithVariables
(
id
ref
unparsed
declaration
)
=
>
Expand Down Expand Up @@ -3664,10 +3667,14 @@ custom_properties
)
)
;
unparsed
declaration
.
value
.
substitute_variables
(
declaration
.
id
custom_properties
context
Expand Down
Loading

0 comments on commit 5878e6b

Please sign in to comment.