#include "third_party/blink/renderer/core/editing/visible_units.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_testing.h"
#include "third_party/blink/renderer/core/dom/text.h"
#include "third_party/blink/renderer/core/editing/ephemeral_range.h"
#include "third_party/blink/renderer/core/editing/position_with_affinity.h"
#include "third_party/blink/renderer/core/editing/selection_template.h"
#include "third_party/blink/renderer/core/editing/testing/editing_test_base.h"
#include "third_party/blink/renderer/core/editing/visible_position.h"
#include "third_party/blink/renderer/core/html/forms/text_control_element.h"
#include "third_party/blink/renderer/core/layout/layout_text_fragment.h"
namespace blink {
namespace visible_units_test {
PositionWithAffinity PositionWithAffinityInDOMTree(
Node& anchor,
int offset,
TextAffinity affinity = TextAffinity::kDownstream) { … }
VisiblePosition CreateVisiblePositionInDOMTree(
Node& anchor,
int offset,
TextAffinity affinity = TextAffinity::kDownstream) { … }
PositionInFlatTreeWithAffinity PositionWithAffinityInFlatTree(
Node& anchor,
int offset,
TextAffinity affinity = TextAffinity::kDownstream) { … }
VisiblePositionInFlatTree CreateVisiblePositionInFlatTree(
Node& anchor,
int offset,
TextAffinity affinity = TextAffinity::kDownstream) { … }
class VisibleUnitsTest : public EditingTestBase { … };
TEST_F(VisibleUnitsTest, caretMinOffset) { … }
TEST_F(VisibleUnitsTest, caretMinOffsetWithFirstLetter) { … }
TEST_F(VisibleUnitsTest, characterAfter) { … }
TEST_F(VisibleUnitsTest, CanonicalPositionOfWithBefore) { … }
TEST_F(VisibleUnitsTest, canonicalPositionOfWithHTMLHtmlElement) { … }
TEST_F(VisibleUnitsTest, canonicalPositionOfWithInputElement) { … }
TEST_F(VisibleUnitsTest, canonicalPositionOfWithCrossBlockFlowlement) { … }
TEST_F(VisibleUnitsTest, characterBefore) { … }
TEST_F(VisibleUnitsTest, endOfDocument) { … }
TEST_F(VisibleUnitsTest,
AdjustForwardPositionToAvoidCrossingEditingBoundariesNestedEditable) { … }
TEST_F(VisibleUnitsTest, isEndOfEditableOrNonEditableContent) { … }
TEST_F(VisibleUnitsTest, isEndOfEditableOrNonEditableContentWithInput) { … }
TEST_F(VisibleUnitsTest, IsVisuallyEquivalentCandidateWithHTMLHtmlElement) { … }
TEST_F(VisibleUnitsTest, isVisuallyEquivalentCandidateWithHTMLBodyElement) { … }
TEST_F(VisibleUnitsTest, isVisuallyEquivalentCandidateWithDocument) { … }
TEST_F(VisibleUnitsTest, mostBackwardCaretPositionAfterAnchor) { … }
TEST_F(VisibleUnitsTest, mostBackwardCaretPositionFirstLetter) { … }
TEST_F(VisibleUnitsTest, mostBackwardCaretPositionFirstLetterSplit) { … }
TEST_F(VisibleUnitsTest, mostForwardCaretPositionAfterAnchor) { … }
TEST_F(VisibleUnitsTest, MostBackwardCaretPositionBeforeSvg) { … }
TEST_F(VisibleUnitsTest, MostForwardCaretPositionBeforeSvg) { … }
TEST_F(VisibleUnitsTest, mostForwardCaretPositionFirstLetter) { … }
TEST_F(VisibleUnitsTest, nextPositionOf) { … }
TEST_F(VisibleUnitsTest, nextPositionOfTable) { … }
TEST_F(VisibleUnitsTest, previousPositionOf) { … }
TEST_F(VisibleUnitsTest, previousPositionOfOneCharPerLine) { … }
TEST_F(VisibleUnitsTest, previousPositionOfNoPreviousPosition) { … }
TEST_F(VisibleUnitsTest, rendersInDifferentPositionAfterAnchor) { … }
TEST_F(VisibleUnitsTest, rendersInDifferentPositionAfterAnchorWithHidden) { … }
TEST_F(VisibleUnitsTest,
rendersInDifferentPositionAfterAnchorWithDifferentLayoutObjects) { … }
TEST_F(VisibleUnitsTest, renderedOffset) { … }
TEST_F(VisibleUnitsTest, startOfDocument) { … }
TEST_F(VisibleUnitsTest,
endsOfNodeAreVisuallyDistinctPositionsWithInvisibleChild) { … }
TEST_F(VisibleUnitsTest,
endsOfNodeAreVisuallyDistinctPositionsWithEmptyLayoutChild) { … }
TEST_F(VisibleUnitsTest,
canonicalizationWithCollapsedSpaceAndIsolatedCombiningCharacter) { … }
TEST_F(VisibleUnitsTest, MostForwardCaretPositionWithInvisibleFirstLetter) { … }
TEST_F(VisibleUnitsTest, MostBackwardOrForwardCaretPositionWithBrInOptgroup) { … }
TEST_F(VisibleUnitsTest, SnapBackwardWithZeroWidthSpace) { … }
TEST_F(VisibleUnitsTest, SnapForwardWithImg) { … }
TEST_F(VisibleUnitsTest, SnapForwardWithInput) { … }
TEST_F(VisibleUnitsTest, SnapForwardWithSelect) { … }
TEST_F(VisibleUnitsTest, SnapForwardWithTableAndImages) { … }
TEST_F(VisibleUnitsTest, SnapForwardWithZeroWidthSpace) { … }
TEST_F(VisibleUnitsTest, FirstRectForRangeHorizontal) { … }
TEST_F(VisibleUnitsTest, FirstRectForRangeHorizontalWrap) { … }
TEST_F(VisibleUnitsTest, FirstRectForRangeVertical) { … }
TEST_F(VisibleUnitsTest, FirstRectForRangeVerticalWrap) { … }
}
}