Bug 849404 RTL support for text/plain documents draft
authorTomer Cohen <tomer@tomercohen.com>
Sat, 24 Dec 2016 01:59:12 +0200
changeset 453621 eff95aeb646c638f626d1d1f21a95d04bf81cc70
parent 453200 d500fdfcb5893db2823d57463cc7547a5c5a65ed
child 540512 c302aca5d96cab3b2e2882a1fd0d8a5b5cdeba26
push id39718
push userbmo:tomer.moz.bugs@tomercohen.com
push dateSat, 24 Dec 2016 00:00:33 +0000
bugs849404
milestone53.0a1
Bug 849404 RTL support for text/plain documents The addition of unicode-plaintext to the pre element will make RTL text to appear from right to left. The html[dir] pre rule will make sure that this addition won't break the 'switch page direction' functionality. MozReview-Commit-ID: 2JXJjqt2iuX
layout/style/res/plaintext.css
--- a/layout/style/res/plaintext.css
+++ b/layout/style/res/plaintext.css
@@ -2,8 +2,13 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 pre {
   white-space: pre-wrap;
   word-wrap: break-word;
   -moz-control-character-visibility: visible;
 }
+
+/* Make text go with the rules of dir=auto, but allow it to be overriden if 'Switch Text Direction' is triggered */
+html:not([dir]) pre {
+  unicode-bidi: plaintext;
+}