-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement multi-position gradient color-stops syntax.
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 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1352643 gecko-commit: 984902ba6faf1864c04fef525f6764983439ce1b gecko-integration-branch: central gecko-reviewers: emilio
- Loading branch information
1 parent
a49e763
commit 6eeafdf
Showing
4 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
css/css-images/multiple-position-color-stop-linear-2-ref.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<!doctype html> | ||
<meta charset=utf-8> | ||
<body> | ||
<div style="background: linear-gradient(to bottom, red 0%, red 25%, blue 25%, blue 75%, red 75%, red 100%); width: 100px; height: 100px;"><br></div> | ||
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<!doctype html> | ||
<meta charset=utf-8> | ||
<title>Linear gradient with a two position color stops</title> | ||
<link rel="help" href="https://drafts.csswg.org/css-images-4/#color-stop-syntax"> | ||
<meta name="assert" content="Color stops with two positions are equivalent to two color stops with the same color"> | ||
<link rel=match href=/css/css-images/multiple-position-color-stop-linear-2-ref.html> | ||
<body> | ||
<div style="background: linear-gradient(to bottom, red 0% 25%, blue 25% 75%, red 75% 100%); width: 100px; height: 100px;"><br></div> | ||
</body> |
5 changes: 5 additions & 0 deletions
5
css/css-images/multiple-position-color-stop-radial-2-ref.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<!doctype html> | ||
<meta charset=utf-8> | ||
<body> | ||
<div style="background: radial-gradient(center, red 0%, red 25%, blue 25%, blue 75%, red 75%, red 100%); width: 100px; height: 100px;"><br></div> | ||
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<!doctype html> | ||
<meta charset=utf-8> | ||
<title>Radial gradient with a two position color stops</title> | ||
<link rel="help" href="https://drafts.csswg.org/css-images-4/#color-stop-syntax"> | ||
<meta name="assert" content="Color stops with two positions are equivalent to two color stops with the same color"> | ||
<link rel=match href=/css/css-images/multiple-position-color-stop-radial-2-ref.html> | ||
<body> | ||
<div style="background: radial-gradient(center, red 0% 25%, blue 25% 75%, red 75% 100%); width: 100px; height: 100px;"><br></div> | ||
</body> |