Paragraph directionality control UI in Editor




18 years ago
9 years ago


(Reporter: ilya.konstantinov+future, Unassigned)


(Blocks 1 bug, {helpwanted, rtl})

Dependency tree / graph

Firefox Tracking Flags

(Not tracked)




(1 attachment, 2 obsolete attachments)



18 years ago
To create a right-aligned document (e.g. a mostly Hebrew document), a user needs
to go to "Page Color and Background" and define the DIR property to be "rtl".

Two buttons should be added to the Composer, one with an arrow pointing to the
right (for LTR) and one with an arrow pointing to the left (for LTR).

Those buttons should affect the paragraph's BiDi directionality (DIR=LTR /
DIR=RTL or the unicode-bidi CSS property).

Comment 1

18 years ago
Another work around is to go to the individual paragraphs tags and set the dir 
attribute for it via Show All Tags and the advanced properties editor.

 Type a few paragraphs.
 Go to All Tags mode (bottom toolbar or via View menu)
 double-click the <p> tags
 add the dir attribute with "rtl"
OS: Linux → All
Hardware: PC → All

Comment 2

18 years ago
marking NEW.
Ever confirmed: true
Keywords: polish, ui
Summary: Paragraph directionality control UI in Composer → [RFE] Paragraph directionality control UI in Composer
Mass-move all BiDi Hebrew and Arabic qa to me, 
Thank you Gilad for your service to this component, and best of luck to you 
in the future.

QA Contact: giladehven → zach
I would suggest also adding "Default direction" to the New Page Settings
preferences tab.
Hmmm, I disagree with new buttons for directionality. This 

  (a) belongs to page properties for the whole document
  (b) is an element property for local overriding

Comment for editor's ex-team : I wonder if the Advanced Properties Dialog
could have special handling for the following attributes, applied to all
elements : ID, DIR, LANG, TITLE. They could be explicitely described in the
advanced attributes panel, what do you think ?

Comment 6

18 years ago
I disagree (as an Israeli user who had enough experience with Hebrew editing):
directionality control must be per-paragraph and not per-page. It is likely to 
have both mostly-english and mostly-hebrew paragraphs in the same page. Also, 
they must be immediately accessed - THIS IS NOT A STYLING ISSUE WHICH CAN BE 

Microsoft Word has such paragraph directionality buttons and I think it does 
an excellent job with it.

Also, on Windows, there are Left Ctrl-Shift and Right Ctrl-Shift to change any 
input widget's direction, keys which could be used in the Composer as well, 
but that's a different issue.

Comment 7

18 years ago
As a Persian speaker/writer, I agree with Ilya. We need direction controls in
the paragraph level. There is a need to switch that a lot in a single bidi document.
About the strong emphasis materialized by the capitals, I am often authoring
documents in both english/french and yiddish. I am not the iso-8859-1-centric
fanatic you seem to believe I am...

I agree with an easy way to see/change dir ; I disagree with an overload of
the toolbar with buttons (I am not talking of other UI means) achieving this


18 years ago
Blocks: 115711

Comment 9

18 years ago
Francly, I do not see any other way to have those controls accecible enugh for
use without haveing them on the toolbar- It would be a real paint to go into the
menu each time I want to set the directionality of the paragraph.
Every editor that knows how to deal with Hebrew properly puts those controls on
the toolbar: Nisus for Mac, front page express (now discontiniued, leaving a gap
since it was the only WYSIWYG html editor that was actaully aware of Hebrew),
Qtext for windows, Dagesh, etc etc.
As you can see from the partial list above- having those buttons on the toolbar
is quite cross-application and cross platform. That is another reason IMO that
we should have them there- if they are not there, I wonder how many users who
need the option will know it even exsits?

Comment 10

18 years ago
Also, what about objects like lists and form elements? user should be able to
defined them as rtl esaly

Comment 11

18 years ago
*** Bug 125580 has been marked as a duplicate of this bug. ***

Comment 12

17 years ago
Any progress here? I have been receving several emails from users wondering how 
to set paragraphs to RTL in composer- it is a shame that:
1. Many users who need this feature are unable to find it on there own
2. There is no easy answer to give them.

After all, people who use composer to create web pages, almost by defenition 
are not fluent in HTML.
yes, there is (hidden) progress : this is almost ready in my own tree but I had
to stop further work on it due to moz1.0 bugs.
Posted patch patch v1.0, ready for reviews (obsolete) — Splinter Review
I have finished this work on my personal time, because I personnally consider
this fix as important for a 1.0 milestone, in the perspective of Israeli and
Arabic markets. I'll leave the readers of this comment try getting a nomination

for it.

The patch adds direction control (a) in composer preferences (b) in mail
compose preferences (c) in page properties in Composer (d) in Format menu
in both Composer and mail Compose.
The menu is always contextual to the selection, as the other Composer's UI 
controls are. 

Oh, and if I tell you that this patch is CSS safe and adds the CSS 'direction'
property in a STYLE attribute instead of a DIR attribute when the CSS pref
is checked, will you believe it ?-))))

/* enjoy */

Comment 15

17 years ago
nominate for nsbeta1
Mike Kaply--Daniel is going to be on holiday until next Tuesday, can you check
this in once it gets reviews, etc.?
Target Milestone: --- → mozilla1.0
brade: would you like to own this? nsbeta1 bugs not assigned to
addresses can slip through the triage net.

Comment 17

17 years ago
I have partially reviewed this and talked with Daniel about my findings.  I'm
awaiting a new patch before I can complete the job.
Attachment #76568 - Attachment is obsolete: true

Comment 19

17 years ago
Comment on attachment 77622 [details] [diff] [review]
patch v1.1, in answer to Joe's comments

I gave Danile some more suggestions for a final patch
Attachment #77622 - Flags: review+
Posted patch patch finalSplinter Review
Attachment #77622 - Attachment is obsolete: true
I have begun testing this patch on Win2K. Composer is working well, but I had
error messages and crashes in mail. I see that there are recently fixed bugs in
that area, so I have updated my tree, but I will not have a build ready for more
tests before the end of the day. I will report further results as soon as I can.
I have now tested mail on Win2K. Everything seems to work correctly, but I have
a few issues which should be addressed, if only on the release note level.

Most seriously, I couldn't discover any way to set the global direction for a
whole mail message (equivalent to setting the direction in Page Title And
Properties from Composer) except by setting the preference for default
direction. This is awkward, because I doubt if many people write *all* their
mail in a right-to-left language.

Secondly, the default direction pref only takes effect on restart.

After restarting, the direction works fine when composing mail, but is lost when
sending, unless one chooses HTML format. I think this behaviour is reasonable
(direction for plaintext mail is another issue, see bug 119857 and but it could be confusing.
Maybe the text in the preference dialog should add something like "(HTML mail only)"
Simon: thanks for testing and useful comments ; working on it to make this patch
and feature land as soon as possible.

Comment 24

17 years ago
1. It is possible to retain the directionaly in plain/text too, but only in
Unicode plain/text (e.g. UTF-8), since that requires Unicode directionality
zero-width characters. I think its a good idea that using those buttons will
mark the mail as "rich" and offer to send it as HTML; this "formatting" is
rather important for actually understanding the content of the message.

2. There's a need for more accessible means than an option in the Format menu.
An option in the Format menu is how you're likely NOT to access this feature.
Strip it from the menus -- it just adds more clutter.

3. Lets do it like Outlook does -- two directionality buttons on the toolbar,
both in Composer and in the Mail Composer.

4. It would be nice to have Windows / Outlook-like keyboard accelerators for it
too: LeftCtrl-Shift setting the paragraph to be left-aligned, RightCtrl-Shift
setting the paragraph to be right-aligned. Those accelerators are very
comfortable. Please lets not impose a learning curve on the users.

5. If you think my suggestions are THAT bothering for Latin-1 users, add all of
those (the toolbar buttons, the accels) only if a single pref checkbox named
"Support Right-to-Left (Arabic, Hebrew) languages" is marked. Only a single
checkbox -- trust me on this: if someone wants to edit RTL documents / mails, he
wants all of those, cause if he ever edited Hebrew documents in the last 5
years, that's how he did it (on MS Office).


17 years ago
Blocks: 152111


17 years ago

Comment 25

17 years ago
[RFE] is deprecated in favor of severity: enhancement.  They have the same meaning.
Severity: normal → enhancement


17 years ago
Summary: [RFE] Paragraph directionality control UI in Composer → Paragraph directionality control UI in Composer

Comment 26

17 years ago
unfortunately this patch needs to be updated to deal with editorshell removal :-(

Also, is a preference panel change really required?  That seems like overkill. 
I'd rather have us try to be smarter somehow.

Lastly, someday when we have configurable toolbars, we should let users add
controls for rtl/ltr on the toolbars (a separate bug if this lands soon).

Comment 27

17 years ago
There's also a third workaround which is very similar to the second one:
Click the Source tab and manually add the tags: <p dir="rtl">  </p>

Obviously, this is hardly as convenient as having toolbar-buttons for direction.
Is there any progress with the patch?


Comment 28

17 years ago
That workround is not good for lists or tables, unless you edit them manully,
thus, defiting the whole WYSIWG thing of composer...

Comment 29

16 years ago
A year has gone by since the final patch was submitted. Any chance to see it 
updated and checked-in? 

Note that HTML templates are currently broken (Bug 191799), in turn forcing 
users to go through 4 different menus and dialogs before writing RTL emails. 
Unfortunately, only Mozilla-fanatics bother to do that.


Comment 30

16 years ago
adding helpwanted keyword
We need someone to make the patch apply to the current tip.
We also need someone to (presumably) make these show/hide with the other
preferences for composer toolbar controls.
Keywords: helpwanted


16 years ago
Keywords: nsbeta1nsbeta1-


16 years ago
Keywords: mozilla1.0
Target Milestone: mozilla1.0 → ---


16 years ago
Flags: blocking1.4?


16 years ago
Flags: blocking1.4? → blocking1.4-
*** Bug 213149 has been marked as a duplicate of this bug. ***

Comment 32

16 years ago
pls, pls, pls - let's get rid of this two-year-old bug !


15 years ago
Blocks: 240501

Comment 33

15 years ago
Asaf, I believe you meant to *ask* for blocking1.8a, not do *deny* it - that
should be '?' rather than '-'. More on flags here:

Flags: blocking1.8a- → blocking1.8a?

Comment 34

15 years ago
*** Bug 231132 has been marked as a duplicate of this bug. ***
review flag is missing for "Patch final"

Comment 36

15 years ago
(In reply to comment #35)
> review flag is missing for "Patch final"

that's because this patch is so old, bugzilla didn't have the review flag when
it was submitted. doesn't it need to be updated?

Comment 37

15 years ago
The patch has already become bitrotted a couple of years ago. See comment 26.

As far as I remember, the patch author (Glazou) is nowadays against BiDi UI in
Mozilla. It clutters the menus or something.


Comment 38

15 years ago
that's not what he wrote here: .

daniel, as module owner (at least according to, what is your position on this?
(In reply to comment #38)

> daniel, as module owner (at least according to
>, what is your position on this?

Writing direction control UI will be in Nvu 0.3, as promised.

Comment 40

15 years ago
(In reply to comment #39)
> Writing direction control UI will be in Nvu 0.3, as promised.

I stand corrected. Thanks for working on this!


(In reply to comment #39)
> (In reply to comment #38)
> > daniel, as module owner (at least according to
> >, what is your position on this?
> Writing direction control UI will be in Nvu 0.3, as promised.

And what about a solution for those of that still using the suite (or a platform
without an offical build of Nvu)? :-)


15 years ago
Flags: blocking1.8a? → blocking1.8a-
Working on it now.
Priority: -- → P1

Comment 43

15 years ago
Daniel, if you need any help in testing this, just ask. 

Meanwhile, you might want to check the progress of directionality control in
Chatzilla (Bug 250864). It would be nice to have consistent BiDi UI across
Mozilla components.

proganthous: please see Nvu 0.30 release. Bidi control is included.

Comment 45

15 years ago
yes, but we would like to see it in Composer too :)

Comment 46

15 years ago
*** Bug 254436 has been marked as a duplicate of this bug. ***
Blocks: Persian
This is clearly a SeaMonkey/Composer issue, not a layout issue.
Component: Layout: BiDi Hebrew & Arabic → Composer
Product: Core → Mozilla Application Suite
Assignee: mozilla → mozeditor
Component: Composer → Editor
Flags: blocking1.8a1-
Flags: blocking1.4-
Keywords: polish
Priority: P1 → --
Product: Mozilla Application Suite → Core
QA Contact: zach
Summary: Paragraph directionality control UI in Composer → Paragraph directionality control UI in Editor

Comment 48

13 years ago
Whoa, just noticed this bug...

this issue is addressed by the BiDi Mail UI extension:

One the migration to toolkit happens, we might consider integrating some of that code into the trunk.
QA Contact: editor
Assignee: mozeditor → nobody

Comment 49

12 years ago
I suspect the last patch is bitrotten, plus, AFAICT it doesn't distinguish between document direction and paragraph direction. There are also several issues with the editor which need to be resolved before proper direction control can be implemented, which have come up over the last few years as bugs for BiDi Mail UI, and need to be addressed as part of the addition of directionality control to the editor:

- paragraph mode vs body text mode as default
- auto-reversion to body text mode in some cases
- persistence of various aspects of style when changing from paragraph mode to body text mode and vice-versa, or when saving and re-editing a draft
- Ctrl+RShfit,Ctrl+LSfhit still not usable
- events missing for various state changes / button presses

Some other issues have come up but these were solvable on the JS level; they might have better solution if one tinkers also with the C++ under the hood of various interfaces.

Anyway, SM is almost toolkitized now, maybe the integration of BiDi Mail UI with the trunk is a viable option.
Keywords: rtl
You need to log in before you can comment on or make changes to this bug.