author | Boris Zbarsky <bzbarsky@mit.edu> |
Fri, 20 Apr 2018 00:49:30 -0400 | |
changeset 414736 | d03756b18579a4bd43e4123af683d1cbfe9660d7 |
parent 414735 | 706b6ff8ea85d0c8e6f51a46c96eb4897a21523c |
child 414737 | 36f208401c8766b95e3b3f5a6bfdf733c0a796bf |
push id | 33876 |
push user | dluca@mozilla.com |
push date | Fri, 20 Apr 2018 23:00:46 +0000 |
treeherder | mozilla-central@39ccabfd7d07 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | mccr8 |
bugs | 1429903 |
milestone | 61.0a1 |
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
|
--- a/dom/base/nsContentUtils.h +++ b/dom/base/nsContentUtils.h @@ -1351,22 +1351,22 @@ public: nsIDocument* aOwnerDoc); /** * This method creates and dispatches a trusted event. * Works only with events which can be created by calling * nsIDOMDocument::CreateEvent() with parameter "Events". * @param aDoc The document which will be used to create the event. * @param aTarget The target of the event, should be QIable to - * nsIDOMEventTarget. + * EventTarget. * @param aEventName The name of the event. * @param aCanBubble Whether the event can bubble. * @param aCancelable Is the event cancelable. * @param aDefaultAction Set to true if default action should be taken, - * see nsIDOMEventTarget::DispatchEvent. + * see EventTarget::DispatchEvent. */ static nsresult DispatchTrustedEvent(nsIDocument* aDoc, nsISupports* aTarget, const nsAString& aEventName, bool aCanBubble, bool aCancelable, bool *aDefaultAction = nullptr); @@ -1374,17 +1374,17 @@ public: * This method creates and dispatches a trusted event using an event message. * @param aDoc The document which will be used to create the event. * @param aTarget The target of the event, should be QIable to * EventTarget. * @param aEventMessage The event message. * @param aCanBubble Whether the event can bubble. * @param aCancelable Is the event cancelable. * @param aDefaultAction Set to true if default action should be taken, - * see nsIDOMEventTarget::DispatchEvent. + * see EventTarget::DispatchEvent. */ template <class WidgetEventType> static nsresult DispatchTrustedEvent(nsIDocument* aDoc, nsISupports* aTarget, mozilla::EventMessage aEventMessage, bool aCanBubble, bool aCancelable, bool *aDefaultAction = nullptr, @@ -1398,22 +1398,22 @@ public: } /** * This method creates and dispatches a untrusted event. * Works only with events which can be created by calling * nsIDOMDocument::CreateEvent() with parameter "Events". * @param aDoc The document which will be used to create the event. * @param aTarget The target of the event, should be QIable to - * nsIDOMEventTarget. + * EventTarget. * @param aEventName The name of the event. * @param aCanBubble Whether the event can bubble. * @param aCancelable Is the event cancelable. * @param aDefaultAction Set to true if default action should be taken, - * see nsIDOMEventTarget::DispatchEvent. + * see EventTarget::DispatchEvent. */ static nsresult DispatchUntrustedEvent(nsIDocument* aDoc, nsISupports* aTarget, const nsAString& aEventName, bool aCanBubble, bool aCancelable, bool *aDefaultAction = nullptr); @@ -1422,17 +1422,17 @@ public: * This method creates and dispatches a untrusted event using an event message. * @param aDoc The document which will be used to create the event. * @param aTarget The target of the event, should be QIable to * EventTarget. * @param aEventMessage The event message. * @param aCanBubble Whether the event can bubble. * @param aCancelable Is the event cancelable. * @param aDefaultAction Set to true if default action should be taken, - * see nsIDOMEventTarget::DispatchEvent. + * see EventTarget::DispatchEvent. */ template <class WidgetEventType> static nsresult DispatchUntrustedEvent(nsIDocument* aDoc, nsISupports* aTarget, mozilla::EventMessage aEventMessage, bool aCanBubble, bool aCancelable, bool *aDefaultAction = nullptr, @@ -1456,17 +1456,17 @@ public: * @param aDocument The document which will be used to create the event, * and whose window's chrome handler will be used to * dispatch the event. * @param aTarget The target of the event, used for event->SetTarget() * @param aEventName The name of the event. * @param aCanBubble Whether the event can bubble. * @param aCancelable Is the event cancelable. * @param aDefaultAction Set to true if default action should be taken, - * see nsIDOMEventTarget::DispatchEvent. + * see EventTarget::DispatchEvent. */ static nsresult DispatchChromeEvent(nsIDocument* aDoc, nsISupports* aTarget, const nsAString& aEventName, bool aCanBubble, bool aCancelable, bool *aDefaultAction = nullptr); @@ -1484,22 +1484,22 @@ public: * propagation path will be used as the start of the event target chain. * This method is different than DispatchChromeEvent, which always dispatches * events to chrome event handler. DispatchEventOnlyToChrome works like * DispatchTrustedEvent in the case aTarget is a chrome object. * Works only with events which can be created by calling * nsIDOMDocument::CreateEvent() with parameter "Events". * @param aDoc The document which will be used to create the event. * @param aTarget The target of the event, should be QIable to - * nsIDOMEventTarget. + * EventTarget. * @param aEventName The name of the event. * @param aCanBubble Whether the event can bubble. * @param aCancelable Is the event cancelable. * @param aDefaultAction Set to true if default action should be taken, - * see nsIDOMEventTarget::DispatchEvent. + * see EventTarget::DispatchEvent. */ static nsresult DispatchEventOnlyToChrome(nsIDocument* aDoc, nsISupports* aTarget, const nsAString& aEventName, bool aCanBubble, bool aCancelable, bool *aDefaultAction = nullptr);
--- a/dom/base/nsGlobalWindowInner.cpp +++ b/dom/base/nsGlobalWindowInner.cpp @@ -14,16 +14,17 @@ #include "Navigator.h" #include "nsContentSecurityManager.h" #include "nsScreen.h" #include "nsHistory.h" #include "nsDOMNavigationTiming.h" #include "nsIDOMStorageManager.h" #include "mozilla/dom/DOMJSProxyHandler.h" #include "mozilla/dom/DOMPrefs.h" +#include "mozilla/dom/EventTarget.h" #include "mozilla/dom/LocalStorage.h" #include "mozilla/dom/Storage.h" #include "mozilla/dom/IdleRequest.h" #include "mozilla/dom/Performance.h" #include "mozilla/dom/StorageEvent.h" #include "mozilla/dom/StorageEventBinding.h" #include "mozilla/dom/StorageNotifierService.h" #include "mozilla/dom/StorageUtils.h" @@ -1612,17 +1613,17 @@ nsGlobalWindowInner::IsBlackForCC(bool a { if (!nsCCUncollectableMarker::sGeneration) { return false; } return (nsCCUncollectableMarker::InGeneration(GetMarkedCCGeneration()) || HasKnownLiveWrapper()) && (!aTracingNeeded || - HasNothingToTrace(static_cast<nsIDOMEventTarget*>(this))); + HasNothingToTrace(ToSupports(this))); } //***************************************************************************** // nsGlobalWindowInner::nsIScriptGlobalObject //***************************************************************************** nsresult nsGlobalWindowInner::EnsureScriptEnvironment() @@ -2041,17 +2042,17 @@ nsGlobalWindowInner::PostHandleEvent(Eve break; default: return NS_OK; } /* mChromeEventHandler and mContext go dangling in the middle of this function under some circumstances (events that destroy the window) without this addref. */ - nsCOMPtr<nsIDOMEventTarget> kungFuDeathGrip1(mChromeEventHandler); + RefPtr<EventTarget> kungFuDeathGrip1(mChromeEventHandler); mozilla::Unused << kungFuDeathGrip1; // These aren't referred to through the function nsCOMPtr<nsIScriptContext> kungFuDeathGrip2(GetContextInternal()); mozilla::Unused << kungFuDeathGrip2; // These aren't referred to through the function if (aVisitor.mEvent->mMessage == eResize) { mIsHandlingResizeEvent = false; } else if (aVisitor.mEvent->mMessage == eUnload && @@ -4481,17 +4482,17 @@ nsGlobalWindowInner::Atob(const nsAStrin void nsGlobalWindowInner::Btoa(const nsAString& aBinaryData, nsAString& aAsciiBase64String, ErrorResult& aError) { aError = nsContentUtils::Btoa(aBinaryData, aAsciiBase64String); } //***************************************************************************** -// nsGlobalWindowInner::nsIDOMEventTarget +// EventTarget //***************************************************************************** nsPIDOMWindowOuter* nsGlobalWindowInner::GetOwnerGlobalForBindings() { return nsPIDOMWindowOuter::GetFromCurrentInner(this); }
--- a/dom/base/nsGlobalWindowInner.h +++ b/dom/base/nsGlobalWindowInner.h @@ -1504,23 +1504,23 @@ protected: friend class mozilla::dom::TimeoutManager; friend class IdleRequestExecutor; friend class nsGlobalWindowOuter; }; inline nsISupports* ToSupports(nsGlobalWindowInner *p) { - return static_cast<nsIDOMEventTarget*>(p); + return static_cast<mozilla::dom::EventTarget*>(p); } inline nsISupports* ToCanonicalSupports(nsGlobalWindowInner *p) { - return static_cast<nsIDOMEventTarget*>(p); + return static_cast<mozilla::dom::EventTarget*>(p); } // XXX: EWW - This is an awful hack - let's not do this #include "nsGlobalWindowOuter.h" inline nsIGlobalObject* nsGlobalWindowInner::GetOwnerGlobal() const {
--- a/dom/base/nsGlobalWindowOuter.cpp +++ b/dom/base/nsGlobalWindowOuter.cpp @@ -1215,17 +1215,17 @@ nsGlobalWindowOuter::IsBlackForCC(bool a { if (!nsCCUncollectableMarker::sGeneration) { return false; } return (nsCCUncollectableMarker::InGeneration(GetMarkedCCGeneration()) || HasKnownLiveWrapper()) && (!aTracingNeeded || - HasNothingToTrace(static_cast<nsIDOMEventTarget*>(this))); + HasNothingToTrace(ToSupports(this))); } //***************************************************************************** // nsGlobalWindowOuter::nsIScriptGlobalObject //***************************************************************************** nsresult nsGlobalWindowOuter::EnsureScriptEnvironment()
--- a/dom/base/nsGlobalWindowOuter.h +++ b/dom/base/nsGlobalWindowOuter.h @@ -1169,23 +1169,23 @@ protected: }; // XXX: EWW - This is an awful hack - let's not do this #include "nsGlobalWindowInner.h" inline nsISupports* ToSupports(nsGlobalWindowOuter *p) { - return static_cast<nsIDOMEventTarget*>(p); + return static_cast<mozilla::dom::EventTarget*>(p); } inline nsISupports* ToCanonicalSupports(nsGlobalWindowOuter *p) { - return static_cast<nsIDOMEventTarget*>(p); + return static_cast<mozilla::dom::EventTarget*>(p); } inline nsIGlobalObject* nsGlobalWindowOuter::GetOwnerGlobal() const { return GetCurrentInnerWindowInternal(); }
--- a/dom/base/nsWindowMemoryReporter.cpp +++ b/dom/base/nsWindowMemoryReporter.cpp @@ -730,17 +730,17 @@ nsWindowMemoryReporter::Observe(nsISuppo } return NS_OK; } void nsWindowMemoryReporter::ObserveDOMWindowDetached(nsGlobalWindowInner* aWindow) { - nsWeakPtr weakWindow = do_GetWeakReference(static_cast<nsIDOMEventTarget*>(aWindow)); + nsWeakPtr weakWindow = do_GetWeakReference(aWindow); if (!weakWindow) { NS_WARNING("Couldn't take weak reference to a window?"); return; } mDetachedWindows.Put(weakWindow, TimeStamp()); AsyncCheckForGhostWindows();
--- a/dom/events/Event.h +++ b/dom/events/Event.h @@ -18,17 +18,16 @@ #include "mozilla/dom/BindingDeclarations.h" #include "mozilla/dom/EventBinding.h" #include "nsIScriptGlobalObject.h" #include "Units.h" #include "js/TypeDecls.h" #include "nsIGlobalObject.h" class nsIContent; -class nsIDOMEventTarget; class nsPresContext; namespace mozilla { namespace dom { class BeforeUnloadEvent; class CustomEvent; class DragEvent;
--- a/dom/html/HTMLEmbedElement.h +++ b/dom/html/HTMLEmbedElement.h @@ -24,17 +24,17 @@ public: mozilla::dom::FromParser aFromParser = mozilla::dom::NOT_FROM_PARSER); // nsISupports NS_DECL_ISUPPORTS_INHERITED NS_IMPL_FROMNODE_HTML_WITH_TAG(HTMLEmbedElement, embed) virtual int32_t TabIndexDefault() override; #ifdef XP_MACOSX - // nsIDOMEventTarget + // EventTarget NS_IMETHOD PostHandleEvent(EventChainPostVisitor& aVisitor) override; #endif // EventTarget virtual void AsyncEventRunning(AsyncEventDispatcher* aEvent) override; virtual nsresult BindToTree(nsIDocument *aDocument, nsIContent *aParent, nsIContent *aBindingParent,
--- a/dom/html/HTMLObjectElement.h +++ b/dom/html/HTMLObjectElement.h @@ -27,17 +27,17 @@ public: // nsISupports NS_DECL_ISUPPORTS_INHERITED NS_IMPL_FROMNODE_HTML_WITH_TAG(HTMLObjectElement, object) virtual int32_t TabIndexDefault() override; #ifdef XP_MACOSX - // nsIDOMEventTarget + // EventTarget NS_IMETHOD PostHandleEvent(EventChainPostVisitor& aVisitor) override; // Helper methods static void OnFocusBlurPlugin(Element* aElement, bool aFocus); static void HandleFocusBlurPlugin(Element* aElement, WidgetEvent* aEvent); static void HandlePluginCrashed(Element* aElement); static void HandlePluginInstantiated(Element* aElement); // Weak pointer. Null if last action was blur. static Element* sLastFocused;
--- a/dom/indexedDB/IDBDatabase.h +++ b/dom/indexedDB/IDBDatabase.h @@ -286,17 +286,16 @@ public: NS_DECL_ISUPPORTS_INHERITED NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(IDBDatabase, IDBWrapperCache) // DOMEventTargetHelper void DisconnectFromOwner() override; - // nsIDOMEventTarget virtual void LastRelease() override; virtual nsresult PostHandleEvent(EventChainPostVisitor& aVisitor) override; // nsWrapperCache virtual JSObject*
--- a/dom/indexedDB/IDBRequest.h +++ b/dom/indexedDB/IDBRequest.h @@ -246,17 +246,17 @@ public: SetTransaction(IDBTransaction* aTransaction); void DispatchNonTransactionError(nsresult aErrorCode); void NoteComplete(); - // nsIDOMEventTarget + // EventTarget virtual nsresult PostHandleEvent(EventChainPostVisitor& aVisitor) override; IDBFactory* Factory() const { return mFactory; }
--- a/dom/media/webaudio/MediaStreamAudioSourceNode.cpp +++ b/dom/media/webaudio/MediaStreamAudioSourceNode.cpp @@ -94,17 +94,17 @@ MediaStreamAudioSourceNode::Init(DOMMedi if (NS_WARN_IF(graph != inputStream->Graph())) { aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR); return; } mInputStream = aMediaStream; AudioNodeEngine* engine = new MediaStreamAudioSourceNodeEngine(this); mStream = AudioNodeExternalInputStream::Create(graph, engine); - mInputStream->AddConsumerToKeepAlive(static_cast<nsIDOMEventTarget*>(this)); + mInputStream->AddConsumerToKeepAlive(ToSupports(this)); mInputStream->RegisterTrackListener(this); AttachToFirstTrack(mInputStream); } void MediaStreamAudioSourceNode::Destroy() {
--- a/dom/offline/nsDOMOfflineResourceList.cpp +++ b/dom/offline/nsDOMOfflineResourceList.cpp @@ -511,20 +511,16 @@ nsDOMOfflineResourceList::SwapCache() } mAvailableApplicationCache = nullptr; mStatus = nsIDOMOfflineResourceList::IDLE; return NS_OK; } -// -// nsDOMOfflineResourceList::nsIDOMEventTarget -// - void nsDOMOfflineResourceList::FirePendingEvents() { for (int32_t i = 0; i < mPendingEvents.Count(); ++i) { RefPtr<Event> event = mPendingEvents[i]; DispatchEvent(*event); } mPendingEvents.Clear();
--- a/dom/workers/WorkerError.cpp +++ b/dom/workers/WorkerError.cpp @@ -111,23 +111,23 @@ public: // this stuff without ending up firing any events is ... hard. Just // return for now. // https://bugzilla.mozilla.org/show_bug.cgi?id=1271441 tracks // making this better. return; } MOZ_ASSERT(globalScope->GetWrapperPreserveColor() == global); - nsIDOMEventTarget* target = static_cast<nsIDOMEventTarget*>(globalScope); RefPtr<ErrorEvent> event = ErrorEvent::Constructor(aTarget, NS_LITERAL_STRING("error"), init); event->SetTrusted(true); - if (NS_FAILED(EventDispatcher::DispatchDOMEvent(target, nullptr, + if (NS_FAILED(EventDispatcher::DispatchDOMEvent(ToSupports(globalScope), + nullptr, event, nullptr, &status))) { NS_WARNING("Failed to dispatch worker thread error event!"); status = nsEventStatus_eIgnore; } } else if ((sgo = nsJSUtils::GetStaticScriptGlobal(global))) { MOZ_ASSERT(NS_IsMainThread()); @@ -365,23 +365,23 @@ WorkerErrorReport::ReportError(JSContext // this stuff without ending up firing any events is ... hard. Just // return for now. // https://bugzilla.mozilla.org/show_bug.cgi?id=1271441 tracks // making this better. return; } MOZ_ASSERT(globalScope->GetWrapperPreserveColor() == global); - nsIDOMEventTarget* target = static_cast<nsIDOMEventTarget*>(globalScope); RefPtr<ErrorEvent> event = ErrorEvent::Constructor(aTarget, NS_LITERAL_STRING("error"), init); event->SetTrusted(true); - if (NS_FAILED(EventDispatcher::DispatchDOMEvent(target, nullptr, + if (NS_FAILED(EventDispatcher::DispatchDOMEvent(ToSupports(globalScope), + nullptr, event, nullptr, &status))) { NS_WARNING("Failed to dispatch worker thread error event!"); status = nsEventStatus_eIgnore; } } else if ((sgo = nsJSUtils::GetStaticScriptGlobal(global))) { MOZ_ASSERT(NS_IsMainThread());
--- a/dom/workers/WorkerScope.h +++ b/dom/workers/WorkerScope.h @@ -456,12 +456,12 @@ private: }; } // namespace dom } // namespace mozilla inline nsISupports* ToSupports(mozilla::dom::WorkerGlobalScope* aScope) { - return static_cast<nsIDOMEventTarget*>(aScope); + return static_cast<mozilla::dom::EventTarget*>(aScope); } #endif /* mozilla_dom_workerscope_h__ */
--- a/editor/libeditor/EditorBase.cpp +++ b/editor/libeditor/EditorBase.cpp @@ -46,16 +46,17 @@ #include "mozilla/Services.h" // for GetObserverService #include "mozilla/TextComposition.h" // for TextComposition #include "mozilla/TextInputListener.h" // for TextInputListener #include "mozilla/TextServicesDocument.h" // for TextServicesDocument #include "mozilla/TextEvents.h" #include "mozilla/TransactionManager.h" // for TransactionManager #include "mozilla/dom/CharacterData.h" // for CharacterData #include "mozilla/dom/Element.h" // for Element, nsINode::AsElement +#include "mozilla/dom/EventTarget.h" // for EventTarget #include "mozilla/dom/HTMLBodyElement.h" #include "mozilla/dom/Text.h" #include "mozilla/dom/Event.h" #include "nsAString.h" // for nsAString::Length, etc. #include "nsCCUncollectableMarker.h" // for nsCCUncollectableMarker #include "nsCaret.h" // for nsCaret #include "nsCaseTreatment.h" #include "nsCharTraits.h" // for NS_IS_HIGH_SURROGATE, etc. @@ -71,17 +72,16 @@ #include "nsGkAtoms.h" // for nsGkAtoms, nsGkAtoms::dir #include "nsIAbsorbingTransaction.h" // for nsIAbsorbingTransaction #include "nsAtom.h" // for nsAtom #include "nsIContent.h" // for nsIContent #include "nsIDOMDocument.h" // for nsIDOMDocument #include "nsIDOMElement.h" // for nsIDOMElement #include "nsIDOMEvent.h" // for nsIDOMEvent #include "nsIDOMEventListener.h" // for nsIDOMEventListener -#include "nsIDOMEventTarget.h" // for nsIDOMEventTarget #include "nsIDOMNode.h" // for nsIDOMNode, etc. #include "nsIDocumentStateListener.h" // for nsIDocumentStateListener #include "nsIEditActionListener.h" // for nsIEditActionListener #include "nsIEditorObserver.h" // for nsIEditorObserver #include "nsIEditorSpellCheck.h" // for nsIEditorSpellCheck #include "nsIFrame.h" // for nsIFrame #include "nsIHTMLDocument.h" // for nsIHTMLDocument #include "nsIInlineSpellChecker.h" // for nsIInlineSpellChecker, etc. @@ -345,20 +345,17 @@ EditorBase::PostCreate() // update the UI with our state NotifyDocumentListeners(eDocumentCreated); NotifyDocumentListeners(eDocumentStateChanged); } // update nsTextStateManager and caret if we have focus nsCOMPtr<nsIContent> focusedContent = GetFocusedContent(); if (focusedContent) { - nsCOMPtr<nsIDOMEventTarget> target = do_QueryInterface(focusedContent); - if (target) { - InitializeSelection(target); - } + InitializeSelection(focusedContent); // If the text control gets reframed during focus, Focus() would not be // called, so take a chance here to see if we need to spell check the text // control. mEventListener->SpellCheckIfNeeded(); IMEState newState; rv = GetPreferredIMEState(&newState); @@ -4935,17 +4932,17 @@ EditorBase::FindSelectionRoot(nsINode* a void EditorBase::InitializeSelectionAncestorLimit(Selection& aSelection, nsIContent& aAncestorLimit) { aSelection.SetAncestorLimiter(&aAncestorLimit); } nsresult -EditorBase::InitializeSelection(nsIDOMEventTarget* aFocusEventTarget) +EditorBase::InitializeSelection(EventTarget* aFocusEventTarget) { nsCOMPtr<nsINode> targetNode = do_QueryInterface(aFocusEventTarget); NS_ENSURE_TRUE(targetNode, NS_ERROR_INVALID_ARG); nsCOMPtr<nsIContent> selectionRootContent = FindSelectionRoot(targetNode); if (!selectionRootContent) { return NS_OK; } @@ -5213,17 +5210,17 @@ bool EditorBase::IsModifiableNode(nsINode* aNode) { return true; } nsIContent* EditorBase::GetFocusedContent() { - nsIDOMEventTarget* piTarget = GetDOMEventTarget(); + EventTarget* piTarget = GetDOMEventTarget(); if (!piTarget) { return nullptr; } nsFocusManager* fm = nsFocusManager::GetFocusManager(); NS_ENSURE_TRUE(fm, nullptr); nsIContent* content = fm->GetFocusedContent(); @@ -5237,17 +5234,17 @@ EditorBase::GetFocusedContentForIME() { nsCOMPtr<nsIContent> content = GetFocusedContent(); return content.forget(); } bool EditorBase::IsActiveInDOMWindow() { - nsIDOMEventTarget* piTarget = GetDOMEventTarget(); + EventTarget* piTarget = GetDOMEventTarget(); if (!piTarget) { return false; } nsFocusManager* fm = nsFocusManager::GetFocusManager(); NS_ENSURE_TRUE(fm, false); nsCOMPtr<nsIDocument> document = GetDocument(); @@ -5322,17 +5319,17 @@ EditorBase::IsAcceptableInputEvent(Widge } // Otherwise, we shouldn't handle any input events when we're not an active // element of the DOM window. return IsActiveInDOMWindow(); } void -EditorBase::OnFocus(nsIDOMEventTarget* aFocusEventTarget) +EditorBase::OnFocus(EventTarget* aFocusEventTarget) { InitializeSelection(aFocusEventTarget); mSpellCheckerDictionaryUpdated = false; if (mInlineSpellChecker && CanEnableSpellCheck()) { mInlineSpellChecker->UpdateCurrentDictionary(); mSpellCheckerDictionaryUpdated = true; } }
--- a/editor/libeditor/EditorBase.h +++ b/editor/libeditor/EditorBase.h @@ -36,17 +36,16 @@ #include "nsWeakReference.h" // for nsSupportsWeakReference #include "nscore.h" // for nsresult, nsAString, etc. class mozInlineSpellChecker; class nsAtom; class nsIContent; class nsIDOMDocument; class nsIDOMEvent; -class nsIDOMEventTarget; class nsIDOMNode; class nsIDocumentStateListener; class nsIEditActionListener; class nsIEditorObserver; class nsINode; class nsIPresShell; class nsISupports; class nsITransaction; @@ -1511,24 +1510,24 @@ public: */ virtual already_AddRefed<nsIContent> FindSelectionRoot(nsINode* aNode); /** * Initializes selection and caret for the editor. If aEventTarget isn't * a host of the editor, i.e., the editor doesn't get focus, this does * nothing. */ - nsresult InitializeSelection(nsIDOMEventTarget* aFocusEventTarget); + nsresult InitializeSelection(dom::EventTarget* aFocusEventTarget); /** * This method has to be called by EditorEventListener::Focus. * All actions that have to be done when the editor is focused needs to be * added here. */ - void OnFocus(nsIDOMEventTarget* aFocusEventTarget); + void OnFocus(dom::EventTarget* aFocusEventTarget); /** * Used to insert content from a data transfer into the editable area. * This is called for each item in the data transfer, with the index of * each item passed as aIndex. */ virtual nsresult InsertFromDataTransfer(dom::DataTransfer* aDataTransfer, int32_t aIndex,
--- a/editor/libeditor/EditorEventListener.cpp +++ b/editor/libeditor/EditorEventListener.cpp @@ -27,17 +27,16 @@ #include "nsGkAtoms.h" // for nsGkAtoms, nsGkAtoms::input #include "nsIClipboard.h" // for nsIClipboard, etc. #include "nsIContent.h" // for nsIContent #include "nsIController.h" // for nsIController #include "nsID.h" #include "mozilla/dom/DOMStringList.h" #include "mozilla/dom/DataTransfer.h" #include "mozilla/dom/DragEvent.h" -#include "nsIDOMEventTarget.h" // for nsIDOMEventTarget #include "nsIDocument.h" // for nsIDocument #include "nsIFocusManager.h" // for nsIFocusManager #include "nsIFormControl.h" // for nsIFormControl, etc. #include "nsINode.h" // for nsINode, ::NODE_IS_EDITABLE, etc. #include "nsIPlaintextEditor.h" // for nsIPlaintextEditor, etc. #include "nsIPresShell.h" // for nsIPresShell #include "nsISelectionController.h" // for nsISelectionController, etc. #include "nsITransferable.h" // for kFileMime, kHTMLMime, etc. @@ -1061,17 +1060,17 @@ EditorEventListener::Focus(InternalFocus // Spell check a textarea the first time that it is focused. SpellCheckIfNeeded(); if (!editorBase) { // In e10s, this can cause us to flush notifications, which can destroy // the node we're about to focus. return NS_OK; } - nsIDOMEventTarget* target = aFocusEvent->GetOriginalDOMEventTarget(); + EventTarget* target = aFocusEvent->GetOriginalDOMEventTarget(); nsCOMPtr<nsINode> node = do_QueryInterface(target); NS_ENSURE_TRUE(node, NS_ERROR_UNEXPECTED); // If the target is a document node but it's not editable, we should ignore // it because actual focused element's event is going to come. if (node->IsDocument() && !node->HasFlag(NODE_IS_EDITABLE)) { return NS_OK; } @@ -1093,21 +1092,18 @@ EditorEventListener::Focus(InternalFocus nsFocusManager* fm = nsFocusManager::GetFocusManager(); NS_ENSURE_TRUE(fm, NS_OK); nsIContent* focusedContent = fm->GetFocusedContent(); if (!focusedContent) { return NS_OK; } - nsCOMPtr<nsIDOMEventTarget> originalTarget = - aFocusEvent->GetOriginalDOMEventTarget(); - nsCOMPtr<nsIContent> originalTargetAsContent = - do_QueryInterface(originalTarget); + do_QueryInterface(aFocusEvent->GetOriginalDOMEventTarget()); if (!SameCOMIdentity( focusedContent->FindFirstNonChromeOnlyAccessContent(), originalTargetAsContent->FindFirstNonChromeOnlyAccessContent())) { return NS_OK; } } } @@ -1186,18 +1182,18 @@ EditorEventListener::ShouldHandleNativeK // Only return true if the target of the event is a desendant of the active // editing host in order to match the similar decision made in // nsXBLWindowKeyHandler. // Note that IsAcceptableInputEvent doesn't check for the active editing // host for keyboard events, otherwise this check would have been // unnecessary. IsAcceptableInputEvent currently makes a similar check for // mouse events. - nsIDOMEventTarget* target = aKeyboardEvent->GetDOMEventTarget(); - nsCOMPtr<nsIContent> targetContent = do_QueryInterface(target); + nsCOMPtr<nsIContent> targetContent = + do_QueryInterface(aKeyboardEvent->GetDOMEventTarget()); if (!targetContent) { return false; } RefPtr<EditorBase> editorBase(mEditorBase); HTMLEditor* htmlEditor = editorBase->AsHTMLEditor(); if (!htmlEditor) { return false;
--- a/editor/libeditor/HTMLEditor.cpp +++ b/editor/libeditor/HTMLEditor.cpp @@ -4799,19 +4799,18 @@ HTMLEditor::NotifyRootChanged() rv = BeginningOfDocument(); if (NS_FAILED(rv)) { return; } // When this editor has focus, we need to reset the selection limiter to // new root. Otherwise, that is going to be done when this gets focus. nsCOMPtr<nsINode> node = GetFocusedNode(); - nsCOMPtr<nsIDOMEventTarget> target = do_QueryInterface(node); - if (target) { - InitializeSelection(target); + if (node) { + InitializeSelection(node); } SyncRealTimeSpell(); } Element* HTMLEditor::GetBodyElement() { @@ -4871,17 +4870,17 @@ HTMLEditor::IsAcceptableInputEvent(Widge // While there is composition, all composition events in its top level window // are always fired on the composing editor. Therefore, if this editor has // composition, the composition events should be handled in this editor. if (mComposition && aGUIEvent->AsCompositionEvent()) { return true; } - nsCOMPtr<nsIDOMEventTarget> target = aGUIEvent->GetOriginalDOMEventTarget(); + RefPtr<EventTarget> target = aGUIEvent->GetOriginalDOMEventTarget(); nsCOMPtr<nsIContent> content = do_QueryInterface(target); if (content) { target = content->FindFirstNonChromeOnlyAccessContent(); } NS_ENSURE_TRUE(target, false); nsCOMPtr<nsIDocument> document = GetDocument(); if (NS_WARN_IF(!document)) {
--- a/editor/libeditor/HTMLEditorEventListener.cpp +++ b/editor/libeditor/HTMLEditorEventListener.cpp @@ -4,24 +4,24 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "HTMLEditorEventListener.h" #include "HTMLEditUtils.h" #include "mozilla/HTMLEditor.h" #include "mozilla/MouseEvents.h" #include "mozilla/dom/Event.h" +#include "mozilla/dom/EventTarget.h" #include "mozilla/dom/MouseEvent.h" #include "mozilla/dom/Selection.h" #include "nsCOMPtr.h" #include "nsDebug.h" #include "nsError.h" #include "nsIDOMElement.h" #include "nsIDOMEvent.h" -#include "nsIDOMEventTarget.h" #include "nsISupportsImpl.h" #include "nsLiteralString.h" #include "nsQueryObject.h" #include "nsRange.h" namespace mozilla { using namespace dom; @@ -47,17 +47,17 @@ HTMLEditorEventListener::MouseUp(MouseEv return NS_OK; } // FYI: We need to notify HTML editor of mouseup even if it's consumed // because HTML editor always needs to release grabbing resizer. HTMLEditor* htmlEditor = mEditorBase->AsHTMLEditor(); MOZ_ASSERT(htmlEditor); - nsCOMPtr<nsIDOMEventTarget> target = aMouseEvent->GetTarget(); + RefPtr<EventTarget> target = aMouseEvent->GetTarget(); NS_ENSURE_TRUE(target, NS_ERROR_NULL_POINTER); nsCOMPtr<nsIDOMElement> element = do_QueryInterface(target); int32_t clientX = aMouseEvent->ClientX(); int32_t clientY = aMouseEvent->ClientY(); htmlEditor->OnMouseUp(clientX, clientY, element); return EditorEventListener::MouseUp(aMouseEvent); @@ -95,17 +95,17 @@ HTMLEditorEventListener::MouseDown(Mouse // But eDOMEvents_contextmenu and eContextMenu is not exposed in any event // interface :-( int16_t buttonNumber = aMouseEvent->Button(); bool isContextClick = buttonNumber == 2; int32_t clickCount = aMouseEvent->Detail(); - nsCOMPtr<nsIDOMEventTarget> target = aMouseEvent->GetExplicitOriginalTarget(); + RefPtr<EventTarget> target = aMouseEvent->GetExplicitOriginalTarget(); NS_ENSURE_TRUE(target, NS_ERROR_NULL_POINTER); nsCOMPtr<nsIDOMElement> element = do_QueryInterface(target); if (isContextClick || (buttonNumber == 0 && clickCount == 2)) { RefPtr<Selection> selection = htmlEditor->GetSelection(); NS_ENSURE_TRUE(selection, NS_OK); // Get location of mouse within target node @@ -187,17 +187,17 @@ HTMLEditorEventListener::MouseDown(Mouse nsresult HTMLEditorEventListener::MouseClick(MouseEvent* aMouseEvent) { if (NS_WARN_IF(DetachedFromEditor())) { return NS_OK; } - nsCOMPtr<nsIDOMEventTarget> target = aMouseEvent->GetTarget(); + RefPtr<EventTarget> target = aMouseEvent->GetTarget(); NS_ENSURE_TRUE(target, NS_ERROR_NULL_POINTER); nsCOMPtr<Element> element = do_QueryInterface(target); if (NS_WARN_IF(!element)) { return NS_ERROR_FAILURE; } RefPtr<HTMLEditor> htmlEditor = mEditorBase->AsHTMLEditor(); MOZ_ASSERT(htmlEditor);
--- a/widget/tests/TestAppShellSteadyState.cpp +++ b/widget/tests/TestAppShellSteadyState.cpp @@ -5,31 +5,31 @@ #include "TestHarness.h" #include "nsIAppShell.h" #include "nsIAppShellService.h" #include "nsIDocument.h" #include "nsIDOMEvent.h" #include "nsIDOMEventListener.h" -#include "nsIDOMEventTarget.h" #include "nsIDOMWindow.h" #include "nsIDOMWindowUtils.h" #include "nsIInterfaceRequestor.h" #include "nsIRunnable.h" #include "nsIURI.h" #include "nsIWebBrowserChrome.h" #include "nsIXULWindow.h" #include "nsAppShellCID.h" #include "nsIInterfaceRequestorUtils.h" #include "nsNetUtil.h" #include "nsThreadUtils.h" #include "mozilla/Attributes.h" #include "mozilla/dom/Event.h" +#include "mozilla/dom/EventTarget.h" #ifdef XP_WIN #include <windows.h> #endif using namespace mozilla; typedef void (*TestFunc)(nsIAppShell*); @@ -410,19 +410,19 @@ Test4Internal(nsIAppShell* aAppShell) } nsCOMPtr<nsIDOMWindow> window = do_GetInterface(xulWindow); if (!window) { fail("Can't get dom window!"); return false; } - nsCOMPtr<nsIDOMEventTarget> target = do_QueryInterface(window); + RefPTr<dom::EventTarget> target = do_QueryInterface(window); if (!target) { - fail("Can't QI to nsIDOMEventTarget!"); + fail("Can't QI to EventTarget!"); return false; } nsCOMPtr<nsIDOMEventListener> listener = new EventListener(aAppShell); if (NS_FAILED(target->AddEventListener(NS_LITERAL_STRING("keypress"), listener, false, false)) || NS_FAILED(target->AddEventListener(NS_LITERAL_STRING("load"), listener, false, false))) {