Skip to content

Commit

Permalink
Bug 1352643 - Implement multi-position gradient color-stops syntax. r…
Browse files Browse the repository at this point in the history
…=emilio

This commit adds the multi-position gradient color-stops syntax.

GradientItem::parse_comma_separated is extended to attempt to parse
a LengthOrPercent after each color stop. If it succeeds, it appends
an additional color stop with a duplicate color and the specified
position.

This change is only to the parsing, serialization is left unchanged
as per [1].

[1] w3c/csswg-drafts#2714

Differential Revision: https://phabricator.services.mozilla.com/D7380

UltraBlame original commit: 984902ba6faf1864c04fef525f6764983439ce1b
  • Loading branch information
marco-c committed Oct 3, 2019
1 parent d7ec042 commit 603b51c
Show file tree
Hide file tree
Showing 9 changed files with 941 additions and 554 deletions.
290 changes: 290 additions & 0 deletions layout/style/test/property_database.js
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,86 @@ linear
-
gradient
(
red
0
%
100
%
)
"
"
linear
-
gradient
(
red
0
%
50
%
blue
50
%
)
"
"
linear
-
gradient
(
red
0
%
50
%
blue
50
%
100
%
)
"
"
linear
-
gradient
(
red
0
%
50
%
0
%
blue
50
%
)
"
"
linear
-
gradient
(
red
0
%
50
%
0
%
blue
50
%
100
%
)
"
"
linear
-
gradient
(
0
red
blue
Expand Down Expand Up @@ -1248,6 +1328,86 @@ blue
)
"
"
radial
-
gradient
(
red
0
%
100
%
)
"
"
radial
-
gradient
(
red
0
%
50
%
blue
50
%
)
"
"
radial
-
gradient
(
red
0
%
50
%
blue
50
%
100
%
)
"
"
radial
-
gradient
(
red
0
%
50
%
0
%
blue
50
%
)
"
"
radial
-
gradient
(
red
0
%
50
%
0
%
blue
50
%
100
%
)
"
"
repeating
-
radial
Expand Down Expand Up @@ -2942,6 +3102,136 @@ red
blue
)
"
"
linear
-
gradient
(
red
0
%
50
%
100
%
)
"
"
linear
-
gradient
(
red
0
%
50
%
75
%
blue
75
%
)
"
"
linear
-
gradient
(
to
bottom
red
0
%
50
%
100
%
)
"
"
linear
-
gradient
(
to
bottom
red
0
%
50
%
75
%
blue
75
%
)
"
"
radial
-
gradient
(
red
0
%
50
%
100
%
)
"
"
radial
-
gradient
(
red
0
%
50
%
75
%
blue
75
%
)
"
"
radial
-
gradient
(
center
red
0
%
50
%
100
%
)
"
"
radial
-
gradient
(
center
red
0
%
50
%
75
%
blue
75
%
)
"
]
;
var
Expand Down
Loading

0 comments on commit 603b51c

Please sign in to comment.