Commit 6fc1a67b authored by Tim van der Lippe's avatar Tim van der Lippe Committed by Commit Bot

Fix autocompletion for camelCased CSS variables

We were force-lowercasing CSS variables, which breaks if you type "var("
and then inspect the autocompletion of DevTools where it would
autocomplete to "--camelcased" instead of "--camelCased".

Bug: 911303
Change-Id: I48b74953fef34e545f020d186ba279023667ce68
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1781427Reviewed-by: default avatarErik Luo <luoe@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@google.com>
Cr-Commit-Position: refs/heads/master@{#696898}
parent 1a4c34c5
...@@ -198,6 +198,8 @@ SDK.CSSMetadata = class { ...@@ -198,6 +198,8 @@ SDK.CSSMetadata = class {
* @return {string} * @return {string}
*/ */
canonicalPropertyName(name) { canonicalPropertyName(name) {
if (this.isCustomProperty(name))
return name;
name = name.toLowerCase(); name = name.toLowerCase();
if (!name || name.length < 9 || name.charAt(0) !== '-') if (!name || name.length < 9 || name.charAt(0) !== '-')
return name; return name;
......
...@@ -5,11 +5,13 @@ element.style ...@@ -5,11 +5,13 @@ element.style
--another-div-variable --another-div-variable
--div-variable --div-variable
--span-variable --span-variable
--camelCased
span span
--body-variable --body-variable
--another-div-variable --another-div-variable
--div-variable --div-variable
--span-variable --span-variable
--camelCased
.myelement .myelement
--body-variable --body-variable
--another-div-variable --another-div-variable
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
span { span {
--span-variable: green; --span-variable: green;
--camelCased: blue;
} }
</style> </style>
<body> <body>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment