Project

General

Profile

PRE tags wrap with latest Google Chrome, Redmine 2.6.0 (Win7x64)

Added by Deoren Moor almost 10 years ago

Is anyone else experiencing this? I've not dug far enough into this yet to determine which is responsible, but I've noticed that existing issues where I used pre tags to preserve long lines and white-space in text now has the content wrapping. I first assumed it was something I did wrong and spent some time trying to tweak the white-space, but I've found that the content is displaying fine within Mozilla Firefox 33.x.

Example text that I am used to seeing without wrapping in Google Chrome:

Hello everyone,

I would like to announce the release of MediaWiki 1.23.7, 1.22.14 and 1.19.22. This is a regular security and maintenance release. Download links are given at the end of this email. 

== Security fixes ==
* (bugs 66776, 71478) SECURITY:  User PleaseStand reported a way to inject code into API clients that used format=php to process pages that underwent flash policy mangling. This was fixed along with improving how the mangling was done for format=json, and allowing sites to disable the mangling using $wgMangleFlashPolicy.
<https://phabricator.wikimedia.org/T68776>
<https://phabricator.wikimedia.org/T73478>

* (bug 70901) SECURITY: User Jackmcbarn reported that the ability to update the content model for a page could allow an unprivileged attacker to edit another user's common.js under certain circumstances. The user right "editcontentmodel" was added, and is needed to change a revision's content model.
<https://phabricator.wikimedia.org/T72901>

* (bug 71111) SECURITY: User PleaseStand reported that on wikis that allow raw HTML, it is not safe to preview wikitext coming from an untrusted source such as a cross-site request. Thus add an edit token to the form, and when raw HTML is allowed, ensure the token is provided before showing the preview.  This check is not performed on wikis that both allow raw HTML and anonymous editing, since there are easier ways to exploit that scenario.
<https://phabricator.wikimedia.org/T73111>

* (bug 72222) SECURITY: Do not show log action when the entry is revdeleted with DELETED_ACTION. NOTICE: this may be reverted in a future release pending a public RFC about the desired functionality. This issue was reported by user Bawolff.
<https://phabricator.wikimedia.org/T74222>
pre wrapped text within Google Chrome 39.0.2171.71 m

google-chrome-39.0.2171.71m-x64_redmine-2.6.0_pre-tag-wrapping.png

pre wrapped text within Mozilla Firefox 33.x:

mozilla-firefox-33.1_redmine-2.6.0_pre-tag-whitespace-preserved.png


Replies (4)

RE: PRE tags wrap with latest Google Chrome, Redmine 2.6.0 (Win7x64) - Added by Deoren Moor almost 10 years ago

Using the Inspect Element option of Google Chrome I drilled down to this style:

div.issue {
background: #ffffdd;
padding: 6px;
margin-bottom: 6px;
border: 1px solid #d7d7d7;
word-wrap: break-word;
}

and found that toggling word-wrap off/on restores what seems like the original behavior.

I looked through the Redmine v2.6.0 install directory and found that the /path/to/redmine/install_dir/public/stylesheets/application.css file contains the relevant line.

Redmine v2.6.0

grep "div.issue {background" ./redmine-v2.6.0/public/stylesheets/application.css

div.issue {background:#ffffdd; padding:6px; margin-bottom:6px;border: 1px solid #d7d7d7; word-wrap: break-word;}

Redmine v2.5.2

grep "div.issue {background" ./redmine-v2.5.2/public/stylesheets/application.css

div.issue {background:#ffffdd; padding:6px; margin-bottom:6px;border: 1px solid #d7d7d7;}
Diff

diff -u ./redmine-v2.5.2/public/stylesheets/application.css ./redmine-v2.6.0/public/stylesheets/application.css

--- ./redmine-v2.5.2/public/stylesheets/application.css 2014-11-26 23:41:42.000000000 -0600
+++ ./redmine-v2.6.0/public/stylesheets/application.css 2014-11-26 23:43:15.000000000 -0600
@@ -241,6 +241,8 @@
 .odd {background-color:#f6f7f8;}
 .even {background-color: #fff;}

+tr.builtin td.name {font-style:italic;}
+
 a.sort { padding-right: 16px; background-position: 100% 50%; background-repeat: no-repeat; }
 a.sort.asc  { background-image: url(../images/sort_asc.png); }
 a.sort.desc { background-image: url(../images/sort_desc.png); }
@@ -254,6 +256,8 @@

 table.messages td.last_message {text-align:left;}

+#query_form_content {font-size:90%;}
+
 table.query-columns {
   border-collapse: collapse;
   border: 0;
@@ -297,6 +301,7 @@
   color:#505050;
   line-height:1.5em;
   border: 1px solid #e4e4e4;
+  word-wrap: break-word;
 }

 div.square {
@@ -323,7 +328,7 @@
 abbr  { border-bottom: 1px dotted; cursor: help; }
 textarea.wiki-edit {width:99%; resize:vertical;}
 li p {margin-top: 0;}
-div.issue {background:#ffffdd; padding:6px; margin-bottom:6px;border: 1px solid #d7d7d7;}
+div.issue {background:#ffffdd; padding:6px; margin-bottom:6px;border: 1px solid #d7d7d7; word-wrap: break-word;}
 p.breadcrumb { font-size: 0.9em; margin: 4px 0 4px 0;}
 p.subtitle { font-size: 0.9em; margin: -6px 0 12px 0; font-style: italic; }
 p.footnote { font-size: 0.9em; margin-top: 0px; margin-bottom: 0px; }
@@ -332,7 +337,7 @@
 div.issue div.subject p {margin: 0; margin-bottom: 0.1em; font-size: 90%; color: #999;}
 div.issue div.subject>div>p { margin-top: 0.5em; }
 div.issue div.subject h3 {margin: 0; margin-bottom: 0.1em;}
-div.issue span.private { position:relative; bottom: 2px; text-transform: uppercase; background: #d22; color: #fff; font-weight:bold; padding: 0px 2px 0px 2px; font-size: 60%; margin-right: 2px; border-radius: 2px;}
+div.issue span.private, div.journal span.private { position:relative; bottom: 2px; text-transform: uppercase; background: #d22; color: #fff; font-weight:bold; padding: 0px 2px 0px 2px; font-size: 60%; margin-right: 2px; border-radius: 2px;}
 div.issue .next-prev-links {color:#999;}
 div.issue table.attributes th {width:22%;}
 div.issue table.attributes td {width:28%;}
@@ -341,7 +346,7 @@
 #issue_tree td.checkbox, #relations td.checkbox {display:none;}
 #relations td.buttons {padding:0;}

-fieldset.collapsible { border-width: 1px 0 0 0; font-size: 0.9em; }
+fieldset.collapsible {border-width: 1px 0 0 0;}
 fieldset.collapsible>legend { padding-left: 16px; background: url(../images/arrow_expanded.png) no-repeat 0% 40%; cursor:pointer; }
 fieldset.collapsible.collapsed>legend { background-image: url(../images/arrow_collapsed.png); }

@@ -454,10 +459,12 @@

 #workflow_copy_form select { width: 200px; }
 table.transitions td.enabled {background: #bfb;}
-table.fields_permissions select {font-size:90%}
+#workflow_form table select {font-size:90%; max-width:100px;}
 table.fields_permissions td.readonly {background:#ddd;}
 table.fields_permissions td.required {background:#d88;}

+select.expandable {vertical-align:top;}
+
 textarea#custom_field_possible_values {width: 95%; resize:vertical}
 textarea#custom_field_default_value {width: 95%; resize:vertical}

@@ -604,7 +611,8 @@
 #users_for_watcher {height: 200px; overflow:auto;}
 #users_for_watcher label {display: block;}

-table.members td.group { padding-left: 20px; background: url(../images/group.png) no-repeat 0% 50%; }
+table.members td.name {padding-left: 20px;}
+table.members td.group, table.members td.groupnonmember, table.members td.groupanonymous {background: url(../images/group.png) no-repeat 0% 1px;}

 input#principal_search, input#user_search {width:90%}

RE: PRE tags wrap with latest Google Chrome, Redmine 2.6.0 (Win7x64) - Added by Deoren Moor almost 10 years ago

Replicated on Google Chrome 39.0.2171.71 x32 in Ubuntu 12.04 and presumably anything later.

RE: PRE tags wrap with latest Google Chrome, Redmine 2.6.0 (Win7x64) - Added by Deoren Moor almost 10 years ago

Digging around it looks like the patch applied as r13399 to fix #12580 changed the behavior.

svn diff -r13399:13401 http://svn.redmine.org/redmine/tags/2.6.0/public/stylesheets

Index: application.css
===================================================================
--- application.css     (revision 13399)
+++ application.css     (revision 13401)
@@ -299,6 +299,7 @@
   color:#505050;
   line-height:1.5em;
   border: 1px solid #e4e4e4;
+  word-wrap: break-word;
 }

 div.square {

Reference:

source:trunk/public/stylesheets/application.css@13399#L328

RE: PRE tags wrap with latest Google Chrome, Redmine 2.6.0 (Win7x64) - Added by Deoren Moor almost 10 years ago

Opened #18464 since this appears to be an unintended side-effect of trying to squash the original problem mentioned on #12580.

    (1-4/4)