<?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>123468</bug_id>
          
          <creation_ts>2013-10-29 14:19:13 -0700</creation_ts>
          <short_desc>Web Inspector: font-family names interpreted as color</short_desc>
          <delta_ts>2015-06-11 13:52:04 -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>528+ (Nightly build)</version>
          <rep_platform>Mac (Intel)</rep_platform>
          <op_sys>Unspecified</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="Andreas Eldh">andreas.eldh</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>commit-queue</cc>
    
    <cc>joepeck</cc>
    
    <cc>timothy</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>944606</commentid>
    <comment_count>0</comment_count>
    <who name="Andreas Eldh">andreas.eldh</who>
    <bug_when>2013-10-29 14:19:13 -0700</bug_when>
    <thetext>I had &quot;Crimson Text&quot; as the font-family on body, and the word &quot;Crimson&quot; was treated as a color, with a red (crimson?) square next to it. 

Using Safari 7.0 (9537.71) on OS X Mavericks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>944607</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2013-10-29 14:19:38 -0700</bug_when>
    <thetext>&lt;rdar://problem/15345003&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>944608</commentid>
    <comment_count>2</comment_count>
      <attachid>215427</attachid>
    <who name="Andreas Eldh">andreas.eldh</who>
    <bug_when>2013-10-29 14:20:07 -0700</bug_when>
    <thetext>Created attachment 215427
Screenshot</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>944644</commentid>
    <comment_count>3</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2013-10-29 15:18:15 -0700</bug_when>
    <thetext>Heh. Well, to extend the &quot;short term fix&quot; we have in CSSStyleDeclarationTextEditor we have:

    // Act as a negative look-behind and disallow the color from being prefixing with certain characters.
    if (match.index &gt; 0 &amp;&amp; /[-.]/.test(lineContent[match.index - 1])) {
        match = colorRegex.exec(lineContent);
        continue;
    }

We could include [&apos;&quot;] in that list of negative look-behind characters. But that wouldn&apos;t help &quot;Foo Red Bar&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>944645</commentid>
    <comment_count>4</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2013-10-29 15:20:49 -0700</bug_when>
    <thetext>Now that I think about it, we have CodeMirror&apos;s tokenizer right now, but we are still regex checking lines:

    var lineContent = this._codeMirror.getLine(i);
    var match = colorRegex.exec(lineContent);
    …

I think we be could just iterate over tokens instead of running the regex on the line?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>944669</commentid>
    <comment_count>5</comment_count>
    <who name="Timothy Hatcher">timothy</who>
    <bug_when>2013-10-29 16:24:07 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; Now that I think about it, we have CodeMirror&apos;s tokenizer right now, but we are still regex checking lines:
&gt; 
&gt;     var lineContent = this._codeMirror.getLine(i);
&gt;     var match = colorRegex.exec(lineContent);
&gt;     …
&gt; 
&gt; I think we be could just iterate over tokens instead of running the regex on the line?

That would work for color words and hex, but will need to have extra logic for rgb, etc.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1101097</commentid>
    <comment_count>6</comment_count>
      <attachid>254674</attachid>
    <who name="Devin Rousso">hi</who>
    <bug_when>2015-06-10 13:31:43 -0700</bug_when>
    <thetext>Created attachment 254674
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1101404</commentid>
    <comment_count>7</comment_count>
      <attachid>254674</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2015-06-11 13:52:00 -0700</bug_when>
    <thetext>Comment on attachment 254674
Patch

Clearing flags on attachment: 254674

Committed r185471: &lt;http://trac.webkit.org/changeset/185471&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1101405</commentid>
    <comment_count>8</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2015-06-11 13:52:04 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>215427</attachid>
            <date>2013-10-29 14:20:07 -0700</date>
            <delta_ts>2013-10-29 14:20:07 -0700</delta_ts>
            <desc>Screenshot</desc>
            <filename>Screenshot 2013-10-29 22.08.59.png</filename>
            <type>image/png</type>
            <size>0</size>
            <attacher name="Andreas Eldh">andreas.eldh</attacher>
            
              <data encoding="base64"></data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>254674</attachid>
            <date>2015-06-10 13:31:43 -0700</date>
            <delta_ts>2015-06-11 13:52:00 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-123468-20150610133115.patch</filename>
            <type>text/plain</type>
            <size>1623</size>
            <attacher name="Devin Rousso">hi</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJJbnNwZWN0b3JVSS9DaGFuZ2VMb2cgYi9Tb3VyY2UvV2Vi
SW5zcGVjdG9yVUkvQ2hhbmdl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IGIvU291cmNlL1dlYkluc3BlY3RvclVJL1VzZXJJbnRlcmZhY2UvVmlld3MvQ29k
ZU1pcnJvckFkZGl0aW9ucy5qcwppbmRleCBiMmJiMTc4MDUyYWQ0NDVhMmFkZDBiYWFiM2U1ZjJi
Y2JiNmVlNjQwLi44NjQ3YzRmMWJiYjhkZjdkM2FjZDQzODI4MGFlMWQ5NGQyMjkxNzgzIDEwMDY0
NAotLS0gYS9Tb3VyY2UvV2ViSW5zcGVjdG9yVUkvVXNlckludGVyZmFjZS9WaWV3cy9Db2RlTWly
cm9yQWRkaXRpb25zLmpzCisrKyBiL1NvdXJjZS9XZWJJbnNwZWN0b3JVSS9Vc2VySW50ZXJmYWNl
L1ZpZXdzL0NvZGVNaXJyb3JBZGRpdGlvbnMuanMKQEAgLTUxMSw3ICs1MTEsNyBAQAogICAgICAg
ICAgICAgd2hpbGUgKG1hdGNoKSB7CiAKICAgICAgICAgICAgICAgICAvLyBBY3QgYXMgYSBuZWdh
dGl2ZSBsb29rLWJlaGluZCBhbmQgZGlzYWxsb3cgdGhlIGNvbG9yIGZyb20gYmVpbmcgcHJlZml4
aW5nIHdpdGggY2VydGFpbiBjaGFyYWN0ZXJzLgotICAgICAgICAgICAgICAgIGlmIChtYXRjaC5p
bmRleCA+IDAgJiYgL1stLl0vLnRlc3QobGluZUNvbnRlbnRbbWF0Y2guaW5kZXggLSAxXSkpIHsK
KyAgICAgICAgICAgICAgICBpZiAobWF0Y2guaW5kZXggPiAwICYmIC9bLS5cIlwnXS8udGVzdChs
aW5lQ29udGVudFttYXRjaC5pbmRleCAtIDFdKSkgewogICAgICAgICAgICAgICAgICAgICBtYXRj
aCA9IGNvbG9yUmVnZXguZXhlYyhsaW5lQ29udGVudCk7CiAgICAgICAgICAgICAgICAgICAgIGNv
bnRpbnVlOwogICAgICAgICAgICAgICAgIH0K
</data>

          </attachment>
      

    </bug>

</bugzilla>