Bug 1764866 - Add "mozilla/EditorForwards.h" r=m_kato

Headers in editor module has a lot of forward declarations for avoiding the
include hell and has a lot of helper template classes.

Forward declarations of template classes is really messy and I'd want to
avoid the duplication because it blocks changing template class.  Therefore,
centralizing forward declarations makes the headers cleaner and maintaining
template classes easier.  Therefore, this patch adds a new header file which
has only forward declarations and some aliases.

It'd be better to define `enum class`es in it like `EventForwards.h` for
reducing the dependencies between headers, but currently this does not do it
for making the new file simpler as far as possible.

Removing `EditActionListener.h` is because it's unused.

Removing `AutoTopLevelEditSubActionNotifier` is because it's renamed to
`AutoEditSubActionNotifier`.
https://hg.mozilla.org/mozilla-central/rev/6de55c5b5f8d5f92389d0d244d2bced1f979ade9

Differential Revision: https://phabricator.services.mozilla.com/D143817
This commit is contained in:
Masayuki Nakano 2022-04-20 14:46:16 +00:00
Родитель 8dd67cabf0
Коммит 1abcb1c46b
31 изменённых файлов: 216 добавлений и 176 удалений

Просмотреть файл

@ -7,7 +7,8 @@
#define mozilla_CSSEditUtils_h
#include "mozilla/ChangeStyleTransaction.h" // for ChangeStyleTransaction
#include "nsCOMPtr.h" // for already_AddRefed
#include "mozilla/EditorForwards.h"
#include "nsCOMPtr.h" // for already_AddRefed
#include "nsStringFwd.h"
#include "nsTArray.h" // for nsTArray
#include "nscore.h" // for nsAString, nsresult, nullptr
@ -21,8 +22,6 @@ class nsStaticAtom;
class nsStyledElement;
namespace mozilla {
class HTMLEditor;
namespace dom {
class Element;
} // namespace dom

Просмотреть файл

@ -6,9 +6,10 @@
#ifndef ChangeAttributeTransaction_h
#define ChangeAttributeTransaction_h
#include "mozilla/Attributes.h" // override
#include "mozilla/EditTransactionBase.h" // base class
#include "nsCOMPtr.h" // nsCOMPtr members
#include "EditTransactionBase.h" // base class
#include "mozilla/Attributes.h" // override
#include "nsCOMPtr.h" // nsCOMPtr members
#include "nsCycleCollectionParticipant.h" // NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED
#include "nsISupportsImpl.h" // NS_DECL_ISUPPORTS_INHERITED
#include "nsString.h" // nsString members
@ -16,7 +17,6 @@
class nsAtom;
namespace mozilla {
namespace dom {
class Element;
} // namespace dom

Просмотреть файл

@ -6,7 +6,8 @@
#ifndef mozilla_ChangeStyleTransaction_h
#define mozilla_ChangeStyleTransaction_h
#include "mozilla/EditTransactionBase.h" // base class
#include "mozilla/EditTransactionBase.h" // base class
#include "nsCOMPtr.h" // nsCOMPtr members
#include "nsCycleCollectionParticipant.h" // various macros
#include "nsString.h" // nsString members

Просмотреть файл

@ -6,16 +6,15 @@
#ifndef CompositionTransaction_h
#define CompositionTransaction_h
#include "mozilla/EditTransactionBase.h" // base class
#include "EditTransactionBase.h" // base class
#include "EditorForwards.h"
#include "mozilla/EditorDOMPoint.h" // EditorDOMPointInText
#include "mozilla/WeakPtr.h"
#include "nsCycleCollectionParticipant.h" // various macros
#include "nsString.h" // mStringToInsert
namespace mozilla {
class EditorBase;
class TextComposition;
class TextRangeArray;

Просмотреть файл

@ -6,7 +6,10 @@
#ifndef DeleteNodeTransaction_h
#define DeleteNodeTransaction_h
#include "mozilla/EditTransactionBase.h"
#include "EditTransactionBase.h"
#include "EditorForwards.h"
#include "nsCOMPtr.h"
#include "nsCycleCollectionParticipant.h"
#include "nsIContent.h"
@ -16,8 +19,6 @@
namespace mozilla {
class EditorBase;
/**
* A transaction that deletes a single element
*/

Просмотреть файл

@ -7,6 +7,9 @@
#define DeleteRangeTransaction_h
#include "EditAggregateTransaction.h"
#include "EditorForwards.h"
#include "mozilla/RangeBoundary.h"
#include "nsCycleCollectionParticipant.h"
#include "nsID.h"
@ -19,9 +22,6 @@ class nsINode;
namespace mozilla {
class EditorBase;
class RangeUpdater;
/**
* A transaction that deletes an entire range in the content tree
*/

Просмотреть файл

@ -6,7 +6,10 @@
#ifndef DeleteTextTransaction_h
#define DeleteTextTransaction_h
#include "mozilla/EditTransactionBase.h"
#include "EditTransactionBase.h"
#include "EditorForwards.h"
#include "mozilla/dom/Text.h"
#include "nsCOMPtr.h"
#include "nsCycleCollectionParticipant.h"
@ -16,9 +19,6 @@
namespace mozilla {
class EditorBase;
class RangeUpdater;
/**
* A transaction that removes text from a content node.
*/

Просмотреть файл

@ -1,14 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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 __editActionListener_h__
#define __editActionListener_h__
class EditActionListener {
public:
virtual void EditAction() = 0;
};
#endif /* __editActionListener_h__ */

Просмотреть файл

@ -6,7 +6,8 @@
#ifndef EditAggregateTransaction_h
#define EditAggregateTransaction_h
#include "mozilla/EditTransactionBase.h"
#include "EditTransactionBase.h"
#include "mozilla/OwningNonNull.h"
#include "nsCOMPtr.h"
#include "nsCycleCollectionParticipant.h"

Просмотреть файл

@ -6,6 +6,8 @@
#ifndef mozilla_EditTransactionBase_h
#define mozilla_EditTransactionBase_h
#include "mozilla/EditorForwards.h"
#include "nsCycleCollectionParticipant.h"
#include "nsISupportsImpl.h"
#include "nsITransaction.h"
@ -21,21 +23,7 @@ nsITransaction::GetAsEditTransactionBase() {
}
namespace mozilla {
class ChangeAttributeTransaction;
class ChangeStyleTransaction;
class CompositionTransaction;
class DeleteNodeTransaction;
class DeleteRangeTransaction;
class DeleteTextTransaction;
class EditAggregateTransaction;
class InsertNodeTransaction;
class InsertTextTransaction;
class JoinNodesTransaction;
class LogModule;
class PlaceholderTransaction;
class ReplaceTextTransaction;
class SplitNodeTransaction;
#define NS_DECL_GETASTRANSACTION_BASE(aClass) \
virtual aClass* GetAs##aClass(); \

Просмотреть файл

@ -7,9 +7,10 @@
#define mozilla_EditorBase_h
#include "mozilla/intl/BidiEmbeddingLevel.h"
#include "mozilla/Assertions.h" // for MOZ_ASSERT, etc.
#include "mozilla/EditAction.h" // for EditAction and EditSubAction
#include "mozilla/EditorDOMPoint.h" // for EditorDOMPoint
#include "mozilla/Assertions.h" // for MOZ_ASSERT, etc.
#include "mozilla/EditAction.h" // for EditAction and EditSubAction
#include "mozilla/EditorDOMPoint.h" // for EditorDOMPoint
#include "mozilla/EditorForwards.h"
#include "mozilla/EventForwards.h" // for InputEventTargetRanges
#include "mozilla/Likely.h" // for MOZ_UNLIKELY, MOZ_LIKELY
#include "mozilla/Maybe.h" // for Maybe
@ -61,47 +62,17 @@ class nsRange;
namespace mozilla {
class AlignStateAtSelection;
class AutoRangeArray;
class AutoTopLevelEditSubActionNotifier;
class AutoTransactionsConserveSelection;
class AutoUpdateViewBatch;
class ChangeAttributeTransaction;
class CompositionTransaction;
class CSSEditUtils;
class DeleteNodeTransaction;
class DeleteRangeTransaction;
class DeleteTextTransaction;
class EditActionResult;
class EditAggregateTransaction;
class EditorEventListener;
class EditTransactionBase;
class ErrorResult;
class HTMLEditor;
class HTMLEditUtils;
class IMEContentObserver;
class InsertNodeTransaction;
class InsertTextTransaction;
class JoinNodesTransaction;
class ListElementSelectionState;
class ListItemElementSelectionState;
class ParagraphStateAtSelection;
class PlaceholderTransaction;
class PresShell;
class ReplaceTextTransaction;
class SplitNodeResult;
class SplitNodeTransaction;
class TextComposition;
class TextEditor;
class TextInputListener;
class TextServicesDocument;
class TypeInState;
class WhiteSpaceVisibilityKeeper;
enum class SplitNodeDirection; // Declrared in HTMLEditor.h
template <typename NodeType>
class CreateNodeResultBase;
typedef CreateNodeResultBase<dom::Element> CreateElementResult;
namespace dom {
class AbstractRange;
@ -1251,11 +1222,8 @@ class EditorBase : public nsIEditor,
case EditSubAction::eComputeTextToOutput:
case EditSubAction::eCreatePaddingBRElementForEmptyEditor:
case EditSubAction::eNone:
MOZ_ASSERT(aDirection == eNone);
mDirectionOfTopLevelEditSubAction = eNone;
break;
case EditSubAction::eReplaceHeadWithHTMLSource:
// NOTE: Not used with AutoTopLevelEditSubActionNotifier.
MOZ_ASSERT(aDirection == eNone);
mDirectionOfTopLevelEditSubAction = eNone;
break;
case EditSubAction::eDeleteNode:

Просмотреть файл

@ -6,6 +6,7 @@
#ifndef mozilla_EditorCommands_h
#define mozilla_EditorCommands_h
#include "mozilla/EditorForwards.h"
#include "mozilla/EventForwards.h"
#include "mozilla/Maybe.h"
#include "mozilla/StaticPtr.h"
@ -26,9 +27,6 @@ class nsStaticAtom;
namespace mozilla {
class EditorBase;
class HTMLEditor;
/**
* EditorCommandParamType tells you that EditorCommand subclasses refer
* which type in nsCommandParams (e.g., bool or nsString) or do not refer.

Просмотреть файл

@ -8,6 +8,7 @@
#include "mozilla/Assertions.h"
#include "mozilla/Attributes.h"
#include "mozilla/EditorForwards.h"
#include "mozilla/Maybe.h"
#include "mozilla/RangeBoundary.h"
#include "mozilla/ToString.h"
@ -26,9 +27,6 @@
namespace mozilla {
template <typename ParentType, typename ChildType>
class EditorDOMPointBase;
/**
* EditorDOMPoint and EditorRawDOMPoint are simple classes which refers
* a point in the DOM tree at creating the instance or initializing the
@ -71,12 +69,6 @@ class EditorDOMPointBase;
* AutoEditorDOMPointOffsetInvalidator and AutoEditorDOMPointChildInvalidator.
*/
typedef EditorDOMPointBase<nsCOMPtr<nsINode>, nsCOMPtr<nsIContent>>
EditorDOMPoint;
typedef EditorDOMPointBase<nsINode*, nsIContent*> EditorRawDOMPoint;
typedef EditorDOMPointBase<RefPtr<dom::Text>, nsIContent*> EditorDOMPointInText;
typedef EditorDOMPointBase<dom::Text*, nsIContent*> EditorRawDOMPointInText;
#define NS_INSTANTIATE_EDITOR_DOM_POINT_METHOD(aResultType, aMethodName) \
template aResultType EditorDOMPoint::aMethodName; \
template aResultType EditorRawDOMPoint::aMethodName; \
@ -1165,20 +1157,11 @@ inline void ImplCycleCollectionTraverse(
ImplCycleCollectionTraverse(aCallback, aField.mChild, "mChild", 0);
}
template <typename EditorDOMPointType>
class EditorDOMRangeBase;
/**
* EditorDOMRangeBase class stores a pair of same EditorDOMPointBase type.
* The instance must be created with valid DOM points and start must be
* before or same as end.
*/
typedef EditorDOMRangeBase<EditorDOMPoint> EditorDOMRange;
typedef EditorDOMRangeBase<EditorRawDOMPoint> EditorRawDOMRange;
typedef EditorDOMRangeBase<EditorDOMPointInText> EditorDOMRangeInTexts;
typedef EditorDOMRangeBase<EditorRawDOMPointInText> EditorRawDOMRangeInTexts;
template <typename EditorDOMPointType>
class EditorDOMRangeBase final {
public:

Просмотреть файл

@ -6,6 +6,8 @@
#ifndef EditorEventListener_h
#define EditorEventListener_h
#include "EditorForwards.h"
#include "mozilla/Attributes.h"
#include "mozilla/EventForwards.h"
#include "nsCOMPtr.h"
@ -29,10 +31,7 @@ class nsPresContext;
#endif
namespace mozilla {
class EditorBase;
class PresShell;
namespace dom {
class DragEvent;
class MouseEvent;

Просмотреть файл

@ -0,0 +1,142 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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_EditorHelperForwards_h
#define mozilla_EditorHelperForwards_h
#include <cstdint>
/******************************************************************************
* Forward declarations of other modules'
******************************************************************************/
class nsIContent;
class nsINode;
template <typename T>
class nsCOMPtr;
template <typename T>
class RefPtr;
namespace mozilla {
template <typename T>
class OwningNonNull;
namespace dom {
class Element;
class Text;
} // namespace dom
/******************************************************************************
* enum classes
******************************************************************************/
enum class EditAction; // mozilla/EditAction.h
enum class EditorCommandParamType : uint16_t; // mozilla/EditorCommands.h
enum class EditSubAction : int32_t; // mozilla/EditAction.h
enum class ParagraphSeparator; // mozilla/HTMLEditor.h
enum class SpecifiedStyle : uint8_t; // mozilla/TypeInState.h
enum class JoinNodesDirection; // HTMLEditHelper.h
enum class SplitNodeDirection; // HTMLEditHelper.h
/******************************************************************************
* classes or structs which are required for template classes/structs
******************************************************************************/
template <typename PT, typename CT>
class EditorDOMPointBase; // mozilla/EditorDOMPoint.h
using EditorDOMPoint =
EditorDOMPointBase<nsCOMPtr<nsINode>, nsCOMPtr<nsIContent>>;
using EditorRawDOMPoint = EditorDOMPointBase<nsINode*, nsIContent*>;
using EditorDOMPointInText = EditorDOMPointBase<RefPtr<dom::Text>, nsIContent*>;
using EditorRawDOMPointInText = EditorDOMPointBase<dom::Text*, nsIContent*>;
/******************************************************************************
* classes
******************************************************************************/
class AutoRangeArray; // mozilla/EditorUtils.h
class AutoSelectionRangeArray; // mozilla/EditorUtils.h
class AutoStyleCacheArray; // mozilla/TypeInState.h
class ChangeStyleTransaction; // mozilla/ChangeStyleTransaction.h
class CSSEditUtils; // mozilla/CSSEditUtils.h
class EditActionResult; // mozilla/EditorUtils.h
class EditTransactionBase; // mozilla/EditTransactionBase.h
class EditorBase; // mozilla/EditorBase.h
class HTMLEditor; // mozilla/HTMLEditor.h
class ManualNACPtr; // mozilla/ManualNAC.h
class RangeUpdater; // mozilla/SelectionState.h
class SelectionState; // mozilla/SelectionState.h
class StyleCache; // mozilla/TypeInState.h
class TextEditor; // mozilla/TextEditor.h
class TypeInState; // mozilla/TypeInState.h
class ChangeAttributeTransaction; // ChangeAttributeTransaction.h
class CompositionTransaction; // CompositionTransaction.h
class DeleteNodeTransaction; // DeleteNodeTransaction.h
class DeleteRangeTransaction; // DeleteRangeTransaction.h
class DeleteTextTransaction; // DeleteTextTransaction.h
class EditAggregateTransaction; // EditAggregateTransaction.h
class EditorEventListener; // EditorEventListener.h
class EditResult; // HTMLEditHelpers.h
class HTMLEditorEventListener; // HTMLEditorEventListener.h
class InsertNodeTransaction; // IntertNodeTransaction.h
class InsertTextTransaction; // InsertTextTransaction.h
class InterCiter; // InterCiter.h
class JoinNodesResult; // HTMLEditHelpers.h
class JoinNodesTransaction; // JoinNodesTransaction.h
class MoveNodeResult; // HTMLEditHelpers.h
class PlaceholderTransaction; // PlaceholderTransaction.h
class ReplaceTextTransaction; // ReplaceTextTransaction.h
class SplitNodeResult; // HTMLEditHelpers.h
class SplitNodeTransaction; // SplitNodeTransaction.h
class SplitRangeOffFromNodeResult; // HTMLEditHelpers.h
class SplitRangeOffResult; // HTMLEditHelpers.h
class WhiteSpaceVisibilityKeeper; // WSRunObject.h
class WSRunScanner; // WSRunObject.h
class WSScanResult; // WSRunObject.h
/******************************************************************************
* structs
******************************************************************************/
struct PropItem; // mozilla/TypeInState.h
struct RangeItem; // mozilla/SelectionState.h
/******************************************************************************
* template classes
******************************************************************************/
template <typename EditorDOMPointType>
class EditorDOMRangeBase; // mozilla/EditorDOMPoint.h
template <typename NodeType>
class CreateNodeResultBase; // mozilla/EditorUtils.h
template <typename EditorDOMPointType>
class ReplaceRangeDataBase; // mozilla/EditorUtils.h
/******************************************************************************
* aliases
******************************************************************************/
using CreateContentResult = CreateNodeResultBase<nsIContent>;
using CreateElementResult = CreateNodeResultBase<dom::Element>;
using CreateTextResult = CreateNodeResultBase<dom::Text>;
using EditorDOMRange = EditorDOMRangeBase<EditorDOMPoint>;
using EditorRawDOMRange = EditorDOMRangeBase<EditorRawDOMPoint>;
using EditorDOMRangeInTexts = EditorDOMRangeBase<EditorDOMPointInText>;
using EditorRawDOMRangeInTexts = EditorDOMRangeBase<EditorRawDOMPointInText>;
using ReplaceRangeData = ReplaceRangeDataBase<EditorDOMPoint>;
using ReplaceRangeInTextsData = ReplaceRangeDataBase<EditorDOMPointInText>;
} // namespace mozilla
#endif // #ifndef mozilla_EditorHelperForwards_h

Просмотреть файл

@ -9,6 +9,7 @@
#include "mozilla/EditAction.h"
#include "mozilla/EditorBase.h"
#include "mozilla/EditorDOMPoint.h"
#include "mozilla/EditorForwards.h"
#include "mozilla/IntegerRange.h"
#include "mozilla/RangeBoundary.h"
#include "mozilla/Result.h"
@ -28,7 +29,6 @@
class nsITransferable;
namespace mozilla {
class MoveNodeResult;
template <class T>
class OwningNonNull;

Просмотреть файл

@ -15,6 +15,7 @@
#include "mozilla/Attributes.h"
#include "mozilla/EditorBase.h"
#include "mozilla/EditorDOMPoint.h"
#include "mozilla/EditorForwards.h"
#include "mozilla/EditorUtils.h"
#include "mozilla/EnumSet.h"
#include "mozilla/IntegerRange.h"
@ -35,8 +36,6 @@ class nsPresContext;
namespace mozilla {
enum class EditAction;
class HTMLEditUtils final {
using AbstractRange = dom::AbstractRange;
using Element = dom::Element;

Просмотреть файл

@ -1394,10 +1394,9 @@ nsresult HTMLEditor::ReplaceHeadContentsWithSourceWithTransaction(
CommitComposition();
// Do not use AutoTopLevelEditSubActionNotifier -- rules code won't let us
// insert in <head>. Use the head node as a parent and delete/insert
// directly.
// XXX We're using AutoTopLevelEditSubActionNotifier above...
// Do not use AutoEditSubActionNotifier -- rules code won't let us insert in
// <head>. Use the head node as a parent and delete/insert directly.
// XXX We're using AutoEditSubActionNotifier above...
RefPtr<Document> document = GetDocument();
if (NS_WARN_IF(!document)) {
return NS_ERROR_NOT_INITIALIZED;

Просмотреть файл

@ -10,6 +10,7 @@
#include "mozilla/ComposerCommandsUpdater.h"
#include "mozilla/CSSEditUtils.h"
#include "mozilla/EditorBase.h"
#include "mozilla/EditorForwards.h"
#include "mozilla/EditorUtils.h"
#include "mozilla/HTMLEditHelpers.h"
#include "mozilla/ManualNAC.h"
@ -47,25 +48,12 @@ namespace mozilla {
class AlignStateAtSelection;
class AutoSelectionSetterAfterTableEdit;
class AutoSetTemporaryAncestorLimiter;
class EditActionResult;
class EditResult;
class EmptyEditableFunctor;
class JoinNodesTransaction;
class ListElementSelectionState;
class ListItemElementSelectionState;
class MoveNodeResult;
class ParagraphStateAtSelection;
class ResizerSelectionListener;
class Runnable;
class SplitNodeTransaction;
class SplitRangeOffFromNodeResult;
class SplitRangeOffResult;
class WhiteSpaceVisibilityKeeper;
class WSRunScanner;
class WSScanResult;
enum class EditSubAction : int32_t;
enum class SpecifiedStyle : uint8_t;
struct PropItem;
template <class T>
class OwningNonNull;
namespace dom {

Просмотреть файл

@ -7,7 +7,10 @@
#define HTMLEditorEventListener_h
#include "EditorEventListener.h"
#include "mozilla/HTMLEditor.h"
#include "EditorForwards.h"
#include "HTMLEditor.h"
#include "nscore.h"
namespace mozilla {
@ -16,8 +19,6 @@ namespace dom {
class Element;
}
class EditorBase;
class HTMLEditorEventListener final : public EditorEventListener {
public:
HTMLEditorEventListener()

Просмотреть файл

@ -6,9 +6,12 @@
#ifndef InsertNodeTransaction_h
#define InsertNodeTransaction_h
#include "mozilla/EditTransactionBase.h" // for EditTransactionBase, etc.
#include "mozilla/EditorDOMPoint.h" // for EditorDOMPoint
#include "nsCOMPtr.h" // for nsCOMPtr
#include "EditTransactionBase.h" // for EditTransactionBase, etc.
#include "EditorDOMPoint.h" // for EditorDOMPoint
#include "EditorForwards.h"
#include "nsCOMPtr.h" // for nsCOMPtr
#include "nsCycleCollectionParticipant.h"
#include "nsIContent.h" // for nsIContent
#include "nsISupportsImpl.h" // for NS_DECL_ISUPPORTS_INHERITED

Просмотреть файл

@ -6,9 +6,10 @@
#ifndef InsertTextTransaction_h
#define InsertTextTransaction_h
#include "mozilla/EditTransactionBase.h" // base class
#include "EditTransactionBase.h" // base class
#include "EditorForwards.h"
#include "mozilla/EditorDOMPoint.h" // EditorDOMPointInText
#include "nsCycleCollectionParticipant.h" // various macros
#include "nsID.h" // NS_DECLARE_STATIC_IID_ACCESSOR
#include "nsISupportsImpl.h" // NS_DECL_ISUPPORTS_INHERITED
@ -16,9 +17,6 @@
#include "nscore.h" // NS_IMETHOD, nsAString
namespace mozilla {
class EditorBase;
namespace dom {
class Text;
} // namespace dom

Просмотреть файл

@ -9,6 +9,7 @@
#include "EditTransactionBase.h" // for EditTransactionBase, etc.
#include "EditorDOMPoint.h" // for EditorDOMPoint, etc.
#include "EditorForwards.h"
#include "nsCOMPtr.h" // for nsCOMPtr
#include "nsCycleCollectionParticipant.h"
@ -20,8 +21,6 @@ class nsINode;
namespace mozilla {
class HTMLEditor;
/**
* A transaction that joins two nodes E1 (left node) and E2 (right node) into a
* single node E. The children of E are the children of E1 followed by the

Просмотреть файл

@ -7,14 +7,14 @@
#define PlaceholderTransaction_h
#include "EditAggregateTransaction.h"
#include "EditorForwards.h"
#include "SelectionState.h"
#include "mozilla/Maybe.h"
#include "mozilla/SelectionState.h"
#include "mozilla/WeakPtr.h"
namespace mozilla {
class EditorBase;
/**
* An aggregate transaction that knows how to absorb all subsequent
* transactions with the same name. This transaction does not "Do" anything.

Просмотреть файл

@ -6,10 +6,12 @@
#ifndef ReplaceTextTransaction_h
#define ReplaceTextTransaction_h
#include "EditorBase.h"
#include "EditorDOMPoint.h"
#include "EditorForwards.h"
#include "EditTransactionBase.h"
#include "mozilla/Attributes.h"
#include "mozilla/EditorBase.h"
#include "mozilla/EditorDOMPoint.h"
#include "mozilla/EditTransactionBase.h"
#include "mozilla/Maybe.h"
#include "mozilla/RefPtr.h"
#include "mozilla/dom/Text.h"
@ -18,8 +20,6 @@
namespace mozilla {
class EditorBase;
class ReplaceTextTransaction final : public EditTransactionBase {
private:
ReplaceTextTransaction(EditorBase& aEditorBase,

Просмотреть файл

@ -7,6 +7,7 @@
#define mozilla_SelectionState_h
#include "mozilla/EditorDOMPoint.h"
#include "mozilla/EditorForwards.h"
#include "mozilla/Maybe.h"
#include "mozilla/OwningNonNull.h"
#include "nsCOMPtr.h"
@ -19,16 +20,12 @@
class nsCycleCollectionTraversalCallback;
class nsRange;
namespace mozilla {
class RangeUpdater;
namespace dom {
class Element;
class Selection;
class Text;
} // namespace dom
enum class JoinNodesDirection; // Declared in HTMLEditHelpers.h
enum class SplitNodeDirection; // Declared in HTMLEditHelpers.h
/**
* A helper struct for saving/setting ranges.
*/

Просмотреть файл

@ -6,6 +6,7 @@
#ifndef SplitNodeTransaction_h
#define SplitNodeTransaction_h
#include "EditorForwards.h"
#include "EditTransactionBase.h" // for EditorTransactionBase
#include "nsCOMPtr.h" // for nsCOMPtr
@ -16,12 +17,6 @@
namespace mozilla {
class HTMLEditor;
class SplitNodeResult;
template <typename PT, typename CT>
class EditorDOMPointBase;
/**
* A transaction that splits a node into two identical nodes, with the children
* divided between the new nodes.

Просмотреть файл

@ -7,6 +7,7 @@
#define mozilla_TextEditor_h
#include "mozilla/EditorBase.h"
#include "mozilla/EditorForwards.h"
#include "mozilla/TextControlState.h"
#include "mozilla/UniquePtr.h"
@ -25,10 +26,6 @@ class nsISelectionController;
class nsITransferable;
namespace mozilla {
class DeleteNodeTransaction;
class InsertNodeTransaction;
enum class EditSubAction : int32_t;
namespace dom {
class Selection;
} // namespace dom

Просмотреть файл

@ -7,6 +7,7 @@
#define mozilla_TypeInState_h
#include "mozilla/EditorDOMPoint.h"
#include "mozilla/EditorForwards.h"
#include "mozilla/EventForwards.h"
#include "mozilla/UniquePtr.h"
#include "nsCOMPtr.h"
@ -26,7 +27,6 @@ class nsAtom;
class nsINode;
namespace mozilla {
class HTMLEditor;
namespace dom {
class MouseEvent;
class Selection;

Просмотреть файл

@ -6,12 +6,14 @@
#ifndef WSRunObject_h
#define WSRunObject_h
#include "EditAction.h"
#include "EditorBase.h"
#include "EditorForwards.h"
#include "EditorDOMPoint.h" // for EditorDOMPoint
#include "HTMLEditor.h"
#include "HTMLEditUtils.h"
#include "mozilla/Assertions.h"
#include "mozilla/EditAction.h"
#include "mozilla/EditorBase.h"
#include "mozilla/EditorDOMPoint.h" // for EditorDOMPoint
#include "mozilla/HTMLEditor.h"
#include "mozilla/Maybe.h"
#include "mozilla/Result.h"
#include "mozilla/dom/Element.h"
@ -24,8 +26,6 @@ namespace mozilla {
using namespace dom;
class WSRunScanner;
/**
* WSScanResult is result of ScanNextVisibleNodeOrBlockBoundaryFrom(),
* ScanPreviousVisibleNodeOrBlockBoundaryFrom(), and their static wrapper
@ -296,8 +296,6 @@ class MOZ_STACK_CLASS WSScanResult final {
WSType mReason;
};
class WhiteSpaceVisibilityKeeper;
class MOZ_STACK_CLASS WSRunScanner final {
public:
using WSType = WSScanResult::WSType;

Просмотреть файл

@ -21,6 +21,7 @@ EXPORTS.mozilla += [
"EditorCommands.h",
"EditorController.h",
"EditorDOMPoint.h",
"EditorForwards.h",
"EditorUtils.h",
"EditTransactionBase.h",
"HTMLEditHelpers.h",