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

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

Issue 2743053003: [Reland #1] Don't create layout objects for children of display-none iframes. (Closed)
Patch Set: rebaseline. Created 3 years, 8 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 "core/paint/PaintPropertyTreePrinter.h" 9 #include "core/paint/PaintPropertyTreePrinter.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 235
236 LayoutRect originalRect(4, 60, 20, 80); 236 LayoutRect originalRect(4, 60, 20, 80);
237 LayoutRect rect = originalRect; 237 LayoutRect rect = originalRect;
238 EXPECT_TRUE(frameDiv->mapToVisualRectInAncestorSpace(frameContainer, rect)); 238 EXPECT_TRUE(frameDiv->mapToVisualRectInAncestorSpace(frameContainer, rect));
239 EXPECT_EQ(rect, LayoutRect(4, 13, 20, 37)); 239 EXPECT_EQ(rect, LayoutRect(4, 13, 20, 37));
240 240
241 Element* frameElement = document().getElementById("frame"); 241 Element* frameElement = document().getElementById("frame");
242 frameElement->setInlineStyleProperty(CSSPropertyDisplay, "none"); 242 frameElement->setInlineStyleProperty(CSSPropertyDisplay, "none");
243 document().view()->updateAllLifecyclePhases(); 243 document().view()->updateAllLifecyclePhases();
244 244
245 rect = originalRect; 245 frameBody = toLayoutBlock(childDocument().body()->layoutObject());
246 EXPECT_FALSE(frameDiv->mapToVisualRectInAncestorSpace(&layoutView(), rect)); 246 EXPECT_EQ(nullptr, frameBody);
247 EXPECT_EQ(rect, LayoutRect());
248 } 247 }
249 248
250 TEST_F(VisualRectMappingTest, SelfFlippedWritingMode) { 249 TEST_F(VisualRectMappingTest, SelfFlippedWritingMode) {
251 setBodyInnerHTML( 250 setBodyInnerHTML(
252 "<div id='target' style='writing-mode: vertical-rl;" 251 "<div id='target' style='writing-mode: vertical-rl;"
253 " box-shadow: 40px 20px black; width: 100px; height: 50px;" 252 " box-shadow: 40px 20px black; width: 100px; height: 50px;"
254 " position: absolute; top: 111px; left: 222px'>" 253 " position: absolute; top: 111px; left: 222px'>"
255 "</div>"); 254 "</div>");
256 255
257 LayoutBlock* target = toLayoutBlock(getLayoutObjectByElementId("target")); 256 LayoutBlock* target = toLayoutBlock(getLayoutObjectByElementId("target"));
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after
825 // getTransformfromContainter includes transform and perspective matrix 824 // getTransformfromContainter includes transform and perspective matrix
826 // of the container. 825 // of the container.
827 target->getTransformFromContainer(container, LayoutSize(), targetMatrix); 826 target->getTransformFromContainer(container, LayoutSize(), targetMatrix);
828 matrix *= targetMatrix; 827 matrix *= targetMatrix;
829 LayoutRect output(matrix.mapRect(FloatRect(originalRect))); 828 LayoutRect output(matrix.mapRect(FloatRect(originalRect)));
830 829
831 checkVisualRect(*target, *target->view(), originalRect, output); 830 checkVisualRect(*target, *target->view(), originalRect, output);
832 } 831 }
833 832
834 } // namespace blink 833 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutView.cpp ('k') | third_party/WebKit/Source/platform/RuntimeEnabledFeatures.json5 » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698