Closed Bug 132837 Opened 22 years ago Closed 22 years ago

[PATCH]extra break inserted into new list item after using style

Categories

(Core :: DOM: Editor, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla1.0

People

(Reporter: sujay, Assigned: mozeditor)

References

Details

(Whiteboard: EDITORBASE+[adt2] fixed on trunk ; patch in 135337)

Attachments

(1 file)

using 3/22 build on win

1) launch netscape
2) launch composer
3) make list
4) make bold
5) type "joe is sooo dreamy"
6) type return to make new list item
7) select "joe is sooo dreamy"
8) backspace
9) backspace again(this will delete 2nd bullet and keep caret in 1st bullet)
might have to hit backspace again one more time if 2nd bullet is still not
deleted.
10) click on bullet list icon

end result = 

*    O   <---  two different level bullets on the same line
I've investigated this bug and determined the real problem (that casues the 
symptoms originally described).

Once you create the second list item in the original test case, the second list 
item is not empty.  Instead it has 2 breaks in it: one inside the bold and one 
not.  This gets you into the situation described here and in 132898 where 
clicking the list button makes you a new list (which in my opinion is correct).

The extra br is clearly wrong and if I fix that this bug goes away.
Status: NEW → ASSIGNED
Summary: second level bullet appears on same line as first level bullet → extra break inserted into new list item after using style
Whiteboard: EDITORBASE
Keywords: nsbeta1+
Whiteboard: EDITORBASE → EDITORBASE+[adt2]
Target Milestone: --- → mozilla1.0
The routine that copies style from the previous block into a new block is now
explicitly emptying the new block first.  This is because a block that passes
the IsEmptyNode() test is not neccessarily empty from a dom point of view.
Whiteboard: EDITORBASE+[adt2] → EDITORBASE+[adt2] FIXINHAND; need r,sr,a=
Component: Editor: Composer → Editor: Core
Comment on attachment 77021 [details] [diff] [review]
patch for nsHTMLEditor.cpp

r=glazman
Attachment #77021 - Flags: review+
Summary: extra break inserted into new list item after using style → [PATCH]extra break inserted into new list item after using style
Comment on attachment 77021 [details] [diff] [review]
patch for nsHTMLEditor.cpp

sr=kin@netscape.com

I know we check for NS_SUCCEEDED in the |while| expression, but do we care if
the aNewBlock->GetFirstChild() call fails in the loop? That is if it fails
would we want to return instead of breaking out of the loop?
Attachment #77021 - Flags: superreview+
Whiteboard: EDITORBASE+[adt2] FIXINHAND; need r,sr,a= → EDITORBASE+[adt2] FIXINHAND; need a=
adt1.0.0
Keywords: adt1.0.0, approval
Comment on attachment 77021 [details] [diff] [review]
patch for nsHTMLEditor.cpp

a=asa (on behalf of drivers) for checkin to the 1.0 trunk
Attachment #77021 - Flags: approval+
adt1.0.0+ (on ADT's behalf) approval for checkin into 1.0.
Keywords: adt1.0.0adt1.0.0+
fix landed on trunk
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
I can still reproduce this problem using 4/9 build using steps
originall described.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
moral: always test original testcase when fixing bug.  It turns out the original
testcase here was caused by two distinct bugs.  I fixed one and decalred
victory, but in fact had merely revealed the second.  Patch to fix second issue
is in 135337.
Whiteboard: EDITORBASE+[adt2] FIXINHAND; need a= → EDITORBASE+[adt2] FIXINHAND; patch in 135337
Depends on: 135337
fixed on trunk
Whiteboard: EDITORBASE+[adt2] FIXINHAND; patch in 135337 → EDITORBASE+[adt2] fixed on trunk ; patch in 135337
ADT gave approval for checkin on 04.04. Why hasn't this landed on the branch?
Resolving as FIXED. Please add fixed1.0.0 keyword after the fix has been checked
into the 1.0.0 branch.
Status: REOPENED → RESOLVED
Closed: 22 years ago22 years ago
Resolution: --- → FIXED
verified on 4/15 trunk build.

Status: RESOLVED → VERIFIED
Keywords: adt1.0.0+fixed1.0.0
fixed on branch
verified in 4/29 branch build.
Keywords: verified1.0.0
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: