chromium/third_party/blink/renderer/core/layout/map_coordinates_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 "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/core/layout/geometry/transform_state.h"
#include "third_party/blink/renderer/core/layout/layout_inline.h"
#include "third_party/blink/renderer/core/layout/layout_multi_column_flow_thread.h"
#include "third_party/blink/renderer/core/layout/layout_view.h"
#include "third_party/blink/renderer/core/paint/paint_layer_scrollable_area.h"
#include "third_party/blink/renderer/core/testing/core_unit_test_helper.h"

namespace blink {

class MapCoordinatesTest : public RenderingTest {};

// One note about tests here that operate on LayoutInline and LayoutText
// objects: mapLocalToAncestor() expects such objects to pass their static
// location and size (relatively to the border edge of their container) to
// mapLocalToAncestor() via the TransformState argument. mapLocalToAncestor() is
// then only expected to make adjustments for relative-positioning,
// container-specific characteristics (such as writing mode roots, multicol),
// and so on. This in contrast to LayoutBox objects, where the TransformState
// passed is relative to the box itself, not the container.

PhysicalOffset MapCoordinatesTest::AdjustForFrameScroll(
    const PhysicalOffset& point) const {}

PhysicalOffset MapCoordinatesTest::MapLocalToAncestor(
    const LayoutObject* object,
    const LayoutBoxModelObject* ancestor,
    PhysicalOffset point,
    MapCoordinatesFlags mode) const {}

gfx::QuadF MapCoordinatesTest::MapLocalToAncestor(
    const LayoutObject* object,
    const LayoutBoxModelObject* ancestor,
    gfx::QuadF quad,
    MapCoordinatesFlags mode) const {}

PhysicalOffset MapCoordinatesTest::MapAncestorToLocal(
    const LayoutObject* object,
    const LayoutBoxModelObject* ancestor,
    PhysicalOffset point,
    MapCoordinatesFlags mode) const {}

gfx::QuadF MapCoordinatesTest::MapAncestorToLocal(
    const LayoutObject* object,
    const LayoutBoxModelObject* ancestor,
    gfx::QuadF quad,
    MapCoordinatesFlags mode) const {}

TEST_F(MapCoordinatesTest, SimpleText) {}

TEST_F(MapCoordinatesTest, SimpleInline) {}

TEST_F(MapCoordinatesTest, SimpleBlock) {}

TEST_F(MapCoordinatesTest, OverflowClip) {}

TEST_F(MapCoordinatesTest, TextInRelPosInline) {}

TEST_F(MapCoordinatesTest, RelposInline) {}

TEST_F(MapCoordinatesTest, RelposInlineInRelposInline) {}

TEST_F(MapCoordinatesTest, RelPosBlock) {}

TEST_F(MapCoordinatesTest, AbsPos) {}

TEST_F(MapCoordinatesTest, AbsPosAuto) {}

TEST_F(MapCoordinatesTest, FixedPos) {}

TEST_F(MapCoordinatesTest, FixedPosAuto) {}

TEST_F(MapCoordinatesTest, FixedPosInFixedPos) {}

TEST_F(MapCoordinatesTest, FixedPosInFixedPosScrollView) {}

TEST_F(MapCoordinatesTest, FixedPosInAbsolutePosScrollView) {}

TEST_F(MapCoordinatesTest, FixedPosInTransform) {}

TEST_F(MapCoordinatesTest, FixedPosInContainPaint) {}

// TODO(chrishtr): add more multi-frame tests.
TEST_F(MapCoordinatesTest, FixedPosInIFrameWhenMainFrameScrolled) {}

TEST_F(MapCoordinatesTest, IFrameTransformed) {}

TEST_F(MapCoordinatesTest, FixedPosInScrolledIFrameWithTransform) {}

TEST_F(MapCoordinatesTest, MulticolWithText) {}

TEST_F(MapCoordinatesTest, MulticolWithInline) {}

TEST_F(MapCoordinatesTest, MulticolWithBlock) {}

TEST_F(MapCoordinatesTest, MulticolWithBlockAbove) {}

TEST_F(MapCoordinatesTest, NestedMulticolWithBlock) {}

TEST_F(MapCoordinatesTest, MulticolWithAbsPosInRelPos) {}

TEST_F(MapCoordinatesTest, MulticolWithAbsPosInInlineRelPos) {}

TEST_F(MapCoordinatesTest, MulticolWithAbsPosNotContained) {}

TEST_F(MapCoordinatesTest, MulticolRtl) {}

TEST_F(MapCoordinatesTest, MulticolWithLargeBorder) {}

TEST_F(MapCoordinatesTest, FlippedBlocksWritingModeWithText) {}

TEST_F(MapCoordinatesTest, FlippedBlocksWritingModeWithInline) {}

TEST_F(MapCoordinatesTest, FlippedBlocksWritingModeWithBlock) {}

TEST_F(MapCoordinatesTest, Table) {}

static bool FloatValuesAlmostEqual(float expected, float actual) {}

static bool QuadsAlmostEqual(const gfx::QuadF& expected,
                             const gfx::QuadF& actual) {}

// If comparison fails, pretty-print the error using EXPECT_EQ()
#define EXPECT_QUADF_EQ(expected, actual)

TEST_F(MapCoordinatesTest, Transforms) {}

TEST_F(MapCoordinatesTest, SVGShape) {}

TEST_F(MapCoordinatesTest, SVGShapeScale) {}

TEST_F(MapCoordinatesTest, SVGShapeWithViewBoxWithoutScale) {}

TEST_F(MapCoordinatesTest, SVGShapeWithViewBoxWithScale) {}

TEST_F(MapCoordinatesTest, SVGShapeWithViewBoxWithNonZeroOffset) {}

TEST_F(MapCoordinatesTest, SVGShapeWithViewBoxWithNonZeroOffsetAndScale) {}

TEST_F(MapCoordinatesTest, SVGForeignObject) {}

TEST_F(MapCoordinatesTest, LocalToAbsoluteTransform) {}

TEST_F(MapCoordinatesTest, LocalToAncestorTransform) {}

TEST_F(MapCoordinatesTest, LocalToAbsoluteTransformFlattens) {}

TEST_F(MapCoordinatesTest, Transform3DWithOffset) {}

TEST_F(MapCoordinatesTest, Transform3DWithOffset2) {}

// This test verifies that the mapped location of a div within a scroller
// remains the same after scroll when ignoring scroll offset.
TEST_F(MapCoordinatesTest, IgnoreScrollOffset) {}

// This test verifies that the mapped location of an inline div within a
// scroller remains the same after scroll when ignoring scroll offset.
TEST_F(MapCoordinatesTest, IgnoreScrollOffsetForInline) {}

// This test verifies that ignoring scroll offset works with writing modes.
TEST_F(MapCoordinatesTest, IgnoreScrollOffsetWithWritingModes) {}

TEST_F(MapCoordinatesTest, FixedPositionWithScrollOffset) {}

TEST_F(MapCoordinatesTest, FixedPositionWithScrollOffsetVerticalRL) {}

TEST_F(MapCoordinatesTest, FixedPositionUnderTransformWithScrollOffset) {}

// This test verifies that ignoring scroll offset works with writing modes and
// non-overlay scrollbar.
TEST_F(MapCoordinatesTest,
       IgnoreScrollOffsetWithWritingModesAndNonOverlayScrollbar) {}

}  // namespace blink