Open
Bug 656626
Opened 13 years ago
Updated 2 years ago
innerHTML reports a superfluous HTMLBRElement after editing a heading with contenteditable set to true
Categories
(Core :: DOM: Editor, defect)
Core
DOM: Editor
Tracking
()
NEW
People
(Reporter: klaus.foerster, Unassigned)
References
(Blocks 1 open bug, )
Details
(Whiteboard: [h2review-noted])
Attachments
(1 file)
(deleted),
text/html
|
Details |
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 Build Identifier: Mozilla/5.0 (X11; Linux i686; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 When you edit a heading that has its contenteditable attribute set to true and add spaces at its end, an extra HTMLBRElement is reported by innerHTML after the last space. Once it is added, there is no way to get rid of it anymore. When you add characters instead of spaces, no HTMLBRElement is added. Reproducible: Always Steps to Reproduce: follow instructions at URL that demonstrates the problem Actual Results: one HTMLBRElement is reported at the end of the string Expected Results: no HTMLBRElement should be reported at all
Comment 1•13 years ago
|
||
Reproduced. Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.2.17) Gecko/20110420 Firefox/3.6.17 Mozilla/5.0 (X11; Linux x86_64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 Mozilla/5.0 (X11; Linux x86_64; rv:6.0a1) Gecko/20110513 Firefox/6.0a1 Mozilla/5.0 (Windows NT 6.0; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 Mozilla/5.0 (Windows NT 6.0; rv:6.0a1) Gecko/20110514 Firefox/6.0a1
OS: Linux → All
Hardware: x86 → All
Version: unspecified → Trunk
Comment 2•13 years ago
|
||
I attached the testcase in case it gets deleted from the web server.
Updated•13 years ago
|
Status: UNCONFIRMED → NEW
Component: General → Editor
Ever confirmed: true
Product: Firefox → Core
QA Contact: general → editor
Comment 3•13 years ago
|
||
Boris, do you think that the HTML encoder should treat the bogus BR node especially (by excluding it from the output)?
Comment 4•13 years ago
|
||
That would be pretty odd... and also the bogus BR node is in the DOM anyway, no? So you can detect its presence in other ways. Can we somehow avoid putting it there to start with?
Comment 5•13 years ago
|
||
(In reply to comment #4) > Can we somehow avoid putting it there to start with? I will hopefully remove it some day, but that's a rather large project...
Comment 6•13 years ago
|
||
In that case, I wouldn't worry too much about this bug for now....
Comment 7•6 years ago
|
||
… and 8 years later, this bug is still around. This also applies to block elements like <p>, resulting in quite some messed up HTML markup.
<div contenteditable="true"><p>Test</p></div>
Adding a space after "Test" yields a <br> too, regardless of any content before or after that <p>.
Updated•6 years ago
|
Blocks: editor-blink-compat
Comment 8•4 years ago
|
||
Possibly related to https://bugzilla.mozilla.org/show_bug.cgi?id=503838?
Whiteboard: [h2review-noted]
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•