From 67f4ec1ac02b836d7858c98c898592f85c9a34c0 Mon Sep 17 00:00:00 2001 From: Makoto Kato Date: Mon, 13 Apr 2020 01:43:41 +0000 Subject: [PATCH] Bug 1628192 - Use more const declarations on editor classes. r=masayuki Differential Revision: https://phabricator.services.mozilla.com/D70146 --HG-- extra : moz-landing-system : lando --- editor/libeditor/EditorBase.cpp | 11 +++-- editor/libeditor/EditorBase.h | 10 ++--- editor/libeditor/HTMLEditor.cpp | 80 +++++++++++++++------------------ editor/libeditor/HTMLEditor.h | 62 ++++++++++++------------- editor/libeditor/TextEditor.cpp | 4 +- editor/libeditor/TextEditor.h | 4 +- 6 files changed, 81 insertions(+), 90 deletions(-) diff --git a/editor/libeditor/EditorBase.cpp b/editor/libeditor/EditorBase.cpp index 79f6eb3b4e97..11b7713a2b92 100644 --- a/editor/libeditor/EditorBase.cpp +++ b/editor/libeditor/EditorBase.cpp @@ -5387,7 +5387,7 @@ bool EditorBase::IsModifiableNode(const nsINode& aNode) const { return !AsHTMLEditor() || aNode.IsEditable(); } -nsIContent* EditorBase::GetFocusedContent() { +nsIContent* EditorBase::GetFocusedContent() const { EventTarget* piTarget = GetDOMEventTarget(); if (!piTarget) { return nullptr; @@ -5404,12 +5404,11 @@ nsIContent* EditorBase::GetFocusedContent() { return (content == piTarget) ? content : nullptr; } -already_AddRefed EditorBase::GetFocusedContentForIME() { - nsCOMPtr content = GetFocusedContent(); - return content.forget(); +nsIContent* EditorBase::GetFocusedContentForIME() const { + return GetFocusedContent(); } -bool EditorBase::IsActiveInDOMWindow() { +bool EditorBase::IsActiveInDOMWindow() const { EventTarget* piTarget = GetDOMEventTarget(); if (!piTarget) { return false; @@ -5420,7 +5419,7 @@ bool EditorBase::IsActiveInDOMWindow() { return false; // Do we need to check the singleton instance?? } - RefPtr document = GetDocument(); + Document* document = GetDocument(); if (NS_WARN_IF(!document)) { return false; } diff --git a/editor/libeditor/EditorBase.h b/editor/libeditor/EditorBase.h index 0d049669592d..331578476c5b 100644 --- a/editor/libeditor/EditorBase.h +++ b/editor/libeditor/EditorBase.h @@ -423,7 +423,7 @@ class EditorBase : public nsIEditor, MOZ_CAN_RUN_SCRIPT virtual nsresult HandleKeyPressEvent( WidgetKeyboardEvent* aKeyboardEvent); - virtual dom::EventTarget* GetDOMEventTarget() = 0; + virtual dom::EventTarget* GetDOMEventTarget() const = 0; /** * Similar to the setter for wrapWidth, but just sets the editor @@ -560,13 +560,13 @@ class EditorBase : public nsIEditor, /** * Get the focused content, if we're focused. Returns null otherwise. */ - virtual nsIContent* GetFocusedContent(); + virtual nsIContent* GetFocusedContent() const; /** * Get the focused content for the argument of some IMEStateManager's * methods. */ - virtual already_AddRefed GetFocusedContentForIME(); + virtual nsIContent* GetFocusedContentForIME() const; /** * Whether the aGUIEvent should be handled by this editor or not. When this @@ -2259,7 +2259,7 @@ class EditorBase : public nsIEditor, * returns true but GetFocusedContent() returns null, it means that this * editor was focused when the DOM window was active. */ - virtual bool IsActiveInDOMWindow(); + virtual bool IsActiveInDOMWindow() const; /** * FindBetterInsertionPoint() tries to look for better insertion point which @@ -2531,7 +2531,7 @@ class EditorBase : public nsIEditor, /** * Get the input event target. This might return null. */ - virtual already_AddRefed GetInputEventTargetElement() = 0; + virtual already_AddRefed GetInputEventTargetElement() const = 0; /** * Return true if spellchecking should be enabled for this editor. diff --git a/editor/libeditor/HTMLEditor.cpp b/editor/libeditor/HTMLEditor.cpp index 5b073be07d92..63caba3d09a7 100644 --- a/editor/libeditor/HTMLEditor.cpp +++ b/editor/libeditor/HTMLEditor.cpp @@ -4094,7 +4094,7 @@ nsresult HTMLEditor::RemoveBlockContainerWithTransaction(Element& aElement) { } nsIContent* HTMLEditor::GetPriorHTMLSibling(nsINode* aNode, - SkipWhitespace aSkipWS) { + SkipWhitespace aSkipWS) const { MOZ_ASSERT(aNode); nsIContent* node = aNode->GetPreviousSibling(); @@ -4106,7 +4106,7 @@ nsIContent* HTMLEditor::GetPriorHTMLSibling(nsINode* aNode, } nsIContent* HTMLEditor::GetNextHTMLSibling(nsINode* aNode, - SkipWhitespace aSkipWS) { + SkipWhitespace aSkipWS) const { MOZ_ASSERT(aNode); nsIContent* node = aNode->GetNextSibling(); @@ -4118,7 +4118,7 @@ nsIContent* HTMLEditor::GetNextHTMLSibling(nsINode* aNode, } nsIContent* HTMLEditor::GetPreviousHTMLElementOrTextInternal( - nsINode& aNode, bool aNoBlockCrossing) { + nsINode& aNode, bool aNoBlockCrossing) const { if (NS_WARN_IF(!GetActiveEditingHost())) { return nullptr; } @@ -4128,7 +4128,7 @@ nsIContent* HTMLEditor::GetPreviousHTMLElementOrTextInternal( template nsIContent* HTMLEditor::GetPreviousHTMLElementOrTextInternal( - const EditorDOMPointBase& aPoint, bool aNoBlockCrossing) { + const EditorDOMPointBase& aPoint, bool aNoBlockCrossing) const { if (NS_WARN_IF(!GetActiveEditingHost())) { return nullptr; } @@ -4137,7 +4137,7 @@ nsIContent* HTMLEditor::GetPreviousHTMLElementOrTextInternal( } nsIContent* HTMLEditor::GetPreviousEditableHTMLNodeInternal( - nsINode& aNode, bool aNoBlockCrossing) { + nsINode& aNode, bool aNoBlockCrossing) const { if (NS_WARN_IF(!GetActiveEditingHost())) { return nullptr; } @@ -4147,7 +4147,7 @@ nsIContent* HTMLEditor::GetPreviousEditableHTMLNodeInternal( template nsIContent* HTMLEditor::GetPreviousEditableHTMLNodeInternal( - const EditorDOMPointBase& aPoint, bool aNoBlockCrossing) { + const EditorDOMPointBase& aPoint, bool aNoBlockCrossing) const { if (NS_WARN_IF(!GetActiveEditingHost())) { return nullptr; } @@ -4156,7 +4156,7 @@ nsIContent* HTMLEditor::GetPreviousEditableHTMLNodeInternal( } nsIContent* HTMLEditor::GetNextHTMLElementOrTextInternal( - nsINode& aNode, bool aNoBlockCrossing) { + nsINode& aNode, bool aNoBlockCrossing) const { if (NS_WARN_IF(!GetActiveEditingHost())) { return nullptr; } @@ -4166,7 +4166,7 @@ nsIContent* HTMLEditor::GetNextHTMLElementOrTextInternal( template nsIContent* HTMLEditor::GetNextHTMLElementOrTextInternal( - const EditorDOMPointBase& aPoint, bool aNoBlockCrossing) { + const EditorDOMPointBase& aPoint, bool aNoBlockCrossing) const { if (NS_WARN_IF(!GetActiveEditingHost())) { return nullptr; } @@ -4233,7 +4233,7 @@ nsIContent* HTMLEditor::GetLastEditableChild(nsINode& aNode) const { return child; } -nsIContent* HTMLEditor::GetFirstEditableLeaf(nsINode& aNode) { +nsIContent* HTMLEditor::GetFirstEditableLeaf(nsINode& aNode) const { nsCOMPtr child = GetLeftmostChild(&aNode); while (child && (!IsEditable(child) || child->HasChildren())) { child = GetNextEditableHTMLNode(*child); @@ -4247,7 +4247,7 @@ nsIContent* HTMLEditor::GetFirstEditableLeaf(nsINode& aNode) { return child; } -nsIContent* HTMLEditor::GetLastEditableLeaf(nsINode& aNode) { +nsIContent* HTMLEditor::GetLastEditableLeaf(nsINode& aNode) const { nsCOMPtr child = GetRightmostChild(&aNode, false); while (child && (!IsEditable(child) || child->HasChildren())) { child = GetPreviousEditableHTMLNode(*child); @@ -5008,15 +5008,15 @@ nsresult HTMLEditor::GetReturnInParagraphCreatesNewParagraph( return NS_OK; } -nsIContent* HTMLEditor::GetFocusedContent() { +nsIContent* HTMLEditor::GetFocusedContent() const { nsFocusManager* focusManager = nsFocusManager::GetFocusManager(); if (NS_WARN_IF(!focusManager)) { return nullptr; } - nsCOMPtr focusedContent = focusManager->GetFocusedElement(); + nsIContent* focusedContent = focusManager->GetFocusedElement(); - RefPtr document = GetDocument(); + Document* document = GetDocument(); if (NS_WARN_IF(!document)) { return nullptr; } @@ -5032,7 +5032,7 @@ nsIContent* HTMLEditor::GetFocusedContent() { if (inDesignMode) { return OurWindowHasFocus() && focusedContent->IsInclusiveDescendantOf(document) - ? focusedContent.get() + ? focusedContent : nullptr; } @@ -5045,30 +5045,29 @@ nsIContent* HTMLEditor::GetFocusedContent() { return nullptr; } // If our window is focused, we're focused. - return OurWindowHasFocus() ? focusedContent.get() : nullptr; + return OurWindowHasFocus() ? focusedContent : nullptr; } -already_AddRefed HTMLEditor::GetFocusedContentForIME() { - nsCOMPtr focusedContent = GetFocusedContent(); +nsIContent* HTMLEditor::GetFocusedContentForIME() const { + nsIContent* focusedContent = GetFocusedContent(); if (!focusedContent) { return nullptr; } - RefPtr document = GetDocument(); + Document* document = GetDocument(); if (NS_WARN_IF(!document)) { return nullptr; } - return document->HasFlag(NODE_IS_EDITABLE) ? nullptr - : focusedContent.forget(); + return document->HasFlag(NODE_IS_EDITABLE) ? nullptr : focusedContent; } -bool HTMLEditor::IsActiveInDOMWindow() { +bool HTMLEditor::IsActiveInDOMWindow() const { nsFocusManager* focusManager = nsFocusManager::GetFocusManager(); if (NS_WARN_IF(!focusManager)) { return false; } - RefPtr document = GetDocument(); + Document* document = GetDocument(); if (NS_WARN_IF(!document)) { return false; } @@ -5164,16 +5163,15 @@ void HTMLEditor::NotifyEditingHostMaybeChanged() { } } -EventTarget* HTMLEditor::GetDOMEventTarget() { +EventTarget* HTMLEditor::GetDOMEventTarget() const { // Don't use getDocument here, because we have no way of knowing // whether Init() was ever called. So we need to get the document // ourselves, if it exists. MOZ_ASSERT(IsInitialized(), "The HTMLEditor has not been initialized yet"); - nsCOMPtr target = GetDocument(); - return target; + return GetDocument(); } -bool HTMLEditor::ShouldReplaceRootElement() { +bool HTMLEditor::ShouldReplaceRootElement() const { if (!mRootElement) { // If we don't know what is our root element, we should find our root. return true; @@ -5225,17 +5223,17 @@ void HTMLEditor::NotifyRootChanged() { SyncRealTimeSpell(); } -Element* HTMLEditor::GetBodyElement() { +Element* HTMLEditor::GetBodyElement() const { MOZ_ASSERT(IsInitialized(), "The HTMLEditor hasn't been initialized yet"); - RefPtr document = GetDocument(); + Document* document = GetDocument(); if (NS_WARN_IF(!document)) { return nullptr; } return document->GetBody(); } -already_AddRefed HTMLEditor::GetFocusedNode() { - nsCOMPtr focusedContent = GetFocusedContent(); +nsINode* HTMLEditor::GetFocusedNode() const { + nsIContent* focusedContent = GetFocusedContent(); if (!focusedContent) { return nullptr; } @@ -5247,30 +5245,24 @@ already_AddRefed HTMLEditor::GetFocusedNode() { nsFocusManager* focusManager = nsFocusManager::GetFocusManager(); NS_ASSERTION(focusManager, "Focus manager is null"); - RefPtr focusedElement = focusManager->GetFocusedElement(); + Element* focusedElement = focusManager->GetFocusedElement(); if (focusedElement) { - return focusedElement.forget(); + return focusedElement; } - RefPtr document = GetDocument(); - return document.forget(); + return GetDocument(); } -bool HTMLEditor::OurWindowHasFocus() { - nsIFocusManager* focusManager = nsFocusManager::GetFocusManager(); +bool HTMLEditor::OurWindowHasFocus() const { + nsFocusManager* focusManager = nsFocusManager::GetFocusManager(); if (NS_WARN_IF(!focusManager)) { return false; } - nsCOMPtr focusedWindow; - DebugOnly rvIgnored = - focusManager->GetFocusedWindow(getter_AddRefs(focusedWindow)); + nsPIDOMWindowOuter* focusedWindow = focusManager->GetFocusedWindow(); if (!focusedWindow) { return false; } - NS_WARNING_ASSERTION( - NS_SUCCEEDED(rvIgnored), - "nsFocusManager::GetFocusedWindow() failed, but ignored"); - RefPtr document = GetDocument(); + Document* document = GetDocument(); if (NS_WARN_IF(!document)) { return false; } @@ -5387,7 +5379,7 @@ nsresult HTMLEditor::GetPreferredIMEState(IMEState* aState) { return NS_OK; } -already_AddRefed HTMLEditor::GetInputEventTargetElement() { +already_AddRefed HTMLEditor::GetInputEventTargetElement() const { RefPtr target = GetActiveEditingHost(); return target.forget(); } diff --git a/editor/libeditor/HTMLEditor.h b/editor/libeditor/HTMLEditor.h index 55e7602044cb..70fe9a302a9b 100644 --- a/editor/libeditor/HTMLEditor.h +++ b/editor/libeditor/HTMLEditor.h @@ -168,10 +168,10 @@ class HTMLEditor final : public TextEditor, MOZ_CAN_RUN_SCRIPT virtual nsresult HandleKeyPressEvent( WidgetKeyboardEvent* aKeyboardEvent) override; - virtual nsIContent* GetFocusedContent() override; - virtual already_AddRefed GetFocusedContentForIME() override; - virtual bool IsActiveInDOMWindow() override; - virtual dom::EventTarget* GetDOMEventTarget() override; + virtual nsIContent* GetFocusedContent() const override; + virtual nsIContent* GetFocusedContentForIME() const override; + virtual bool IsActiveInDOMWindow() const override; + virtual dom::EventTarget* GetDOMEventTarget() const override; virtual Element* FindSelectionRoot(nsINode* aNode) const override; virtual bool IsAcceptableInputEvent(WidgetGUIEvent* aGUIEvent) override; virtual nsresult GetPreferredIMEState(widget::IMEState* aState) override; @@ -1037,7 +1037,7 @@ class HTMLEditor final : public TextEditor, */ enum class SkipWhitespace { Yes, No }; nsIContent* GetPriorHTMLSibling(nsINode* aNode, - SkipWhitespace = SkipWhitespace::No); + SkipWhitespace = SkipWhitespace::No) const; /** * GetNextHTMLSibling() returns the next editable sibling, if there is @@ -1045,7 +1045,7 @@ class HTMLEditor final : public TextEditor, * whitespace. */ nsIContent* GetNextHTMLSibling(nsINode* aNode, - SkipWhitespace = SkipWhitespace::No); + SkipWhitespace = SkipWhitespace::No) const; // Helper for GetPriorHTMLSibling/GetNextHTMLSibling. static bool SkippableWhitespace(nsINode* aNode, SkipWhitespace aSkipWS) { @@ -1058,20 +1058,20 @@ class HTMLEditor final : public TextEditor, * EditorBase::GetPreviousElementOrText*() but this won't return nodes * outside active editing host. */ - nsIContent* GetPreviousHTMLElementOrText(nsINode& aNode) { + nsIContent* GetPreviousHTMLElementOrText(nsINode& aNode) const { return GetPreviousHTMLElementOrTextInternal(aNode, false); } - nsIContent* GetPreviousHTMLElementOrTextInBlock(nsINode& aNode) { + nsIContent* GetPreviousHTMLElementOrTextInBlock(nsINode& aNode) const { return GetPreviousHTMLElementOrTextInternal(aNode, true); } template nsIContent* GetPreviousHTMLElementOrText( - const EditorDOMPointBase& aPoint) { + const EditorDOMPointBase& aPoint) const { return GetPreviousHTMLElementOrTextInternal(aPoint, false); } template nsIContent* GetPreviousHTMLElementOrTextInBlock( - const EditorDOMPointBase& aPoint) { + const EditorDOMPointBase& aPoint) const { return GetPreviousHTMLElementOrTextInternal(aPoint, true); } @@ -1080,30 +1080,30 @@ class HTMLEditor final : public TextEditor, * of above methods. Please don't use this method directly. */ nsIContent* GetPreviousHTMLElementOrTextInternal(nsINode& aNode, - bool aNoBlockCrossing); + bool aNoBlockCrossing) const; template nsIContent* GetPreviousHTMLElementOrTextInternal( - const EditorDOMPointBase& aPoint, bool aNoBlockCrossing); + const EditorDOMPointBase& aPoint, bool aNoBlockCrossing) const; /** * GetPreviousEditableHTMLNode*() methods are similar to * EditorBase::GetPreviousEditableNode() but this won't return nodes outside * active editing host. */ - nsIContent* GetPreviousEditableHTMLNode(nsINode& aNode) { + nsIContent* GetPreviousEditableHTMLNode(nsINode& aNode) const { return GetPreviousEditableHTMLNodeInternal(aNode, false); } - nsIContent* GetPreviousEditableHTMLNodeInBlock(nsINode& aNode) { + nsIContent* GetPreviousEditableHTMLNodeInBlock(nsINode& aNode) const { return GetPreviousEditableHTMLNodeInternal(aNode, true); } template nsIContent* GetPreviousEditableHTMLNode( - const EditorDOMPointBase& aPoint) { + const EditorDOMPointBase& aPoint) const { return GetPreviousEditableHTMLNodeInternal(aPoint, false); } template nsIContent* GetPreviousEditableHTMLNodeInBlock( - const EditorDOMPointBase& aPoint) { + const EditorDOMPointBase& aPoint) const { return GetPreviousEditableHTMLNodeInternal(aPoint, true); } @@ -1112,10 +1112,10 @@ class HTMLEditor final : public TextEditor, * of above methods. Please don't use this method directly. */ nsIContent* GetPreviousEditableHTMLNodeInternal(nsINode& aNode, - bool aNoBlockCrossing); + bool aNoBlockCrossing) const; template nsIContent* GetPreviousEditableHTMLNodeInternal( - const EditorDOMPointBase& aPoint, bool aNoBlockCrossing); + const EditorDOMPointBase& aPoint, bool aNoBlockCrossing) const; /** * GetNextHTMLElementOrText*() methods are similar to @@ -1127,20 +1127,20 @@ class HTMLEditor final : public TextEditor, * On the other hand, methods which take |nsINode&| start to search from * next node of aNode. */ - nsIContent* GetNextHTMLElementOrText(nsINode& aNode) { + nsIContent* GetNextHTMLElementOrText(nsINode& aNode) const { return GetNextHTMLElementOrTextInternal(aNode, false); } - nsIContent* GetNextHTMLElementOrTextInBlock(nsINode& aNode) { + nsIContent* GetNextHTMLElementOrTextInBlock(nsINode& aNode) const { return GetNextHTMLElementOrTextInternal(aNode, true); } template nsIContent* GetNextHTMLElementOrText( - const EditorDOMPointBase& aPoint) { + const EditorDOMPointBase& aPoint) const { return GetNextHTMLElementOrTextInternal(aPoint, false); } template nsIContent* GetNextHTMLElementOrTextInBlock( - const EditorDOMPointBase& aPoint) { + const EditorDOMPointBase& aPoint) const { return GetNextHTMLElementOrTextInternal(aPoint, true); } @@ -1149,10 +1149,10 @@ class HTMLEditor final : public TextEditor, * of above methods. Please don't use this method directly. */ nsIContent* GetNextHTMLElementOrTextInternal(nsINode& aNode, - bool aNoBlockCrossing); + bool aNoBlockCrossing) const; template nsIContent* GetNextHTMLElementOrTextInternal( - const EditorDOMPointBase& aPoint, bool aNoBlockCrossing); + const EditorDOMPointBase& aPoint, bool aNoBlockCrossing) const; /** * GetNextEditableHTMLNode*() methods are similar to @@ -1196,8 +1196,8 @@ class HTMLEditor final : public TextEditor, nsIContent* GetFirstEditableChild(nsINode& aNode) const; nsIContent* GetLastEditableChild(nsINode& aNode) const; - nsIContent* GetFirstEditableLeaf(nsINode& aNode); - nsIContent* GetLastEditableLeaf(nsINode& aNode); + nsIContent* GetFirstEditableLeaf(nsINode& aNode) const; + nsIContent* GetLastEditableLeaf(nsINode& aNode) const; [[nodiscard]] MOZ_CAN_RUN_SCRIPT nsresult GetInlinePropertyBase( nsAtom& aHTMLProperty, nsAtom* aAttribute, const nsAString* aValue, @@ -3604,18 +3604,18 @@ class HTMLEditor final : public TextEditor, virtual nsresult InstallEventListeners() override; virtual void RemoveEventListeners() override; - bool ShouldReplaceRootElement(); + bool ShouldReplaceRootElement() const; MOZ_CAN_RUN_SCRIPT void NotifyRootChanged(); - Element* GetBodyElement(); + Element* GetBodyElement() const; /** * Get the focused node of this editor. * @return If the editor has focus, this returns the focused node. * Otherwise, returns null. */ - already_AddRefed GetFocusedNode(); + nsINode* GetFocusedNode() const; - virtual already_AddRefed GetInputEventTargetElement() override; + virtual already_AddRefed GetInputEventTargetElement() const override; /** * Return TRUE if aElement is a table-related elemet and caret was set. @@ -4155,7 +4155,7 @@ class HTMLEditor final : public TextEditor, /** * Whether the outer window of the DOM event target has focus or not. */ - bool OurWindowHasFocus(); + bool OurWindowHasFocus() const; /** * This function is used to insert a string of HTML input optionally with some diff --git a/editor/libeditor/TextEditor.cpp b/editor/libeditor/TextEditor.cpp index beaf338057cd..d041df5d13d0 100644 --- a/editor/libeditor/TextEditor.cpp +++ b/editor/libeditor/TextEditor.cpp @@ -1427,7 +1427,7 @@ void TextEditor::OnCompositionEnd( NotifyEditorObservers(eNotifyEditorObserversOfEnd); } -already_AddRefed TextEditor::GetInputEventTargetElement() { +already_AddRefed TextEditor::GetInputEventTargetElement() const { nsCOMPtr target = do_QueryInterface(mEventTarget); return target.forget(); } @@ -2130,7 +2130,7 @@ nsresult TextEditor::SelectEntireDocument() { return error.StealNSResult(); } -EventTarget* TextEditor::GetDOMEventTarget() { return mEventTarget; } +EventTarget* TextEditor::GetDOMEventTarget() const { return mEventTarget; } nsresult TextEditor::SetAttributeOrEquivalent(Element* aElement, nsAtom* aAttribute, diff --git a/editor/libeditor/TextEditor.h b/editor/libeditor/TextEditor.h index b2cc7a3b198b..a634ad80a1be 100644 --- a/editor/libeditor/TextEditor.h +++ b/editor/libeditor/TextEditor.h @@ -171,7 +171,7 @@ class TextEditor : public EditorBase, public nsITimerCallback, public nsINamed { MOZ_CAN_RUN_SCRIPT virtual nsresult HandleKeyPressEvent( WidgetKeyboardEvent* aKeyboardEvent) override; - virtual dom::EventTarget* GetDOMEventTarget() override; + virtual dom::EventTarget* GetDOMEventTarget() const override; /** * PasteAsAction() pastes clipboard content to Selection. This method @@ -825,7 +825,7 @@ class TextEditor : public EditorBase, public nsITimerCallback, public nsINamed { */ bool EnsureComposition(WidgetCompositionEvent& aCompositionEvent); - virtual already_AddRefed GetInputEventTargetElement() override; + virtual already_AddRefed GetInputEventTargetElement() const override; /** * See SetUnmaskRange() and SetUnmaskRangeAndNotify() for the detail.