author | Xidorn Quan <me@upsuper.org> |
Tue, 06 Jun 2017 14:48:33 +1000 | |
changeset 590834 | 40cc6d9bc0986e22480305357a66050b08bb1b78 |
parent 590833 | 9ca789cf4af9b0c34e8df6da2fb9184198a71d30 |
child 632316 | 9f37a90f13196a9fbc491e8397447436179db993 |
push id | 62840 |
push user | xquan@mozilla.com |
push date | Thu, 08 Jun 2017 04:58:43 +0000 |
reviewers | heycam |
bugs | 1345709 |
milestone | 55.0a1 |
layout/style/nsCSSParser.cpp | file | annotate | diff | comparison | revisions | |
layout/style/test/chrome/test_author_specified_style.html | file | annotate | diff | comparison | revisions |
--- a/layout/style/nsCSSParser.cpp +++ b/layout/style/nsCSSParser.cpp @@ -6756,16 +6756,19 @@ CSSParserImpl::ParseColor(nsCSSValue& aV } aValue.SetIntegerColorValue(rgba, unit); return CSSParseResult::Ok; } break; case eCSSToken_Ident: { if (NS_ColorNameToRGB(tk->mIdent, &rgba)) { + // Lowercase color name, since keyword values should be + // serialized in lowercase. + nsContentUtils::ASCIIToLower(tk->mIdent); aValue.SetStringValue(tk->mIdent, eCSSUnit_Ident); return CSSParseResult::Ok; } nsCSSKeyword keyword = nsCSSKeywords::LookupKeyword(tk->mIdent); if (Maybe<int32_t> value = GetEnumColorValue(keyword, mIsChrome)) { aValue.SetIntValue(value.value(), eCSSUnit_EnumColor); return CSSParseResult::Ok; }
--- a/layout/style/test/chrome/test_author_specified_style.html +++ b/layout/style/test/chrome/test_author_specified_style.html @@ -5,17 +5,17 @@ <script> var values = [ // specified value // returned from getAuthoredPropertyValue() "#12F", "#12f", "#1122FF", "#1122ff", "rgb(10,20,30)", "rgb(10, 20, 30)", "Rgb(300,20,30)", "rgb(255, 20, 30)", "rgba(10,20,30,0.250)", "rgba(10, 20, 30, 0.25)", - "OrangeRed", "OrangeRed", + "OrangeRed", "orangered", "rgb(10%,25%,99%)", "rgb(10%, 25%, 99%)", "rgb(6.66667%,0%,0.0%)", "rgb(6.66667%, 0%, 0%)", "HSL(0,25%,75%)", "hsl(0, 25%, 75%)", "hsl(60,0%,0%)", "hsl(60, 0%, 0%)", "hsla(60,50%,50%,0.1250)", "hsla(60, 50%, 50%, 0.125)", "rgba(0,0,0,0)", "rgba(0, 0, 0, 0)", "rgba(50,50,50,1)", "rgb(50, 50, 50)", "rgba(50%,50%,50%,1)", "rgb(50%, 50%, 50%)",