Open Bug 212008 Opened 21 years ago Updated 4 years ago

Text editing problems - alternating indentation behaviour

Categories

(Core :: DOM: Editor, defect, P5)

defect

Tracking

()

People

(Reporter: david, Unassigned)

Details

(Keywords: testcase)

Attachments

(3 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5a) Gecko/20030707
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5a) Gecko/20030707

There are still major editing problems in mail composition.

I here attempt to provide a reproducible scenario of how to produce one where
indentation happens that doesn't seem correct.

Reproducible: Always

Steps to Reproduce:
1.Open the attached html in composer
2.Select the content with CTRL-A and copy it with CTRL-C
3.Open a new message window
4.Select anything there with CTRL-A
5.Paste the previously copied content in there
6.Click the cursor to the beginning of point 2, right before the number 2.
7.Press enter.

Actual Results:  
A line is inserted where you would expect, but point 2 has now become indented.
 I would not have expected it to be indented, given that it was not indented before.
Also, if you press enter again, it becomes not indented, and then if you press
it again, it again becomes indented.  The behaviour alternates.

Expected Results:  
I would expect that pressing enter when the cursor is positioned before a
paragraph would open up a new paragraph with identical indentation.
Do you get the same problem pasting into Composer, or just into mailcompose?
Yes, same in composer.

I should have checked there first, but I experienced the problem in mail message
composition.
Over to Editor.  Please check the other bug you filed also and reassing as
needed (make sure to check the "Reassign bug to owner and QA contact of selected
component" radio button).
Assignee: sspitzer → jfrancis
Component: Composition → Editor: Core
Product: MailNews → Browser
QA Contact: esther → sairuh
confirming; I see the problem in Netscape 7.1 on MacOSX (based on mozilla 1.4).

This testcase is filled with MS-isms and probably wouldn't validate as html.

Requested qawanted to get a more minimal testcase.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: qawanted
OS: Windows 2000 → All
Hardware: PC → All
Summary: Text editing problems - alternating indentation behaviour → Text editing problems - alternating indentation behaviour [invalid HTML; MS compatibility]
Attached file reduced testcase
The style declarations say that the paragraph should have a left margin of 25
pixels, and the first line should be indented -25 pixels (relative to the
margin). So the paragraph should have the first line at normal indentation, and
following lines at 25 pixels.

When the <br> is added into the current <p> what was previously the first line
(specially alinged) text becomes the second line of the paragraph, which should
indeed be indented to 25 pixels. I don't know if that counts as a bug.

It's for someone else to say what the correct behaviour should be. Put the <br>
before the <p>? Only if there are indentation tags present?

The "alternating" behaviour makes sense to me, according to the CSS indentation
tags for the paragraph.
Attached file actual bug
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5b) Gecko/20030820 

Reproducible: Always

Steps to Reproduce:
1. click cursor to the begining of the line
2. press enter
3. type something anywhere in that line (or delete a character)

Actual Results:
Text not aligned until line changes

Expected Results:
Text incorrectly aligned until line changes.

Similarly:
if you backspace the empty first line the second line will remain 'indented'
until it is altered.
Above bug added as bug 217281 since it's not really the same as this bug.

Sorry for making a bit of a mess. If someone can remove my previous
post/attachment that would be tidier.
originally, the html looks like this:
<p style="margin-left: 18pt; text-indent: -18pt;">2.</p>

after pressing enter once:
<p style="margin-left: 18pt; text-indent: -18pt;"><br>
2.</p>

and twice:
<p style="margin-left: 18pt; text-indent: -18pt;"><br>
</p>
<p style="margin-left: 18pt; text-indent: -18pt;">2.</p>
Keywords: qawantedtestcase
Summary: Text editing problems - alternating indentation behaviour [invalid HTML; MS compatibility] → Text editing problems - alternating indentation behaviour
I think it is clear what happens here is mainly due to an odd CSS specification rather than incorrect behaviour of the program. Andrew describes what is the normal behaviour for pressing enter inside <p> tags, the alternating indenting only happens because of the text-indent specification.

Unless anyone can suggest a better behaviour for composer (such as not allowing an empty line as the first line of a <p> with the text-indent property set) then this bug should be resolved invalid.
But surely mozilla should handle things in a way that gives the end user a sensible experience.

Leaving this alternating indentation issue leaves the user with a bad taste in their mouth concerning the quality of Thunderbird.

Isn't there a way of handling this so it doesn't happen?
Out of curiousity... What does Word do when similar paragraph styling is used in this situation?
If I load the HTML used in this case into OpenOffice, it behaves the way I would expect, and doesn't do the alternating indentation that thunderbird does.
But does it carry over the styling?
openoffice.org does carry the styling over but pressing enter always starts a new paragraph. You can only get a <br> by pushing shift+enter.

This in my mind makes sense but seems to be different from how enters are handled by composer. I don't know anything about what Word does.
QA Contact: bugzilla → editor
Assignee: mozeditor → nobody

Bulk-downgrade of unassigned, >=5 years untouched DOM/Storage bugs' priority and severity.

If you have reason to believe this is wrong, please write a comment and ni :jstutte.

Severity: normal → S4
Priority: -- → P5
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: