<?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>128990</bug_id>
          
          <creation_ts>2014-02-18 12:47:30 -0800</creation_ts>
          <short_desc>CSP breaks soft-wrapping of plaintext documents unless unsafe-inline is used</short_desc>
          <delta_ts>2016-05-27 12:30:12 -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>Layout and Rendering</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Mac (Intel)</rep_platform>
          <op_sys>OS X 10.9</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></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="Adam Roben (:aroben)">aroben</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>dbates</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>982048</commentid>
    <comment_count>0</comment_count>
    <who name="Adam Roben (:aroben)">aroben</who>
    <bug_when>2014-02-18 12:47:30 -0800</bug_when>
    <thetext>To reproduce:

1. Serve a plaintext document containing long lines with Content-Security-Policy header of &quot;style-src &apos;none&apos;&quot; or stronger (like &quot;default-src &apos;none&apos;&quot;).

The lines should soft-wrap to match the browser width.

But the lines do not wrap. In the JS console there is a warning that says:

&gt; Refused to apply inline style because it violates the following Content Security Policy directive: &quot;default-src &apos;none&apos;&quot;. Note that &apos;style-src&apos; was not explicitly set, so &apos;default-src&apos; is used as a fallback.

It looks like CSP is breaking the style attribute that WebKit puts on the &lt;pre&gt; element that wraps the plaintext contents.

We were running into this when serving raw file contents from raw.github.com (I&apos;m a GitHub engineer), so we added a &quot;style-src &apos;unsafe-inline&apos;&quot; directive.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1197169</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2016-05-27 12:30:12 -0700</bug_when>
    <thetext>&lt;rdar://problem/26522742&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>