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

// Copyright 2016 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/inline_items_builder.h"

#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/core/css/resolver/style_resolver.h"
#include "third_party/blink/renderer/core/layout/inline/inline_node_data.h"
#include "third_party/blink/renderer/core/layout/layout_inline.h"
#include "third_party/blink/renderer/core/layout/layout_ruby_column.h"
#include "third_party/blink/renderer/core/layout/layout_text.h"
#include "third_party/blink/renderer/core/style/computed_style.h"
#include "third_party/blink/renderer/core/testing/core_unit_test_helper.h"
#include "third_party/blink/renderer/platform/testing/runtime_enabled_features_test_helpers.h"

namespace blink {

// The spec turned into a discussion that may change. Put this logic on hold
// until CSSWG resolves the issue.
// https://github.com/w3c/csswg-drafts/issues/337
#define SEGMENT_BREAK_TRANSFORMATION_FOR_EAST_ASIAN_WIDTH

#define EXPECT_ITEM_OFFSET(item, type, start, end)

class InlineItemsBuilderTest : public RenderingTest {};

#define TestWhitespaceValue(expected_text, input, whitespace)

TEST_F(InlineItemsBuilderTest, CollapseSpaces) {}

TEST_F(InlineItemsBuilderTest, CollapseTabs) {}

TEST_F(InlineItemsBuilderTest, CollapseNewLines) {}

TEST_F(InlineItemsBuilderTest, CollapseNewlinesAsSpaces) {}

TEST_F(InlineItemsBuilderTest, CollapseAcrossElements) {}

TEST_F(InlineItemsBuilderTest, CollapseLeadingSpaces) {}

TEST_F(InlineItemsBuilderTest, CollapseTrailingSpaces) {}

TEST_F(InlineItemsBuilderTest, CollapseAllSpaces) {}

TEST_F(InlineItemsBuilderTest, CollapseLeadingNewlines) {}

TEST_F(InlineItemsBuilderTest, CollapseTrailingNewlines) {}

TEST_F(InlineItemsBuilderTest, CollapseNewlineAcrossElements) {}

TEST_F(InlineItemsBuilderTest, CollapseBeforeAndAfterNewline) {}

TEST_F(InlineItemsBuilderTest,
       CollapsibleSpaceAfterNonCollapsibleSpaceAcrossElements) {}

TEST_F(InlineItemsBuilderTest, CollapseZeroWidthSpaces) {}

TEST_F(InlineItemsBuilderTest, CollapseZeroWidthSpaceAndNewLineAtEnd) {}

#if SEGMENT_BREAK_TRANSFORMATION_FOR_EAST_ASIAN_WIDTH
TEST_F(InlineItemsBuilderTest, CollapseEastAsianWidth) {
  EXPECT_EQ(String(u"\u4E00\u4E00"), TestAppend(u"\u4E00\n\u4E00"))
      << "Newline is removed when both sides are Wide.";

  EXPECT_EQ(String(u"\u4E00 A"), TestAppend(u"\u4E00\nA"))
      << "Newline is not removed when after is Narrow.";
  EXPECT_EQ(String(u"A \u4E00"), TestAppend(u"A\n\u4E00"))
      << "Newline is not removed when before is Narrow.";

  EXPECT_EQ(String(u"\u4E00\u4E00"), TestAppend(u"\u4E00\n", u"\u4E00"))
      << "Newline at the end of elements is removed when both sides are Wide.";
  EXPECT_EQ(String(u"\u4E00\u4E00"), TestAppend(u"\u4E00", u"\n\u4E00"))
      << "Newline at the beginning of elements is removed "
         "when both sides are Wide.";
}
#endif

TEST_F(InlineItemsBuilderTest, OpaqueToSpaceCollapsing) {}

TEST_F(InlineItemsBuilderTest, CollapseAroundReplacedElement) {}

TEST_F(InlineItemsBuilderTest, CollapseNewlineAfterObject) {}

TEST_F(InlineItemsBuilderTest, AppendEmptyString) {}

TEST_F(InlineItemsBuilderTest, NewLines) {}

TEST_F(InlineItemsBuilderTest, IgnorablePre) {}

TEST_F(InlineItemsBuilderTest, Empty) {}

class CollapsibleSpaceTest : public InlineItemsBuilderTest,
                             public testing::WithParamInterface<UChar> {};

INSTANTIATE_TEST_SUITE_P();

TEST_P(CollapsibleSpaceTest, CollapsedSpaceAfterNoWrap) {}

TEST_F(InlineItemsBuilderTest, GenerateBreakOpportunityAfterLeadingSpaces) {}

TEST_F(InlineItemsBuilderTest, BidiBlockOverride) {}

static LayoutInline* CreateLayoutInline(
    Document* document,
    void (*initialize_style)(ComputedStyleBuilder&)) {}

TEST_F(InlineItemsBuilderTest, BidiIsolate) {}

TEST_F(InlineItemsBuilderTest, BidiIsolateOverride) {}

TEST_F(InlineItemsBuilderTest, BlockInInline) {}

TEST_F(InlineItemsBuilderTest, HasRuby) {}

TEST_F(InlineItemsBuilderTest, OpenCloseRubyColumns) {}

}  // namespace blink