<?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>160465</bug_id>
          
          <creation_ts>2016-08-02 14:40:18 -0700</creation_ts>
          <short_desc>Web Inspector: CodeMirror in resource content view should not show &apos;CR&apos; characters</short_desc>
          <delta_ts>2016-09-06 16:05:29 -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>http://www.tractorsupply.com/tsc/catalog/home-garden/outdoor-power-equipment/generators?cm_re=20160725-_-FOURTH-_-Portable+Generators</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="Blaze Burg">bburg</reporter>
          <assigned_to name="Devin Rousso">hi</assigned_to>
          <cc>bburg</cc>
    
    <cc>commit-queue</cc>
    
    <cc>hi</cc>
    
    <cc>joepeck</cc>
    
    <cc>mattbaker</cc>
    
    <cc>nvasilyev</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>timothy</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1216604</commentid>
    <comment_count>0</comment_count>
    <who name="Blaze Burg">bburg</who>
    <bug_when>2016-08-02 14:40:18 -0700</bug_when>
    <thetext>SUMMARY:

When pretty-printing is disabled, or for comment blocks (which aren&apos;t altered by pretty-printing), some pages show a &apos;CR&apos; glyph at the end of each line. This is probably a CR/LF character. We shouldn&apos;t render this glyph as it&apos;s distracting and irrelevant for JavaScript.

STEPS TO REPRODUCE:

1. Go to the URL
2. Go to resources tab
3. Select &apos;foresee_surveydef.js&apos;  or any other JS file served from &apos;gateway.answerscloud.com&apos;
4. Deselect pretty printing (the {} button)

Now most of the lines have a little &apos;CR&apos; glyph at the end. This is annoying.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1216606</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2016-08-02 14:40:48 -0700</bug_when>
    <thetext>&lt;rdar://problem/27666053&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1216624</commentid>
    <comment_count>2</comment_count>
    <who name="Nikita Vasilyev">nvasilyev</who>
    <bug_when>2016-08-02 15:08:22 -0700</bug_when>
    <thetext>https://github.com/WebKit/webkit/blob/c20f470adf2cf34821a0756d01a4df33b353c1e6/Source/WebInspectorUI/UserInterface/External/CodeMirror/codemirror.js#L6951

This appears to be hardcoded in CodeMirror, i.e. CodeMirror doesn&apos;t seem to
provide an option to turn it off. We may have to modify codemirror.js directly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1216634</commentid>
    <comment_count>3</comment_count>
    <who name="Blaze Burg">bburg</who>
    <bug_when>2016-08-02 15:22:31 -0700</bug_when>
    <thetext>I don&apos;t think editing codemirror.js is going to be the right fix. Here are some alternatives:

1. Heuristically detect whether the line endings seem to be \r\n or \n and tell CodeMirror which line ending to assume (there&apos;s a setting for that)
2. Strip line endings from the text that we display (somewhat dangerous due to line:col interactions with JSC)
3. Tag the CR character with CSS and make it visibility:none.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1216640</commentid>
    <comment_count>4</comment_count>
    <who name="Nikita Vasilyev">nvasilyev</who>
    <bug_when>2016-08-02 15:39:33 -0700</bug_when>
    <thetext>(In reply to comment #3)
&gt; I don&apos;t think editing codemirror.js is going to be the right fix. Here are
&gt; some alternatives:
&gt; 
&gt; 1. Heuristically detect whether the line endings seem to be \r\n or \n and
&gt; tell CodeMirror which line ending to assume (there&apos;s a setting for that)

This is what Chrome seems to do.
https://codereview.chromium.org/19540026/

&gt; 2. Strip line endings from the text that we display (somewhat dangerous due
&gt; to line:col interactions with JSC)
&gt; 3. Tag the CR character with CSS and make it visibility:none.

I can&apos;t figure out how to write a valid CSS selector for this element:

&lt;span class=&quot;cm-invalidchar&quot; cm-text=&quot;
&quot;&gt;␍&lt;/span&gt;

These don&apos;t work:

.cm-invalidchar[cm-text=&quot;
&quot;]
.cm-invalidchar[cm-text=&quot;\n&quot;]
.cm-invalidchar[cm-text=&quot;\a&quot;]</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1217951</commentid>
    <comment_count>5</comment_count>
    <who name="Timothy Hatcher">timothy</who>
    <bug_when>2016-08-05 10:17:03 -0700</bug_when>
    <thetext>We could just hide all .cm-invalidchar. This should be a setting switch once we have a Settings view.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1226521</commentid>
    <comment_count>6</comment_count>
      <attachid>287986</attachid>
    <who name="Devin Rousso">hi</who>
    <bug_when>2016-09-05 16:44:16 -0700</bug_when>
    <thetext>Created attachment 287986
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1226769</commentid>
    <comment_count>7</comment_count>
      <attachid>287986</attachid>
    <who name="Blaze Burg">bburg</who>
    <bug_when>2016-09-06 11:40:04 -0700</bug_when>
    <thetext>Comment on attachment 287986
Patch

How does this look on misencoded files? Is there any way to differentiate CR from other invalid characters?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1226786</commentid>
    <comment_count>8</comment_count>
    <who name="Devin Rousso">hi</who>
    <bug_when>2016-09-06 12:22:21 -0700</bug_when>
    <thetext>(In reply to comment #7)
&gt; How does this look on misencoded files? Is there any way to differentiate CR
&gt; from other invalid characters?

Not really sure if I tested that.  Any sure-fire steps for reproducing a mis-encoded file?  What would that even look like?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1226890</commentid>
    <comment_count>9</comment_count>
      <attachid>287986</attachid>
    <who name="Blaze Burg">bburg</who>
    <bug_when>2016-09-06 15:50:22 -0700</bug_when>
    <thetext>Comment on attachment 287986
Patch

r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1226891</commentid>
    <comment_count>10</comment_count>
    <who name="Blaze Burg">bburg</who>
    <bug_when>2016-09-06 15:51:01 -0700</bug_when>
    <thetext>(In reply to comment #8)
&gt; (In reply to comment #7)
&gt; &gt; How does this look on misencoded files? Is there any way to differentiate CR
&gt; &gt; from other invalid characters?
&gt; 
&gt; Not really sure if I tested that.  Any sure-fire steps for reproducing a
&gt; mis-encoded file?  What would that even look like?

On second thought, I&apos;ve only really seen this on XHR responses that had the wrong MIME type. I think Johan fixed a bug in that area. Not sure this would really make it any worse...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1226904</commentid>
    <comment_count>11</comment_count>
      <attachid>287986</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2016-09-06 16:05:25 -0700</bug_when>
    <thetext>Comment on attachment 287986
Patch

Clearing flags on attachment: 287986

Committed r205517: &lt;http://trac.webkit.org/changeset/205517&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1226905</commentid>
    <comment_count>12</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2016-09-06 16:05:29 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>287986</attachid>
            <date>2016-09-05 16:44:16 -0700</date>
            <delta_ts>2016-09-06 16:05:25 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-160465-20160905164155.patch</filename>
            <type>text/plain</type>
            <size>1363</size>
            <attacher name="Devin Rousso">hi</attacher>
            
              <data encoding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