From: Jeff R. <jef...@us...> - 2005-10-23 23:39:47
|
Update of /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorDom/SharpVectors/Dom/Events In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18901/src/SharpVectorDom/SharpVectors/Dom/Events Modified Files: Event.cs EventListenerMap.cs EventTarget.cs MutationEvent.cs MutationNameEvent.cs Log Message: Library wide fixes for Unit Test completion, only Mutation events left to implement for current test coverage Index: MutationNameEvent.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorDom/SharpVectors/Dom/Events/MutationNameEvent.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- MutationNameEvent.cs 15 Aug 2003 08:51:52 -0000 1.1 +++ MutationNameEvent.cs 23 Oct 2005 23:39:29 -0000 1.2 @@ -38,7 +38,7 @@ string eventType, bool bubbles, bool cancelable, - IXmlNode relatedNode, + INode relatedNode, string prevNamespaceUri, string prevNodeName) { @@ -55,7 +55,7 @@ string eventType, bool bubbles, bool cancelable, - IXmlNode relatedNode, + INode relatedNode, string prevNamespaceUri, string prevNodeName) { Index: EventListenerMap.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorDom/SharpVectors/Dom/Events/EventListenerMap.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- EventListenerMap.cs 14 Aug 2003 13:40:50 -0000 1.1 +++ EventListenerMap.cs 23 Oct 2005 23:39:29 -0000 1.2 @@ -129,7 +129,6 @@ { string namespaceUri = @event.NamespaceUri; string eventType = @event.Type; - for (int i = 0; i < count; i++) { string entryNamespaceUri = entries[i].NamespaceUri; Index: Event.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorDom/SharpVectors/Dom/Events/Event.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Event.cs 17 Aug 2003 11:00:56 -0000 1.2 +++ Event.cs 23 Oct 2005 23:39:29 -0000 1.3 @@ -201,8 +201,9 @@ #region Unit tests #if TEST + [TestFixture] - public class EventTests + public class EventTests { public class EventMonitor { @@ -622,10 +623,10 @@ @event.InitEvent("foo", true, false); ((IEventTarget)document).AddEventListener("foo", new EventListener(eventMonitor.EventHandler), false); - ((IEventTarget)document).DispatchEvent(@event); - Assertion.AssertEquals(eventMonitor.AtEvents, 1); - Assertion.AssertEquals(eventMonitor.BubbledEvents, 0); - Assertion.AssertEquals(eventMonitor.CapturedEvents, 0); + ((IEventTarget)document).DispatchEvent(@event); + Assertion.AssertEquals(1, eventMonitor.AtEvents); + Assertion.AssertEquals(0, eventMonitor.BubbledEvents); + Assertion.AssertEquals(0, eventMonitor.CapturedEvents); } /// <test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-2" name="dispatchEvent09"> @@ -645,7 +646,7 @@ ((IEventTarget)document).AddEventListener("foo", new EventListener(eventMonitor.EventHandler), true); ((IEventTarget)document).DispatchEvent(@event); - Assertion.AssertEquals(eventMonitor.AtEvents, 0); + Assertion.AssertEquals(eventMonitor.AtEvents, 0); Assertion.AssertEquals(eventMonitor.BubbledEvents, 0); Assertion.AssertEquals(eventMonitor.CapturedEvents, 0); } Index: MutationEvent.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorDom/SharpVectors/Dom/Events/MutationEvent.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- MutationEvent.cs 17 Aug 2003 11:00:56 -0000 1.2 +++ MutationEvent.cs 23 Oct 2005 23:39:29 -0000 1.3 @@ -15,7 +15,7 @@ { #region Private Fields - private IXmlNode relatedNode; + private INode relatedNode; private string prevValue; private string newValue; private string attrName; @@ -33,7 +33,7 @@ #region IMutationEvent interface - public IXmlNode RelatedNode + public INode RelatedNode { get { @@ -77,7 +77,7 @@ string eventType, bool bubbles, bool cancelable, - IXmlNode relatedNode, + INode relatedNode, string prevValue, string newValue, string attrName, @@ -97,7 +97,7 @@ string eventType, bool bubbles, bool cancelable, - IXmlNode relatedNode, + INode relatedNode, string prevValue, string newValue, string attrName, Index: EventTarget.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorDom/SharpVectors/Dom/Events/EventTarget.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- EventTarget.cs 21 Jan 2005 04:47:39 -0000 1.4 +++ EventTarget.cs 23 Oct 2005 23:39:29 -0000 1.5 @@ -108,13 +108,14 @@ ancestors.Add(currInstance); } currNode = (XmlNode)currInstance.CorrespondingUseElement; + ancestors.Add(currNode); } // Build actual ancestors - while (currNode != null) + while (currNode != null && currNode.ParentNode != null) { - ancestors.Add(currNode); currNode = currNode.ParentNode; + ancestors.Add(currNode); } @@ -146,13 +147,13 @@ } } - if (!realEvent.stopped) + if (!realEvent.stopped) { - realEvent.eventPhase = EventPhase.AtTarget; + realEvent.eventPhase = EventPhase.AtTarget; realEvent.currentTarget = this.eventTarget; this.eventTarget.FireEvent(realEvent); } - + if (!realEvent.stopped) { realEvent.eventPhase = EventPhase.BubblingPhase; |