| OLD | NEW |
| 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 "core/dom/ClientRect.h" | 5 #include "core/dom/ClientRect.h" |
| 6 #include "core/frame/BrowserControls.h" | 6 #include "core/frame/BrowserControls.h" |
| 7 #include "core/frame/FrameHost.h" | 7 #include "core/frame/FrameHost.h" |
| 8 #include "core/frame/FrameView.h" | 8 #include "core/frame/FrameView.h" |
| 9 #include "core/frame/RootFrameViewport.h" | 9 #include "core/frame/RootFrameViewport.h" |
| 10 #include "core/frame/VisualViewport.h" | 10 #include "core/frame/VisualViewport.h" |
| (...skipping 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1161 // Now do a rotation resize. | 1161 // Now do a rotation resize. |
| 1162 webViewImpl()->resizeWithBrowserControls(IntSize(1000, 250), 50, false); | 1162 webViewImpl()->resizeWithBrowserControls(IntSize(1000, 250), 50, false); |
| 1163 mainFrameView()->updateAllLifecyclePhases(); | 1163 mainFrameView()->updateAllLifecyclePhases(); |
| 1164 | 1164 |
| 1165 // The visual viewport should remain fully filled by the target. | 1165 // The visual viewport should remain fully filled by the target. |
| 1166 ClientRect* rect = target->getBoundingClientRect(); | 1166 ClientRect* rect = target->getBoundingClientRect(); |
| 1167 EXPECT_EQ(rect->left(), visualViewport().scrollOffset().width()); | 1167 EXPECT_EQ(rect->left(), visualViewport().scrollOffset().width()); |
| 1168 EXPECT_EQ(rect->top(), visualViewport().scrollOffset().height()); | 1168 EXPECT_EQ(rect->top(), visualViewport().scrollOffset().height()); |
| 1169 } | 1169 } |
| 1170 | 1170 |
| 1171 // Tests that we don't crash if the default documentElement isn't a valid root |
| 1172 // scroller. This can happen in some edge cases where documentElement isn't |
| 1173 // <html>. crbug.com/668553. |
| 1174 TEST_F(RootScrollerTest, InvalidDefaultRootScroller) { |
| 1175 initialize("overflow-scrolling.html"); |
| 1176 |
| 1177 Document* document = mainFrame()->document(); |
| 1178 |
| 1179 Element* br = document->createElement("br"); |
| 1180 document->replaceChild(br, document->documentElement()); |
| 1181 mainFrameView()->updateAllLifecyclePhases(); |
| 1182 Element* html = document->createElement("html"); |
| 1183 Element* body = document->createElement("body"); |
| 1184 html->appendChild(body); |
| 1185 body->appendChild(br); |
| 1186 document->appendChild(html); |
| 1187 mainFrameView()->updateAllLifecyclePhases(); |
| 1188 } |
| 1189 |
| 1171 } // namespace | 1190 } // namespace |
| 1172 | 1191 |
| 1173 } // namespace blink | 1192 } // namespace blink |
| OLD | NEW |