<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>241558</bug_id>
          
          <creation_ts>2022-06-13 10:55:47 -0700</creation_ts>
          <short_desc>REGRESSION (r251194): Web Inspector: Uncaught exception when inspecting color referenced by CSS variable</short_desc>
          <delta_ts>2022-06-13 13:19:51 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Web Inspector</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Razvan Caliman">rcaliman</reporter>
          <assigned_to name="Razvan Caliman">rcaliman</assigned_to>
          <cc>inspector-bugzilla-changes</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1875564</commentid>
    <comment_count>0</comment_count>
      <attachid>460208</attachid>
    <who name="Razvan Caliman">rcaliman</who>
    <bug_when>2022-06-13 10:55:47 -0700</bug_when>
    <thetext>Created attachment 460208
Test case

Uncaught Exception in Web Inspector.

Test case (save as HTML file):
```
&lt;!DOCTYPE html&gt;
&lt;body style=&quot;--color: red&quot;&gt;
&lt;h1 style=&quot;color: var(--color)&quot;&gt;Inspect my color&lt;/h1&gt;
&lt;/body&gt;
```

Steps to Reproduce:
1. Open the attached test case file
2. Inspect the `&lt;h1&gt;` element&apos;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 &apos;this._preventChangingColorFormats&apos;) (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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1875565</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-06-13 10:56:26 -0700</bug_when>
    <thetext>&lt;rdar://problem/95039560&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1875567</commentid>
    <comment_count>2</comment_count>
    <who name="Razvan Caliman">rcaliman</who>
    <bug_when>2022-06-13 11:15:08 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/1474</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1875598</commentid>
    <comment_count>3</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2022-06-13 13:19:49 -0700</bug_when>
    <thetext>Committed r295500 (251505@main): &lt;https://commits.webkit.org/251505@main&gt;

Reviewed commits have been landed. Closing PR #1474 and removing active labels.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>460208</attachid>
            <date>2022-06-13 10:55:47 -0700</date>
            <delta_ts>2022-06-13 10:55:47 -0700</delta_ts>
            <desc>Test case</desc>
            <filename>variable-color.html</filename>
            <type>text/html</type>
            <size>105</size>
            <attacher name="Razvan Caliman">rcaliman</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+Cjxib2R5IHN0eWxlPSItLWNvbG9yOiByZWQiPgo8aDEgc3R5bGU9ImNv
bG9yOiB2YXIoLS1jb2xvcikiPkluc3BlY3QgbXkgY29sb3I8L2gxPgo8L2JvZHk+
</data>

          </attachment>
      

    </bug>

</bugzilla>