Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1089)

Side by Side Diff: third_party/WebKit/Source/core/layout/VisualRectMappingTest.cpp

Issue 2564633002: Don't create layout objects for children of display-none iframes. (Closed)
Patch Set: Rebase. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 203
204 LayoutRect originalRect(4, 60, 20, 80); 204 LayoutRect originalRect(4, 60, 20, 80);
205 LayoutRect rect = originalRect; 205 LayoutRect rect = originalRect;
206 EXPECT_TRUE(frameDiv->mapToVisualRectInAncestorSpace(frameContainer, rect)); 206 EXPECT_TRUE(frameDiv->mapToVisualRectInAncestorSpace(frameContainer, rect));
207 EXPECT_EQ(rect, LayoutRect(4, 13, 20, 37)); 207 EXPECT_EQ(rect, LayoutRect(4, 13, 20, 37));
208 208
209 Element* frameElement = document().getElementById("frame"); 209 Element* frameElement = document().getElementById("frame");
210 frameElement->setInlineStyleProperty(CSSPropertyDisplay, "none"); 210 frameElement->setInlineStyleProperty(CSSPropertyDisplay, "none");
211 document().view()->updateAllLifecyclePhases(); 211 document().view()->updateAllLifecyclePhases();
212 212
213 rect = originalRect; 213 frameBody = toLayoutBlock(childDocument().body()->layoutObject());
214 EXPECT_FALSE(frameDiv->mapToVisualRectInAncestorSpace(&layoutView(), rect)); 214 EXPECT_EQ(nullptr, frameBody);
215 EXPECT_EQ(rect, LayoutRect());
216 } 215 }
217 216
218 TEST_F(VisualRectMappingTest, SelfFlippedWritingMode) { 217 TEST_F(VisualRectMappingTest, SelfFlippedWritingMode) {
219 setBodyInnerHTML( 218 setBodyInnerHTML(
220 "<div id='target' style='writing-mode: vertical-rl;" 219 "<div id='target' style='writing-mode: vertical-rl;"
221 " box-shadow: 40px 20px black; width: 100px; height: 50px;" 220 " box-shadow: 40px 20px black; width: 100px; height: 50px;"
222 " position: absolute; top: 111px; left: 222px'>" 221 " position: absolute; top: 111px; left: 222px'>"
223 "</div>"); 222 "</div>");
224 223
225 LayoutBlock* target = toLayoutBlock(getLayoutObjectByElementId("target")); 224 LayoutBlock* target = toLayoutBlock(getLayoutObjectByElementId("target"));
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
694 EXPECT_TRUE(target->mapToVisualRectInAncestorSpace(&layoutView(), rect)); 693 EXPECT_TRUE(target->mapToVisualRectInAncestorSpace(&layoutView(), rect));
695 EXPECT_EQ(LayoutRect(66, 55, 33, 44), rect); 694 EXPECT_EQ(LayoutRect(66, 55, 33, 44), rect);
696 EXPECT_EQ(rect, target->visualRect()); 695 EXPECT_EQ(rect, target->visualRect());
697 696
698 rect = targetVisualRect; 697 rect = targetVisualRect;
699 EXPECT_TRUE(target->mapToVisualRectInAncestorSpace(span, rect)); 698 EXPECT_TRUE(target->mapToVisualRectInAncestorSpace(span, rect));
700 EXPECT_EQ(LayoutRect(-200, -100, 33, 44), rect); 699 EXPECT_EQ(LayoutRect(-200, -100, 33, 44), rect);
701 } 700 }
702 701
703 } // namespace blink 702 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698