diff options
Diffstat (limited to 'dom/events')
-rwxr-xr-x | dom/events/Event.cpp | 14 | ||||
-rw-r--r-- | dom/events/SpeechRecognitionError.cpp | 51 | ||||
-rw-r--r-- | dom/events/SpeechRecognitionError.h | 62 | ||||
-rw-r--r-- | dom/events/moz.build | 6 | ||||
-rw-r--r-- | dom/events/test/test_eventTimeStamp.html | 6 |
5 files changed, 0 insertions, 139 deletions
diff --git a/dom/events/Event.cpp b/dom/events/Event.cpp index 280e40ad5..91417499b 100755 --- a/dom/events/Event.cpp +++ b/dom/events/Event.cpp @@ -44,9 +44,6 @@ extern bool IsCurrentThreadRunningChromeWorker(); static char *sPopupAllowedEvents; -static bool sReturnHighResTimeStamp = false; -static bool sReturnHighResTimeStampIsSet = false; - Event::Event(EventTarget* aOwner, nsPresContext* aPresContext, WidgetEvent* aEvent) @@ -67,13 +64,6 @@ Event::ConstructorInit(EventTarget* aOwner, SetOwner(aOwner); mIsMainThreadEvent = NS_IsMainThread(); - if (mIsMainThreadEvent && !sReturnHighResTimeStampIsSet) { - Preferences::AddBoolVarCache(&sReturnHighResTimeStamp, - "dom.event.highrestimestamp.enabled", - sReturnHighResTimeStamp); - sReturnHighResTimeStampIsSet = true; - } - mPrivateDataDuplicated = false; mWantsPopupControlCheck = false; @@ -1109,10 +1099,6 @@ Event::TimeStamp() const double Event::TimeStampImpl() const { - if (!sReturnHighResTimeStamp) { - return static_cast<double>(mEvent->mTime); - } - if (mEvent->mTimeStamp.IsNull()) { return 0.0; } diff --git a/dom/events/SpeechRecognitionError.cpp b/dom/events/SpeechRecognitionError.cpp deleted file mode 100644 index 2d0c357e6..000000000 --- a/dom/events/SpeechRecognitionError.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=80: */ -/* 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 "SpeechRecognitionError.h" - -namespace mozilla { -namespace dom { - -SpeechRecognitionError::SpeechRecognitionError( - mozilla::dom::EventTarget* aOwner, - nsPresContext* aPresContext, - WidgetEvent* aEvent) - : Event(aOwner, aPresContext, aEvent) - , mError() -{ -} - -SpeechRecognitionError::~SpeechRecognitionError() {} - -already_AddRefed<SpeechRecognitionError> -SpeechRecognitionError::Constructor(const GlobalObject& aGlobal, - const nsAString& aType, - const SpeechRecognitionErrorInit& aParam, - ErrorResult& aRv) -{ - nsCOMPtr<mozilla::dom::EventTarget> t = do_QueryInterface(aGlobal.GetAsSupports()); - RefPtr<SpeechRecognitionError> e = new SpeechRecognitionError(t, nullptr, nullptr); - bool trusted = e->Init(t); - e->InitSpeechRecognitionError(aType, aParam.mBubbles, aParam.mCancelable, aParam.mError, aParam.mMessage); - e->SetTrusted(trusted); - e->SetComposed(aParam.mComposed); - return e.forget(); -} - -void -SpeechRecognitionError::InitSpeechRecognitionError(const nsAString& aType, - bool aCanBubble, - bool aCancelable, - SpeechRecognitionErrorCode aError, - const nsAString& aMessage) -{ - Event::InitEvent(aType, aCanBubble, aCancelable); - mError = aError; - mMessage = aMessage; -} - -} // namespace dom -} // namespace mozilla diff --git a/dom/events/SpeechRecognitionError.h b/dom/events/SpeechRecognitionError.h deleted file mode 100644 index ef43feffd..000000000 --- a/dom/events/SpeechRecognitionError.h +++ /dev/null @@ -1,62 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=80: */ -/* 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 SpeechRecognitionError_h__ -#define SpeechRecognitionError_h__ - -#include "mozilla/dom/Event.h" -#include "mozilla/dom/SpeechRecognitionErrorBinding.h" - -namespace mozilla { -namespace dom { - -class SpeechRecognitionError : public Event -{ -public: - SpeechRecognitionError(mozilla::dom::EventTarget* aOwner, - nsPresContext* aPresContext, - WidgetEvent* aEvent); - virtual ~SpeechRecognitionError(); - - static already_AddRefed<SpeechRecognitionError> - Constructor(const GlobalObject& aGlobal, - const nsAString& aType, - const SpeechRecognitionErrorInit& aParam, - ErrorResult& aRv); - - virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override - { - return mozilla::dom::SpeechRecognitionErrorBinding::Wrap(aCx, this, aGivenProto); - } - - void - GetMessage(nsAString& aString) - { - aString = mMessage; - } - - SpeechRecognitionErrorCode - Error() - { - return mError; - } - - void - InitSpeechRecognitionError(const nsAString& aType, - bool aCanBubble, - bool aCancelable, - SpeechRecognitionErrorCode aError, - const nsAString& aMessage); - -protected: - SpeechRecognitionErrorCode mError; - nsString mMessage; -}; - -} // namespace dom -} // namespace mozilla - -#endif // SpeechRecognitionError_h__ diff --git a/dom/events/moz.build b/dom/events/moz.build index 661f56c7e..2378b92be 100644 --- a/dom/events/moz.build +++ b/dom/events/moz.build @@ -73,9 +73,6 @@ EXPORTS.mozilla.dom += [ 'XULCommandEvent.h', ] -if CONFIG['MOZ_WEBSPEECH']: - EXPORTS.mozilla.dom += ['SpeechRecognitionError.h'] - SOURCES += [ 'AnimationEvent.cpp', 'AsyncEventDispatcher.cpp', @@ -127,9 +124,6 @@ SOURCES += [ 'XULCommandEvent.cpp', ] -if CONFIG['MOZ_WEBSPEECH']: - SOURCES += ['SpeechRecognitionError.cpp'] - include('/ipc/chromium/chromium-config.mozbuild') FINAL_LIBRARY = 'xul' diff --git a/dom/events/test/test_eventTimeStamp.html b/dom/events/test/test_eventTimeStamp.html index 056203e92..5ca5cd47d 100644 --- a/dom/events/test/test_eventTimeStamp.html +++ b/dom/events/test/test_eventTimeStamp.html @@ -35,12 +35,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=77992 SimpleTest.waitForExplicitFinish(); SimpleTest.requestFlakyTimeout("untriaged"); -// We don't use SpecialPowers.pushPrefEnv since it can delay the test -// function until after the load event has fired which means we can't -// test the timestamp of the load event. -const kPrefName = "dom.event.highrestimestamp.enabled"; -var prevPrefValue = SpecialPowers.getBoolPref(kPrefName); -SpecialPowers.setBoolPref(kPrefName, true); testRegularEvents(); // Event.timeStamp should be relative to the time origin which is: |