Backed out changeset ea13caf078a7 (bug 847586)
authorEd Morley <emorley@mozilla.com>
Thu, 14 Mar 2013 13:23:28 +0000
changeset 124793 630d841daf46397e796c7fa30f6cee92a8f672ac
parent 124792 ea13caf078a735f3bd4904a56900df59cd6e8e18
child 124794 44810fa6c3122477c8f8ec2061c536f0caa39216
push id24611
push useremorley@mozilla.com
push dateThu, 14 Mar 2013 13:25:36 +0000
treeherdermozilla-inbound@9f128f1af706 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs847586
milestone22.0a1
backs outea13caf078a735f3bd4904a56900df59cd6e8e18
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset ea13caf078a7 (bug 847586)
content/events/src/nsDOMMutationEvent.cpp
content/events/src/nsDOMMutationEvent.h
dom/bindings/Bindings.conf
dom/webidl/MutationEvent.webidl
dom/webidl/WebIDL.mk
--- a/content/events/src/nsDOMMutationEvent.cpp
+++ b/content/events/src/nsDOMMutationEvent.cpp
@@ -1,27 +1,28 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsCOMPtr.h"
 #include "nsDOMClassInfoID.h"
 #include "nsDOMMutationEvent.h"
+#include "nsMutationEvent.h"
+
 
 class nsPresContext;
 
 nsDOMMutationEvent::nsDOMMutationEvent(mozilla::dom::EventTarget* aOwner,
                                        nsPresContext* aPresContext,
                                        nsMutationEvent* aEvent)
   : nsDOMEvent(aOwner, aPresContext,
                aEvent ? aEvent : new nsMutationEvent(false, 0))
 {
   mEventIsInternal = (aEvent == nullptr);
-  SetIsDOMBinding();
 }
 
 nsDOMMutationEvent::~nsDOMMutationEvent()
 {
   if (mEventIsInternal) {
     nsMutationEvent* mutation = static_cast<nsMutationEvent*>(mEvent);
     delete mutation;
     mEvent = nullptr;
@@ -36,19 +37,20 @@ NS_INTERFACE_MAP_BEGIN(nsDOMMutationEven
 NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
 
 NS_IMPL_ADDREF_INHERITED(nsDOMMutationEvent, nsDOMEvent)
 NS_IMPL_RELEASE_INHERITED(nsDOMMutationEvent, nsDOMEvent)
 
 NS_IMETHODIMP
 nsDOMMutationEvent::GetRelatedNode(nsIDOMNode** aRelatedNode)
 {
-  nsCOMPtr<nsINode> relatedNode = GetRelatedNode();
-  nsCOMPtr<nsIDOMNode> relatedDOMNode = relatedNode ? relatedNode->AsDOMNode() : nullptr;
-  relatedDOMNode.forget(aRelatedNode);
+  *aRelatedNode = nullptr;
+  nsMutationEvent* mutation = static_cast<nsMutationEvent*>(mEvent);
+  *aRelatedNode = mutation->mRelatedNode;
+  NS_IF_ADDREF(*aRelatedNode);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDOMMutationEvent::GetPrevValue(nsAString& aPrevValue)
 {
   nsMutationEvent* mutation = static_cast<nsMutationEvent*>(mEvent);
   if (mutation->mPrevAttrValue)
@@ -72,17 +74,20 @@ nsDOMMutationEvent::GetAttrName(nsAStrin
   if (mutation->mAttrName)
       mutation->mAttrName->ToString(aAttrName);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDOMMutationEvent::GetAttrChange(uint16_t* aAttrChange)
 {
-  *aAttrChange = AttrChange();
+  *aAttrChange = 0;
+  nsMutationEvent* mutation = static_cast<nsMutationEvent*>(mEvent);
+  if (mutation->mAttrChange)
+      *aAttrChange = mutation->mAttrChange;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDOMMutationEvent::InitMutationEvent(const nsAString& aTypeArg, bool aCanBubbleArg, bool aCancelableArg, nsIDOMNode* aRelatedNodeArg, const nsAString& aPrevValueArg, const nsAString& aNewValueArg, const nsAString& aAttrNameArg, uint16_t aAttrChangeArg)
 {
   nsresult rv = nsDOMEvent::InitEvent(aTypeArg, aCanBubbleArg, aCancelableArg);
   NS_ENSURE_SUCCESS(rv, rv);
--- a/content/events/src/nsDOMMutationEvent.h
+++ b/content/events/src/nsDOMMutationEvent.h
@@ -3,64 +3,27 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsDOMMutationEvent_h__
 #define nsDOMMutationEvent_h__
 
 #include "nsIDOMMutationEvent.h"
 #include "nsDOMEvent.h"
-#include "nsMutationEvent.h"
-#include "mozilla/dom/MutationEventBinding.h"
 
 class nsDOMMutationEvent : public nsDOMEvent,
                            public nsIDOMMutationEvent
 {
 public:
   nsDOMMutationEvent(mozilla::dom::EventTarget* aOwner,
                      nsPresContext* aPresContext, nsMutationEvent* aEvent);
 
   virtual ~nsDOMMutationEvent();
-
+                     
   NS_DECL_ISUPPORTS_INHERITED
 
   NS_DECL_NSIDOMMUTATIONEVENT
 
   // Forward to base class
   NS_FORWARD_TO_NSDOMEVENT
-
-  virtual JSObject* WrapObject(JSContext* aCx, JSObject* aScope)
-  {
-    return mozilla::dom::MutationEventBinding::Wrap(aCx, aScope, this);
-  }
-
-  // xpidl implementation
-  // GetPrevValue(nsAString& aPrevValue);
-  // GetNewValue(nsAString& aNewValue);
-  // GetAttrName(nsAString& aAttrName);
-
-  already_AddRefed<nsINode> GetRelatedNode()
-  {
-    nsCOMPtr<nsINode> n =
-      do_QueryInterface(static_cast<nsMutationEvent*>(mEvent)->mRelatedNode);
-    return n.forget();
-  }
-
-  uint16_t AttrChange()
-  {
-    return static_cast<nsMutationEvent*>(mEvent)->mAttrChange;
-  }
-
-  void InitMutationEvent(const nsAString& aType,
-                         bool& aCanBubble, bool& aCancelable,
-                         nsINode* aRelatedNode,
-                         const nsAString& aPrevValue,
-                         const nsAString& aNewValue,
-                         const nsAString& aAttrName,
-                         uint16_t& aAttrChange, mozilla::ErrorResult& aRv)
-  {
-    aRv = InitMutationEvent(aType, aCanBubble, aCancelable,
-                            aRelatedNode ? aRelatedNode->AsDOMNode() : nullptr,
-                            aPrevValue, aNewValue, aAttrName, aAttrChange);
-  }
 };
 
 #endif // nsDOMMutationEvent_h__
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -513,19 +513,16 @@ DOMInterfaces = {
 {
     'nativeType': 'nsIChannel',
     'notflattened': True
 },
 {
     'workers': True,
 }],
 
-'MutationEvent': {
-    'nativeType': 'nsDOMMutationEvent',
-},
 
 'MutationObserver': {
     'nativeType': 'nsDOMMutationObserver',
 },
 
 'MutationRecord': {
     'nativeType': 'nsDOMMutationRecord',
     'headerFile': 'nsDOMMutationObserver.h',
deleted file mode 100644
--- a/dom/webidl/MutationEvent.webidl
+++ /dev/null
@@ -1,33 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * The origin of this IDL file is
- * http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html
- *
- * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
- * liability, trademark and document use rules apply.
- */
-interface MutationEvent : Event
-{
-  const unsigned short MODIFICATION = 1;
-  const unsigned short ADDITION     = 2;
-  const unsigned short REMOVAL      = 3;
-
-  readonly attribute Node?          relatedNode;
-  readonly attribute DOMString      prevValue;
-  readonly attribute DOMString      newValue;
-  readonly attribute DOMString      attrName;
-  readonly attribute unsigned short attrChange;
-
-  [Throws]
-  void initMutationEvent(DOMString type,
-                         boolean canBubble,
-                         boolean cancelable,
-                         Node? relatedNode,
-                         DOMString prevValue,
-                         DOMString newValue,
-                         DOMString attrName,
-                         unsigned short attrChange);
-};
--- a/dom/webidl/WebIDL.mk
+++ b/dom/webidl/WebIDL.mk
@@ -120,17 +120,16 @@ webidl_files = \
   HTMLUListElement.webidl \
   IDBVersionChangeEvent.webidl \
   ImageData.webidl \
   LinkStyle.webidl \
   LocalMediaStream.webidl \
   Location.webidl \
   MediaStream.webidl \
   MessageEvent.webidl \
-  MutationEvent.webidl \
   MutationObserver.webidl \
   Node.webidl \
   NodeFilter.webidl \
   NodeIterator.webidl \
   NodeList.webidl \
   PaintRequest.webidl \
   PaintRequestList.webidl \
   PannerNode.webidl \