Closed
Bug 487524
Opened 16 years ago
Closed 16 years ago
Attempting to delete single item in list containing sublist also removes next item
Categories
(Core :: DOM: Editor, defect, P2)
Tracking
()
RESOLVED
FIXED
People
(Reporter: annie.sullivan, Assigned: MatsPalmgren_bugz)
References
(Depends on 1 open bug, )
Details
(Keywords: fixed1.9.1, regression)
Attachments
(2 files)
4.22 KB,
patch
|
peterv
:
review+
peterv
:
superreview+
|
Details | Diff | Splinter Review |
2.78 KB,
patch
|
peterv
:
review+
|
Details | Diff | Splinter Review |
Steps to reproduce (Firefox 3.1 beta 3):
1. Go to midas demo: http://www.mozilla.org/editor/midasdemo/
2. Enter the following HTML:
<ul><li>one</li><li>two</li><ul><li>a</li></ul></ul>
3. Uncheck "View HTML Source" and put the cursor at the start of "one".
4. Press Shift+Down Arrow to select the entire item.
5. Press Delete or Backspace to remove the item.
Actual Result:
Both first and second list items are removed. Resulting HTML:
<ul><ul><li>a</li></ul></ul>
Expected Result:
Only the first list item (which was selected) is removed. Expected HTML:
<ul><li>two</li><ul><li>a</li></ul></ul>
(This is what I see in Firefox 3.0.8)
Reporter | ||
Updated•16 years ago
|
Flags: blocking1.9.1?
Assignee | ||
Comment 1•16 years ago
|
||
Regression window:
2008-10-15-13
http://hg.mozilla.org/mozilla-central/rev/3b4a3bfc99a7
2008-10-16-08
http://hg.mozilla.org/mozilla-central/rev/99dbf3b2688b
http://hg.mozilla.org/mozilla-central/pushloghtml?startdate=2008-10-15+12%3A00&enddate=2008-10-16+09%3A00
Backing out (needs a bit of work) bug 157546 locally seems to fix it.
Blocks: 157546
Keywords: regression
OS: Windows XP → All
Hardware: x86 → All
Summary: [Regression] Attempting to delete single item in list containing sublist also removes next item → Attempting to delete single item in list containing sublist also removes next item
Assignee | ||
Comment 2•16 years ago
|
||
It's the last hunk in nsHTMLEditRules.cpp that causes the problem:
https://bugzilla.mozilla.org/attachment.cgi?id=342183&action=diff#mozilla/editor/libeditor/html/nsHTMLEditRules.cpp_sec3
We're asking JoinBlocks() to join the 2nd <li> to the top <ul>, ie its
current parent. This is a "right block is inside left block" situation,
so JoinBlocks() calls MoveBlock() which decides to first call MoveContents()
for the <li> and then delete it. MoveContents() calls MoveNodeSmart()
which finds that <ul> can't contain #text so it calls MoveContents()
(for the #text node!) which just falls through with a NS_OK result
and then MoveNodeSmart() deletes it (the #text).
Assignee | ||
Comment 3•16 years ago
|
||
Assignee: nobody → mats.palmgren
Assignee | ||
Comment 4•16 years ago
|
||
Assignee | ||
Comment 5•16 years ago
|
||
Comment on attachment 371794 [details] [diff] [review]
wip3
Passes regression tests, without triggering the added assertion (on Linux).
Attachment #371794 -
Flags: superreview?(peterv)
Attachment #371794 -
Flags: review?(peterv)
Flags: blocking1.9.1? → blocking1.9.1+
Priority: -- → P2
Whiteboard: [needs review]
Updated•16 years ago
|
Attachment #371794 -
Flags: superreview?(peterv)
Attachment #371794 -
Flags: superreview+
Attachment #371794 -
Flags: review?(peterv)
Attachment #371794 -
Flags: review+
Updated•16 years ago
|
Attachment #372538 -
Flags: review+
Looks like this has been reviewed. Mats, can you land it, or do you want somebody else to?
Keywords: checkin-needed
Whiteboard: [needs review] → [needs landing]
Status: NEW → RESOLVED
Closed: 16 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Whiteboard: [needs landing] → [needs 191 landing]
Keywords: checkin-needed → fixed1.9.1
Whiteboard: [needs 191 landing]
You need to log in
before you can comment on or make changes to this bug.
Description
•