Closed
Bug 364413
Opened 19 years ago
Closed 19 years ago
Related node on DOMAttrModified listener isn't the same as attr node set by SetAttributeNodeNS
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
People
(Reporter: WeirdAl, Assigned: smaug)
Details
(Keywords: dom2, testcase)
Attachments
(4 files, 2 obsolete files)
7.92 KB,
text/plain
|
Details | |
1.18 KB,
application/vnd.mozilla.xul+xml
|
Details | |
2.11 KB,
patch
|
Details | Diff | Splinter Review | |
2.04 KB,
patch
|
sicking
:
review+
sicking
:
superreview+
|
Details | Diff | Splinter Review |
Similar problem to bug 364092. When I set an attribute via setAttributeNodeNS, the event listener on the owner element gets an event with a related node similar to, but not exactly, the node being set.
Testcase coming up as an attachment.
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20061219 SeaMonkey/1.5a
Reporter | ||
Comment 1•19 years ago
|
||
Reporter | ||
Updated•19 years ago
|
Summary: Related node on DOMAttrModifed listener isn't the same as attr node set by SetAttributeNodeNS → Related node on DOMAttrModified listener isn't the same as attr node set by SetAttributeNodeNS
Reporter | ||
Comment 2•19 years ago
|
||
In this case, nsDOMAttributeMap::SetNamedItemInternal() calls on nsGenericElement::SetAttr(), but does not pass in the original node. Later on, we have a call to GetNamedItemNS(), which tries to find the new attribute. No attribute has been set yet, so we create a new one. Ergo, we fail the test.
Reporter | ||
Comment 3•19 years ago
|
||
Thanks to smaug for inspiring this patch with his patch for the removeAttributeNode case. It took me a couple hours to see this myself.
Attachment #249217 -
Flags: superreview?(bugmail)
Attachment #249217 -
Flags: review?(bugmail)
Reporter | ||
Updated•19 years ago
|
Assignee: general → ajvincent
Reporter | ||
Comment 4•19 years ago
|
||
Comment on attachment 249217 [details] [diff] [review]
patch, v1
Uh, oops. We lost the new value of the attribute with this patch.
Attachment #249217 -
Flags: superreview?(bugmail)
Attachment #249217 -
Flags: review?(bugmail)
Reporter | ||
Comment 5•19 years ago
|
||
Attachment #249197 -
Attachment is obsolete: true
Reporter | ||
Comment 6•19 years ago
|
||
This patch gets the attribute value, and the event has the correct prevValue and newValue settings (according to Venkman).
Attachment #249217 -
Attachment is obsolete: true
Attachment #249222 -
Flags: superreview?(bugmail)
Attachment #249222 -
Flags: review?(bugmail)
Won't event.relatedNode.ownerElement be wrong with this patch? I.e. don't you want to call SetMap before calling SetAttr and solve the value problem some other way (I'm not sure I fully understand the comment in the patch)
Reporter | ||
Comment 8•19 years ago
|
||
Comment on attachment 249222 [details] [diff] [review]
patch, v1.1
Nuts, you're right. As Mike Rowe would call it, "rookie mistake!"
smaug, do you want to take this on and do it right?
Attachment #249222 -
Flags: superreview?(bugmail)
Attachment #249222 -
Flags: review?(bugmail)
Assignee | ||
Comment 9•19 years ago
|
||
(In reply to comment #8)
> (From update of attachment 249222 [details] [diff] [review] [edit])
> Nuts, you're right. As Mike Rowe would call it, "rookie mistake!"
>
> smaug, do you want to take this on and do it right?
>
Ok :)
Assignee: ajvincent → Olli.Pettay
Assignee | ||
Comment 10•19 years ago
|
||
Attachment #249252 -
Flags: superreview?(bugmail)
Attachment #249252 -
Flags: review?(bugmail)
Attachment #249252 -
Flags: superreview?(bugmail)
Attachment #249252 -
Flags: superreview+
Attachment #249252 -
Flags: review?(bugmail)
Attachment #249252 -
Flags: review+
Assignee | ||
Comment 11•19 years ago
|
||
I'll add the .ownerElement test to the testcase and add that to mochitest.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Assignee | ||
Updated•19 years ago
|
Flags: in-testsuite+
You need to log in
before you can comment on or make changes to this bug.
Description
•