зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1573119: declare more methods around `HTMLEditor` `const`/`static`. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D41524 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
56a1409a1d
Коммит
81a41b2d7d
|
@ -3406,7 +3406,7 @@ nsINode* EditorBase::GetNodeLocation(nsINode* aChild, int32_t* aOffset) {
|
|||
nsIContent* EditorBase::GetPreviousNodeInternal(nsINode& aNode,
|
||||
bool aFindEditableNode,
|
||||
bool aFindAnyDataNode,
|
||||
bool aNoBlockCrossing) {
|
||||
bool aNoBlockCrossing) const {
|
||||
if (!IsDescendantOfEditorRoot(&aNode)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -3417,7 +3417,7 @@ nsIContent* EditorBase::GetPreviousNodeInternal(nsINode& aNode,
|
|||
nsIContent* EditorBase::GetPreviousNodeInternal(const EditorRawDOMPoint& aPoint,
|
||||
bool aFindEditableNode,
|
||||
bool aFindAnyDataNode,
|
||||
bool aNoBlockCrossing) {
|
||||
bool aNoBlockCrossing) const {
|
||||
MOZ_ASSERT(aPoint.IsSetAndValid());
|
||||
NS_WARNING_ASSERTION(
|
||||
!aPoint.IsInDataNode() || aPoint.IsInTextNode(),
|
||||
|
@ -3462,7 +3462,7 @@ nsIContent* EditorBase::GetPreviousNodeInternal(const EditorRawDOMPoint& aPoint,
|
|||
nsIContent* EditorBase::GetNextNodeInternal(nsINode& aNode,
|
||||
bool aFindEditableNode,
|
||||
bool aFindAnyDataNode,
|
||||
bool aNoBlockCrossing) {
|
||||
bool aNoBlockCrossing) const {
|
||||
if (!IsDescendantOfEditorRoot(&aNode)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -3473,7 +3473,7 @@ nsIContent* EditorBase::GetNextNodeInternal(nsINode& aNode,
|
|||
nsIContent* EditorBase::GetNextNodeInternal(const EditorRawDOMPoint& aPoint,
|
||||
bool aFindEditableNode,
|
||||
bool aFindAnyDataNode,
|
||||
bool aNoBlockCrossing) {
|
||||
bool aNoBlockCrossing) const {
|
||||
MOZ_ASSERT(aPoint.IsSetAndValid());
|
||||
NS_WARNING_ASSERTION(
|
||||
!aPoint.IsInDataNode() || aPoint.IsInTextNode(),
|
||||
|
@ -3528,7 +3528,7 @@ nsIContent* EditorBase::GetNextNodeInternal(const EditorRawDOMPoint& aPoint,
|
|||
}
|
||||
|
||||
nsIContent* EditorBase::FindNextLeafNode(nsINode* aCurrentNode, bool aGoForward,
|
||||
bool bNoBlockCrossing) {
|
||||
bool bNoBlockCrossing) const {
|
||||
// called only by GetPriorNode so we don't need to check params.
|
||||
MOZ_ASSERT(
|
||||
IsDescendantOfEditorRoot(aCurrentNode) && !IsEditorRoot(aCurrentNode),
|
||||
|
@ -3577,7 +3577,7 @@ nsIContent* EditorBase::FindNextLeafNode(nsINode* aCurrentNode, bool aGoForward,
|
|||
|
||||
nsIContent* EditorBase::FindNode(nsINode* aCurrentNode, bool aGoForward,
|
||||
bool aEditableNode, bool aFindAnyDataNode,
|
||||
bool bNoBlockCrossing) {
|
||||
bool bNoBlockCrossing) const {
|
||||
if (IsEditorRoot(aCurrentNode)) {
|
||||
// Don't allow traversal above the root node! This helps
|
||||
// prevent us from accidentally editing browser content
|
||||
|
|
|
@ -1503,40 +1503,42 @@ class EditorBase : public nsIEditor,
|
|||
/**
|
||||
* Get the previous node.
|
||||
*/
|
||||
nsIContent* GetPreviousNode(const EditorRawDOMPoint& aPoint) {
|
||||
nsIContent* GetPreviousNode(const EditorRawDOMPoint& aPoint) const {
|
||||
return GetPreviousNodeInternal(aPoint, false, true, false);
|
||||
}
|
||||
nsIContent* GetPreviousElementOrText(const EditorRawDOMPoint& aPoint) {
|
||||
nsIContent* GetPreviousElementOrText(const EditorRawDOMPoint& aPoint) const {
|
||||
return GetPreviousNodeInternal(aPoint, false, false, false);
|
||||
}
|
||||
nsIContent* GetPreviousEditableNode(const EditorRawDOMPoint& aPoint) {
|
||||
nsIContent* GetPreviousEditableNode(const EditorRawDOMPoint& aPoint) const {
|
||||
return GetPreviousNodeInternal(aPoint, true, true, false);
|
||||
}
|
||||
nsIContent* GetPreviousNodeInBlock(const EditorRawDOMPoint& aPoint) {
|
||||
nsIContent* GetPreviousNodeInBlock(const EditorRawDOMPoint& aPoint) const {
|
||||
return GetPreviousNodeInternal(aPoint, false, true, true);
|
||||
}
|
||||
nsIContent* GetPreviousElementOrTextInBlock(const EditorRawDOMPoint& aPoint) {
|
||||
nsIContent* GetPreviousElementOrTextInBlock(
|
||||
const EditorRawDOMPoint& aPoint) const {
|
||||
return GetPreviousNodeInternal(aPoint, false, false, true);
|
||||
}
|
||||
nsIContent* GetPreviousEditableNodeInBlock(const EditorRawDOMPoint& aPoint) {
|
||||
nsIContent* GetPreviousEditableNodeInBlock(
|
||||
const EditorRawDOMPoint& aPoint) const {
|
||||
return GetPreviousNodeInternal(aPoint, true, true, true);
|
||||
}
|
||||
nsIContent* GetPreviousNode(nsINode& aNode) {
|
||||
nsIContent* GetPreviousNode(nsINode& aNode) const {
|
||||
return GetPreviousNodeInternal(aNode, false, true, false);
|
||||
}
|
||||
nsIContent* GetPreviousElementOrText(nsINode& aNode) {
|
||||
nsIContent* GetPreviousElementOrText(nsINode& aNode) const {
|
||||
return GetPreviousNodeInternal(aNode, false, false, false);
|
||||
}
|
||||
nsIContent* GetPreviousEditableNode(nsINode& aNode) {
|
||||
nsIContent* GetPreviousEditableNode(nsINode& aNode) const {
|
||||
return GetPreviousNodeInternal(aNode, true, true, false);
|
||||
}
|
||||
nsIContent* GetPreviousNodeInBlock(nsINode& aNode) {
|
||||
nsIContent* GetPreviousNodeInBlock(nsINode& aNode) const {
|
||||
return GetPreviousNodeInternal(aNode, false, true, true);
|
||||
}
|
||||
nsIContent* GetPreviousElementOrTextInBlock(nsINode& aNode) {
|
||||
nsIContent* GetPreviousElementOrTextInBlock(nsINode& aNode) const {
|
||||
return GetPreviousNodeInternal(aNode, false, false, true);
|
||||
}
|
||||
nsIContent* GetPreviousEditableNodeInBlock(nsINode& aNode) {
|
||||
nsIContent* GetPreviousEditableNodeInBlock(nsINode& aNode) const {
|
||||
return GetPreviousNodeInternal(aNode, true, true, true);
|
||||
}
|
||||
|
||||
|
@ -1567,47 +1569,50 @@ class EditorBase : public nsIEditor,
|
|||
* node.
|
||||
*/
|
||||
template <typename PT, typename CT>
|
||||
nsIContent* GetNextNode(const EditorDOMPointBase<PT, CT>& aPoint) {
|
||||
nsIContent* GetNextNode(const EditorDOMPointBase<PT, CT>& aPoint) const {
|
||||
return GetNextNodeInternal(aPoint, false, true, false);
|
||||
}
|
||||
template <typename PT, typename CT>
|
||||
nsIContent* GetNextElementOrText(const EditorDOMPointBase<PT, CT>& aPoint) {
|
||||
nsIContent* GetNextElementOrText(
|
||||
const EditorDOMPointBase<PT, CT>& aPoint) const {
|
||||
return GetNextNodeInternal(aPoint, false, false, false);
|
||||
}
|
||||
template <typename PT, typename CT>
|
||||
nsIContent* GetNextEditableNode(const EditorDOMPointBase<PT, CT>& aPoint) {
|
||||
nsIContent* GetNextEditableNode(
|
||||
const EditorDOMPointBase<PT, CT>& aPoint) const {
|
||||
return GetNextNodeInternal(aPoint, true, true, false);
|
||||
}
|
||||
template <typename PT, typename CT>
|
||||
nsIContent* GetNextNodeInBlock(const EditorDOMPointBase<PT, CT>& aPoint) {
|
||||
nsIContent* GetNextNodeInBlock(
|
||||
const EditorDOMPointBase<PT, CT>& aPoint) const {
|
||||
return GetNextNodeInternal(aPoint, false, true, true);
|
||||
}
|
||||
template <typename PT, typename CT>
|
||||
nsIContent* GetNextElementOrTextInBlock(
|
||||
const EditorDOMPointBase<PT, CT>& aPoint) {
|
||||
const EditorDOMPointBase<PT, CT>& aPoint) const {
|
||||
return GetNextNodeInternal(aPoint, false, false, true);
|
||||
}
|
||||
template <typename PT, typename CT>
|
||||
nsIContent* GetNextEditableNodeInBlock(
|
||||
const EditorDOMPointBase<PT, CT>& aPoint) {
|
||||
const EditorDOMPointBase<PT, CT>& aPoint) const {
|
||||
return GetNextNodeInternal(aPoint, true, true, true);
|
||||
}
|
||||
nsIContent* GetNextNode(nsINode& aNode) {
|
||||
nsIContent* GetNextNode(nsINode& aNode) const {
|
||||
return GetNextNodeInternal(aNode, false, true, false);
|
||||
}
|
||||
nsIContent* GetNextElementOrText(nsINode& aNode) {
|
||||
nsIContent* GetNextElementOrText(nsINode& aNode) const {
|
||||
return GetNextNodeInternal(aNode, false, false, false);
|
||||
}
|
||||
nsIContent* GetNextEditableNode(nsINode& aNode) {
|
||||
nsIContent* GetNextEditableNode(nsINode& aNode) const {
|
||||
return GetNextNodeInternal(aNode, true, true, false);
|
||||
}
|
||||
nsIContent* GetNextNodeInBlock(nsINode& aNode) {
|
||||
nsIContent* GetNextNodeInBlock(nsINode& aNode) const {
|
||||
return GetNextNodeInternal(aNode, false, true, true);
|
||||
}
|
||||
nsIContent* GetNextElementOrTextInBlock(nsINode& aNode) {
|
||||
nsIContent* GetNextElementOrTextInBlock(nsINode& aNode) const {
|
||||
return GetNextNodeInternal(aNode, false, false, true);
|
||||
}
|
||||
nsIContent* GetNextEditableNodeInBlock(nsINode& aNode) {
|
||||
nsIContent* GetNextEditableNodeInBlock(nsINode& aNode) const {
|
||||
return GetNextNodeInternal(aNode, true, true, true);
|
||||
}
|
||||
|
||||
|
@ -2000,10 +2005,10 @@ class EditorBase : public nsIEditor,
|
|||
* Helper for GetPreviousNodeInternal() and GetNextNodeInternal().
|
||||
*/
|
||||
nsIContent* FindNextLeafNode(nsINode* aCurrentNode, bool aGoForward,
|
||||
bool bNoBlockCrossing);
|
||||
bool bNoBlockCrossing) const;
|
||||
nsIContent* FindNode(nsINode* aCurrentNode, bool aGoForward,
|
||||
bool aEditableNode, bool aFindAnyDataNode,
|
||||
bool bNoBlockCrossing);
|
||||
bool bNoBlockCrossing) const;
|
||||
|
||||
/**
|
||||
* Get the node immediately previous node of aNode.
|
||||
|
@ -2020,7 +2025,7 @@ class EditorBase : public nsIEditor,
|
|||
*/
|
||||
nsIContent* GetPreviousNodeInternal(nsINode& aNode, bool aFindEditableNode,
|
||||
bool aFindAnyDataNode,
|
||||
bool aNoBlockCrossing);
|
||||
bool aNoBlockCrossing) const;
|
||||
|
||||
/**
|
||||
* And another version that takes a point in DOM tree rather than a node.
|
||||
|
@ -2028,7 +2033,7 @@ class EditorBase : public nsIEditor,
|
|||
nsIContent* GetPreviousNodeInternal(const EditorRawDOMPoint& aPoint,
|
||||
bool aFindEditableNode,
|
||||
bool aFindAnyDataNode,
|
||||
bool aNoBlockCrossing);
|
||||
bool aNoBlockCrossing) const;
|
||||
|
||||
/**
|
||||
* Get the node immediately next node of aNode.
|
||||
|
@ -2044,14 +2049,15 @@ class EditorBase : public nsIEditor,
|
|||
* next node, returns nullptr.
|
||||
*/
|
||||
nsIContent* GetNextNodeInternal(nsINode& aNode, bool aFindEditableNode,
|
||||
bool aFindAnyDataNode, bool bNoBlockCrossing);
|
||||
bool aFindAnyDataNode,
|
||||
bool bNoBlockCrossing) const;
|
||||
|
||||
/**
|
||||
* And another version that takes a point in DOM tree rather than a node.
|
||||
*/
|
||||
nsIContent* GetNextNodeInternal(const EditorRawDOMPoint& aPoint,
|
||||
bool aFindEditableNode, bool aFindAnyDataNode,
|
||||
bool aNoBlockCrossing);
|
||||
bool aNoBlockCrossing) const;
|
||||
|
||||
virtual nsresult InstallEventListeners();
|
||||
virtual void CreateEventListeners();
|
||||
|
|
|
@ -84,7 +84,7 @@ nsresult HTMLEditor::SetSelectionToAbsoluteOrStaticAsAction(
|
|||
}
|
||||
|
||||
already_AddRefed<Element>
|
||||
HTMLEditor::GetAbsolutelyPositionedSelectionContainer() {
|
||||
HTMLEditor::GetAbsolutelyPositionedSelectionContainer() const {
|
||||
AutoEditActionDataSetter editActionData(*this, EditAction::eNotEditing);
|
||||
if (NS_WARN_IF(!editActionData.CanHandle())) {
|
||||
return nullptr;
|
||||
|
|
|
@ -6608,7 +6608,7 @@ Element* HTMLEditRules::CheckForInvisibleBR(Element& aBlock, BRLocation aWhere,
|
|||
|
||||
void HTMLEditRules::GetInnerContent(
|
||||
nsINode& aNode, nsTArray<OwningNonNull<nsINode>>& aOutArrayOfNodes,
|
||||
int32_t* aIndex, Lists aLists, Tables aTables) {
|
||||
int32_t* aIndex, Lists aLists, Tables aTables) const {
|
||||
MOZ_ASSERT(IsEditorDataAvailable());
|
||||
MOZ_ASSERT(aIndex);
|
||||
|
||||
|
@ -6898,9 +6898,9 @@ nsresult HTMLEditRules::NormalizeSelection() {
|
|||
return error.StealNSResult();
|
||||
}
|
||||
|
||||
EditorDOMPoint HTMLEditRules::GetPromotedPoint(RulesEndpoint aWhere,
|
||||
nsINode& aNode, int32_t aOffset,
|
||||
EditSubAction aEditSubAction) {
|
||||
EditorDOMPoint HTMLEditRules::GetPromotedPoint(
|
||||
RulesEndpoint aWhere, nsINode& aNode, int32_t aOffset,
|
||||
EditSubAction aEditSubAction) const {
|
||||
MOZ_ASSERT(IsEditorDataAvailable());
|
||||
|
||||
// we do one thing for text actions, something else entirely for other
|
||||
|
@ -7088,7 +7088,8 @@ EditorDOMPoint HTMLEditRules::GetPromotedPoint(RulesEndpoint aWhere,
|
|||
}
|
||||
|
||||
void HTMLEditRules::GetPromotedRanges(
|
||||
nsTArray<RefPtr<nsRange>>& outArrayOfRanges, EditSubAction aEditSubAction) {
|
||||
nsTArray<RefPtr<nsRange>>& outArrayOfRanges,
|
||||
EditSubAction aEditSubAction) const {
|
||||
MOZ_ASSERT(IsEditorDataAvailable());
|
||||
|
||||
uint32_t rangeCount = SelectionRefPtr()->RangeCount();
|
||||
|
@ -7110,7 +7111,7 @@ void HTMLEditRules::GetPromotedRanges(
|
|||
}
|
||||
|
||||
void HTMLEditRules::PromoteRange(nsRange& aRange,
|
||||
EditSubAction aEditSubAction) {
|
||||
EditSubAction aEditSubAction) const {
|
||||
MOZ_ASSERT(IsEditorDataAvailable());
|
||||
MOZ_ASSERT(!aRange.IsInSelection());
|
||||
|
||||
|
@ -7205,7 +7206,7 @@ class UniqueFunctor final : public BoolDomIterFunctor {
|
|||
nsresult HTMLEditRules::GetNodesForOperation(
|
||||
nsTArray<RefPtr<nsRange>>& aArrayOfRanges,
|
||||
nsTArray<OwningNonNull<nsINode>>& aOutArrayOfNodes,
|
||||
EditSubAction aEditSubAction, TouchContent aTouchContent) {
|
||||
EditSubAction aEditSubAction, TouchContent aTouchContent) const {
|
||||
MOZ_ASSERT(IsEditorDataAvailable());
|
||||
|
||||
if (aTouchContent == TouchContent::yes) {
|
||||
|
@ -7380,7 +7381,7 @@ void HTMLEditRules::GetChildNodesForOperation(
|
|||
|
||||
nsresult HTMLEditRules::GetListActionNodes(
|
||||
nsTArray<OwningNonNull<nsINode>>& aOutArrayOfNodes, EntireList aEntireList,
|
||||
TouchContent aTouchContent) {
|
||||
TouchContent aTouchContent) const {
|
||||
MOZ_ASSERT(IsEditorDataAvailable());
|
||||
|
||||
// Added this in so that ui code can ask to change an entire list, even if
|
||||
|
@ -7443,7 +7444,7 @@ nsresult HTMLEditRules::GetListActionNodes(
|
|||
}
|
||||
|
||||
void HTMLEditRules::LookInsideDivBQandList(
|
||||
nsTArray<OwningNonNull<nsINode>>& aNodeArray) {
|
||||
nsTArray<OwningNonNull<nsINode>>& aNodeArray) const {
|
||||
MOZ_ASSERT(IsEditorDataAvailable());
|
||||
|
||||
// If there is only one node in the array, and it is a list, div, or
|
||||
|
@ -7488,7 +7489,7 @@ void HTMLEditRules::LookInsideDivBQandList(
|
|||
}
|
||||
|
||||
void HTMLEditRules::GetDefinitionListItemTypes(dom::Element* aElement,
|
||||
bool* aDT, bool* aDD) {
|
||||
bool* aDT, bool* aDD) const {
|
||||
MOZ_ASSERT(aElement);
|
||||
MOZ_ASSERT(aElement->IsHTMLElement(nsGkAtoms::dl));
|
||||
MOZ_ASSERT(aDT);
|
||||
|
@ -7540,7 +7541,8 @@ nsresult HTMLEditRules::GetParagraphFormatNodes(
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult HTMLEditRules::BustUpInlinesAtRangeEndpoints(RangeItem& aRangeItem) {
|
||||
nsresult HTMLEditRules::BustUpInlinesAtRangeEndpoints(
|
||||
RangeItem& aRangeItem) const {
|
||||
MOZ_ASSERT(IsEditorDataAvailable());
|
||||
|
||||
bool isCollapsed = aRangeItem.mStartContainer == aRangeItem.mEndContainer &&
|
||||
|
@ -7604,7 +7606,8 @@ nsresult HTMLEditRules::BustUpInlinesAtRangeEndpoints(RangeItem& aRangeItem) {
|
|||
}
|
||||
|
||||
nsresult HTMLEditRules::BustUpInlinesAtBRs(
|
||||
nsIContent& aNode, nsTArray<OwningNonNull<nsINode>>& aOutArrayOfNodes) {
|
||||
nsIContent& aNode,
|
||||
nsTArray<OwningNonNull<nsINode>>& aOutArrayOfNodes) const {
|
||||
MOZ_ASSERT(IsEditorDataAvailable());
|
||||
|
||||
// First build up a list of all the break nodes inside the inline container.
|
||||
|
@ -7668,7 +7671,7 @@ nsresult HTMLEditRules::BustUpInlinesAtBRs(
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
nsIContent* HTMLEditRules::GetHighestInlineParent(nsINode& aNode) {
|
||||
nsIContent* HTMLEditRules::GetHighestInlineParent(nsINode& aNode) const {
|
||||
MOZ_ASSERT(IsEditorDataAvailable());
|
||||
|
||||
if (!aNode.IsContent() || IsBlockNode(aNode)) {
|
||||
|
@ -7706,7 +7709,7 @@ nsIContent* HTMLEditRules::GetHighestInlineParent(nsINode& aNode) {
|
|||
nsresult HTMLEditRules::GetNodesFromPoint(
|
||||
const EditorDOMPoint& aPoint, EditSubAction aEditSubAction,
|
||||
nsTArray<OwningNonNull<nsINode>>& outArrayOfNodes,
|
||||
TouchContent aTouchContent) {
|
||||
TouchContent aTouchContent) const {
|
||||
if (NS_WARN_IF(!aPoint.IsSet())) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
@ -7739,7 +7742,7 @@ nsresult HTMLEditRules::GetNodesFromPoint(
|
|||
nsresult HTMLEditRules::GetNodesFromSelection(
|
||||
EditSubAction aEditSubAction,
|
||||
nsTArray<OwningNonNull<nsINode>>& outArrayOfNodes,
|
||||
TouchContent aTouchContent) {
|
||||
TouchContent aTouchContent) const {
|
||||
MOZ_ASSERT(IsEditorDataAvailable());
|
||||
|
||||
// Promote selection ranges
|
||||
|
|
|
@ -624,7 +624,7 @@ class HTMLEditRules : public TextEditRules {
|
|||
void GetInnerContent(nsINode& aNode,
|
||||
nsTArray<OwningNonNull<nsINode>>& aOutArrayOfNodes,
|
||||
int32_t* aIndex, Lists aLists = Lists::yes,
|
||||
Tables aTables = Tables::yes);
|
||||
Tables aTables = Tables::yes) const;
|
||||
|
||||
/**
|
||||
* If aNode is the descendant of a listitem, return that li. But table
|
||||
|
@ -906,20 +906,20 @@ class HTMLEditRules : public TextEditRules {
|
|||
*/
|
||||
EditorDOMPoint GetPromotedPoint(RulesEndpoint aWhere, nsINode& aNode,
|
||||
int32_t aOffset,
|
||||
EditSubAction aEditSubAction);
|
||||
EditSubAction aEditSubAction) const;
|
||||
|
||||
/**
|
||||
* GetPromotedRanges() runs all the selection range endpoint through
|
||||
* GetPromotedPoint().
|
||||
*/
|
||||
void GetPromotedRanges(nsTArray<RefPtr<nsRange>>& outArrayOfRanges,
|
||||
EditSubAction aEditSubAction);
|
||||
EditSubAction aEditSubAction) const;
|
||||
|
||||
/**
|
||||
* PromoteRange() expands a range to include any parents for which all
|
||||
* editable children are already in range.
|
||||
*/
|
||||
void PromoteRange(nsRange& aRange, EditSubAction aEditSubAction);
|
||||
void PromoteRange(nsRange& aRange, EditSubAction aEditSubAction) const;
|
||||
|
||||
/**
|
||||
* GetNodesForOperation() runs through the ranges in the array and construct a
|
||||
|
@ -933,7 +933,7 @@ class HTMLEditRules : public TextEditRules {
|
|||
MOZ_MUST_USE nsresult GetNodesForOperation(
|
||||
nsTArray<RefPtr<nsRange>>& aArrayOfRanges,
|
||||
nsTArray<OwningNonNull<nsINode>>& aOutArrayOfNodes,
|
||||
EditSubAction aEditSubAction, TouchContent aTouchContent);
|
||||
EditSubAction aEditSubAction, TouchContent aTouchContent) const;
|
||||
|
||||
void GetChildNodesForOperation(
|
||||
nsINode& aNode, nsTArray<OwningNonNull<nsINode>>& outArrayOfNodes);
|
||||
|
@ -946,7 +946,7 @@ class HTMLEditRules : public TextEditRules {
|
|||
MOZ_MUST_USE nsresult
|
||||
GetNodesFromPoint(const EditorDOMPoint& aPoint, EditSubAction aEditSubAction,
|
||||
nsTArray<OwningNonNull<nsINode>>& outArrayOfNodes,
|
||||
TouchContent aTouchContent);
|
||||
TouchContent aTouchContent) const;
|
||||
|
||||
/**
|
||||
* GetNodesFromSelection() constructs a list of nodes from the selection that
|
||||
|
@ -956,18 +956,20 @@ class HTMLEditRules : public TextEditRules {
|
|||
MOZ_MUST_USE nsresult
|
||||
GetNodesFromSelection(EditSubAction aEditSubAction,
|
||||
nsTArray<OwningNonNull<nsINode>>& outArrayOfNodes,
|
||||
TouchContent aTouchContent);
|
||||
TouchContent aTouchContent) const;
|
||||
|
||||
enum class EntireList { no, yes };
|
||||
MOZ_CAN_RUN_SCRIPT
|
||||
MOZ_MUST_USE nsresult
|
||||
GetListActionNodes(nsTArray<OwningNonNull<nsINode>>& aOutArrayOfNodes,
|
||||
EntireList aEntireList, TouchContent aTouchContent);
|
||||
void GetDefinitionListItemTypes(Element* aElement, bool* aDT, bool* aDD);
|
||||
EntireList aEntireList, TouchContent aTouchContent) const;
|
||||
void GetDefinitionListItemTypes(Element* aElement, bool* aDT,
|
||||
bool* aDD) const;
|
||||
MOZ_CAN_RUN_SCRIPT
|
||||
nsresult GetParagraphFormatNodes(
|
||||
nsTArray<OwningNonNull<nsINode>>& outArrayOfNodes);
|
||||
void LookInsideDivBQandList(nsTArray<OwningNonNull<nsINode>>& aNodeArray);
|
||||
void LookInsideDivBQandList(
|
||||
nsTArray<OwningNonNull<nsINode>>& aNodeArray) const;
|
||||
|
||||
/**
|
||||
* BustUpInlinesAtRangeEndpoints() splits nodes at both start and end of
|
||||
|
@ -980,7 +982,8 @@ class HTMLEditRules : public TextEditRules {
|
|||
* split.
|
||||
*/
|
||||
MOZ_CAN_RUN_SCRIPT
|
||||
MOZ_MUST_USE nsresult BustUpInlinesAtRangeEndpoints(RangeItem& aRangeItem);
|
||||
MOZ_MUST_USE nsresult
|
||||
BustUpInlinesAtRangeEndpoints(RangeItem& aRangeItem) const;
|
||||
|
||||
/**
|
||||
* BustUpInlinesAtBRs() splits before all <br> elements in aNode. All <br>
|
||||
|
@ -994,15 +997,16 @@ class HTMLEditRules : public TextEditRules {
|
|||
* aNode itself.
|
||||
*/
|
||||
MOZ_CAN_RUN_SCRIPT
|
||||
MOZ_MUST_USE nsresult BustUpInlinesAtBRs(
|
||||
nsIContent& aNode, nsTArray<OwningNonNull<nsINode>>& aOutArrayOfNodes);
|
||||
MOZ_MUST_USE nsresult
|
||||
BustUpInlinesAtBRs(nsIContent& aNode,
|
||||
nsTArray<OwningNonNull<nsINode>>& aOutArrayOfNodes) const;
|
||||
|
||||
/**
|
||||
* GetHiestInlineParent() returns the highest inline node parent between
|
||||
* aNode and the editing host. Even if the editing host is an inline
|
||||
* element, this method never returns the editing host as the result.
|
||||
*/
|
||||
nsIContent* GetHighestInlineParent(nsINode& aNode);
|
||||
nsIContent* GetHighestInlineParent(nsINode& aNode) const;
|
||||
|
||||
/**
|
||||
* MakeTransitionList() detects all the transitions in the array, where a
|
||||
|
|
|
@ -4147,8 +4147,8 @@ nsIContent* HTMLEditor::GetNextHTMLElementOrTextInternal(
|
|||
: GetNextElementOrText(aPoint);
|
||||
}
|
||||
|
||||
nsIContent* HTMLEditor::GetNextEditableHTMLNodeInternal(nsINode& aNode,
|
||||
bool aNoBlockCrossing) {
|
||||
nsIContent* HTMLEditor::GetNextEditableHTMLNodeInternal(
|
||||
nsINode& aNode, bool aNoBlockCrossing) const {
|
||||
if (!GetActiveEditingHost()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -4158,7 +4158,7 @@ nsIContent* HTMLEditor::GetNextEditableHTMLNodeInternal(nsINode& aNode,
|
|||
|
||||
template <typename PT, typename CT>
|
||||
nsIContent* HTMLEditor::GetNextEditableHTMLNodeInternal(
|
||||
const EditorDOMPointBase<PT, CT>& aPoint, bool aNoBlockCrossing) {
|
||||
const EditorDOMPointBase<PT, CT>& aPoint, bool aNoBlockCrossing) const {
|
||||
if (!GetActiveEditingHost()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
|
|
@ -372,7 +372,7 @@ class HTMLEditor final : public TextEditor,
|
|||
* returns the deepest absolutely positioned container of the selection
|
||||
* if it exists or null.
|
||||
*/
|
||||
already_AddRefed<Element> GetAbsolutelyPositionedSelectionContainer();
|
||||
already_AddRefed<Element> GetAbsolutelyPositionedSelectionContainer() const;
|
||||
|
||||
Element* GetPositionedElement() const { return mAbsolutelyPositionedObject; }
|
||||
|
||||
|
@ -788,14 +788,14 @@ class HTMLEditor final : public TextEditor,
|
|||
MOZ_CAN_RUN_SCRIPT
|
||||
nsresult DeleteTableCellContentsWithTransaction();
|
||||
|
||||
void IsNextCharInNodeWhitespace(nsIContent* aContent, int32_t aOffset,
|
||||
bool* outIsSpace, bool* outIsNBSP,
|
||||
nsIContent** outNode = nullptr,
|
||||
int32_t* outOffset = 0);
|
||||
void IsPrevCharInNodeWhitespace(nsIContent* aContent, int32_t aOffset,
|
||||
bool* outIsSpace, bool* outIsNBSP,
|
||||
nsIContent** outNode = nullptr,
|
||||
int32_t* outOffset = 0);
|
||||
static void IsNextCharInNodeWhitespace(nsIContent* aContent, int32_t aOffset,
|
||||
bool* outIsSpace, bool* outIsNBSP,
|
||||
nsIContent** outNode = nullptr,
|
||||
int32_t* outOffset = 0);
|
||||
static void IsPrevCharInNodeWhitespace(nsIContent* aContent, int32_t aOffset,
|
||||
bool* outIsSpace, bool* outIsNBSP,
|
||||
nsIContent** outNode = nullptr,
|
||||
int32_t* outOffset = 0);
|
||||
|
||||
/**
|
||||
* @param aElement Must not be null.
|
||||
|
@ -1039,20 +1039,20 @@ class HTMLEditor final : public TextEditor,
|
|||
* On the other hand, methods which take |nsINode&| start to search from
|
||||
* next node of aNode.
|
||||
*/
|
||||
nsIContent* GetNextEditableHTMLNode(nsINode& aNode) {
|
||||
nsIContent* GetNextEditableHTMLNode(nsINode& aNode) const {
|
||||
return GetNextEditableHTMLNodeInternal(aNode, false);
|
||||
}
|
||||
nsIContent* GetNextEditableHTMLNodeInBlock(nsINode& aNode) {
|
||||
nsIContent* GetNextEditableHTMLNodeInBlock(nsINode& aNode) const {
|
||||
return GetNextEditableHTMLNodeInternal(aNode, true);
|
||||
}
|
||||
template <typename PT, typename CT>
|
||||
nsIContent* GetNextEditableHTMLNode(
|
||||
const EditorDOMPointBase<PT, CT>& aPoint) {
|
||||
const EditorDOMPointBase<PT, CT>& aPoint) const {
|
||||
return GetNextEditableHTMLNodeInternal(aPoint, false);
|
||||
}
|
||||
template <typename PT, typename CT>
|
||||
nsIContent* GetNextEditableHTMLNodeInBlock(
|
||||
const EditorDOMPointBase<PT, CT>& aPoint) {
|
||||
const EditorDOMPointBase<PT, CT>& aPoint) const {
|
||||
return GetNextEditableHTMLNodeInternal(aPoint, true);
|
||||
}
|
||||
|
||||
|
@ -1061,10 +1061,10 @@ class HTMLEditor final : public TextEditor,
|
|||
* of above methods. Please don't use this method directly.
|
||||
*/
|
||||
nsIContent* GetNextEditableHTMLNodeInternal(nsINode& aNode,
|
||||
bool aNoBlockCrossing);
|
||||
bool aNoBlockCrossing) const;
|
||||
template <typename PT, typename CT>
|
||||
nsIContent* GetNextEditableHTMLNodeInternal(
|
||||
const EditorDOMPointBase<PT, CT>& aPoint, bool aNoBlockCrossing);
|
||||
const EditorDOMPointBase<PT, CT>& aPoint, bool aNoBlockCrossing) const;
|
||||
|
||||
bool IsFirstEditableChild(nsINode* aNode);
|
||||
bool IsLastEditableChild(nsINode* aNode);
|
||||
|
|
Загрузка…
Ссылка в новой задаче