Bug 241558

Summary: REGRESSION (r251194): Web Inspector: Uncaught exception when inspecting color referenced by CSS variable
Product: WebKit Reporter: Razvan Caliman <rcaliman>
Component: Web InspectorAssignee: Razvan Caliman <rcaliman>
Status: RESOLVED FIXED    
Severity: Normal CC: inspector-bugzilla-changes, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Test case none

Description Razvan Caliman 2022-06-13 10:55:47 PDT
Created attachment 460208 [details]
Test case

Uncaught Exception in Web Inspector.

Test case (save as HTML file):
```
<!DOCTYPE html>
<body style="--color: red">
<h1 style="color: var(--color)">Inspect my color</h1>
</body>
```

Steps to Reproduce:
1. Open the attached test case file
2. Inspect the `<h1>` element's color
3. In the Styles panel, click the swatch next to `var(--color)` to see the resolved color value


Uncaught Exceptions:
-----------------------
 - TypeError: undefined is not an object (evaluating 'this._preventChangingColorFormats') (at InlineSwatch.js:389:127)
    callback @ InlineSwatch.js:389:127
    createCodeMirrorTextMarkers @ CodeMirrorTextMarkers.js:76:25
    createCodeMirrorColorTextMarkers @ CodeMirrorTextMarkers.js:121:39
    _swatchElementClicked @ InlineSwatch.js:394:45
    _swatchElementClicked @ [native code]
-----------------------

Regressed by https://bugs.webkit.org/show_bug.cgi?id=241055
Comment 1 Radar WebKit Bug Importer 2022-06-13 10:56:26 PDT
<rdar://problem/95039560>
Comment 2 Razvan Caliman 2022-06-13 11:15:08 PDT
Pull request: https://github.com/WebKit/WebKit/pull/1474
Comment 3 EWS 2022-06-13 13:19:49 PDT
Committed r295500 (251505@main): <https://commits.webkit.org/251505@main>

Reviewed commits have been landed. Closing PR #1474 and removing active labels.