| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 #include "core/frame/FrameView.h" | 56 #include "core/frame/FrameView.h" |
| 57 #include "core/frame/LocalFrame.h" | 57 #include "core/frame/LocalFrame.h" |
| 58 #include "core/frame/RemoteFrame.h" | 58 #include "core/frame/RemoteFrame.h" |
| 59 #include "core/frame/Settings.h" | 59 #include "core/frame/Settings.h" |
| 60 #include "core/frame/VisualViewport.h" | 60 #include "core/frame/VisualViewport.h" |
| 61 #include "core/html/HTMLDocument.h" | 61 #include "core/html/HTMLDocument.h" |
| 62 #include "core/html/HTMLFormElement.h" | 62 #include "core/html/HTMLFormElement.h" |
| 63 #include "core/html/HTMLMediaElement.h" | 63 #include "core/html/HTMLMediaElement.h" |
| 64 #include "core/input/EventHandler.h" | 64 #include "core/input/EventHandler.h" |
| 65 #include "core/layout/HitTestResult.h" | 65 #include "core/layout/HitTestResult.h" |
| 66 #include "core/layout/LayoutFullScreen.h" | |
| 67 #include "core/layout/LayoutView.h" | 66 #include "core/layout/LayoutView.h" |
| 68 #include "core/layout/compositing/DeprecatedPaintLayerCompositor.h" | 67 #include "core/layout/compositing/DeprecatedPaintLayerCompositor.h" |
| 69 #include "core/loader/DocumentLoader.h" | 68 #include "core/loader/DocumentLoader.h" |
| 70 #include "core/loader/DocumentThreadableLoader.h" | 69 #include "core/loader/DocumentThreadableLoader.h" |
| 71 #include "core/loader/DocumentThreadableLoaderClient.h" | 70 #include "core/loader/DocumentThreadableLoaderClient.h" |
| 72 #include "core/loader/FrameLoadRequest.h" | 71 #include "core/loader/FrameLoadRequest.h" |
| 73 #include "core/loader/ThreadableLoader.h" | 72 #include "core/loader/ThreadableLoader.h" |
| 74 #include "core/page/Page.h" | 73 #include "core/page/Page.h" |
| 75 #include "core/paint/DeprecatedPaintLayer.h" | 74 #include "core/paint/DeprecatedPaintLayer.h" |
| 76 #include "core/testing/NullExecutionContext.h" | 75 #include "core/testing/NullExecutionContext.h" |
| (...skipping 6400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6477 | 6476 |
| 6478 Document* document = toWebLocalFrameImpl(webViewImpl->mainFrame())->frame()-
>document(); | 6477 Document* document = toWebLocalFrameImpl(webViewImpl->mainFrame())->frame()-
>document(); |
| 6479 UserGestureIndicator gesture(DefinitelyProcessingUserGesture); | 6478 UserGestureIndicator gesture(DefinitelyProcessingUserGesture); |
| 6480 Element* divFullscreen = document->getElementById("div1"); | 6479 Element* divFullscreen = document->getElementById("div1"); |
| 6481 Fullscreen::from(*document).requestFullscreen(*divFullscreen, Fullscreen::Pr
efixedRequest); | 6480 Fullscreen::from(*document).requestFullscreen(*divFullscreen, Fullscreen::Pr
efixedRequest); |
| 6482 webViewImpl->didEnterFullScreen(); | 6481 webViewImpl->didEnterFullScreen(); |
| 6483 webViewImpl->layout(); | 6482 webViewImpl->layout(); |
| 6484 ASSERT_TRUE(Fullscreen::isFullScreen(*document)); | 6483 ASSERT_TRUE(Fullscreen::isFullScreen(*document)); |
| 6485 | 6484 |
| 6486 // Verify that the element is sized to the viewport. | 6485 // Verify that the element is sized to the viewport. |
| 6487 LayoutFullScreen* fullscreenLayoutObject = Fullscreen::from(*document).fullS
creenLayoutObject(); | 6486 Element* fullscreenElement = Fullscreen::currentFullScreenElementFrom(*docum
ent); |
| 6487 LayoutBox* fullscreenLayoutObject = toLayoutBox(fullscreenElement->layoutObj
ect()); |
| 6488 EXPECT_EQ(viewportWidth, fullscreenLayoutObject->logicalWidth().toInt()); | 6488 EXPECT_EQ(viewportWidth, fullscreenLayoutObject->logicalWidth().toInt()); |
| 6489 EXPECT_EQ(viewportHeight, fullscreenLayoutObject->logicalHeight().toInt()); | 6489 EXPECT_EQ(viewportHeight, fullscreenLayoutObject->logicalHeight().toInt()); |
| 6490 | 6490 |
| 6491 // Verify it's updated after a device rotation. | 6491 // Verify it's updated after a device rotation. |
| 6492 client.m_screenInfo.rect.width = viewportHeight; | 6492 client.m_screenInfo.rect.width = viewportHeight; |
| 6493 client.m_screenInfo.rect.height = viewportWidth; | 6493 client.m_screenInfo.rect.height = viewportWidth; |
| 6494 webViewImpl->resize(WebSize(viewportHeight, viewportWidth)); | 6494 webViewImpl->resize(WebSize(viewportHeight, viewportWidth)); |
| 6495 webViewImpl->layout(); | 6495 webViewImpl->layout(); |
| 6496 EXPECT_EQ(viewportHeight, fullscreenLayoutObject->logicalWidth().toInt()); | 6496 EXPECT_EQ(viewportHeight, fullscreenLayoutObject->logicalWidth().toInt()); |
| 6497 EXPECT_EQ(viewportWidth, fullscreenLayoutObject->logicalHeight().toInt()); | 6497 EXPECT_EQ(viewportWidth, fullscreenLayoutObject->logicalHeight().toInt()); |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6581 webViewImpl->layout(); | 6581 webViewImpl->layout(); |
| 6582 | 6582 |
| 6583 Document* document = toWebLocalFrameImpl(webViewHelper.webView()->mainFrame(
)->firstChild())->frame()->document(); | 6583 Document* document = toWebLocalFrameImpl(webViewHelper.webView()->mainFrame(
)->firstChild())->frame()->document(); |
| 6584 UserGestureIndicator gesture(DefinitelyProcessingUserGesture); | 6584 UserGestureIndicator gesture(DefinitelyProcessingUserGesture); |
| 6585 Element* divFullscreen = document->getElementById("div1"); | 6585 Element* divFullscreen = document->getElementById("div1"); |
| 6586 Fullscreen::from(*document).requestFullscreen(*divFullscreen, Fullscreen::Pr
efixedRequest); | 6586 Fullscreen::from(*document).requestFullscreen(*divFullscreen, Fullscreen::Pr
efixedRequest); |
| 6587 webViewImpl->didEnterFullScreen(); | 6587 webViewImpl->didEnterFullScreen(); |
| 6588 webViewImpl->layout(); | 6588 webViewImpl->layout(); |
| 6589 | 6589 |
| 6590 // Verify that the element is sized to the viewport. | 6590 // Verify that the element is sized to the viewport. |
| 6591 LayoutFullScreen* fullscreenLayoutObject = Fullscreen::from(*document).fullS
creenLayoutObject(); | 6591 Element* fullscreenElement = Fullscreen::currentFullScreenElementFrom(*docum
ent); |
| 6592 LayoutBox* fullscreenLayoutObject = toLayoutBox(fullscreenElement->layoutObj
ect()); |
| 6592 EXPECT_EQ(viewportWidth, fullscreenLayoutObject->logicalWidth().toInt()); | 6593 EXPECT_EQ(viewportWidth, fullscreenLayoutObject->logicalWidth().toInt()); |
| 6593 EXPECT_EQ(viewportHeight, fullscreenLayoutObject->logicalHeight().toInt()); | 6594 EXPECT_EQ(viewportHeight, fullscreenLayoutObject->logicalHeight().toInt()); |
| 6594 | 6595 |
| 6595 // Verify it's updated after a device rotation. | 6596 // Verify it's updated after a device rotation. |
| 6596 client.m_screenInfo.rect.width = viewportHeight; | 6597 client.m_screenInfo.rect.width = viewportHeight; |
| 6597 client.m_screenInfo.rect.height = viewportWidth; | 6598 client.m_screenInfo.rect.height = viewportWidth; |
| 6598 webViewImpl->resize(WebSize(viewportHeight, viewportWidth)); | 6599 webViewImpl->resize(WebSize(viewportHeight, viewportWidth)); |
| 6599 webViewImpl->layout(); | 6600 webViewImpl->layout(); |
| 6600 EXPECT_EQ(viewportHeight, fullscreenLayoutObject->logicalWidth().toInt()); | 6601 EXPECT_EQ(viewportHeight, fullscreenLayoutObject->logicalWidth().toInt()); |
| 6601 EXPECT_EQ(viewportWidth, fullscreenLayoutObject->logicalHeight().toInt()); | 6602 EXPECT_EQ(viewportWidth, fullscreenLayoutObject->logicalHeight().toInt()); |
| (...skipping 1600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8202 | 8203 |
| 8203 TEST_F(WebFrameTest, MaxFramesDetach) | 8204 TEST_F(WebFrameTest, MaxFramesDetach) |
| 8204 { | 8205 { |
| 8205 registerMockedHttpURLLoad("max-frames-detach.html"); | 8206 registerMockedHttpURLLoad("max-frames-detach.html"); |
| 8206 FrameTestHelpers::WebViewHelper webViewHelper; | 8207 FrameTestHelpers::WebViewHelper webViewHelper; |
| 8207 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "max-
frames-detach.html", true); | 8208 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "max-
frames-detach.html", true); |
| 8208 webViewImpl->mainFrameImpl()->collectGarbage(); | 8209 webViewImpl->mainFrameImpl()->collectGarbage(); |
| 8209 } | 8210 } |
| 8210 | 8211 |
| 8211 } // namespace blink | 8212 } // namespace blink |
| OLD | NEW |