Closed Bug 72065 Opened 24 years ago Closed 23 years ago

mutation events don't work in xml/html

Categories

(Core :: DOM: Events, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla0.9.1

People

(Reporter: alex, Assigned: hyatt)

Details

(Keywords: xhtml)

Testcase below produces assertion in nsXMLElement::HandleDOMEvent() because its 
being passed a null PresContext.
A similar XUL testcase works fine.

-------------------------------------------------------------
<?xml version="1.0" ?>
<doc xmlns:html="http://www.w3.org/1999/xhtml" >
<html:script language="javascript">
function handler(e){ 
    alert(e); 
}
function attachHandler(){ 
    document.documentElement.addEventListener("DOMAttrModified",handler,false);
}
var gCount=0;
function modifyAttrib(){
    document.documentElement.setAttribute("foo",++gCount);
}
</html:script>
<html:button onclick="attachHandler();">add mutation listener</html:button>
<html:button onclick="modifyAttrib();">modify an attrib</html:button>
</doc>
------------------------------------------------------------------------
Probably my fault.
Assignee: joki → hyatt
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9.1
Fixed.  I removed the bogus NS_ENSURE_ARG for the pres context at the front of 
nsXMLElement's HandleDOMEvent.  The pres context is null for mutation events, 
so this check is bogus.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
verifying build 2001-04-10-04-trunk
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.