Skip to content

Commit 703c46c

Browse files
pfaffeDevtools-frontend LUCI CQ
authored andcommitted
Fix letting disabled custom properties as override previous declarations
Fixed: 361717753 Change-Id: Ibd724284b6a5461ed136fd3046e955ecb47359e2 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5973212 Auto-Submit: Philip Pfaffe <[email protected]> Reviewed-by: Ergün Erdoğmuş <[email protected]> Commit-Queue: Ergün Erdoğmuş <[email protected]>
1 parent b42b554 commit 703c46c

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

front_end/core/sdk/CSSStyleDeclaration.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,16 @@ describeWithMockConnection('CSSStyleDeclaration', () => {
202202
range: {startLine: 1, startColumn: 4, endLine: 1, endColumn: 20},
203203
text: '--a 10;',
204204
},
205+
{
206+
name: '--b',
207+
value: '10',
208+
disabled: true,
209+
implicit: false,
210+
parsedOk: true,
211+
longhandProperties: [],
212+
range: {startLine: 1, startColumn: 4, endLine: 1, endColumn: 20},
213+
text: '--b: 10;',
214+
},
205215
],
206216
shorthandEntries: [],
207217
cssText: '\n --a: 5px;\n --a: 10\n',

front_end/core/sdk/CSSStyleDeclaration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ export class CSSStyleDeclaration {
192192
const metadata = cssMetadata();
193193
const canonicalName = metadata.canonicalPropertyName(property.name);
194194
if (property.disabled || !property.parsedOk) {
195-
if (property.name.startsWith('--')) {
195+
if (!property.disabled && metadata.isCustomProperty(property.name)) {
196196
// Variable declarations that aren't parsedOk still "overload" other previous active declarations.
197197
activeProperties.get(canonicalName)?.setActive(false);
198198
activeProperties.delete(canonicalName);

0 commit comments

Comments
 (0)