Bug 1632425 - Part 2: Mark const methods as such r=masayuki
authorKagami Sascha Rosylight <saschanaz@outlook.com>
Wed, 03 Jun 2020 03:08:58 +0000
changeset 533693 67d197b2b8d270b6c852c812d57d670bd96ce9e7
parent 533692 da4122fa9fd12a905a9a77809723df8a38db09df
child 533694 2a670d8c9c3e98406108cafc1f281c6c2d90a583
push id37475
push userbtara@mozilla.com
push dateWed, 03 Jun 2020 16:12:12 +0000
treeherdermozilla-central@ea34fd156c89 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmasayuki
bugs1632425
milestone79.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
Bug 1632425 - Part 2: Mark const methods as such r=masayuki Depends on D77812 Differential Revision: https://phabricator.services.mozilla.com/D77942
dom/events/UIEvent.cpp
dom/events/UIEvent.h
editor/libeditor/EditorBase.cpp
editor/libeditor/EditorBase.h
editor/libeditor/HTMLEditor.cpp
editor/libeditor/HTMLEditor.h
--- a/dom/events/UIEvent.cpp
+++ b/dom/events/UIEvent.cpp
@@ -128,17 +128,17 @@ void UIEvent::InitUIEvent(const nsAStrin
 
   Event::InitEvent(typeArg, canBubbleArg, cancelableArg);
 
   mDetail = detailArg;
   mView = viewArg ? viewArg->GetOuterWindow() : nullptr;
 }
 
 already_AddRefed<nsIContent> UIEvent::GetRangeParentContentAndOffset(
-    int32_t* aOffset) {
+    int32_t* aOffset) const {
   if (NS_WARN_IF(!mPresContext)) {
     return nullptr;
   }
   RefPtr<PresShell> presShell = mPresContext->GetPresShell();
   if (NS_WARN_IF(!presShell)) {
     return nullptr;
   }
   nsCOMPtr<nsIContent> container;
--- a/dom/events/UIEvent.h
+++ b/dom/events/UIEvent.h
@@ -80,17 +80,17 @@ class UIEvent : public Event {
   MOZ_CAN_RUN_SCRIPT already_AddRefed<nsIContent> GetRangeParentContent() {
     return GetRangeParentContentAndOffset(nullptr);
   }
   /**
    * aOffset is optional (i.e., can be nullptr), but when you call this with
    * nullptr, you should use GetRangeParentContent() instead.
    */
   MOZ_CAN_RUN_SCRIPT already_AddRefed<nsIContent>
-  GetRangeParentContentAndOffset(int32_t* aOffset);
+  GetRangeParentContentAndOffset(int32_t* aOffset) const;
 
   /**
    * If you also need to compute range parent in C++ code, you should use
    * GetRangeParentContentAndOffset() instead.
    */
   MOZ_CAN_RUN_SCRIPT int32_t RangeOffset() const;
 
  protected:
--- a/editor/libeditor/EditorBase.cpp
+++ b/editor/libeditor/EditorBase.cpp
@@ -4687,17 +4687,17 @@ bool EditorBase::IsActiveInDOMWindow() c
   }
   nsPIDOMWindowOuter* ourWindow = document->GetWindow();
   nsCOMPtr<nsPIDOMWindowOuter> win;
   nsIContent* content = nsFocusManager::GetFocusedDescendant(
       ourWindow, nsFocusManager::eOnlyCurrentWindow, getter_AddRefs(win));
   return SameCOMIdentity(content, piTarget);
 }
 
-bool EditorBase::IsAcceptableInputEvent(WidgetGUIEvent* aGUIEvent) {
+bool EditorBase::IsAcceptableInputEvent(WidgetGUIEvent* aGUIEvent) const {
   // If the event is trusted, the event should always cause input.
   if (NS_WARN_IF(!aGUIEvent)) {
     return false;
   }
 
   // If this is dispatched by using cordinates but this editor doesn't have
   // focus, we shouldn't handle it.
   if (aGUIEvent->IsUsingCoordinates()) {
--- a/editor/libeditor/EditorBase.h
+++ b/editor/libeditor/EditorBase.h
@@ -560,17 +560,17 @@ class EditorBase : public nsIEditor,
   virtual nsIContent* GetFocusedContentForIME() const;
 
   /**
    * Whether the aGUIEvent should be handled by this editor or not.  When this
    * returns false, The aGUIEvent shouldn't be handled on this editor,
    * i.e., The aGUIEvent should be handled by another inner editor or ancestor
    * elements.
    */
-  virtual bool IsAcceptableInputEvent(WidgetGUIEvent* aGUIEvent);
+  virtual bool IsAcceptableInputEvent(WidgetGUIEvent* aGUIEvent) const;
 
   /**
    * FindSelectionRoot() returns a selection root of this editor when aNode
    * gets focus.  aNode must be a content node or a document node.  When the
    * target isn't a part of this editor, returns nullptr.  If this is for
    * designMode, you should set the document node to aNode except that an
    * element in the document has focus.
    */
--- a/editor/libeditor/HTMLEditor.cpp
+++ b/editor/libeditor/HTMLEditor.cpp
@@ -6127,17 +6127,17 @@ bool HTMLEditor::OurWindowHasFocus() con
   Document* document = GetDocument();
   if (NS_WARN_IF(!document)) {
     return false;
   }
   nsPIDOMWindowOuter* ourWindow = document->GetWindow();
   return ourWindow == focusedWindow;
 }
 
-bool HTMLEditor::IsAcceptableInputEvent(WidgetGUIEvent* aGUIEvent) {
+bool HTMLEditor::IsAcceptableInputEvent(WidgetGUIEvent* aGUIEvent) const {
   if (!EditorBase::IsAcceptableInputEvent(aGUIEvent)) {
     return false;
   }
 
   // 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.
--- a/editor/libeditor/HTMLEditor.h
+++ b/editor/libeditor/HTMLEditor.h
@@ -166,17 +166,17 @@ class HTMLEditor final : public TextEdit
 
   MOZ_CAN_RUN_SCRIPT virtual nsresult HandleKeyPressEvent(
       WidgetKeyboardEvent* aKeyboardEvent) 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 bool IsAcceptableInputEvent(WidgetGUIEvent* aGUIEvent) const override;
   virtual nsresult GetPreferredIMEState(widget::IMEState* aState) override;
 
   /**
    * GetBackgroundColorState() returns what the background color of the
    * selection.
    *
    * @param aMixed      true if there is more than one font color
    * @param aOutColor   Color string. "" is returned for none.