Closed
Bug 152329
Opened 22 years ago
Closed 19 years ago
Inserting a text node in a textarea displays the text twice
Categories
(Core :: Layout: Form Controls, defect, P2)
Tracking
()
RESOLVED
FIXED
Future
People
(Reporter: ebourg, Assigned: mrbkap)
References
Details
(Keywords: testcase)
Attachments
(3 files)
1.04 KB,
text/html
|
Details | |
2.73 KB,
text/html
|
Details | |
2.46 KB,
patch
|
bzbarsky
:
review+
bzbarsky
:
superreview+
asa
:
approval1.8b3+
|
Details | Diff | Splinter Review |
Inserting a text node in a textarea displays the text twice. The text is incorectly displayed on the first line and doesn't scroll on moving the slider.
Reporter | ||
Comment 1•22 years ago
|
||
Comment 3•22 years ago
|
||
I see this on Win XP branch build 2002061708
Status: UNCONFIRMED → NEW
Ever confirmed: true
Reporter | ||
Comment 4•22 years ago
|
||
José Jeria provided an interesting screenshot of this bug, see Attachment 109537 [details]
Comment 5•22 years ago
|
||
I can reproduce using (todays) 2003020604 build on WinXP.
Priority: -- → P2
Target Milestone: --- → Future
Comment 6•21 years ago
|
||
I've created a bit more elaborate testcase. What you can see is, is that if you do textarea.normalize() after you've appended the textnode, the weird behavior disappears (not all the time, though) Also, I have made methods to put a paragraph element or a textarea element into the textarea. You can see how that affects the textarea and different properties of it.
Comment 7•21 years ago
|
||
I think this is somehow related with bug 215228 IMHO: - Textarea.innerHTML, textarea.childNodes[0].nodeValue, textarea.value and the text you can see inside the textarea should always be the same. - Objects generated with the DOM (textnodes, elements, whatever) should be inserted as strings if they are inserted in the textarea. - Textarea should never have more than one childNode (a textnode). Any attempts (textarea.splitText or something like that) should be made undone. A textarea may contain markup according to the w3c: http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.7 But I don't know if that means, that markup inside a textarea should be available via the DOM. I don't think it would be usefull for anything.
Comment 8•20 years ago
|
||
So the problem here is that we actually construct a frame for the textnode.... Perhaps we should not construct frames on dynamic changes if the parent frame has the REPLACED_ELEMENT flag set?
yeah
Hmm.. i could have sworn we had an ancient bug for this but i can't find it. I defenely remember it from when I fixed bug 17003 (amazing, i still remember that bugnumber). As I recall it the problem is that we create frames for all but the first text-child of the textarea. I.e. it seemed like the nsCSSFrameConstructor just skipped the first childnode of the textarea rather then all of them. That's why normalize fixes the problem since all textnodes are combined into one.
Comment 11•20 years ago
|
||
Perhaps the real problem is that we construct frames for kids of a textarea at all? Note bug 265367, eg.
Depends on: 265367
interestingly, it doesn't seem to happen for xhtml
(In reply to comment #7) > IMHO: > - Textarea.innerHTML, textarea.childNodes[0].nodeValue, textarea.value and the > text you can see inside the textarea should always be the same. No, the spec says otherwise. See bug 17003 comment 81. > - Objects generated with the DOM (textnodes, elements, whatever) should be > inserted as strings if they are inserted in the textarea. Depends on what you mean by 'as strings'. If you insert a node like <XXX>sometexthere</XXX> into a textarea we should either insert the text 'sometexthere' or we should ignore it compleatly, a good argument can be made for either. Right now I think we ignore it compleatly. > - Textarea should never have more than one childNode (a textnode). Any attempts > (textarea.splitText or something like that) should be made undone. Why? I defenetly don't agree. The DOM should allow for almost any change. How we render it is something different though. At least that's how I recall the DOM spec.
Assignee | ||
Comment 14•19 years ago
|
||
This makes us not construct frames for explicit children of <textarea>.
Assignee: kinmoz → mrbkap
Status: NEW → ASSIGNED
Attachment #185698 -
Flags: superreview?(bzbarsky)
Attachment #185698 -
Flags: review?(bzbarsky)
Comment 15•19 years ago
|
||
Comment on attachment 185698 [details] [diff] [review] patch v1 Fix the comment to mention <INPUT TYPE="text"> and TEXTAREA in both places, and r+sr=bzbarsky
Attachment #185698 -
Flags: superreview?(bzbarsky)
Attachment #185698 -
Flags: superreview+
Attachment #185698 -
Flags: review?(bzbarsky)
Attachment #185698 -
Flags: review+
Assignee | ||
Comment 16•19 years ago
|
||
Comment on attachment 185698 [details] [diff] [review] patch v1 More fixes to make <textarea>.innerHTML work correctly.
Attachment #185698 -
Flags: approval1.8b3?
Updated•19 years ago
|
Attachment #185698 -
Flags: approval1.8b3? → approval1.8b3+
Assignee | ||
Comment 17•19 years ago
|
||
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•