Closed Bug 510409 Opened 15 years ago Closed 4 years ago

Outdenting divs removes the divs and combines their text content into the same line

Categories

(Core :: DOM: Editor, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: marcosalmeida, Unassigned)

References

()

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/530.5 (KHTML, like Gecko) Chrome/2.0.172.39 Safari/530.5
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.13) Gecko/2009073022 Firefox/3.0.13 (.NET CLR 3.5.30729)

When you outdent text that is in a plain div such as <div>hello</div>, the browser removes that div and leaves "hello". I suspect this is because when you indent the browser wraps the content in a div with a margin, and in this case it sees the div and thinks it was previously indented. It should only outdent if the div has the margin that indented blocks get.
The problem is more visible when you have two divs, which to the user looks like two lines of text. When the div tags are removed, all that is left is the text, which is combined into a single line.

Reproducible: Always

Steps to Reproduce:
1. Go to http://www.mozilla.org/editor/midasdemo/
2. Check the "View HTML Source checkbox at the bottom.
3. Enter the following HTML: <div>hello</div><div>world</div>
4. Uncheck the "View HTML Source checkbox at the bottom.
5. Select all text.
6. Press the outdent button in the toolbar.
Actual Results:  
The two lines of text get combined into one: "helloworld"

Expected Results:  
Nothing should change. You should still see two lines of text: "hello" and "world"

This affects Google properties.

This is fixed in 2012-04-05 build.

Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.