Bug 1627175 - part 29: Get rid of `EditorBase::GetNextElementOrTextInBlock()` and `EditorBase::GetPreviousElementOrTextInBlock()` r=m_kato

Depends on D113232

Differential Revision: https://phabricator.services.mozilla.com/D113233
This commit is contained in:
Masayuki Nakano 2021-04-27 11:17:40 +00:00
Родитель 4a928f25f7
Коммит 3f701eb0f4
3 изменённых файлов: 14 добавлений и 25 удалений

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

@ -1732,11 +1732,6 @@ class EditorBase : public nsIEditor,
nsIContent* GetPreviousNodeInBlock(const EditorRawDOMPoint& aPoint) const {
return GetPreviousContent(aPoint, {WalkTreeOption::StopAtBlockBoundary});
}
nsIContent* GetPreviousElementOrTextInBlock(
const EditorRawDOMPoint& aPoint) const {
return GetPreviousContent(aPoint, {WalkTreeOption::IgnoreDataNodeExceptText,
WalkTreeOption::StopAtBlockBoundary});
}
nsIContent* GetPreviousEditableNodeInBlock(
const EditorRawDOMPoint& aPoint) const {
return GetPreviousContent(aPoint, {WalkTreeOption::IgnoreNonEditableNode,
@ -1748,10 +1743,6 @@ class EditorBase : public nsIEditor,
nsIContent* GetPreviousNodeInBlock(const nsINode& aNode) const {
return GetPreviousContent(aNode, {WalkTreeOption::StopAtBlockBoundary});
}
nsIContent* GetPreviousElementOrTextInBlock(const nsINode& aNode) const {
return GetPreviousContent(aNode, {WalkTreeOption::IgnoreDataNodeExceptText,
WalkTreeOption::StopAtBlockBoundary});
}
nsIContent* GetPreviousEditableNodeInBlock(const nsINode& aNode) const {
return GetPreviousContent(aNode, {WalkTreeOption::IgnoreNonEditableNode,
WalkTreeOption::StopAtBlockBoundary});
@ -1794,12 +1785,6 @@ class EditorBase : public nsIEditor,
return GetNextContent(aPoint, {WalkTreeOption::StopAtBlockBoundary});
}
template <typename PT, typename CT>
nsIContent* GetNextElementOrTextInBlock(
const EditorDOMPointBase<PT, CT>& aPoint) const {
return GetNextContent(aPoint, {WalkTreeOption::IgnoreDataNodeExceptText,
WalkTreeOption::StopAtBlockBoundary});
}
template <typename PT, typename CT>
nsIContent* GetNextEditableNodeInBlock(
const EditorDOMPointBase<PT, CT>& aPoint) const {
return GetNextContent(aPoint, {WalkTreeOption::IgnoreNonEditableNode,
@ -1811,10 +1796,6 @@ class EditorBase : public nsIEditor,
nsIContent* GetNextNodeInBlock(const nsINode& aNode) const {
return GetNextContent(aNode, {WalkTreeOption::StopAtBlockBoundary});
}
nsIContent* GetNextElementOrTextInBlock(const nsINode& aNode) const {
return GetNextContent(aNode, {WalkTreeOption::IgnoreDataNodeExceptText,
WalkTreeOption::StopAtBlockBoundary});
}
nsIContent* GetNextEditableNodeInBlock(const nsINode& aNode) const {
return GetNextContent(aNode, {WalkTreeOption::IgnoreNonEditableNode,
WalkTreeOption::StopAtBlockBoundary});

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

@ -5005,7 +5005,9 @@ nsIContent* HTMLEditor::GetPreviousHTMLElementOrTextInternal(
return nullptr;
}
return aNoBlockCrossing
? GetPreviousElementOrTextInBlock(aNode)
? GetPreviousContent(aNode,
{WalkTreeOption::IgnoreDataNodeExceptText,
WalkTreeOption::StopAtBlockBoundary})
: GetPreviousContent(aNode,
{WalkTreeOption::IgnoreDataNodeExceptText});
}
@ -5017,7 +5019,9 @@ nsIContent* HTMLEditor::GetPreviousHTMLElementOrTextInternal(
return nullptr;
}
return aNoBlockCrossing
? GetPreviousElementOrTextInBlock(aPoint)
? GetPreviousContent(aPoint,
{WalkTreeOption::IgnoreDataNodeExceptText,
WalkTreeOption::StopAtBlockBoundary})
: GetPreviousContent(aPoint,
{WalkTreeOption::IgnoreDataNodeExceptText});
}
@ -5047,7 +5051,8 @@ nsIContent* HTMLEditor::GetNextHTMLElementOrTextInternal(
return nullptr;
}
return aNoBlockCrossing
? GetNextElementOrTextInBlock(aNode)
? GetNextContent(aNode, {WalkTreeOption::IgnoreDataNodeExceptText,
WalkTreeOption::StopAtBlockBoundary})
: GetNextContent(aNode,
{WalkTreeOption::IgnoreDataNodeExceptText});
}
@ -5059,7 +5064,8 @@ nsIContent* HTMLEditor::GetNextHTMLElementOrTextInternal(
return nullptr;
}
return aNoBlockCrossing
? GetNextElementOrTextInBlock(aPoint)
? GetNextContent(aPoint, {WalkTreeOption::IgnoreDataNodeExceptText,
WalkTreeOption::StopAtBlockBoundary})
: GetNextContent(aPoint,
{WalkTreeOption::IgnoreDataNodeExceptText});
}

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

@ -4415,8 +4415,10 @@ nsresult HTMLEditor::AutoDeleteRangesHandler::AutoBlockElementsJoiner::
atStart.IsEndOfContainer() && range.StartRef().GetChild() &&
range.StartRef().GetChild()->IsHTMLElement(nsGkAtoms::br) &&
!aHTMLEditor.IsVisibleBRElement(range.StartRef().GetChild())
? aHTMLEditor.GetNextElementOrTextInBlock(
*atStart.ContainerAsContent())
? aHTMLEditor.GetNextContent(
*atStart.ContainerAsContent(),
{WalkTreeOption::IgnoreDataNodeExceptText,
WalkTreeOption::StopAtBlockBoundary})
: nullptr;
if (!nextContent || nextContent != range.StartRef().GetChild()) {
noNeedToChangeStart = true;