Closed
Bug 97634
Opened 24 years ago
Closed 21 years ago
[FIXr]Event.target.parentNode of the Text element passed to a DOMCharacterDataModified/DOMNodeInserted listener is incorrect for a <textarea>'s contents.
Categories
(Core :: DOM: Core & HTML, defect, P2)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla1.7alpha
People
(Reporter: davidemmerson, Assigned: bzbarsky)
References
()
Details
(Keywords: dom2)
Attachments
(1 file)
8.94 KB,
patch
|
bryner
:
review+
jst
:
superreview+
|
Details | Diff | Splinter Review |
I've been trying out DOM2's mutation events, specifically to see when a textarea
is modified by handling DOMCharacterDataModified and DOMNodeInserted.
I am using Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.3+) Gecko/20010827 on
win98se.
What happens:
The events work fine, and the parameter passed to my handler is an event with a
target of the modified (or new) Text node.
The problem occurs when I try to check if the text node was the one in the
<textarea>. event.target.parentNode is returning HTMLDivElement,
event.parentNode.parentNode is the HTMLTextAreaElement.
What I expect to happen:
As a textarea is meant to contain PCDATA in HTML and my document has no <div>s,
I expect event.target.parentNode to be the textarea.
To reproduce:
Go to the url, type something into the box and see the alerted information.
Comment 1•24 years ago
|
||
confirming... where does the DIV come from!?
Status: UNCONFIRMED → NEW
Ever confirmed: true
![]() |
Assignee | |
Comment 2•24 years ago
|
||
ccing jst.... seems like a weird dom issue
Comment 3•24 years ago
|
||
Smells like anonymous content is leaking out to the DOM here, not good.
![]() |
Assignee | |
Comment 4•23 years ago
|
||
*** Bug 101197 has been marked as a duplicate of this bug. ***
![]() |
Assignee | |
Comment 5•23 years ago
|
||
Over to DOM HTML. This is definitely anonymous content leaking. See testcase
in bug 101197
Assignee: joki → jst
Severity: normal → major
Component: DOM Events → DOM HTML
Keywords: dom2
OS: Windows 98 → All
QA Contact: vladimire → stummala
Hardware: PC → All
Keywords: mozilla0.9.9
Updated•23 years ago
|
Priority: -- → P3
Comment 7•22 years ago
|
||
Still here with Mozilla trunk build 200211208 running under Mac OS 9.2.2.
![]() |
Assignee | |
Comment 9•21 years ago
|
||
*** Bug 225462 has been marked as a duplicate of this bug. ***
![]() |
Assignee | |
Comment 10•21 years ago
|
||
The problem here is that the event target is a Text node such never have a
bindingParent... as a result, event retargeting does not happen.
![]() |
Assignee | |
Comment 11•21 years ago
|
||
This makes Text nodes and other GenericDOMDataNodes implement
GetBindingParent() in the only sane way they can -- by looking at their parent.
The other option is to retarget for native anonymous content (something I think
I may prefer, actually, since the content inside a text control really
shouldn't have a binding parent set).
The patch also removes the code added to fix bug 29517 since that was obsoleted
by the bindingParent-based retargeting (I did test to make sure I didn't
regress that bug).
![]() |
Assignee | |
Comment 12•21 years ago
|
||
Taking, I guess.
Note that with this patch the DOMCharacterDataModified is targeted at the
_textarea_, not a Text node. There is no Text node to target it at, really,
since the actual Text node in the DOM is not modified when you type in a
textarea. Perhaps the textarea should simply suppress mutation events targeted
at its kids?
Or perhaps our retargeting should generally suppress mutation events, since they
don't make very much sense on the new target, usually...
Assignee: general → bz-vacation
Priority: P3 → P2
Summary: Event.target.parentNode of the Text element passed to a DOMCharacterDataModified/DOMNodeInserted listener is incorrect for a <textarea>'s contents. → [FIX]Event.target.parentNode of the Text element passed to a DOMCharacterDataModified/DOMNodeInserted listener is incorrect for a <textarea>'s contents.
Target Milestone: Future → mozilla1.6beta
![]() |
Assignee | |
Comment 13•21 years ago
|
||
Comment on attachment 135381 [details] [diff] [review]
Proposed patch
bryner? jst? What do you think?
Attachment #135381 -
Flags: superreview?(jst)
Attachment #135381 -
Flags: review?(bryner)
Comment 14•21 years ago
|
||
Does this patch have any effect on bug 101197?
![]() |
Assignee | |
Comment 15•21 years ago
|
||
No, which is why I reopened that bug.
Comment 16•21 years ago
|
||
Comment on attachment 135381 [details] [diff] [review]
Proposed patch
sr=jst for this patch, but I think supressing mutation events for things inside
text inputs is the way to go.
Attachment #135381 -
Flags: superreview?(jst) → superreview+
Updated•21 years ago
|
Attachment #135381 -
Flags: review?(bryner) → review+
![]() |
Assignee | |
Comment 17•21 years ago
|
||
Will land for 1.7a when tree opens.
Summary: [FIX]Event.target.parentNode of the Text element passed to a DOMCharacterDataModified/DOMNodeInserted listener is incorrect for a <textarea>'s contents. → [FIXr]Event.target.parentNode of the Text element passed to a DOMCharacterDataModified/DOMNodeInserted listener is incorrect for a <textarea>'s contents.
Target Milestone: mozilla1.6beta → mozilla1.7alpha
![]() |
Assignee | |
Comment 18•21 years ago
|
||
Checked in for 1.7a.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Component: DOM: HTML → DOM: Core & HTML
QA Contact: stummala → general
You need to log in
before you can comment on or make changes to this bug.
Description
•