Closed
Bug 414223
Opened 17 years ago
Closed 13 years ago
[MIDAS] contenteditable adds a phantom <br> (goes away when pressing enter)
Categories
(Core :: DOM: Editor, defect)
Tracking
()
RESOLVED
WONTFIX
People
(Reporter: bugzilla, Unassigned)
References
(Depends on 1 open bug)
Details
(Keywords: testcase, Whiteboard: midas [parity-webkit] [parity-IE] [parity-opera])
Attachments
(1 file, 1 obsolete file)
145 bytes,
text/html
|
Details |
Build ID: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9b3pre) Gecko/2008012704 Minefield/3.0b3pre
Steps to reproduce:
1. load testcase (and notice the extra space above the paragraph)
2. click somewhere on the paragraph and press enter
3. note that the extra space above is gone
DOM Inspector says that the extra br tag inserted has the following nodeName and nodeValue:
_moz_editor_bogus_node="TRUE"
_moz_dirty=""
Reporter | ||
Comment 1•17 years ago
|
||
Reporter | ||
Updated•17 years ago
|
Whiteboard: midas
As far as I know when I last looked at this, in the case of Midas, the extra <br> is needed because if the <p> element is empty, then the whole element is collapsed, making the caret at a weird position. The dummy <br> makes it so there's always something in the new elements.
And I think this existed before the bug 322202 patch.
Has this changed recently?
Reporter | ||
Comment 3•17 years ago
|
||
Yes, it changed after bug 322202 was checked in. Also note that the br tag is added before the paragraph.
Flags: blocking1.9?
Reporter | ||
Comment 4•17 years ago
|
||
Note that, this issue has nothing to do with the paragraph, it will still insert a brake tag even though there are no paragraphs present.
Reporter | ||
Comment 5•17 years ago
|
||
Sorry for the confusion. This behavior existed before bug 322202 was checked in.
Note that this testcase has no paragraph and it will still insert a brake tag.
Internet Explorer, Safari and Opera does _not_ add this extra brake tag.
Attachment #299572 -
Attachment is obsolete: true
Reporter | ||
Updated•17 years ago
|
Whiteboard: midas → midas [parity-safari] [parity-IE] [parity-opera]
Why is this marked as a regression?
Reporter | ||
Comment 7•17 years ago
|
||
regression keyword is incorrect. I thought that bug 322202 had caused this. Removing keyword.
Keywords: regression
Flags: wanted1.9+
Flags: blocking1.9?
Flags: blocking1.9-
We should look at removing the <br> hack. We now have much more flexibility in positioning the caret and can possibly do without it.
Flags: wanted1.9-
Flags: wanted1.9+
Flags: wanted-next+
Reporter | ||
Updated•16 years ago
|
Reporter | ||
Updated•16 years ago
|
Flags: blocking1.9.2?
Reporter | ||
Updated•16 years ago
|
Whiteboard: midas [parity-safari] [parity-IE] [parity-opera] → midas [parity-safari] [parity-IE] [parity-opera] [parity-chrome]
Updated•15 years ago
|
Depends on: better-invisible-br-handling
Updated•15 years ago
|
Flags: wanted1.9.2-
Flags: blocking1.9.2?
Flags: blocking1.9.2-
Updated•15 years ago
|
Whiteboard: midas [parity-safari] [parity-IE] [parity-opera] [parity-chrome] → midas [parity-webkit] [parity-IE] [parity-opera]
Comment 9•14 years ago
|
||
I think the only remaining dependency to fix this bug is to make sure that empty contenteditable block elements have the same height as if they contained a BR node when reflown. I'll look at this once we branch for 2.0.
Whiteboard: midas [parity-webkit] [parity-IE] [parity-opera] → midas [parity-webkit] [parity-IE] [parity-opera][post-2.0]
Reporter | ||
Comment 10•14 years ago
|
||
This bug is WFM using Firefox 4.0.1. Testcase works fine. Should this bug be closed or should bug 503838 be fixed first?
Comment 11•13 years ago
|
||
See comment 9, please!
Comment 12•13 years ago
|
||
(In reply to Ehsan Akhgari [:ehsan] from comment #9)
> I think the only remaining dependency to fix this bug is to make sure that
> empty contenteditable block elements have the same height as if they
> contained a BR node when reflown. I'll look at this once we branch for 2.0.
We can't make display change based on whether elements are editable. That would make contenteditable not WYSIWYG -- the paragraphs don't collapse, then when you publish your blog post or whatever and it's not editable, suddenly they collapse and it looks different. The <br> hacks are terrible, but I see no better solution -- thus something like Gecko's behavior is required by the editing spec.
Comment 13•13 years ago
|
||
Yeah, as much as this sucks, this is WONTFIX I think. :/
Whiteboard: midas [parity-webkit] [parity-IE] [parity-opera][post-2.0] → midas [parity-webkit] [parity-IE] [parity-opera]
Updated•13 years ago
|
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → WONTFIX
Comment 14•9 years ago
|
||
ContentEditable is not, by definition, WYSIWYG. Consider the case of inline text styling. There is almost never a 1:1 parity between the visual representation of the nodes and the underlying markup. Please consider reopening this? No other major browsers add these BR tags, and it tends to mess with actual WYSIWYG libraries and frameworks (since a line break, in many circumstances, counts as "content" when calculating whether a field/node/area of text is empty or not).
Comment 15•9 years ago
|
||
just posted a related issue https://bugzilla.mozilla.org/show_bug.cgi?id=1249374
Are there plans to change this <br> placeholder?
You need to log in
before you can comment on or make changes to this bug.
Description
•