Bug 1191354 part 8 - Typedefs in headers for readability; r=ehsan

This commit is contained in:
Aryeh Gregor 2016-05-01 16:15:14 +03:00
Родитель ef040f7942
Коммит f9d2d13cb5
5 изменённых файлов: 219 добавлений и 241 удалений

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

@ -143,6 +143,11 @@ class nsEditor : public nsIEditor,
public nsIPhonetic
{
public:
typedef mozilla::ErrorResult ErrorResult;
typedef mozilla::dom::Element Element;
typedef mozilla::dom::Selection Selection;
typedef mozilla::dom::Text Text;
template<typename T> using OwningNonNull = mozilla::OwningNonNull<T>;
enum IterDirection
{
@ -199,36 +204,33 @@ public:
int32_t* aInOutOffset,
nsIDocument* aDoc);
nsresult InsertTextIntoTextNodeImpl(const nsAString& aStringToInsert,
mozilla::dom::Text& aTextNode,
int32_t aOffset,
Text& aTextNode, int32_t aOffset,
bool aSuppressIME = false);
NS_IMETHOD DeleteSelectionImpl(EDirection aAction,
EStripWrappers aStripWrappers);
already_AddRefed<mozilla::dom::Element>
DeleteSelectionAndCreateElement(nsIAtom& aTag);
already_AddRefed<Element> DeleteSelectionAndCreateElement(nsIAtom& aTag);
/* helper routines for node/parent manipulations */
nsresult DeleteNode(nsINode* aNode);
nsresult InsertNode(nsIContent& aNode, nsINode& aParent, int32_t aPosition);
enum ECloneAttributes { eDontCloneAttributes, eCloneAttributes };
already_AddRefed<mozilla::dom::Element> ReplaceContainer(
mozilla::dom::Element* aOldContainer,
nsIAtom* aNodeType,
nsIAtom* aAttribute = nullptr,
const nsAString* aValue = nullptr,
ECloneAttributes aCloneAttributes = eDontCloneAttributes);
void CloneAttributes(mozilla::dom::Element* aDest,
mozilla::dom::Element* aSource);
already_AddRefed<Element> ReplaceContainer(Element* aOldContainer,
nsIAtom* aNodeType,
nsIAtom* aAttribute = nullptr,
const nsAString* aValue = nullptr,
ECloneAttributes aCloneAttributes
= eDontCloneAttributes);
void CloneAttributes(Element* aDest, Element* aSource);
nsresult RemoveContainer(nsIContent* aNode);
already_AddRefed<mozilla::dom::Element> InsertContainerAbove(
nsIContent* aNode,
nsIAtom* aNodeType,
nsIAtom* aAttribute = nullptr,
const nsAString* aValue = nullptr);
already_AddRefed<Element> InsertContainerAbove(nsIContent* aNode,
nsIAtom* aNodeType,
nsIAtom* aAttribute = nullptr,
const nsAString* aValue =
nullptr);
nsIContent* SplitNode(nsIContent& aNode, int32_t aOffset,
mozilla::ErrorResult& aResult);
ErrorResult& aResult);
nsresult JoinNodes(nsINode& aLeftNode, nsINode& aRightNode);
nsresult MoveNode(nsIContent* aNode, nsINode* aParent, int32_t aOffset);
@ -236,7 +238,7 @@ public:
Arguments:
nsIAtom* aTag - tag you want
*/
already_AddRefed<mozilla::dom::Element> CreateHTMLContent(nsIAtom* aTag);
already_AddRefed<Element> CreateHTMLContent(nsIAtom* aTag);
// IME event handlers
virtual nsresult BeginIMEComposition(mozilla::WidgetCompositionEvent* aEvent);
@ -253,15 +255,14 @@ protected:
* returns null.
*/
already_AddRefed<mozilla::dom::ChangeAttributeTxn>
CreateTxnForSetAttribute(mozilla::dom::Element& aElement,
nsIAtom& aAttribute, const nsAString& aValue);
CreateTxnForSetAttribute(Element& aElement, nsIAtom& aAttribute,
const nsAString& aValue);
/** Create a transaction for removing aAttribute on aElement. Never returns
* null.
*/
already_AddRefed<mozilla::dom::ChangeAttributeTxn>
CreateTxnForRemoveAttribute(mozilla::dom::Element& aElement,
nsIAtom& aAttribute);
CreateTxnForRemoveAttribute(Element& aElement, nsIAtom& aAttribute);
/** create a transaction for creating a new child node of aParent of type aTag.
*/
@ -270,9 +271,8 @@ protected:
nsINode& aParent,
int32_t aPosition);
already_AddRefed<mozilla::dom::Element> CreateNode(nsIAtom* aTag,
nsINode* aParent,
int32_t aPosition);
already_AddRefed<Element> CreateNode(nsIAtom* aTag, nsINode* aParent,
int32_t aPosition);
/** create a transaction for inserting aNode as a child of aParent.
*/
@ -302,8 +302,8 @@ protected:
* returns null.
*/
already_AddRefed<mozilla::dom::InsertTextTxn>
CreateTxnForInsertText(const nsAString& aStringToInsert,
mozilla::dom::Text& aTextNode, int32_t aOffset);
CreateTxnForInsertText(const nsAString& aStringToInsert, Text& aTextNode,
int32_t aOffset);
// Never returns null.
already_AddRefed<mozilla::dom::IMETextTxn>
@ -365,7 +365,7 @@ protected:
NS_IMETHOD NotifyDocumentListeners(TDocumentListenerNotification aNotificationType);
/** make the given selection span the entire document */
virtual nsresult SelectEntireDocument(mozilla::dom::Selection* aSelection);
virtual nsresult SelectEntireDocument(Selection* aSelection);
/** helper method for scrolling the selection into view after
* an edit operation. aScrollToAnchor should be true if you
@ -431,8 +431,8 @@ public:
/** routines for managing the preservation of selection across
* various editor actions */
bool ArePreservingSelection();
void PreserveSelectionAcrossActions(mozilla::dom::Selection* aSel);
nsresult RestorePreservedSelection(mozilla::dom::Selection* aSel);
void PreserveSelectionAcrossActions(Selection* aSel);
nsresult RestorePreservedSelection(Selection* aSel);
void StopPreservingSelection();
/**
@ -603,22 +603,22 @@ public:
static nsCOMPtr<nsIDOMNode> GetChildAt(nsIDOMNode *aParent, int32_t aOffset);
static nsCOMPtr<nsIDOMNode> GetNodeAtRangeOffsetPoint(nsIDOMNode* aParentOrNode, int32_t aOffset);
static nsresult GetStartNodeAndOffset(mozilla::dom::Selection* aSelection,
static nsresult GetStartNodeAndOffset(Selection* aSelection,
nsIDOMNode** outStartNode,
int32_t* outStartOffset);
static nsresult GetStartNodeAndOffset(mozilla::dom::Selection* aSelection,
static nsresult GetStartNodeAndOffset(Selection* aSelection,
nsINode** aStartNode,
int32_t* aStartOffset);
static nsresult GetEndNodeAndOffset(mozilla::dom::Selection* aSelection,
static nsresult GetEndNodeAndOffset(Selection* aSelection,
nsIDOMNode** outEndNode,
int32_t* outEndOffset);
static nsresult GetEndNodeAndOffset(mozilla::dom::Selection* aSelection,
static nsresult GetEndNodeAndOffset(Selection* aSelection,
nsINode** aEndNode,
int32_t* aEndOffset);
#if DEBUG_JOE
static void DumpNode(nsIDOMNode *aNode, int32_t indent=0);
#endif
mozilla::dom::Selection* GetSelection(int16_t aSelectionType =
Selection* GetSelection(int16_t aSelectionType =
nsISelectionController::SELECTION_NORMAL);
// Helpers to add a node to the selection.
@ -653,7 +653,7 @@ public:
virtual nsresult HandleKeyPressEvent(nsIDOMKeyEvent* aKeyEvent);
nsresult HandleInlineSpellCheck(EditAction action,
mozilla::dom::Selection* aSelection,
Selection* aSelection,
nsIDOMNode *previousSelectedNode,
int32_t previousSelectedOffset,
nsIDOMNode *aStartNode,
@ -664,15 +664,15 @@ public:
virtual already_AddRefed<mozilla::dom::EventTarget> GetDOMEventTarget() = 0;
// Fast non-refcounting editor root element accessor
mozilla::dom::Element *GetRoot();
Element* GetRoot();
// Likewise, but gets the editor's root instead, which is different for HTML
// editors
virtual mozilla::dom::Element* GetEditorRoot();
virtual Element* GetEditorRoot();
// Likewise, but gets the text control element instead of the root for
// plaintext editors
mozilla::dom::Element* GetExposedRoot();
Element* GetExposedRoot();
// Accessor methods to flags
bool IsPlaintextEditor() const
@ -835,8 +835,8 @@ protected:
nsCOMPtr<nsIInlineSpellChecker> mInlineSpellChecker;
RefPtr<nsTransactionManager> mTxnMgr;
nsCOMPtr<mozilla::dom::Element> mRootElement; // cached root node
RefPtr<mozilla::dom::Text> mIMETextNode; // current IME text node
nsCOMPtr<Element> mRootElement; // cached root node
RefPtr<Text> mIMETextNode; // current IME text node
nsCOMPtr<mozilla::dom::EventTarget> mEventTarget; // The form field as an event receiver
nsCOMPtr<nsIDOMEventListener> mEventListener;
nsWeakPtr mSelConWeak; // weak reference to the nsISelectionController
@ -851,11 +851,11 @@ protected:
// various listeners
// Listens to all low level actions on the doc
nsTArray<mozilla::OwningNonNull<nsIEditActionListener>> mActionListeners;
nsTArray<OwningNonNull<nsIEditActionListener>> mActionListeners;
// Just notify once per high level change
nsTArray<mozilla::OwningNonNull<nsIEditorObserver>> mEditorObservers;
nsTArray<OwningNonNull<nsIEditorObserver>> mEditorObservers;
// Listen to overall doc state (dirty or not, just created, etc)
nsTArray<mozilla::OwningNonNull<nsIDocumentStateListener>> mDocStateListeners;
nsTArray<OwningNonNull<nsIDocumentStateListener>> mDocStateListeners;
nsSelectionState mSavedSel; // cached selection for nsAutoSelectionReset
nsRangeUpdater mRangeUpdater; // utility class object for maintaining preserved ranges

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

@ -75,10 +75,10 @@ public:
nsIEditor::EDirection aDirection) override;
NS_IMETHOD AfterEdit(EditAction action,
nsIEditor::EDirection aDirection) override;
NS_IMETHOD WillDoAction(mozilla::dom::Selection* aSelection, nsRulesInfo* aInfo,
NS_IMETHOD WillDoAction(Selection* aSelection, nsRulesInfo* aInfo,
bool* aCancel, bool* aHandled) override;
NS_IMETHOD DidDoAction(mozilla::dom::Selection* aSelection,
nsRulesInfo* aInfo, nsresult aResult) override;
NS_IMETHOD DidDoAction(Selection* aSelection, nsRulesInfo* aInfo,
nsresult aResult) override;
NS_IMETHOD DocumentModified() override;
nsresult GetListState(bool *aMixed, bool *aOL, bool *aUL, bool *aDL);
@ -120,30 +120,29 @@ protected:
void InitFields();
// nsHTMLEditRules implementation methods
void WillInsert(mozilla::dom::Selection& aSelection, bool* aCancel);
void WillInsert(Selection& aSelection, bool* aCancel);
nsresult WillInsertText( EditAction aAction,
mozilla::dom::Selection* aSelection,
Selection* aSelection,
bool *aCancel,
bool *aHandled,
const nsAString *inString,
nsAString *outString,
int32_t aMaxLength);
nsresult WillLoadHTML(mozilla::dom::Selection* aSelection, bool* aCancel);
nsresult WillInsertBreak(mozilla::dom::Selection& aSelection,
bool* aCancel, bool* aHandled);
nsresult WillLoadHTML(Selection* aSelection, bool* aCancel);
nsresult WillInsertBreak(Selection& aSelection, bool* aCancel,
bool* aHandled);
nsresult StandardBreakImpl(nsINode& aNode, int32_t aOffset,
mozilla::dom::Selection& aSelection);
nsresult DidInsertBreak(mozilla::dom::Selection* aSelection,
nsresult aResult);
nsresult SplitMailCites(mozilla::dom::Selection* aSelection, bool* aHandled);
nsresult WillDeleteSelection(mozilla::dom::Selection* aSelection,
Selection& aSelection);
nsresult DidInsertBreak(Selection* aSelection, nsresult aResult);
nsresult SplitMailCites(Selection* aSelection, bool* aHandled);
nsresult WillDeleteSelection(Selection* aSelection,
nsIEditor::EDirection aAction,
nsIEditor::EStripWrappers aStripWrappers,
bool* aCancel, bool* aHandled);
nsresult DidDeleteSelection(mozilla::dom::Selection* aSelection,
nsresult DidDeleteSelection(Selection* aSelection,
nsIEditor::EDirection aDir,
nsresult aResult);
nsresult InsertBRIfNeeded(mozilla::dom::Selection* aSelection);
nsresult InsertBRIfNeeded(Selection* aSelection);
::DOMPoint GetGoodSelPointForNode(nsINode& aNode,
nsIEditor::EDirection aAction);
nsresult JoinBlocks(nsIContent& aLeftNode, nsIContent& aRightNode,
@ -152,72 +151,63 @@ protected:
nsresult MoveNodeSmart(nsIDOMNode *aSource, nsIDOMNode *aDest, int32_t *aOffset);
nsresult MoveContents(nsIDOMNode *aSource, nsIDOMNode *aDest, int32_t *aOffset);
nsresult DeleteNonTableElements(nsINode* aNode);
nsresult WillMakeList(mozilla::dom::Selection* aSelection,
nsresult WillMakeList(Selection* aSelection,
const nsAString* aListType,
bool aEntireList,
const nsAString* aBulletType,
bool* aCancel, bool* aHandled,
const nsAString* aItemType = nullptr);
nsresult WillRemoveList(mozilla::dom::Selection* aSelection,
bool aOrdered, bool* aCancel, bool* aHandled);
nsresult WillIndent(mozilla::dom::Selection* aSelection,
bool* aCancel, bool* aHandled);
nsresult WillCSSIndent(mozilla::dom::Selection* aSelection,
bool* aCancel, bool* aHandled);
nsresult WillHTMLIndent(mozilla::dom::Selection* aSelection,
bool* aCancel, bool* aHandled);
nsresult WillOutdent(mozilla::dom::Selection* aSelection,
bool* aCancel, bool* aHandled);
nsresult WillAlign(mozilla::dom::Selection& aSelection,
const nsAString& aAlignType,
nsresult WillRemoveList(Selection* aSelection, bool aOrdered, bool* aCancel,
bool* aHandled);
nsresult WillIndent(Selection* aSelection, bool* aCancel, bool* aHandled);
nsresult WillCSSIndent(Selection* aSelection, bool* aCancel, bool* aHandled);
nsresult WillHTMLIndent(Selection* aSelection, bool* aCancel,
bool* aHandled);
nsresult WillOutdent(Selection* aSelection, bool* aCancel, bool* aHandled);
nsresult WillAlign(Selection& aSelection, const nsAString& aAlignType,
bool* aCancel, bool* aHandled);
nsresult WillAbsolutePosition(mozilla::dom::Selection* aSelection,
bool* aCancel, bool* aHandled);
nsresult WillRemoveAbsolutePosition(mozilla::dom::Selection* aSelection,
bool* aCancel, bool* aHandled);
nsresult WillRelativeChangeZIndex(mozilla::dom::Selection* aSelection,
int32_t aChange,
nsresult WillAbsolutePosition(Selection* aSelection, bool* aCancel,
bool* aHandled);
nsresult WillRemoveAbsolutePosition(Selection* aSelection, bool* aCancel,
bool* aHandled);
nsresult WillRelativeChangeZIndex(Selection* aSelection, int32_t aChange,
bool* aCancel, bool* aHandled);
nsresult WillMakeDefListItem(mozilla::dom::Selection* aSelection,
nsresult WillMakeDefListItem(Selection* aSelection,
const nsAString* aBlockType, bool aEntireList,
bool* aCancel, bool* aHandled);
nsresult WillMakeBasicBlock(mozilla::dom::Selection* aSelection,
nsresult WillMakeBasicBlock(Selection* aSelection,
const nsAString* aBlockType,
bool* aCancel, bool* aHandled);
nsresult DidMakeBasicBlock(mozilla::dom::Selection* aSelection,
nsRulesInfo* aInfo, nsresult aResult);
nsresult DidMakeBasicBlock(Selection* aSelection, nsRulesInfo* aInfo,
nsresult aResult);
nsresult DidAbsolutePosition();
nsresult AlignInnerBlocks(nsINode& aNode, const nsAString* alignType);
nsresult AlignBlockContents(nsIDOMNode *aNode, const nsAString *alignType);
nsresult AppendInnerFormatNodes(nsTArray<mozilla::OwningNonNull<nsINode>>& aArray,
nsresult AppendInnerFormatNodes(nsTArray<OwningNonNull<nsINode>>& aArray,
nsINode* aNode);
nsresult GetFormatString(nsIDOMNode *aNode, nsAString &outFormat);
enum class Lists { no, yes };
enum class Tables { no, yes };
void GetInnerContent(nsINode& aNode,
nsTArray<mozilla::OwningNonNull<nsINode>>& aOutArrayOfNodes,
nsTArray<OwningNonNull<nsINode>>& aOutArrayOfNodes,
int32_t* aIndex, Lists aLists = Lists::yes,
Tables aTables = Tables::yes);
mozilla::dom::Element* IsInListItem(nsINode* aNode);
nsresult ReturnInHeader(mozilla::dom::Selection& aSelection,
mozilla::dom::Element& aHeader, nsINode& aNode,
int32_t aOffset);
nsresult ReturnInParagraph(mozilla::dom::Selection* aSelection,
nsIDOMNode* aHeader, nsIDOMNode* aTextNode,
int32_t aOffset, bool* aCancel, bool* aHandled);
Element* IsInListItem(nsINode* aNode);
nsresult ReturnInHeader(Selection& aSelection, Element& aHeader,
nsINode& aNode, int32_t aOffset);
nsresult ReturnInParagraph(Selection* aSelection, nsIDOMNode* aHeader,
nsIDOMNode* aTextNode, int32_t aOffset,
bool* aCancel, bool* aHandled);
nsresult SplitParagraph(nsIDOMNode *aPara,
nsIDOMNode *aBRNode,
mozilla::dom::Selection* aSelection,
Selection* aSelection,
nsCOMPtr<nsIDOMNode> *aSelNode,
int32_t *aOffset);
nsresult ReturnInListItem(mozilla::dom::Selection& aSelection,
mozilla::dom::Element& aHeader,
nsINode& aNode,
int32_t aOffset);
nsresult ReturnInListItem(Selection& aSelection, Element& aHeader,
nsINode& aNode, int32_t aOffset);
nsresult AfterEditInner(EditAction action,
nsIEditor::EDirection aDirection);
nsresult RemovePartOfBlock(mozilla::dom::Element& aBlock,
nsIContent& aStartChild,
nsresult RemovePartOfBlock(Element& aBlock, nsIContent& aStartChild,
nsIContent& aEndChild);
nsresult SplitBlock(nsIDOMNode *aBlock,
nsIDOMNode *aStartChild,
@ -236,86 +226,79 @@ protected:
nsCOMPtr<nsIDOMNode>* outList,
nsIAtom* aListType,
nsIAtom* aItemType);
nsresult ConvertListType(mozilla::dom::Element* aList,
mozilla::dom::Element** aOutList,
nsIAtom* aListType,
nsIAtom* aItemType);
nsresult ConvertListType(Element* aList, Element** aOutList,
nsIAtom* aListType, nsIAtom* aItemType);
nsresult CreateStyleForInsertText(mozilla::dom::Selection& aSelection,
nsIDocument& aDoc);
nsresult CreateStyleForInsertText(Selection& aSelection, nsIDocument& aDoc);
enum class MozBRCounts { yes, no };
nsresult IsEmptyBlock(mozilla::dom::Element& aNode,
bool* aOutIsEmptyBlock,
nsresult IsEmptyBlock(Element& aNode, bool* aOutIsEmptyBlock,
MozBRCounts aMozBRCounts = MozBRCounts::yes);
nsresult CheckForEmptyBlock(nsINode* aStartNode,
mozilla::dom::Element* aBodyNode,
mozilla::dom::Selection* aSelection,
nsIEditor::EDirection aAction,
bool* aHandled);
nsresult CheckForEmptyBlock(nsINode* aStartNode, Element* aBodyNode,
Selection* aSelection,
nsIEditor::EDirection aAction, bool* aHandled);
enum class BRLocation { beforeBlock, blockEnd };
mozilla::dom::Element* CheckForInvisibleBR(mozilla::dom::Element& aBlock,
BRLocation aWhere,
int32_t aOffset = 0);
nsresult ExpandSelectionForDeletion(mozilla::dom::Selection& aSelection);
Element* CheckForInvisibleBR(Element& aBlock, BRLocation aWhere,
int32_t aOffset = 0);
nsresult ExpandSelectionForDeletion(Selection& aSelection);
bool IsFirstNode(nsIDOMNode *aNode);
bool IsLastNode(nsIDOMNode *aNode);
nsresult NormalizeSelection(mozilla::dom::Selection* aSelection);
nsresult NormalizeSelection(Selection* aSelection);
void GetPromotedPoint(RulesEndpoint aWhere, nsIDOMNode* aNode,
int32_t aOffset, EditAction actionID,
nsCOMPtr<nsIDOMNode>* outNode, int32_t* outOffset);
void GetPromotedRanges(mozilla::dom::Selection& aSelection,
void GetPromotedRanges(Selection& aSelection,
nsTArray<RefPtr<nsRange>>& outArrayOfRanges,
EditAction inOperationType);
void PromoteRange(nsRange& aRange, EditAction inOperationType);
enum class TouchContent { no, yes };
nsresult GetNodesForOperation(nsTArray<RefPtr<nsRange>>& aArrayOfRanges,
nsTArray<mozilla::OwningNonNull<nsINode>>& aOutArrayOfNodes,
nsTArray<OwningNonNull<nsINode>>& aOutArrayOfNodes,
EditAction aOperationType,
TouchContent aTouchContent = TouchContent::yes);
void GetChildNodesForOperation(nsINode& aNode,
nsTArray<mozilla::OwningNonNull<nsINode>>& outArrayOfNodes);
nsTArray<OwningNonNull<nsINode>>& outArrayOfNodes);
nsresult GetNodesFromPoint(::DOMPoint aPoint,
EditAction aOperation,
nsTArray<mozilla::OwningNonNull<nsINode>>& outArrayOfNodes,
nsTArray<OwningNonNull<nsINode>>& outArrayOfNodes,
TouchContent aTouchContent);
nsresult GetNodesFromSelection(mozilla::dom::Selection& aSelection,
nsresult GetNodesFromSelection(Selection& aSelection,
EditAction aOperation,
nsTArray<mozilla::OwningNonNull<nsINode>>& outArrayOfNodes,
nsTArray<OwningNonNull<nsINode>>& outArrayOfNodes,
TouchContent aTouchContent = TouchContent::yes);
enum class EntireList { no, yes };
nsresult GetListActionNodes(nsTArray<mozilla::OwningNonNull<nsINode>>& aOutArrayOfNodes,
nsresult GetListActionNodes(nsTArray<OwningNonNull<nsINode>>& aOutArrayOfNodes,
EntireList aEntireList,
TouchContent aTouchContent = TouchContent::yes);
void GetDefinitionListItemTypes(mozilla::dom::Element* aElement, bool* aDT, bool* aDD);
void GetDefinitionListItemTypes(Element* aElement, bool* aDT, bool* aDD);
nsresult GetParagraphFormatNodes(
nsTArray<mozilla::OwningNonNull<nsINode>>& outArrayOfNodes,
nsTArray<OwningNonNull<nsINode>>& outArrayOfNodes,
TouchContent aTouchContent = TouchContent::yes);
void LookInsideDivBQandList(nsTArray<mozilla::OwningNonNull<nsINode>>& aNodeArray);
void LookInsideDivBQandList(nsTArray<OwningNonNull<nsINode>>& aNodeArray);
nsresult BustUpInlinesAtRangeEndpoints(nsRangeStore &inRange);
nsresult BustUpInlinesAtBRs(nsIContent& aNode,
nsTArray<mozilla::OwningNonNull<nsINode>>& aOutArrayOfNodes);
nsTArray<OwningNonNull<nsINode>>& aOutArrayOfNodes);
nsIContent* GetHighestInlineParent(nsINode& aNode);
void MakeTransitionList(nsTArray<mozilla::OwningNonNull<nsINode>>& aNodeArray,
void MakeTransitionList(nsTArray<OwningNonNull<nsINode>>& aNodeArray,
nsTArray<bool>& aTransitionArray);
nsresult RemoveBlockStyle(nsTArray<mozilla::OwningNonNull<nsINode>>& aNodeArray);
nsresult ApplyBlockStyle(nsTArray<mozilla::OwningNonNull<nsINode>>& aNodeArray,
nsresult RemoveBlockStyle(nsTArray<OwningNonNull<nsINode>>& aNodeArray);
nsresult ApplyBlockStyle(nsTArray<OwningNonNull<nsINode>>& aNodeArray,
nsIAtom& aBlockTag);
nsresult MakeBlockquote(nsTArray<mozilla::OwningNonNull<nsINode>>& aNodeArray);
nsresult MakeBlockquote(nsTArray<OwningNonNull<nsINode>>& aNodeArray);
nsresult SplitAsNeeded(nsIAtom& aTag, nsCOMPtr<nsINode>& inOutParent,
int32_t& inOutOffset);
nsresult AddTerminatingBR(nsIDOMNode *aBlock);
::DOMPoint JoinNodesSmart(nsIContent& aNodeLeft, nsIContent& aNodeRight);
mozilla::dom::Element* GetTopEnclosingMailCite(nsINode& aNode);
Element* GetTopEnclosingMailCite(nsINode& aNode);
nsresult PopListItem(nsIDOMNode *aListItem, bool *aOutOfList);
nsresult RemoveListStructure(nsIDOMNode *aList);
nsresult CacheInlineStyles(nsIDOMNode *aNode);
nsresult ReapplyCachedStyles();
void ClearCachedStyles();
void AdjustSpecialBreaks();
nsresult AdjustWhitespace(mozilla::dom::Selection* aSelection);
nsresult PinSelectionToNewBlock(mozilla::dom::Selection* aSelection);
void CheckInterlinePosition(mozilla::dom::Selection& aSelection);
nsresult AdjustSelection(mozilla::dom::Selection* aSelection,
nsresult AdjustWhitespace(Selection* aSelection);
nsresult PinSelectionToNewBlock(Selection* aSelection);
void CheckInterlinePosition(Selection& aSelection);
nsresult AdjustSelection(Selection* aSelection,
nsIEditor::EDirection aAction);
nsresult FindNearSelectableNode(nsIDOMNode *aSelNode,
int32_t aSelOffset,
@ -336,11 +319,11 @@ protected:
nsresult ConfirmSelectionInBody();
nsresult InsertMozBRIfNeeded(nsINode& aNode);
bool IsEmptyInline(nsINode& aNode);
bool ListIsEmptyLine(nsTArray<mozilla::OwningNonNull<nsINode>>& arrayOfNodes);
bool ListIsEmptyLine(nsTArray<OwningNonNull<nsINode>>& arrayOfNodes);
nsresult RemoveAlignment(nsIDOMNode * aNode, const nsAString & aAlignType, bool aChildrenOnly);
nsresult MakeSureElemStartsOrEndsOnCR(nsIDOMNode *aNode, bool aStarts);
enum class ContentsOnly { no, yes };
nsresult AlignBlock(mozilla::dom::Element& aElement,
nsresult AlignBlock(Element& aElement,
const nsAString& aAlignType, ContentsOnly aContentsOnly);
nsresult RelativeChangeIndentationOfElementNode(nsIDOMNode *aNode, int8_t aRelativeChange);
void DocumentModifiedWorker();

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

@ -110,7 +110,7 @@ public:
virtual already_AddRefed<nsIContent> GetFocusedContentForIME() override;
virtual bool IsActiveInDOMWindow() override;
virtual already_AddRefed<mozilla::dom::EventTarget> GetDOMEventTarget() override;
virtual mozilla::dom::Element* GetEditorRoot() override;
virtual Element* GetEditorRoot() override;
virtual already_AddRefed<nsIContent> FindSelectionRoot(nsINode *aNode) override;
virtual bool IsAcceptableInputEvent(nsIDOMEvent* aEvent) override;
virtual already_AddRefed<nsIContent> GetInputEventTargetContent() override;
@ -143,7 +143,7 @@ public:
/* ------------ nsIHTMLEditor methods -------------- */
nsresult CopyLastEditableChildStyles(nsIDOMNode *aPreviousBlock, nsIDOMNode *aNewBlock,
mozilla::dom::Element** aOutBrNode);
Element** aOutBrNode);
nsresult LoadHTML(const nsAString &aInputString);
@ -232,9 +232,9 @@ public:
nsresult SetHTMLBackgroundColor(const nsAString& aColor);
/* ------------ Block methods moved from nsEditor -------------- */
static mozilla::dom::Element* GetBlockNodeParent(nsINode* aNode);
static Element* GetBlockNodeParent(nsINode* aNode);
static nsIDOMNode* GetBlockNodeParent(nsIDOMNode* aNode);
static mozilla::dom::Element* GetBlock(nsINode& aNode);
static Element* GetBlock(nsINode& aNode);
void IsNextCharInNodeWhitespace(nsIContent* aContent,
int32_t aOffset,
@ -298,7 +298,7 @@ public:
virtual bool IsContainer(nsIDOMNode* aNode) override;
/** make the given selection span the entire document */
virtual nsresult SelectEntireDocument(mozilla::dom::Selection* aSelection) override;
virtual nsresult SelectEntireDocument(Selection* aSelection) override;
NS_IMETHOD SetAttributeOrEquivalent(nsIDOMElement * aElement,
const nsAString & aAttribute,
@ -350,8 +350,8 @@ public:
// This will stop at a table, however, since we don't want to
// "drill down" into nested tables.
// aSelection is optional -- if null, we get current seletion
void CollapseSelectionToDeepestNonTableFirstChild(
mozilla::dom::Selection* aSelection, nsINode* aNode);
void CollapseSelectionToDeepestNonTableFirstChild(Selection* aSelection,
nsINode* aNode);
/**
* aNode must be a non-null text node.
@ -395,7 +395,7 @@ public:
return mCSSAware && mHTMLCSSUtils && mHTMLCSSUtils->IsCSSPrefChecked();
}
static bool HasAttributes(mozilla::dom::Element* aElement)
static bool HasAttributes(Element* aElement)
{
MOZ_ASSERT(aElement);
uint32_t attrCount = aElement->GetAttrCount();
@ -426,8 +426,8 @@ protected:
// key event helpers
NS_IMETHOD TabInTable(bool inIsShift, bool *outHandled);
mozilla::dom::Element* CreateBR(nsINode* aNode, int32_t aOffset,
EDirection aSelect = eNone);
Element* CreateBR(nsINode* aNode, int32_t aOffset,
EDirection aSelect = eNone);
NS_IMETHOD CreateBR(nsIDOMNode *aNode, int32_t aOffset,
nsCOMPtr<nsIDOMNode> *outBRNode, nsIEditor::EDirection aSelect = nsIEditor::eNone) override;
@ -449,8 +449,7 @@ protected:
// Move all contents from aCellToMerge into aTargetCell (append at end)
NS_IMETHOD MergeCells(nsCOMPtr<nsIDOMElement> aTargetCell, nsCOMPtr<nsIDOMElement> aCellToMerge, bool aDeleteCellToMerge);
nsresult DeleteTable2(nsIDOMElement* aTable,
mozilla::dom::Selection* aSelection);
nsresult DeleteTable2(nsIDOMElement* aTable, Selection* aSelection);
NS_IMETHOD SetColSpan(nsIDOMElement *aCell, int32_t aColSpan);
NS_IMETHOD SetRowSpan(nsIDOMElement *aCell, int32_t aRowSpan);
@ -463,17 +462,17 @@ protected:
bool AllCellsInRowSelected(nsIDOMElement *aTable, int32_t aRowIndex, int32_t aNumberOfColumns);
bool AllCellsInColumnSelected(nsIDOMElement *aTable, int32_t aColIndex, int32_t aNumberOfRows);
bool IsEmptyCell(mozilla::dom::Element* aCell);
bool IsEmptyCell(Element* aCell);
// Most insert methods need to get the same basic context data
// Any of the pointers may be null if you don't need that datum (for more efficiency)
// Input: *aCell is a known cell,
// if null, cell is obtained from the anchor node of the selection
// Returns NS_EDITOR_ELEMENT_NOT_FOUND if cell is not found even if aCell is null
nsresult GetCellContext(mozilla::dom::Selection** aSelection,
nsIDOMElement** aTable, nsIDOMElement** aCell,
nsIDOMNode** aCellParent, int32_t* aCellOffset,
int32_t* aRowIndex, int32_t* aColIndex);
nsresult GetCellContext(Selection** aSelection, nsIDOMElement** aTable,
nsIDOMElement** aCell, nsIDOMNode** aCellParent,
int32_t* aCellOffset, int32_t* aRowIndex,
int32_t* aColIndex);
NS_IMETHOD GetCellSpansAt(nsIDOMElement* aTable, int32_t aRowIndex, int32_t aColIndex,
int32_t& aActualRowSpan, int32_t& aActualColSpan);
@ -492,11 +491,11 @@ protected:
// Fallback method: Call this after using ClearSelection() and you
// failed to set selection to some other content in the document
nsresult SetSelectionAtDocumentStart(mozilla::dom::Selection* aSelection);
nsresult SetSelectionAtDocumentStart(Selection* aSelection);
// End of Table Editing utilities
static mozilla::dom::Element* GetEnclosingTable(nsINode* aNode);
static Element* GetEnclosingTable(nsINode* aNode);
static nsIDOMNode* GetEnclosingTable(nsIDOMNode *aNode);
/** content-based query returns true if <aProperty aAttribute=aValue> effects aNode
@ -597,7 +596,7 @@ protected:
mozilla::dom::DocumentFragment** aFragment,
bool aTrustedInput);
void CreateListOfNodesToPaste(mozilla::dom::DocumentFragment& aFragment,
nsTArray<mozilla::OwningNonNull<nsINode>>& outNodeList,
nsTArray<OwningNonNull<nsINode>>& outNodeList,
nsINode* aStartNode,
int32_t aStartOffset,
nsINode* aEndNode,
@ -606,16 +605,16 @@ protected:
nsIDOMNode *aNode);
enum class StartOrEnd { start, end };
void GetListAndTableParents(StartOrEnd aStartOrEnd,
nsTArray<mozilla::OwningNonNull<nsINode>>& aNodeList,
nsTArray<mozilla::OwningNonNull<mozilla::dom::Element>>& outArray);
int32_t DiscoverPartialListsAndTables(nsTArray<mozilla::OwningNonNull<nsINode>>& aPasteNodes,
nsTArray<mozilla::OwningNonNull<mozilla::dom::Element>>& aListsAndTables);
nsTArray<OwningNonNull<nsINode>>& aNodeList,
nsTArray<OwningNonNull<Element>>& outArray);
int32_t DiscoverPartialListsAndTables(nsTArray<OwningNonNull<nsINode>>& aPasteNodes,
nsTArray<OwningNonNull<Element>>& aListsAndTables);
nsINode* ScanForListAndTableStructure(StartOrEnd aStartOrEnd,
nsTArray<mozilla::OwningNonNull<nsINode>>& aNodes,
mozilla::dom::Element& aListOrTable);
nsTArray<OwningNonNull<nsINode>>& aNodes,
Element& aListOrTable);
void ReplaceOrphanedStructure(StartOrEnd aStartOrEnd,
nsTArray<mozilla::OwningNonNull<nsINode>>& aNodeArray,
nsTArray<mozilla::OwningNonNull<mozilla::dom::Element>>& aListAndTableArray,
nsTArray<OwningNonNull<nsINode>>& aNodeArray,
nsTArray<OwningNonNull<Element>>& aListAndTableArray,
int32_t aHighWaterMark);
/* small utility routine to test if a break node is visible to user */
@ -641,14 +640,14 @@ protected:
/* helper routines for font size changing */
nsresult RelativeFontChangeOnTextNode(FontSize aDir,
mozilla::dom::Text& aTextNode,
Text& aTextNode,
int32_t aStartOffset,
int32_t aEndOffset);
nsresult RelativeFontChangeOnNode(int32_t aSizeChange, nsIContent* aNode);
nsresult RelativeFontChangeHelper(int32_t aSizeChange, nsINode* aNode);
/* helper routines for inline style */
nsresult SetInlinePropertyOnTextNode(mozilla::dom::Text& aData,
nsresult SetInlinePropertyOnTextNode(Text& aData,
int32_t aStartOffset,
int32_t aEndOffset,
nsIAtom& aProperty,
@ -722,8 +721,8 @@ protected:
bool* aAll,
nsAString* outValue,
bool aCheckDefaults = true);
bool HasStyleOrIdOrClass(mozilla::dom::Element* aElement);
nsresult RemoveElementIfNoStyleOrIdOrClass(mozilla::dom::Element& aElement);
bool HasStyleOrIdOrClass(Element* aElement);
nsresult RemoveElementIfNoStyleOrIdOrClass(Element& aElement);
// Whether the outer window of the DOM event target has focus or not.
bool OurWindowHasFocus();
@ -752,13 +751,12 @@ protected:
nsresult ClearStyle(nsCOMPtr<nsINode>* aNode, int32_t* aOffset,
nsIAtom* aProperty, const nsAString* aAttribute);
void SetElementPosition(mozilla::dom::Element& aElement,
int32_t aX, int32_t aY);
void SetElementPosition(Element& aElement, int32_t aX, int32_t aY);
// Data members
protected:
nsTArray<mozilla::OwningNonNull<nsIContentFilter>> mContentFilters;
nsTArray<OwningNonNull<nsIContentFilter>> mContentFilters;
RefPtr<TypeInState> mTypeInState;
@ -786,7 +784,7 @@ protected:
void RemoveListenerAndDeleteRef(const nsAString& aEvent,
nsIDOMEventListener* aListener,
bool aUseCapture,
mozilla::dom::Element* aElement,
Element* aElement,
nsIContent* aParentContent,
nsIPresShell* aShell);
void DeleteRefToAnonymousNode(nsIDOMElement* aElement,
@ -828,27 +826,27 @@ protected:
/* RESIZING */
nsCOMPtr<mozilla::dom::Element> mTopLeftHandle;
nsCOMPtr<mozilla::dom::Element> mTopHandle;
nsCOMPtr<mozilla::dom::Element> mTopRightHandle;
nsCOMPtr<mozilla::dom::Element> mLeftHandle;
nsCOMPtr<mozilla::dom::Element> mRightHandle;
nsCOMPtr<mozilla::dom::Element> mBottomLeftHandle;
nsCOMPtr<mozilla::dom::Element> mBottomHandle;
nsCOMPtr<mozilla::dom::Element> mBottomRightHandle;
nsCOMPtr<Element> mTopLeftHandle;
nsCOMPtr<Element> mTopHandle;
nsCOMPtr<Element> mTopRightHandle;
nsCOMPtr<Element> mLeftHandle;
nsCOMPtr<Element> mRightHandle;
nsCOMPtr<Element> mBottomLeftHandle;
nsCOMPtr<Element> mBottomHandle;
nsCOMPtr<Element> mBottomRightHandle;
nsCOMPtr<mozilla::dom::Element> mActivatedHandle;
nsCOMPtr<Element> mActivatedHandle;
nsCOMPtr<mozilla::dom::Element> mResizingShadow;
nsCOMPtr<mozilla::dom::Element> mResizingInfo;
nsCOMPtr<Element> mResizingShadow;
nsCOMPtr<Element> mResizingInfo;
nsCOMPtr<mozilla::dom::Element> mResizedObject;
nsCOMPtr<Element> mResizedObject;
nsCOMPtr<nsIDOMEventListener> mMouseMotionListenerP;
nsCOMPtr<nsISelectionListener> mSelectionListenerP;
nsCOMPtr<nsIDOMEventListener> mResizeEventListenerP;
nsTArray<mozilla::OwningNonNull<nsIHTMLObjectResizeListener>> mObjectResizeEventListeners;
nsTArray<OwningNonNull<nsIHTMLObjectResizeListener>> mObjectResizeEventListeners;
int32_t mOriginalX;
int32_t mOriginalY;
@ -873,18 +871,17 @@ protected:
nsresult SetAllResizersPosition();
already_AddRefed<mozilla::dom::Element>
CreateResizer(int16_t aLocation, nsIDOMNode* aParentNode);
already_AddRefed<Element> CreateResizer(int16_t aLocation,
nsIDOMNode* aParentNode);
void SetAnonymousElementPosition(int32_t aX, int32_t aY, nsIDOMElement *aResizer);
already_AddRefed<mozilla::dom::Element>
CreateShadow(nsIDOMNode* aParentNode, nsIDOMElement* aOriginalObject);
nsresult SetShadowPosition(mozilla::dom::Element* aShadow,
mozilla::dom::Element* aOriginalObject,
already_AddRefed<Element> CreateShadow(nsIDOMNode* aParentNode,
nsIDOMElement* aOriginalObject);
nsresult SetShadowPosition(Element* aShadow, Element* aOriginalObject,
int32_t aOriginalObjectX,
int32_t aOriginalObjectY);
already_AddRefed<mozilla::dom::Element> CreateResizingInfo(nsIDOMNode* aParentNode);
already_AddRefed<Element> CreateResizingInfo(nsIDOMNode* aParentNode);
nsresult SetResizingInfoPosition(int32_t aX, int32_t aY,
int32_t aW, int32_t aH);
@ -912,13 +909,13 @@ protected:
int32_t mPositionedObjectBorderLeft;
int32_t mPositionedObjectBorderTop;
nsCOMPtr<mozilla::dom::Element> mAbsolutelyPositionedObject;
nsCOMPtr<mozilla::dom::Element> mGrabber;
nsCOMPtr<mozilla::dom::Element> mPositioningShadow;
nsCOMPtr<Element> mAbsolutelyPositionedObject;
nsCOMPtr<Element> mGrabber;
nsCOMPtr<Element> mPositioningShadow;
int32_t mGridSize;
already_AddRefed<mozilla::dom::Element> CreateGrabber(nsINode* aParentNode);
already_AddRefed<Element> CreateGrabber(nsINode* aParentNode);
nsresult StartMoving(nsIDOMElement * aHandle);
nsresult SetFinalPosition(int32_t aX, int32_t aY);
void AddPositioningOffset(int32_t & aX, int32_t & aY);
@ -967,9 +964,9 @@ private:
void DoContentInserted(nsIDocument* aDocument, nsIContent* aContainer,
nsIContent* aChild, int32_t aIndexInContainer,
InsertedOrAppended aInsertedOrAppended);
already_AddRefed<mozilla::dom::Element> GetElementOrParentByTagName(
already_AddRefed<Element> GetElementOrParentByTagName(
const nsAString& aTagName, nsINode* aNode);
already_AddRefed<mozilla::dom::Element> CreateElementWithDefaults(
already_AddRefed<Element> CreateElementWithDefaults(
const nsAString& aTagName);
};
#endif //nsHTMLEditor_h__

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

@ -120,7 +120,7 @@ public:
NS_IMETHOD EndOperation() override;
/** make the given selection span the entire document */
virtual nsresult SelectEntireDocument(mozilla::dom::Selection* aSelection) override;
virtual nsresult SelectEntireDocument(Selection* aSelection) override;
virtual nsresult HandleKeyPressEvent(nsIDOMKeyEvent* aKeyEvent) override;
@ -153,7 +153,7 @@ public:
* If done, also update aAction to what's actually left to do after the
* extension.
*/
nsresult ExtendSelectionForDelete(mozilla::dom::Selection* aSelection,
nsresult ExtendSelectionForDelete(Selection* aSelection,
nsIEditor::EDirection *aAction);
// Return true if the data is safe to insert as the source and destination
@ -180,9 +180,8 @@ protected:
// key event helpers
NS_IMETHOD CreateBR(nsIDOMNode *aNode, int32_t aOffset,
nsCOMPtr<nsIDOMNode> *outBRNode, EDirection aSelect = eNone);
mozilla::dom::Element* CreateBRImpl(nsCOMPtr<nsINode>* aInOutParent,
int32_t* aInOutOffset,
EDirection aSelect);
Element* CreateBRImpl(nsCOMPtr<nsINode>* aInOutParent, int32_t* aInOutOffset,
EDirection aSelect);
nsresult CreateBRImpl(nsCOMPtr<nsIDOMNode>* aInOutParent,
int32_t* aInOutOffset,
nsCOMPtr<nsIDOMNode>* outBRNode,

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

@ -39,6 +39,11 @@ class Selection;
class nsTextEditRules : public nsIEditRules, public nsITimerCallback
{
public:
typedef mozilla::dom::Element Element;
typedef mozilla::dom::Selection Selection;
typedef mozilla::dom::Text Text;
template<typename T> using OwningNonNull = mozilla::OwningNonNull<T>;
NS_DECL_NSITIMERCALLBACK
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsTextEditRules, nsIEditRules)
@ -53,10 +58,10 @@ public:
nsIEditor::EDirection aDirection) override;
NS_IMETHOD AfterEdit(EditAction action,
nsIEditor::EDirection aDirection) override;
NS_IMETHOD WillDoAction(mozilla::dom::Selection* aSelection,
nsRulesInfo* aInfo, bool* aCancel, bool* aHandled) override;
NS_IMETHOD DidDoAction(mozilla::dom::Selection* aSelection,
nsRulesInfo* aInfo, nsresult aResult) override;
NS_IMETHOD WillDoAction(Selection* aSelection, nsRulesInfo* aInfo,
bool* aCancel, bool* aHandled) override;
NS_IMETHOD DidDoAction(Selection* aSelection, nsRulesInfo* aInfo,
nsresult aResult) override;
NS_IMETHOD DocumentIsEmpty(bool *aDocumentIsEmpty) override;
NS_IMETHOD DocumentModified() override;
@ -108,49 +113,43 @@ protected:
// nsTextEditRules implementation methods
nsresult WillInsertText( EditAction aAction,
mozilla::dom::Selection* aSelection,
Selection* aSelection,
bool *aCancel,
bool *aHandled,
const nsAString *inString,
nsAString *outString,
int32_t aMaxLength);
nsresult DidInsertText(mozilla::dom::Selection* aSelection,
nsresult aResult);
nsresult DidInsertText(Selection* aSelection, nsresult aResult);
nsresult GetTopEnclosingPre(nsIDOMNode *aNode, nsIDOMNode** aOutPreNode);
nsresult WillInsertBreak(mozilla::dom::Selection* aSelection, bool* aCancel,
nsresult WillInsertBreak(Selection* aSelection, bool* aCancel,
bool *aHandled, int32_t aMaxLength);
nsresult DidInsertBreak(mozilla::dom::Selection* aSelection,
nsresult aResult);
nsresult DidInsertBreak(Selection* aSelection, nsresult aResult);
void WillInsert(mozilla::dom::Selection& aSelection, bool* aCancel);
nsresult DidInsert(mozilla::dom::Selection* aSelection, nsresult aResult);
void WillInsert(Selection& aSelection, bool* aCancel);
nsresult DidInsert(Selection* aSelection, nsresult aResult);
nsresult WillDeleteSelection(mozilla::dom::Selection* aSelection,
nsresult WillDeleteSelection(Selection* aSelection,
nsIEditor::EDirection aCollapsedAction,
bool *aCancel,
bool *aHandled);
nsresult DidDeleteSelection(mozilla::dom::Selection* aSelection,
nsresult DidDeleteSelection(Selection* aSelection,
nsIEditor::EDirection aCollapsedAction,
nsresult aResult);
nsresult WillSetTextProperty(mozilla::dom::Selection* aSelection,
bool* aCancel, bool* aHandled);
nsresult DidSetTextProperty(mozilla::dom::Selection* aSelection,
nsresult aResult);
nsresult WillSetTextProperty(Selection* aSelection, bool* aCancel,
bool* aHandled);
nsresult DidSetTextProperty(Selection* aSelection, nsresult aResult);
nsresult WillRemoveTextProperty(mozilla::dom::Selection* aSelection,
bool* aCancel, bool* aHandled);
nsresult DidRemoveTextProperty(mozilla::dom::Selection* aSelection,
nsresult aResult);
nsresult WillRemoveTextProperty(Selection* aSelection, bool* aCancel,
bool* aHandled);
nsresult DidRemoveTextProperty(Selection* aSelection, nsresult aResult);
nsresult WillUndo(mozilla::dom::Selection* aSelection, bool* aCancel,
bool* aHandled);
nsresult DidUndo(mozilla::dom::Selection* aSelection, nsresult aResult);
nsresult WillUndo(Selection* aSelection, bool* aCancel, bool* aHandled);
nsresult DidUndo(Selection* aSelection, nsresult aResult);
nsresult WillRedo(mozilla::dom::Selection* aSelection, bool* aCancel,
bool* aHandled);
nsresult DidRedo(mozilla::dom::Selection* aSelection, nsresult aResult);
nsresult WillRedo(Selection* aSelection, bool* aCancel, bool* aHandled);
nsresult DidRedo(Selection* aSelection, nsresult aResult);
/** called prior to nsIEditor::OutputToString
* @param aSelection
@ -159,13 +158,13 @@ protected:
* @param aOutCancel if set to true, the caller should cancel the operation
* and use aOutText as the result.
*/
nsresult WillOutputText(mozilla::dom::Selection* aSelection,
nsresult WillOutputText(Selection* aSelection,
const nsAString *aInFormat,
nsAString *aOutText,
bool *aOutCancel,
bool *aHandled);
nsresult DidOutputText(mozilla::dom::Selection* aSelection, nsresult aResult);
nsresult DidOutputText(Selection* aSelection, nsresult aResult);
// helper functions
@ -177,11 +176,11 @@ protected:
nsresult CreateTrailingBRIfNeeded();
/** creates a bogus text node if the document has no editable content */
nsresult CreateBogusNodeIfNeeded(mozilla::dom::Selection* aSelection);
nsresult CreateBogusNodeIfNeeded(Selection* aSelection);
/** returns a truncated insertion string if insertion would place us
over aMaxLength */
nsresult TruncateInsertionIfNeeded(mozilla::dom::Selection* aSelection,
nsresult TruncateInsertionIfNeeded(Selection* aSelection,
const nsAString *aInString,
nsAString *aOutString,
int32_t aMaxLength,
@ -193,9 +192,9 @@ protected:
nsresult CreateMozBR(nsIDOMNode* inParent, int32_t inOffset,
nsIDOMNode** outBRNode = nullptr);
void UndefineCaretBidiLevel(mozilla::dom::Selection* aSelection);
void UndefineCaretBidiLevel(Selection* aSelection);
nsresult CheckBidiLevelForDeletion(mozilla::dom::Selection* aSelection,
nsresult CheckBidiLevelForDeletion(Selection* aSelection,
nsIDOMNode *aSelNode,
int32_t aSelOffset,
nsIEditor::EDirection aAction,
@ -203,7 +202,7 @@ protected:
nsresult HideLastPWInput();
nsresult CollapseSelectionToTrailingBRIfNeeded(mozilla::dom::Selection* aSelection);
nsresult CollapseSelectionToTrailingBRIfNeeded(Selection* aSelection);
bool IsPasswordEditor() const
{