diff --git a/include/DOM/Simple/CharacterDataImpl.hpp b/include/DOM/Simple/CharacterDataImpl.hpp index 364eed95..9909b82d 100644 --- a/include/DOM/Simple/CharacterDataImpl.hpp +++ b/include/DOM/Simple/CharacterDataImpl.hpp @@ -4,6 +4,12 @@ #include #include +#define DISPATCH_DOM_CHARACTERDATA_MODIFIED_EVENT(oldValue, newValue) \ +DOM::Events::MutationEvent mutationEvent(NodeImpl::ownerDoc_->createEvent("MutationEvent")); \ +mutationEvent.initMutationEvent("DOMCharacterDataModified", true, false, Arabica::DOM::Node(), oldValue, newValue, "", Arabica::DOM::Events::MutationEvent::MODIFICATION); \ +DOM::Events::EventTarget eventTarget(this); \ +eventTarget.dispatchEvent(mutationEvent); \ + namespace Arabica { namespace SimpleDOM @@ -33,7 +39,9 @@ class CharacterDataImpl : virtual public DOM::CharacterData_impl static_cast(string_adaptorT::length(data_)))) throw DOM::DOMException(DOM::DOMException::INDEX_SIZE_ERR); + stringT oldValue = data_; string_adaptorT::insert(data_, offset, arg); + DISPATCH_DOM_CHARACTERDATA_MODIFIED_EVENT(oldValue, data_); } // insertData virtual void deleteData(int offset, int count) @@ -76,7 +88,9 @@ class CharacterDataImpl : virtual public DOM::CharacterData_impl