Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #ifndef mozilla_dom_MutationEvent_h_ |
michael@0 | 7 | #define mozilla_dom_MutationEvent_h_ |
michael@0 | 8 | |
michael@0 | 9 | #include "mozilla/EventForwards.h" |
michael@0 | 10 | #include "mozilla/dom/Event.h" |
michael@0 | 11 | #include "mozilla/dom/MutationEventBinding.h" |
michael@0 | 12 | #include "nsIDOMMutationEvent.h" |
michael@0 | 13 | #include "nsINode.h" |
michael@0 | 14 | |
michael@0 | 15 | namespace mozilla { |
michael@0 | 16 | namespace dom { |
michael@0 | 17 | |
michael@0 | 18 | class MutationEvent : public Event, |
michael@0 | 19 | public nsIDOMMutationEvent |
michael@0 | 20 | { |
michael@0 | 21 | public: |
michael@0 | 22 | MutationEvent(EventTarget* aOwner, |
michael@0 | 23 | nsPresContext* aPresContext, |
michael@0 | 24 | InternalMutationEvent* aEvent); |
michael@0 | 25 | |
michael@0 | 26 | NS_DECL_ISUPPORTS_INHERITED |
michael@0 | 27 | |
michael@0 | 28 | NS_DECL_NSIDOMMUTATIONEVENT |
michael@0 | 29 | |
michael@0 | 30 | // Forward to base class |
michael@0 | 31 | NS_FORWARD_TO_EVENT |
michael@0 | 32 | |
michael@0 | 33 | virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE |
michael@0 | 34 | { |
michael@0 | 35 | return MutationEventBinding::Wrap(aCx, this); |
michael@0 | 36 | } |
michael@0 | 37 | |
michael@0 | 38 | // xpidl implementation |
michael@0 | 39 | // GetPrevValue(nsAString& aPrevValue); |
michael@0 | 40 | // GetNewValue(nsAString& aNewValue); |
michael@0 | 41 | // GetAttrName(nsAString& aAttrName); |
michael@0 | 42 | |
michael@0 | 43 | already_AddRefed<nsINode> GetRelatedNode(); |
michael@0 | 44 | |
michael@0 | 45 | uint16_t AttrChange(); |
michael@0 | 46 | |
michael@0 | 47 | void InitMutationEvent(const nsAString& aType, |
michael@0 | 48 | bool& aCanBubble, bool& aCancelable, |
michael@0 | 49 | nsINode* aRelatedNode, |
michael@0 | 50 | const nsAString& aPrevValue, |
michael@0 | 51 | const nsAString& aNewValue, |
michael@0 | 52 | const nsAString& aAttrName, |
michael@0 | 53 | uint16_t& aAttrChange, ErrorResult& aRv) |
michael@0 | 54 | { |
michael@0 | 55 | aRv = InitMutationEvent(aType, aCanBubble, aCancelable, |
michael@0 | 56 | aRelatedNode ? aRelatedNode->AsDOMNode() : nullptr, |
michael@0 | 57 | aPrevValue, aNewValue, aAttrName, aAttrChange); |
michael@0 | 58 | } |
michael@0 | 59 | }; |
michael@0 | 60 | |
michael@0 | 61 | } // namespace dom |
michael@0 | 62 | } // namespace mozilla |
michael@0 | 63 | |
michael@0 | 64 | #endif // mozilla_dom_MutationEvent_h_ |