Last Comment Bug 483651 - Trailing <br> node not removed when it should be
: Trailing <br> node not removed when it should be
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Editor (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla8
Assigned To: Graeme McCutcheon [:graememcc]
:
Mentors:
Depends on: 503838 740784
Blocks: 46555
  Show dependency treegraph
 
Reported: 2009-03-16 12:29 PDT by Graeme McCutcheon [:graememcc]
Modified: 2012-04-08 10:47 PDT (History)
6 users (show)
khuey: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch (8.43 KB, patch)
2009-03-16 12:34 PDT, Graeme McCutcheon [:graememcc]
no flags Details | Diff | Review
Updated patch (8.77 KB, patch)
2011-08-12 12:52 PDT, :Ehsan Akhgari (busy, don't ask for review please)
ehsan: review+
Details | Diff | Review

Description Graeme McCutcheon [:graememcc] 2009-03-16 12:29:42 PDT
When bug 132133, it ensured that the last node in non-empty non-single-line editors would be a <br> node. However, it proves very persistent - when all other content is removed from the tree, and it no longer serves any purpose, it should go away, and the special "bogus node" should reappear. Instead it sticks around.

Consequences of this include:
- documentIsEmpty reporting the wrong value
- deleting text in a <textarea> by a) manually backspacing through the text and b) select all followed by cut lead to different DOM trees
Comment 1 Graeme McCutcheon [:graememcc] 2009-03-16 12:34:43 PDT
Created attachment 367636 [details] [diff] [review]
Patch

Proposed fix
Comment 2 :Ehsan Akhgari (busy, don't ask for review please) 2011-08-12 12:52:30 PDT
Created attachment 552737 [details] [diff] [review]
Updated patch

The patch looked good, I just updated it to apply cleanly on trunk.  I'll land it on mozilla-inbound.
Comment 3 Kyle Huey [:khuey] (khuey@mozilla.com) (Away until 6/13) 2011-08-14 05:01:20 PDT
http://hg.mozilla.org/mozilla-central/rev/437f3eb67c18

Note You need to log in before you can comment on or make changes to this bug.