WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
128990
CSP breaks soft-wrapping of plaintext documents unless unsafe-inline is used
https://bugs.webkit.org/show_bug.cgi?id=128990
Summary
CSP breaks soft-wrapping of plaintext documents unless unsafe-inline is used
Adam Roben (:aroben)
Reported
2014-02-18 12:47:30 PST
To reproduce: 1. Serve a plaintext document containing long lines with Content-Security-Policy header of "style-src 'none'" or stronger (like "default-src 'none'"). 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:
> Refused to apply inline style because it violates the following Content Security Policy directive: "default-src 'none'". Note that 'style-src' was not explicitly set, so 'default-src' is used as a fallback.
It looks like CSP is breaking the style attribute that WebKit puts on the <pre> element that wraps the plaintext contents. We were running into this when serving raw file contents from raw.github.com (I'm a GitHub engineer), so we added a "style-src 'unsafe-inline'" directive.
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2016-05-27 12:30:12 PDT
<
rdar://problem/26522742
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug