From 930d3a8b39b6da73b2e8890124b87648a26a94b4 Mon Sep 17 00:00:00 2001 From: Ryan VanderMeulen Date: Wed, 28 May 2014 16:28:24 -0400 Subject: [PATCH] Backed out changeset 457400a5938c (bug 1016053) for bustage. --- dom/events/EventDispatcher.cpp | 4 - dom/events/StorageEvent.cpp | 115 -------------------- dom/events/StorageEvent.h | 90 --------------- dom/events/moz.build | 2 - dom/events/test/mochitest.ini | 1 - dom/events/test/test_dom_storage_event.html | 62 ----------- dom/events/test/test_eventctors.html | 3 - dom/webidl/StorageEvent.webidl | 11 -- dom/webidl/moz.build | 2 +- 9 files changed, 1 insertion(+), 289 deletions(-) delete mode 100644 dom/events/StorageEvent.cpp delete mode 100644 dom/events/StorageEvent.h delete mode 100644 dom/events/test/test_dom_storage_event.html diff --git a/dom/events/EventDispatcher.cpp b/dom/events/EventDispatcher.cpp index 73bea8107b0..b881a19004c 100644 --- a/dom/events/EventDispatcher.cpp +++ b/dom/events/EventDispatcher.cpp @@ -832,10 +832,6 @@ EventDispatcher::CreateEvent(EventTarget* aOwner, return NS_NewDOMMozSmsEvent(aDOMEvent, aOwner, aPresContext, nullptr); if (aEventType.LowerCaseEqualsLiteral("mozmmsevent")) return NS_NewDOMMozMmsEvent(aDOMEvent, aOwner, aPresContext, nullptr); - if (aEventType.LowerCaseEqualsLiteral("storageevent")) { - return NS_NEWDOMStorageEvent(aDOMEvent, aOwner); - } - // NEW EVENT TYPES SHOULD NOT BE ADDED HERE; THEY SHOULD USE ONLY EVENT // CONSTRUCTORS diff --git a/dom/events/StorageEvent.cpp b/dom/events/StorageEvent.cpp deleted file mode 100644 index 036a942393c..00000000000 --- a/dom/events/StorageEvent.cpp +++ /dev/null @@ -1,115 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim:set ts=2 sw=2 sts=2 et cindent: */ -/* 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 "mozilla/dom/StorageEvent.h" -#include "nsIDOMStorage.h" - -namespace mozilla { -namespace dom { - -NS_IMPL_CYCLE_COLLECTION_CLASS(StorageEvent) - -NS_IMPL_ADDREF_INHERITED(StorageEvent, Event) -NS_IMPL_RELEASE_INHERITED(StorageEvent, Event) - -NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(StorageEvent, Event) - NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mStorageArea) -NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END - -NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(StorageEvent, Event) -NS_IMPL_CYCLE_COLLECTION_TRACE_END - -NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(StorageEvent, Event) - NS_IMPL_CYCLE_COLLECTION_UNLINK(mStorageArea) -NS_IMPL_CYCLE_COLLECTION_UNLINK_END - -NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(StorageEvent) -NS_INTERFACE_MAP_END_INHERITING(Event) - -StorageEvent::StorageEvent(EventTarget* aOwner) - : Event(aOwner, nullptr, nullptr) -{ -} - -StorageEvent::~StorageEvent() -{ -} - -StorageEvent* -StorageEvent::AsStorageEvent() -{ - return this; -} - -JSObject* -StorageEvent::WrapObject(JSContext* aCx) -{ - return StorageEventBinding::Wrap(aCx, this); -} - -already_AddRefed -StorageEvent::Constructor(EventTarget* aOwner, - const nsAString& aType, - const StorageEventInit& aEventInitDict) -{ - nsRefPtr e = new StorageEvent(aOwner); - - bool trusted = e->Init(aOwner); - e->InitEvent(aType, aEventInitDict.mBubbles, aEventInitDict.mCancelable); - e->mKey = aEventInitDict.mKey; - e->mOldValue = aEventInitDict.mOldValue; - e->mNewValue = aEventInitDict.mNewValue; - e->mUrl = aEventInitDict.mUrl; - e->mStorageArea = aEventInitDict.mStorageArea; - e->SetTrusted(trusted); - - return e.forget(); -} - -already_AddRefed -StorageEvent::Constructor(const GlobalObject& aGlobal, - const nsAString& aType, - const StorageEventInit& aEventInitDict, - ErrorResult& aRv) -{ - nsCOMPtr owner = do_QueryInterface(aGlobal.GetAsSupports()); - return Constructor(owner, aType, aEventInitDict); -} - -void -StorageEvent::InitStorageEvent(const nsAString& aType, bool aCanBubble, - bool aCancelable, const nsAString& aKey, - const nsAString& aOldValue, - const nsAString& aNewValue, - const nsAString& aURL, - nsIDOMStorage* aStorageArea, - ErrorResult& aRv) -{ - aRv = InitEvent(aType, aCanBubble, aCancelable); - if (aRv.Failed()) { - return; - } - - mKey = aKey; - mOldValue = aOldValue; - mNewValue = aNewValue; - mUrl = aURL; - mStorageArea = aStorageArea; -} - -nsresult -NS_NEWDOMStorageEvent(nsIDOMEvent** aDOMEvent, EventTarget* aOwner) -{ - nsRefPtr e = new StorageEvent(aOwner); - - e->SetTrusted(e->Init(aOwner)); - e.forget(aDOMEvent); - - return NS_OK; -} - -} // namespace dom -} // namespace mozilla diff --git a/dom/events/StorageEvent.h b/dom/events/StorageEvent.h deleted file mode 100644 index 53ded83e258..00000000000 --- a/dom/events/StorageEvent.h +++ /dev/null @@ -1,90 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim:set ts=2 sw=2 sts=2 et cindent: */ -/* 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/. */ - -#ifndef mozilla_dom_StorageEvent_h -#define mozilla_dom_StorageEvent_h - -#include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" -#include "mozilla/dom/BindingUtils.h" -#include "mozilla/dom/Event.h" -#include "mozilla/dom/StorageEventBinding.h" - -class nsIDOMStorage; - -namespace mozilla { -namespace dom { - -// Helper for EventDispatcher. -nsresult NS_NEWDOMStorageEvent(nsIDOMEvent** aDOMEvent, EventTarget* aOwner); - -class StorageEvent : public Event -{ -public: - NS_DECL_ISUPPORTS_INHERITED - NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(StorageEvent, Event) - - StorageEvent(EventTarget* aOwner); - virtual ~StorageEvent(); - -protected: - nsString mKey; - nsString mOldValue; - nsString mNewValue; - nsString mUrl; - nsCOMPtr mStorageArea; - -public: - virtual StorageEvent* AsStorageEvent(); - - virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE; - - static already_AddRefed - Constructor(EventTarget* aOwner, const nsAString& aType, - const StorageEventInit& aEventInitDict); - - static already_AddRefed - Constructor(const GlobalObject& aGlobal, const nsAString& aType, - const StorageEventInit& aEventInitDict, ErrorResult& aRv); - - void InitStorageEvent(const nsAString& aType, bool aCanBubble, - bool aCancelable, const nsAString& aKey, - const nsAString& aOldValue, - const nsAString& aNewValue, - const nsAString& aURL, - nsIDOMStorage* aStorageArea, - ErrorResult& aRv); - - void GetKey(nsString& aRetVal) const - { - aRetVal = mKey; - } - - void GetOldValue(nsString& aRetVal) const - { - aRetVal = mOldValue; - } - - void GetNewValue(nsString& aRetVal) const - { - aRetVal = mNewValue; - } - - void GetUrl(nsString& aRetVal) const - { - aRetVal = mUrl; - } - - nsIDOMStorage* GetStorageArea() const - { - return mStorageArea; - } -}; - -} // namespace dom -} // namespace mozilla - -#endif // mozilla_dom_StorageEvent_h diff --git a/dom/events/moz.build b/dom/events/moz.build index a4b3ff77232..b6eb0ad0a74 100644 --- a/dom/events/moz.build +++ b/dom/events/moz.build @@ -54,7 +54,6 @@ EXPORTS.mozilla.dom += [ 'PointerEvent.h', 'ScrollAreaEvent.h', 'SimpleGestureEvent.h', - 'StorageEvent.h', 'Touch.h', 'TouchEvent.h', 'TransitionEvent.h', @@ -99,7 +98,6 @@ UNIFIED_SOURCES += [ 'PointerEvent.cpp', 'ScrollAreaEvent.cpp', 'SimpleGestureEvent.cpp', - 'StorageEvent.cpp', 'TextComposition.cpp', 'Touch.cpp', 'TouchEvent.cpp', diff --git a/dom/events/test/mochitest.ini b/dom/events/test/mochitest.ini index eab54336ef6..e89c10fa835 100644 --- a/dom/events/test/mochitest.ini +++ b/dom/events/test/mochitest.ini @@ -155,4 +155,3 @@ skip-if = toolkit == 'android' #CRASH_DUMP, RANDOM [test_wheel_default_action.html] skip-if = buildapp == 'b2g' || e10s [test_bug985988.html] -[test_dom_storage_event.html] diff --git a/dom/events/test/test_dom_storage_event.html b/dom/events/test/test_dom_storage_event.html deleted file mode 100644 index 4ac967dfe79..00000000000 --- a/dom/events/test/test_dom_storage_event.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - Test for DOM StorageEvent - - - - -

- -
-
-
- - diff --git a/dom/events/test/test_eventctors.html b/dom/events/test/test_eventctors.html index 27420a6e01f..953ce2024ca 100644 --- a/dom/events/test/test_eventctors.html +++ b/dom/events/test/test_eventctors.html @@ -559,9 +559,6 @@ is(receivedEvent, e, "Wrong event!"); // StorageEvent -e = document.createEvent("StorageEvent"); -ok(e, "Should have created an event!"); - try { e = new StorageEvent(); } catch(exp) { diff --git a/dom/webidl/StorageEvent.webidl b/dom/webidl/StorageEvent.webidl index 20b23dd323b..a444465a889 100644 --- a/dom/webidl/StorageEvent.webidl +++ b/dom/webidl/StorageEvent.webidl @@ -19,17 +19,6 @@ interface StorageEvent : Event readonly attribute DOMString? newValue; readonly attribute DOMString? url; readonly attribute Storage? storageArea; - - // Bug 1016053 - This is not spec compliant. - [Throws] - void initStorageEvent(DOMString type, - boolean canBubble, - boolean cancelable, - DOMString? key, - DOMString? oldValue, - DOMString? newValue, - DOMString? url, - Storage? storageArea); }; dictionary StorageEventInit : EventInit diff --git a/dom/webidl/moz.build b/dom/webidl/moz.build index b6c91558b1c..ddf47e075e8 100644 --- a/dom/webidl/moz.build +++ b/dom/webidl/moz.build @@ -314,7 +314,6 @@ WEBIDL_FILES = [ 'SimpleGestureEvent.webidl', 'SourceBuffer.webidl', 'SourceBufferList.webidl', - 'StorageEvent.webidl', 'StorageType.webidl', 'StyleSheet.webidl', 'StyleSheetList.webidl', @@ -641,6 +640,7 @@ GENERATED_EVENTS_WEBIDL_FILES = [ 'RTCPeerConnectionIceEvent.webidl', 'RTCPeerConnectionIdentityErrorEvent.webidl', 'RTCPeerConnectionIdentityEvent.webidl', + 'StorageEvent.webidl', 'TrackEvent.webidl', 'UserProximityEvent.webidl', 'USSDReceivedEvent.webidl',