Last Comment Bug 483651 - Trailing <br> node not removed when it should be
: Trailing <br> node not removed when it should be
Product: Core
Classification: Components
Component: Editor (show other bugs)
: Trunk
: All All
-- normal (vote)
: mozilla8
Assigned To: Graeme McCutcheon [:graememcc]
: Makoto Kato [:m_kato]
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:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

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

Description User image 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 User image Graeme McCutcheon [:graememcc] 2009-03-16 12:34:43 PDT
Created attachment 367636 [details] [diff] [review]

Proposed fix
Comment 2 User image :Ehsan Akhgari 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 User image Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary) 2011-08-14 05:01:20 PDT

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