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

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

Issue 2780593002: Apply control clips in LayoutBox::clippingRect() (Closed)
Patch Set: none 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
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/LayoutBox.h" 5 #include "core/layout/LayoutBox.h"
6 6
7 #include "core/html/HTMLElement.h" 7 #include "core/html/HTMLElement.h"
8 #include "core/layout/ImageQualityController.h" 8 #include "core/layout/ImageQualityController.h"
9 #include "core/layout/LayoutTestHelper.h" 9 #include "core/layout/LayoutTestHelper.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 // The writing mode style should be still be inherited. 203 // The writing mode style should be still be inherited.
204 EXPECT_TRUE(foreign->hasFlippedBlocksWritingMode()); 204 EXPECT_TRUE(foreign->hasFlippedBlocksWritingMode());
205 205
206 // The child of the foreign object is affected by writing-mode. 206 // The child of the foreign object is affected by writing-mode.
207 EXPECT_EQ(foreign, child->locationContainer()); 207 EXPECT_EQ(foreign, child->locationContainer());
208 EXPECT_EQ(LayoutRect(0, 0, 33, 55), child->frameRect()); 208 EXPECT_EQ(LayoutRect(0, 0, 33, 55), child->frameRect());
209 EXPECT_EQ(LayoutPoint(67, 0), child->physicalLocation()); 209 EXPECT_EQ(LayoutPoint(67, 0), child->physicalLocation());
210 EXPECT_TRUE(child->hasFlippedBlocksWritingMode()); 210 EXPECT_TRUE(child->hasFlippedBlocksWritingMode());
211 } 211 }
212 212
213 TEST_F(LayoutBoxTest, ControlClip) {
214 setBodyInnerHTML(
215 "<style>"
216 " * { margin: 0; }"
217 " #target {"
218 " position: relative;"
219 " width: 100px; height: 50px;"
220 " }"
221 "</style>"
222 "<input id='target' type='button' value='some text'/>");
223 LayoutBox* target = toLayoutBox(getLayoutObjectByElementId("target"));
224 EXPECT_TRUE(target->hasControlClip());
225 EXPECT_TRUE(target->hasClipRelatedProperty());
226 EXPECT_TRUE(target->shouldClipOverflow());
227 #if OS(MACOSX)
228 EXPECT_EQ(LayoutRect(0, 0, 100, 18), target->clippingRect());
229 #else
230 EXPECT_EQ(LayoutRect(2, 2, 96, 46), target->clippingRect());
231 #endif
232 }
233
213 } // namespace blink 234 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698