mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -05:00
fix(ext/console): ignore casing for named colors in css parsing (#26466)
This commit is contained in:
parent
f26c8bcf31
commit
9696e0b378
2 changed files with 2 additions and 0 deletions
|
@ -2653,6 +2653,7 @@ const HSL_PATTERN = new SafeRegExp(
|
||||||
);
|
);
|
||||||
|
|
||||||
function parseCssColor(colorString) {
|
function parseCssColor(colorString) {
|
||||||
|
colorString = StringPrototypeToLowerCase(colorString);
|
||||||
if (colorKeywords.has(colorString)) {
|
if (colorKeywords.has(colorString)) {
|
||||||
colorString = colorKeywords.get(colorString);
|
colorString = colorKeywords.get(colorString);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1227,6 +1227,7 @@ Deno.test(function consoleParseCssColor() {
|
||||||
assertEquals(parseCssColor("inherit"), null);
|
assertEquals(parseCssColor("inherit"), null);
|
||||||
assertEquals(parseCssColor("black"), [0, 0, 0]);
|
assertEquals(parseCssColor("black"), [0, 0, 0]);
|
||||||
assertEquals(parseCssColor("darkmagenta"), [139, 0, 139]);
|
assertEquals(parseCssColor("darkmagenta"), [139, 0, 139]);
|
||||||
|
assertEquals(parseCssColor("darkMaGenta"), [139, 0, 139]);
|
||||||
assertEquals(parseCssColor("slateblue"), [106, 90, 205]);
|
assertEquals(parseCssColor("slateblue"), [106, 90, 205]);
|
||||||
assertEquals(parseCssColor("#ffaa00"), [255, 170, 0]);
|
assertEquals(parseCssColor("#ffaa00"), [255, 170, 0]);
|
||||||
assertEquals(parseCssColor("#ffAA00"), [255, 170, 0]);
|
assertEquals(parseCssColor("#ffAA00"), [255, 170, 0]);
|
||||||
|
|
Loading…
Reference in a new issue