OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/layout/LayoutTestHelper.h" | 5 #include "core/layout/LayoutTestHelper.h" |
6 #include "core/layout/LayoutView.h" | 6 #include "core/layout/LayoutView.h" |
7 #include "core/layout/PaintInvalidationState.h" | 7 #include "core/layout/PaintInvalidationState.h" |
8 #include "core/paint/PaintLayer.h" | 8 #include "core/paint/PaintLayer.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 | 10 |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 ProgrammaticScroll); | 213 ProgrammaticScroll); |
214 LayoutRect originalRect(4, 60, 20, 80); | 214 LayoutRect originalRect(4, 60, 20, 80); |
215 LayoutRect rect = originalRect; | 215 LayoutRect rect = originalRect; |
216 EXPECT_TRUE(frameDiv->mapToVisualRectInAncestorSpace(frameContainer, rect)); | 216 EXPECT_TRUE(frameDiv->mapToVisualRectInAncestorSpace(frameContainer, rect)); |
217 EXPECT_EQ(rect, LayoutRect(4, 13, 20, 37)); | 217 EXPECT_EQ(rect, LayoutRect(4, 13, 20, 37)); |
218 | 218 |
219 Element* frameElement = document().getElementById("frame"); | 219 Element* frameElement = document().getElementById("frame"); |
220 frameElement->setInlineStyleProperty(CSSPropertyDisplay, "none"); | 220 frameElement->setInlineStyleProperty(CSSPropertyDisplay, "none"); |
221 document().view()->updateAllLifecyclePhases(); | 221 document().view()->updateAllLifecyclePhases(); |
222 | 222 |
223 rect = originalRect; | 223 frameBody = toLayoutBlock(childDocument().body()->layoutObject()); |
224 EXPECT_FALSE(frameDiv->mapToVisualRectInAncestorSpace(&layoutView(), rect)); | 224 EXPECT_EQ(nullptr, frameBody); |
225 EXPECT_EQ(rect, LayoutRect()); | |
226 } | 225 } |
227 | 226 |
228 TEST_F(VisualRectMappingTest, SelfFlippedWritingMode) { | 227 TEST_F(VisualRectMappingTest, SelfFlippedWritingMode) { |
229 setBodyInnerHTML( | 228 setBodyInnerHTML( |
230 "<div id='target' style='writing-mode: vertical-rl; box-shadow: 40px " | 229 "<div id='target' style='writing-mode: vertical-rl; box-shadow: 40px " |
231 "20px black;" | 230 "20px black;" |
232 " width: 100px; height: 50px; position: absolute; top: 111px; left: " | 231 " width: 100px; height: 50px; position: absolute; top: 111px; left: " |
233 "222px'>" | 232 "222px'>" |
234 "</div>"); | 233 "</div>"); |
235 | 234 |
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
691 LayoutRect targetVisualRect = target->localVisualRect(); | 690 LayoutRect targetVisualRect = target->localVisualRect(); |
692 EXPECT_EQ(LayoutRect(0, 0, 400, 400), targetVisualRect); | 691 EXPECT_EQ(LayoutRect(0, 0, 400, 400), targetVisualRect); |
693 LayoutRect rect = targetVisualRect; | 692 LayoutRect rect = targetVisualRect; |
694 EXPECT_TRUE(target->mapToVisualRectInAncestorSpace(&layoutView(), rect)); | 693 EXPECT_TRUE(target->mapToVisualRectInAncestorSpace(&layoutView(), rect)); |
695 EXPECT_EQ(LayoutRect(0, 0, 200, 200), rect); | 694 EXPECT_EQ(LayoutRect(0, 0, 200, 200), rect); |
696 checkPaintInvalidationStateRectMapping(rect, targetVisualRect, *target, | 695 checkPaintInvalidationStateRectMapping(rect, targetVisualRect, *target, |
697 layoutView(), layoutView()); | 696 layoutView(), layoutView()); |
698 } | 697 } |
699 | 698 |
700 } // namespace blink | 699 } // namespace blink |
OLD | NEW |