Skip to content

Commit 93ebef8

Browse files
pfaffeDevtools-frontend LUCI CQ
authored and
Devtools-frontend LUCI CQ
committed
Fix regression in rendering css keywords
Bug: 409325196 Change-Id: I1a51b5ed045b5a334a6407b693709c3cd12af67a Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6439041 Reviewed-by: Benedikt Meurer <bmeurer@chromium.org> Auto-Submit: Philip Pfaffe <pfaffe@chromium.org> Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
1 parent a1dabaf commit 93ebef8

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

front_end/panels/elements/StylePropertyTreeElement.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1587,9 +1587,12 @@ describeWithMockConnection('StylePropertyTreeElement', () => {
15871587
const originalDeclaration = mockResolvedKeyword('width', keyword);
15881588
const stylePropertyTreeElement = getTreeElement(originalDeclaration.name, keyword);
15891589
stylePropertyTreeElement.updateTitle();
1590+
assert.exists(stylePropertyTreeElement.valueElement);
1591+
renderElementIntoDOM(stylePropertyTreeElement.valueElement);
15901592

1591-
const linkSwatch = stylePropertyTreeElement.valueElement?.querySelector('devtools-link-swatch');
1593+
const linkSwatch = stylePropertyTreeElement.valueElement.querySelector('devtools-link-swatch');
15921594
assert.isOk(linkSwatch);
1595+
assert.strictEqual(linkSwatch.innerText, keyword);
15931596
const spy = sinon.spy(stylePropertyTreeElement.parentPane(), 'revealProperty');
15941597
(linkSwatch.querySelector('button') as HTMLElement | undefined)?.click();
15951598
assert.isTrue(spy.calledOnceWithExactly(originalDeclaration));

front_end/panels/elements/StylePropertyTreeElement.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,6 @@ export class CSSWideKeywordRenderer extends rendererBase(SDK.CSSPropertyParserMa
212212
}
213213

214214
const swatch = new InlineEditor.LinkSwatch.LinkSwatch();
215-
UI.UIUtils.createTextChild(swatch, match.text);
216215
swatch.data = {
217216
text: match.text,
218217
tooltip: resolvedProperty ? undefined : {title: i18nString(UIStrings.sIsNotDefined, {PH1: match.text})},

0 commit comments

Comments
 (0)