File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -76,10 +76,14 @@ public static function parse(ParserState $oParserState, bool $bIgnoreCase = fals
76
76
// So, attempt to parse with the `a`, and allow for it not being there.
77
77
switch ($ sColorMode ) {
78
78
case 'rgb ' :
79
+ $ colorModeForParsing = 'rgba ' ;
80
+ $ mayHaveOptionalAlpha = true ;
81
+ break ;
79
82
case 'hsl ' :
80
- $ colorModeForParsing = $ sColorMode . ' a ' ;
83
+ $ colorModeForParsing = ' hsla ' ;
81
84
$ mayHaveOptionalAlpha = true ;
82
85
break ;
86
+ // These two cases are handled identically.
83
87
case 'rgba ' :
84
88
case 'hsla ' :
85
89
$ colorModeForParsing = $ sColorMode ;
@@ -88,7 +92,6 @@ public static function parse(ParserState $oParserState, bool $bIgnoreCase = fals
88
92
default :
89
93
$ colorModeForParsing = $ sColorMode ;
90
94
$ mayHaveOptionalAlpha = false ;
91
- break ;
92
95
}
93
96
94
97
$ bContainsVar = false ;
@@ -105,7 +108,7 @@ public static function parse(ParserState $oParserState, bool $bIgnoreCase = fals
105
108
// This must be done first, to consume comments as well, so that the `comes` test will work.
106
109
$ oParserState ->consumeWhiteSpace ();
107
110
108
- // With a var argument, the function can have fewer arguments.
111
+ // With a ` var` argument, the function can have fewer arguments.
109
112
// And as of CSS Color Module Level 4, the alpha argument is optional.
110
113
$ canCloseNow =
111
114
$ bContainsVar ||
You can’t perform that action at this time.
0 commit comments