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

Side by Side Diff: third_party/WebKit/Source/web/tests/RootScrollerTest.cpp

Issue 2869803003: Change from ClientRect to DOMRect.
Patch Set: Change from ClientRect to DOMRect. Created 3 years, 6 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "bindings/core/v8/NodeOrString.h" 5 #include "bindings/core/v8/NodeOrString.h"
6 #include "core/dom/ClientRect.h"
7 #include "core/exported/WebRemoteFrameImpl.h" 6 #include "core/exported/WebRemoteFrameImpl.h"
8 #include "core/frame/BrowserControls.h" 7 #include "core/frame/BrowserControls.h"
9 #include "core/frame/FrameTestHelpers.h" 8 #include "core/frame/FrameTestHelpers.h"
10 #include "core/frame/LocalFrameView.h" 9 #include "core/frame/LocalFrameView.h"
11 #include "core/frame/RootFrameViewport.h" 10 #include "core/frame/RootFrameViewport.h"
12 #include "core/frame/VisualViewport.h" 11 #include "core/frame/VisualViewport.h"
13 #include "core/frame/WebLocalFrameBase.h" 12 #include "core/frame/WebLocalFrameBase.h"
13 #include "core/geometry/DOMRect.h"
14 #include "core/html/HTMLFrameOwnerElement.h" 14 #include "core/html/HTMLFrameOwnerElement.h"
15 #include "core/layout/LayoutBox.h" 15 #include "core/layout/LayoutBox.h"
16 #include "core/layout/api/LayoutViewItem.h" 16 #include "core/layout/api/LayoutViewItem.h"
17 #include "core/layout/compositing/CompositedLayerMapping.h" 17 #include "core/layout/compositing/CompositedLayerMapping.h"
18 #include "core/layout/compositing/PaintLayerCompositor.h" 18 #include "core/layout/compositing/PaintLayerCompositor.h"
19 #include "core/page/Page.h" 19 #include "core/page/Page.h"
20 #include "core/page/scrolling/RootScrollerController.h" 20 #include "core/page/scrolling/RootScrollerController.h"
21 #include "core/page/scrolling/TopDocumentRootScrollerController.h" 21 #include "core/page/scrolling/TopDocumentRootScrollerController.h"
22 #include "core/paint/PaintLayer.h" 22 #include "core/paint/PaintLayer.h"
23 #include "core/paint/PaintLayerScrollableArea.h" 23 #include "core/paint/PaintLayerScrollableArea.h"
(...skipping 924 matching lines...) Expand 10 before | Expand all | Expand 10 after
948 // The visual viewport should have scrolled the last half layout viewport. 948 // The visual viewport should have scrolled the last half layout viewport.
949 ASSERT_EQ((250) / 2, GetVisualViewport().GetScrollOffset().Width()); 949 ASSERT_EQ((250) / 2, GetVisualViewport().GetScrollOffset().Width());
950 ASSERT_EQ((1000) / 2, GetVisualViewport().GetScrollOffset().Height()); 950 ASSERT_EQ((1000) / 2, GetVisualViewport().GetScrollOffset().Height());
951 } 951 }
952 952
953 // Now do a rotation resize. 953 // Now do a rotation resize.
954 GetWebView()->ResizeWithBrowserControls(IntSize(1000, 250), 50, false); 954 GetWebView()->ResizeWithBrowserControls(IntSize(1000, 250), 50, false);
955 MainFrameView()->UpdateAllLifecyclePhases(); 955 MainFrameView()->UpdateAllLifecyclePhases();
956 956
957 // The visual viewport should remain fully filled by the target. 957 // The visual viewport should remain fully filled by the target.
958 ClientRect* rect = target->getBoundingClientRect(); 958 DOMRect* rect = target->getBoundingClientRect();
959 EXPECT_EQ(rect->left(), GetVisualViewport().GetScrollOffset().Width()); 959 EXPECT_EQ(rect->left(), GetVisualViewport().GetScrollOffset().Width());
960 EXPECT_EQ(rect->top(), GetVisualViewport().GetScrollOffset().Height()); 960 EXPECT_EQ(rect->top(), GetVisualViewport().GetScrollOffset().Height());
961 } 961 }
962 962
963 // Tests that we don't crash if the default documentElement isn't a valid root 963 // Tests that we don't crash if the default documentElement isn't a valid root
964 // scroller. This can happen in some edge cases where documentElement isn't 964 // scroller. This can happen in some edge cases where documentElement isn't
965 // <html>. crbug.com/668553. 965 // <html>. crbug.com/668553.
966 TEST_F(RootScrollerTest, InvalidDefaultRootScroller) { 966 TEST_F(RootScrollerTest, InvalidDefaultRootScroller) {
967 Initialize("overflow-scrolling.html"); 967 Initialize("overflow-scrolling.html");
968 968
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
1213 // Ensure the target and container weren't put into the same layer. 1213 // Ensure the target and container weren't put into the same layer.
1214 ASSERT_NE(ToLayoutBox(target->GetLayoutObject())->EnclosingLayer(), 1214 ASSERT_NE(ToLayoutBox(target->GetLayoutObject())->EnclosingLayer(),
1215 ToLayoutBox(container->GetLayoutObject())->Layer()); 1215 ToLayoutBox(container->GetLayoutObject())->Layer());
1216 1216
1217 CheckHitTestAtBottomOfScreen(); 1217 CheckHitTestAtBottomOfScreen();
1218 } 1218 }
1219 1219
1220 } // namespace 1220 } // namespace
1221 1221
1222 } // namespace blink 1222 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698