Reviewed by Dave Hyatt.
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 6 Aug 2005 16:30:14 +0000 (16:30 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 6 Aug 2005 16:30:14 +0000 (16:30 +0000)
        - fixed crash in one of the W3C DOM tests

        * khtml/xml/dom_nodeimpl.cpp: (DOM::NodeImpl::dispatchEvent): Check for NULL which means
        the passed object is not an event. Return without raising an exception because that's
        what Gecko does despite the fact that the DOM test expects a (platform-specific) exception.

        * layout-tests/dom/html/level2/events/dispatchEvent01-expected.txt: Added.
        * layout-tests/dom/html/level2/events/dispatchEvent01.html: Added.
        * layout-tests/dom/html/level2/events/dispatchEvent01.html-disabled: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@10071 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/dom/html/level2/events/dispatchEvent01-expected.txt [new file with mode: 0644]
LayoutTests/dom/html/level2/events/dispatchEvent01.html [moved from LayoutTests/dom/html/level2/events/dispatchEvent01.html-disabled with 100% similarity]
WebCore/ChangeLog-2005-08-23
WebCore/khtml/xml/dom_nodeimpl.cpp

diff --git a/LayoutTests/dom/html/level2/events/dispatchEvent01-expected.txt b/LayoutTests/dom/html/level2/events/dispatchEvent01-expected.txt
new file mode 100644 (file)
index 0000000..4241ec2
--- /dev/null
@@ -0,0 +1,3 @@
+Test:  http://www.w3.org/2001/DOM-Test-Suite/level2/events/dispatchEvent01     
+Status:        failure
+Detail:        throw_ImplException: assertTrue failed
index a8de1feaf1ed819395d7abc726ea1f1a94ec6f82..8f06f4950e1202f2725436324f16bc2a7041fa2e 100644 (file)
@@ -1,3 +1,17 @@
+2005-08-06  Darin Adler  <darin@apple.com>
+
+        Reviewed by Dave Hyatt.
+
+        - fixed crash in one of the W3C DOM tests
+
+        * khtml/xml/dom_nodeimpl.cpp: (DOM::NodeImpl::dispatchEvent): Check for NULL which means
+        the passed object is not an event. Return without raising an exception because that's
+        what Gecko does despite the fact that the DOM test expects a (platform-specific) exception.
+
+        * layout-tests/dom/html/level2/events/dispatchEvent01-expected.txt: Added.
+        * layout-tests/dom/html/level2/events/dispatchEvent01.html: Added.
+        * layout-tests/dom/html/level2/events/dispatchEvent01.html-disabled: Removed.
+
 2005-08-06  Darin Adler  <darin@apple.com>
 
         Reviewed by Dave Hyatt.
index 2c82f10a6b12f1fcfeb94bc107ed93b4bd99966f..9e3e76567ad45a60bf89a6279671a1dacdd437b0 100644 (file)
@@ -475,6 +475,11 @@ EventListener *NodeImpl::getHTMLEventListener(int id)
 
 bool NodeImpl::dispatchEvent(EventImpl *evt, int &exceptioncode, bool tempEvent)
 {
+    if (!evt) {
+        exceptioncode = 0;
+        return false;
+    }
+
     evt->ref();
 
     evt->setTarget(this);