| Index: third_party/WebKit/Source/core/layout/VisualRectMappingTest.cpp
|
| diff --git a/third_party/WebKit/Source/core/layout/VisualRectMappingTest.cpp b/third_party/WebKit/Source/core/layout/VisualRectMappingTest.cpp
|
| index c1760c940a85a7591147cb774325a75f4d9f0372..9d24f1e331496dc20e05a10b8aad4306f24a3528 100644
|
| --- a/third_party/WebKit/Source/core/layout/VisualRectMappingTest.cpp
|
| +++ b/third_party/WebKit/Source/core/layout/VisualRectMappingTest.cpp
|
| @@ -139,8 +139,8 @@ TEST_F(VisualRectMappingTest, LayoutView) {
|
| LayoutBlock* frameBody = toLayoutBlock(frameDocument.body()->layoutObject());
|
| LayoutText* frameText = toLayoutText(frameBody->lastChild());
|
|
|
| - // This case involves clipping: frame height is 50, y-coordinate of result rect is 13,
|
| - // so height should be clipped to (50 - 13) == 37.
|
| + // This case involves clipping: frame height is 50, y-coordinate of result
|
| + // rect is 13, so height should be clipped to (50 - 13) == 37.
|
| frameDocument.view()->setScrollOffset(ScrollOffset(0, 47),
|
| ProgrammaticScroll);
|
| LayoutRect originalRect(4, 60, 20, 80);
|
| @@ -180,8 +180,9 @@ TEST_F(VisualRectMappingTest, LayoutViewSubpixelRounding) {
|
| LayoutObject* target = frameDocument.getElementById("target")->layoutObject();
|
| LayoutRect rect(0, 0, 100, 100);
|
| EXPECT_TRUE(target->mapToVisualRectInAncestorSpace(frameContainer, rect));
|
| - // When passing from the iframe to the parent frame, the rect of (0.5, 0, 100, 100) is expanded to (0, 0, 100, 100), and then offset by
|
| - // the 0.5 offset of frameContainer.
|
| + // When passing from the iframe to the parent frame, the rect of (0.5, 0, 100,
|
| + // 100) is expanded to (0, 0, 100, 100), and then offset by the 0.5 offset of
|
| + // frameContainer.
|
| EXPECT_EQ(LayoutRect(LayoutPoint(DoublePoint(0.5, 0)), LayoutSize(101, 100)),
|
| rect);
|
| }
|
| @@ -206,8 +207,8 @@ TEST_F(VisualRectMappingTest, LayoutViewDisplayNone) {
|
| LayoutBlock* frameBody = toLayoutBlock(frameDocument.body()->layoutObject());
|
| LayoutBlock* frameDiv = toLayoutBlock(frameBody->lastChild());
|
|
|
| - // This part is copied from the LayoutView test, just to ensure that the mapped
|
| - // rect is valid before display:none is set on the iframe.
|
| + // This part is copied from the LayoutView test, just to ensure that the
|
| + // mapped rect is valid before display:none is set on the iframe.
|
| frameDocument.view()->setScrollOffset(ScrollOffset(0, 47),
|
| ProgrammaticScroll);
|
| LayoutRect originalRect(4, 60, 20, 80);
|
| @@ -234,7 +235,8 @@ TEST_F(VisualRectMappingTest, SelfFlippedWritingMode) {
|
|
|
| LayoutBlock* target = toLayoutBlock(getLayoutObjectByElementId("target"));
|
| LayoutRect overflowRect = target->localOverflowRectForPaintInvalidation();
|
| - // -40 = -box_shadow_offset_x(40) (with target's top-right corner as the origin)
|
| + // -40 = -box_shadow_offset_x(40) (with target's top-right corner as the
|
| + // origin)
|
| // 140 = width(100) + box_shadow_offset_x(40)
|
| // 70 = height(50) + box_shadow_offset_y(20)
|
| EXPECT_EQ(LayoutRect(-40, 0, 140, 70), overflowRect);
|
| @@ -270,7 +272,8 @@ TEST_F(VisualRectMappingTest, ContainerFlippedWritingMode) {
|
| LayoutBlock* target = toLayoutBlock(getLayoutObjectByElementId("target"));
|
| LayoutRect targetOverflowRect =
|
| target->localOverflowRectForPaintInvalidation();
|
| - // -40 = -box_shadow_offset_x(40) (with target's top-right corner as the origin)
|
| + // -40 = -box_shadow_offset_x(40) (with target's top-right corner as the
|
| + // origin)
|
| // 140 = width(100) + box_shadow_offset_x(40)
|
| // 110 = height(90) + box_shadow_offset_y(20)
|
| EXPECT_EQ(LayoutRect(-40, 0, 140, 110), targetOverflowRect);
|
| @@ -342,20 +345,23 @@ TEST_F(VisualRectMappingTest, ContainerOverflowScroll) {
|
| rect.move(-container->scrolledContentOffset());
|
| // 2 = target_x(0) + container_border_left(10) - scroll_left(8)
|
| // 3 = target_y(0) + container_border_top(10) - scroll_top(7)
|
| - // Rect is not clipped by container's overflow clip because of overflow:scroll.
|
| + // Rect is not clipped by container's overflow clip because of
|
| + // overflow:scroll.
|
| EXPECT_EQ(LayoutRect(2, 3, 140, 110), rect);
|
|
|
| rect = targetOverflowRect;
|
| EXPECT_TRUE(target->mapToVisualRectInAncestorSpace(&layoutView(), rect));
|
| - // (2, 3, 140, 100) is first clipped by container's overflow clip, to (10, 10, 50, 80),
|
| - // then is by added container's offset in LayoutView (111, 222).
|
| + // (2, 3, 140, 100) is first clipped by container's overflow clip, to
|
| + // (10, 10, 50, 80), then is by added container's offset in LayoutView
|
| + // (111, 222).
|
| EXPECT_EQ(LayoutRect(232, 121, 50, 80), rect);
|
| checkPaintInvalidationStateRectMapping(rect, targetOverflowRect, *target,
|
| layoutView(), layoutView());
|
|
|
| LayoutRect containerOverflowRect =
|
| container->localOverflowRectForPaintInvalidation();
|
| - // Because container has overflow clip, its visual overflow doesn't include overflow from children.
|
| + // Because container has overflow clip, its visual overflow doesn't include
|
| + // overflow from children.
|
| // 70 = width(50) + border_left_width(10) + border_right_width(10)
|
| // 100 = height(80) + border_top_width(10) + border_bottom_width(10)
|
| EXPECT_EQ(LayoutRect(0, 0, 70, 100), containerOverflowRect);
|
| @@ -385,7 +391,8 @@ TEST_F(VisualRectMappingTest, ContainerFlippedWritingModeAndOverflowScroll) {
|
| LayoutBlock* container =
|
| toLayoutBlock(getLayoutObjectByElementId("container"));
|
| EXPECT_EQ(LayoutUnit(), container->scrollTop());
|
| - // The initial scroll offset is to the left-most because of flipped blocks writing mode.
|
| + // The initial scroll offset is to the left-most because of flipped blocks
|
| + // writing mode.
|
| // 150 = total_layout_overflow(100 + 100) - width(50)
|
| EXPECT_EQ(LayoutUnit(150), container->scrollLeft());
|
| container->setScrollTop(LayoutUnit(7));
|
| @@ -396,7 +403,8 @@ TEST_F(VisualRectMappingTest, ContainerFlippedWritingModeAndOverflowScroll) {
|
| LayoutBlock* target = toLayoutBlock(getLayoutObjectByElementId("target"));
|
| LayoutRect targetOverflowRect =
|
| target->localOverflowRectForPaintInvalidation();
|
| - // -40 = -box_shadow_offset_x(40) (with target's top-right corner as the origin)
|
| + // -40 = -box_shadow_offset_x(40) (with target's top-right corner as the
|
| + // origin)
|
| // 140 = width(100) + box_shadow_offset_x(40)
|
| // 110 = height(90) + box_shadow_offset_y(20)
|
| EXPECT_EQ(LayoutRect(-40, 0, 140, 110), targetOverflowRect);
|
| @@ -419,9 +427,11 @@ TEST_F(VisualRectMappingTest, ContainerFlippedWritingModeAndOverflowScroll) {
|
| rect = targetOverflowRect;
|
| target->flipForWritingMode(rect);
|
| EXPECT_TRUE(target->mapToVisualRectInAncestorSpace(&layoutView(), rect));
|
| - // (-2, 3, 140, 100) is first clipped by container's overflow clip, to (40, 10, 50, 80),
|
| - // then is added by container's offset in LayoutView (111, 222).
|
| - // TODO(crbug.com/600039): rect.x() should be 262 (left + border-left), but is offset
|
| + // (-2, 3, 140, 100) is first clipped by container's overflow clip, to
|
| + // (40, 10, 50, 80), then is added by container's offset in LayoutView
|
| + // (111, 222).
|
| + // TODO(crbug.com/600039): rect.x() should be 262 (left + border-left), but is
|
| + // offset
|
| // by extra horizontal border-widths because of layout error.
|
| EXPECT_EQ(LayoutRect(322, 121, 50, 80), rect);
|
| checkPaintInvalidationStateRectMapping(rect, targetOverflowRect, *target,
|
| @@ -429,7 +439,8 @@ TEST_F(VisualRectMappingTest, ContainerFlippedWritingModeAndOverflowScroll) {
|
|
|
| LayoutRect containerOverflowRect =
|
| container->localOverflowRectForPaintInvalidation();
|
| - // Because container has overflow clip, its visual overflow doesn't include overflow from children.
|
| + // Because container has overflow clip, its visual overflow doesn't include
|
| + // overflow from children.
|
| // 110 = width(50) + border_left_width(40) + border_right_width(20)
|
| // 120 = height(80) + border_top_width(10) + border_bottom_width(30)
|
| EXPECT_EQ(LayoutRect(0, 0, 110, 120), containerOverflowRect);
|
| @@ -442,7 +453,8 @@ TEST_F(VisualRectMappingTest, ContainerFlippedWritingModeAndOverflowScroll) {
|
| rect = containerOverflowRect;
|
| container->flipForWritingMode(rect);
|
| EXPECT_TRUE(container->mapToVisualRectInAncestorSpace(&layoutView(), rect));
|
| - // TODO(crbug.com/600039): rect.x() should be 222 (left), but is offset by extra horizontal
|
| + // TODO(crbug.com/600039): rect.x() should be 222 (left), but is offset by
|
| + // extra horizontal
|
| // border-widths because of layout error.
|
| EXPECT_EQ(LayoutRect(282, 111, 110, 120), rect);
|
| checkPaintInvalidationStateRectMapping(
|
| @@ -496,7 +508,8 @@ TEST_F(VisualRectMappingTest, ContainerFlippedWritingModeAndOverflowHidden) {
|
| LayoutBlock* container =
|
| toLayoutBlock(getLayoutObjectByElementId("container"));
|
| EXPECT_EQ(LayoutUnit(), container->scrollTop());
|
| - // The initial scroll offset is to the left-most because of flipped blocks writing mode.
|
| + // The initial scroll offset is to the left-most because of flipped blocks
|
| + // writing mode.
|
| // 150 = total_layout_overflow(100 + 100) - width(50)
|
| EXPECT_EQ(LayoutUnit(150), container->scrollLeft());
|
| container->setScrollTop(LayoutUnit(7));
|
| @@ -506,7 +519,8 @@ TEST_F(VisualRectMappingTest, ContainerFlippedWritingModeAndOverflowHidden) {
|
| LayoutBlock* target = toLayoutBlock(getLayoutObjectByElementId("target"));
|
| LayoutRect targetOverflowRect =
|
| target->localOverflowRectForPaintInvalidation();
|
| - // -40 = -box_shadow_offset_x(40) (with target's top-right corner as the origin)
|
| + // -40 = -box_shadow_offset_x(40) (with target's top-right corner as the
|
| + // origin)
|
| // 140 = width(100) + box_shadow_offset_x(40)
|
| // 110 = height(90) + box_shadow_offset_y(20)
|
| EXPECT_EQ(LayoutRect(-40, 0, 140, 110), targetOverflowRect);
|
| @@ -538,7 +552,8 @@ TEST_F(VisualRectMappingTest, ContainerAndTargetDifferentFlippedWritingMode) {
|
| LayoutBlock* container =
|
| toLayoutBlock(getLayoutObjectByElementId("container"));
|
| EXPECT_EQ(LayoutUnit(), container->scrollTop());
|
| - // The initial scroll offset is to the left-most because of flipped blocks writing mode.
|
| + // The initial scroll offset is to the left-most because of flipped blocks
|
| + // writing mode.
|
| // 150 = total_layout_overflow(100 + 100) - width(50)
|
| EXPECT_EQ(LayoutUnit(150), container->scrollLeft());
|
| container->setScrollTop(LayoutUnit(7));
|
| @@ -629,7 +644,8 @@ TEST_F(VisualRectMappingTest,
|
| // This div makes stacking-context composited.
|
| " <div style='position: absolute; width: 1px; height: 1px; "
|
| "background:yellow; will-change: transform'></div>"
|
| - // This stacking context is paintInvalidationContainer of the absolute child, but not a container of it.
|
| + // This stacking context is paintInvalidationContainer of the absolute
|
| + // child, but not a container of it.
|
| " <div id='stacking-context' style='opacity: 0.9'>"
|
| " <div id='absolute' style='position: absolute; top: 50px; left: "
|
| "50px; width: 50px; height: 50px; background: green'></div>"
|
|
|