зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
4a928f25f7
Коммит
3f701eb0f4
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче