chromium/third_party/blink/renderer/core/layout/inline/fragment_item_test.cc

// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "third_party/blink/renderer/core/layout/inline/fragment_item.h"

#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/core/dom/dom_token_list.h"
#include "third_party/blink/renderer/core/layout/inline/fragment_items.h"
#include "third_party/blink/renderer/core/layout/inline/inline_cursor.h"
#include "third_party/blink/renderer/core/layout/layout_block_flow.h"
#include "third_party/blink/renderer/core/layout/physical_box_fragment.h"
#include "third_party/blink/renderer/core/paint/paint_layer.h"
#include "third_party/blink/renderer/core/testing/core_unit_test_helper.h"

ElementsAre;

namespace blink {

class FragmentItemTest : public RenderingTest {};

TEST_F(FragmentItemTest, CopyMove) {}

TEST_F(FragmentItemTest, BasicText) {}

TEST_F(FragmentItemTest, RtlText) {}

TEST_F(FragmentItemTest, BasicInlineBox) {}

// Same as |BasicInlineBox| but `<span>`s do not have background.
// They will not produce fragment items, but all operations should work the
// same.
TEST_F(FragmentItemTest, CulledInlineBox) {}

TEST_F(FragmentItemTest, SelfPaintingInlineBox) {}

TEST_F(FragmentItemTest, StartOffsetInContainer) {}

TEST_F(FragmentItemTest, EllipsizedAtomicInline) {}

TEST_F(FragmentItemTest, LineFragmentId) {}

TEST_F(FragmentItemTest, Outline) {}

// Various nodes/elements to test insertions.
CreateNode;
static CreateNode node_creators[] =* element =* element =;

class FragmentItemInsertTest : public FragmentItemTest,
                               public testing::WithParamInterface<CreateNode> {};

INSTANTIATE_TEST_SUITE_P();

// Various nodes/elements to test removals.
class FragmentItemRemoveTest : public FragmentItemTest,
                               public testing::WithParamInterface<const char*> {};

INSTANTIATE_TEST_SUITE_P();

// Test marking line boxes when inserting a span before the first child.
TEST_P(FragmentItemInsertTest, MarkLineBoxesDirtyOnInsert) {}

// Test marking line boxes when appending a span.
TEST_P(FragmentItemInsertTest, MarkLineBoxesDirtyOnAppend) {}

// Test marking line boxes when appending a span on 2nd line.
TEST_P(FragmentItemInsertTest, MarkLineBoxesDirtyOnAppend2) {}

// Test marking line boxes when appending a span on 2nd line.
TEST_P(FragmentItemInsertTest, MarkLineBoxesDirtyOnAppendAfterBR) {}

// Test marking line boxes when removing a span.
TEST_F(FragmentItemTest, MarkLineBoxesDirtyOnRemove) {}

// Test marking line boxes when removing a span.
TEST_P(FragmentItemRemoveTest, MarkLineBoxesDirtyOnRemoveFirst) {}

// Test marking line boxes when removing a span on 2nd line.
TEST_F(FragmentItemTest, MarkLineBoxesDirtyOnRemove2) {}

// Test marking line boxes when removing a text node on 2nd line.
TEST_P(FragmentItemRemoveTest, MarkLineBoxesDirtyOnRemoveAfterBR) {}

TEST_F(FragmentItemTest, MarkLineBoxesDirtyOnEndSpaceCollapsed) {}

// Test marking line boxes when the first span has NeedsLayout. The span is
// culled.
TEST_F(FragmentItemTest, MarkLineBoxesDirtyOnNeedsLayoutFirst) {}

// Test marking line boxes when the first span has NeedsLayout. The span has a
// box fragment.
TEST_F(FragmentItemTest, MarkLineBoxesDirtyOnNeedsLayoutFirstWithBox) {}

// Test marking line boxes when a span has NeedsLayout. The span is culled.
TEST_F(FragmentItemTest, MarkLineBoxesDirtyOnNeedsLayout) {}

// Test marking line boxes when a span has NeedsLayout. The span has a box
// fragment.
TEST_F(FragmentItemTest, MarkLineBoxesDirtyOnNeedsLayoutWithBox) {}

// Test marking line boxes when a span inside a span has NeedsLayout.
// The parent span has a box fragment, and wraps, so that its fragment
// is seen earlier in pre-order DFS.
TEST_F(FragmentItemTest, MarkLineBoxesDirtyOnChildOfWrappedBox) {}

// Test marking line boxes when a span has NeedsLayout. The span has a box
// fragment.
TEST_F(FragmentItemTest, MarkLineBoxesDirtyInInlineBlock) {}

TEST_F(FragmentItemTest, MarkLineBoxesDirtyByRemoveChildAfterForcedBreak) {}

TEST_F(FragmentItemTest, MarkLineBoxesDirtyByRemoveForcedBreak) {}

TEST_F(FragmentItemTest, MarkLineBoxesDirtyByRemoveSpanWithForcedBreak) {}

TEST_F(FragmentItemTest, MarkLineBoxesDirtyByInsertAtStart) {}

TEST_F(FragmentItemTest, MarkLineBoxesDirtyByInsertAtLast) {}

TEST_F(FragmentItemTest, MarkLineBoxesDirtyByInsertAtMiddle) {}

TEST_F(FragmentItemTest, MarkLineBoxesDirtyByTextSetData) {}

TEST_F(FragmentItemTest, MarkLineBoxesDirtyWrappedLine) {}

TEST_F(FragmentItemTest, MarkLineBoxesDirtyInsideInlineBlock) {}

// This test creates various types of |FragmentItem| to check "natvis" (Native
// DebugVisualizers) for Windows Visual Studio.
TEST_F(FragmentItemTest, Disabled_DebugVisualizers) {}

}  // namespace blink