/* -*- 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/. */ #include "WSRunScanner.h" #include "EditorDOMPoint.h" #include "EditorUtils.h" #include "HTMLEditUtils.h" #include "mozilla/Assertions.h" #include "mozilla/dom/AncestorIterator.h" #include "mozilla/dom/CharacterDataBuffer.h" #include "nsCRT.h" #include "nsDebug.h" #include "nsIContent.h" #include "nsIContentInlines.h" namespace mozilla { using namespace dom; using AncestorType = HTMLEditUtils::AncestorType; using AncestorTypes = HTMLEditUtils::AncestorTypes; using LeafNodeType = HTMLEditUtils::LeafNodeType; using LeafNodeTypes = HTMLEditUtils::LeafNodeTypes; template WSRunScanner::TextFragmentData::TextFragmentData( Scan aScanMode, const EditorDOMPoint& aPoint, BlockInlineCheck aBlockInlineCheck, const Element* aAncestorLimiter); template WSRunScanner::TextFragmentData::TextFragmentData( Scan aScanMode, const EditorRawDOMPoint& aPoint, BlockInlineCheck aBlockInlineCheck, const Element* aAncestorLimiter); template WSRunScanner::TextFragmentData::TextFragmentData( Scan aScanMode, const EditorDOMPointInText& aPoint, BlockInlineCheck aBlockInlineCheck, const Element* aAncestorLimiter); template WSRunScanner::TextFragmentData::TextFragmentData( Scan aScanMode, const EditorRawDOMPointInText& aPoint, BlockInlineCheck aBlockInlineCheck, const Element* aAncestorLimiter); NS_INSTANTIATE_METHOD_RETURNING_ANY_EDITOR_DOM_POINT( WSRunScanner::TextFragmentData::GetInclusiveNextCharPoint, const EditorDOMPoint& aPoint, BlockInlineCheck aBlockInlineCheck, IgnoreNonEditableNodes aIgnoreNonEditableNodes, const nsIContent* aFollowingLimiterContent); NS_INSTANTIATE_METHOD_RETURNING_ANY_EDITOR_DOM_POINT( WSRunScanner::TextFragmentData::GetInclusiveNextCharPoint, const EditorRawDOMPoint& aPoint, BlockInlineCheck aBlockInlineCheck, IgnoreNonEditableNodes aIgnoreNonEditableNodes, const nsIContent* aFollowingLimiterContent); NS_INSTANTIATE_METHOD_RETURNING_ANY_EDITOR_DOM_POINT( WSRunScanner::TextFragmentData::GetInclusiveNextCharPoint, const EditorDOMPointInText& aPoint, BlockInlineCheck aBlockInlineCheck, IgnoreNonEditableNodes aIgnoreNonEditableNodes, const nsIContent* aFollowingLimiterContent); NS_INSTANTIATE_METHOD_RETURNING_ANY_EDITOR_DOM_POINT( WSRunScanner::TextFragmentData::GetInclusiveNextCharPoint, const EditorRawDOMPointInText& aPoint, BlockInlineCheck aBlockInlineCheck, IgnoreNonEditableNodes aIgnoreNonEditableNodes, const nsIContent* aFollowingLimiterContent); NS_INSTANTIATE_METHOD_RETURNING_ANY_EDITOR_DOM_POINT( WSRunScanner::TextFragmentData::GetPreviousCharPoint, const EditorDOMPoint& aPoint, BlockInlineCheck aBlockInlineCheck, IgnoreNonEditableNodes aIgnoreNonEditableNodes, const nsIContent* aPrecedingLimiterContent); NS_INSTANTIATE_METHOD_RETURNING_ANY_EDITOR_DOM_POINT( WSRunScanner::TextFragmentData::GetPreviousCharPoint, const EditorRawDOMPoint& aPoint, BlockInlineCheck aBlockInlineCheck, IgnoreNonEditableNodes aIgnoreNonEditableNodes, const nsIContent* aPrecedingLimiterContent); NS_INSTANTIATE_METHOD_RETURNING_ANY_EDITOR_DOM_POINT( WSRunScanner::TextFragmentData::GetPreviousCharPoint, const EditorDOMPointInText& aPoint, BlockInlineCheck aBlockInlineCheck, IgnoreNonEditableNodes aIgnoreNonEditableNodes, const nsIContent* aPrecedingLimiterContent); NS_INSTANTIATE_METHOD_RETURNING_ANY_EDITOR_DOM_POINT( WSRunScanner::TextFragmentData::GetPreviousCharPoint, const EditorRawDOMPointInText& aPoint, BlockInlineCheck aBlockInlineCheck, IgnoreNonEditableNodes aIgnoreNonEditableNodes, const nsIContent* aPrecedingLimiterContent); NS_INSTANTIATE_METHOD_RETURNING_ANY_EDITOR_DOM_POINT( WSRunScanner::TextFragmentData::GetEndOfCollapsibleASCIIWhiteSpaces, const EditorDOMPointInText& aPointAtASCIIWhiteSpace, nsIEditor::EDirection aDirectionToDelete, BlockInlineCheck aBlockInlineCheck, IgnoreNonEditableNodes aIgnoreNonEditableNodes, const nsIContent* aFollowingLimiterContent); NS_INSTANTIATE_METHOD_RETURNING_ANY_EDITOR_DOM_POINT( WSRunScanner::TextFragmentData::GetFirstASCIIWhiteSpacePointCollapsedTo, const EditorDOMPointInText& aPointAtASCIIWhiteSpace, nsIEditor::EDirection aDirectionToDelete, BlockInlineCheck aBlockInlineCheck, IgnoreNonEditableNodes aIgnoreNonEditableNodes, const nsIContent* aPrecedingLimiterContent); // FIXME: I think the scanner should not cross the