| 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 22 matching lines...) Expand all  Loading... | 
| 33 #include "public/web/WebFrame.h" | 33 #include "public/web/WebFrame.h" | 
| 34 | 34 | 
| 35 #include "SkBitmap.h" | 35 #include "SkBitmap.h" | 
| 36 #include "SkCanvas.h" | 36 #include "SkCanvas.h" | 
| 37 #include "core/UserAgentStyleSheets.h" | 37 #include "core/UserAgentStyleSheets.h" | 
| 38 #include "core/clipboard/DataTransfer.h" | 38 #include "core/clipboard/DataTransfer.h" | 
| 39 #include "core/css/StyleSheetContents.h" | 39 #include "core/css/StyleSheetContents.h" | 
| 40 #include "core/css/resolver/StyleResolver.h" | 40 #include "core/css/resolver/StyleResolver.h" | 
| 41 #include "core/css/resolver/ViewportStyleResolver.h" | 41 #include "core/css/resolver/ViewportStyleResolver.h" | 
| 42 #include "core/dom/DocumentMarkerController.h" | 42 #include "core/dom/DocumentMarkerController.h" | 
| 43 #include "core/dom/FullscreenElementStack.h" | 43 #include "core/dom/Fullscreen.h" | 
| 44 #include "core/dom/NodeRenderStyle.h" | 44 #include "core/dom/NodeRenderStyle.h" | 
| 45 #include "core/dom/Range.h" | 45 #include "core/dom/Range.h" | 
| 46 #include "core/editing/Editor.h" | 46 #include "core/editing/Editor.h" | 
| 47 #include "core/editing/FrameSelection.h" | 47 #include "core/editing/FrameSelection.h" | 
| 48 #include "core/editing/SpellChecker.h" | 48 #include "core/editing/SpellChecker.h" | 
| 49 #include "core/editing/VisiblePosition.h" | 49 #include "core/editing/VisiblePosition.h" | 
| 50 #include "core/events/MouseEvent.h" | 50 #include "core/events/MouseEvent.h" | 
| 51 #include "core/frame/FrameView.h" | 51 #include "core/frame/FrameView.h" | 
| 52 #include "core/frame/LocalFrame.h" | 52 #include "core/frame/LocalFrame.h" | 
| 53 #include "core/frame/Settings.h" | 53 #include "core/frame/Settings.h" | 
| (...skipping 5593 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 5647     FrameTestHelpers::WebViewHelper webViewHelper; | 5647     FrameTestHelpers::WebViewHelper webViewHelper; | 
| 5648     int viewportWidth = 640; | 5648     int viewportWidth = 640; | 
| 5649     int viewportHeight = 480; | 5649     int viewportHeight = 480; | 
| 5650     WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "full
      screen_div.html", true, 0, &client, &configueCompositingWebView); | 5650     WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "full
      screen_div.html", true, 0, &client, &configueCompositingWebView); | 
| 5651     webViewImpl->resize(WebSize(viewportWidth, viewportHeight)); | 5651     webViewImpl->resize(WebSize(viewportWidth, viewportHeight)); | 
| 5652     webViewImpl->layout(); | 5652     webViewImpl->layout(); | 
| 5653 | 5653 | 
| 5654     Document* document = toWebLocalFrameImpl(webViewImpl->mainFrame())->frame()-
      >document(); | 5654     Document* document = toWebLocalFrameImpl(webViewImpl->mainFrame())->frame()-
      >document(); | 
| 5655     blink::UserGestureIndicator gesture(blink::DefinitelyProcessingUserGesture); | 5655     blink::UserGestureIndicator gesture(blink::DefinitelyProcessingUserGesture); | 
| 5656     Element* divFullscreen = document->getElementById("div1"); | 5656     Element* divFullscreen = document->getElementById("div1"); | 
| 5657     FullscreenElementStack::from(*document).requestFullscreen(*divFullscreen, Fu
      llscreenElementStack::PrefixedRequest); | 5657     Fullscreen::from(*document).requestFullscreen(*divFullscreen, Fullscreen::Pr
      efixedRequest); | 
| 5658     webViewImpl->willEnterFullScreen(); | 5658     webViewImpl->willEnterFullScreen(); | 
| 5659     webViewImpl->didEnterFullScreen(); | 5659     webViewImpl->didEnterFullScreen(); | 
| 5660     webViewImpl->layout(); | 5660     webViewImpl->layout(); | 
| 5661 | 5661 | 
| 5662     // Verify that the main frame is not scrollable. | 5662     // Verify that the main frame is not scrollable. | 
| 5663     ASSERT_TRUE(blink::FullscreenElementStack::isFullScreen(*document)); | 5663     ASSERT_TRUE(blink::Fullscreen::isFullScreen(*document)); | 
| 5664     WebLayer* webScrollLayer = webViewImpl->compositor()->scrollLayer()->platfor
      mLayer(); | 5664     WebLayer* webScrollLayer = webViewImpl->compositor()->scrollLayer()->platfor
      mLayer(); | 
| 5665     ASSERT_FALSE(webScrollLayer->scrollable()); | 5665     ASSERT_FALSE(webScrollLayer->scrollable()); | 
| 5666 | 5666 | 
| 5667     // Verify that the main frame is scrollable upon exiting fullscreen. | 5667     // Verify that the main frame is scrollable upon exiting fullscreen. | 
| 5668     webViewImpl->willExitFullScreen(); | 5668     webViewImpl->willExitFullScreen(); | 
| 5669     webViewImpl->didExitFullScreen(); | 5669     webViewImpl->didExitFullScreen(); | 
| 5670     webViewImpl->layout(); | 5670     webViewImpl->layout(); | 
| 5671     ASSERT_FALSE(blink::FullscreenElementStack::isFullScreen(*document)); | 5671     ASSERT_FALSE(blink::Fullscreen::isFullScreen(*document)); | 
| 5672     webScrollLayer = webViewImpl->compositor()->scrollLayer()->platformLayer(); | 5672     webScrollLayer = webViewImpl->compositor()->scrollLayer()->platformLayer(); | 
| 5673     ASSERT_TRUE(webScrollLayer->scrollable()); | 5673     ASSERT_TRUE(webScrollLayer->scrollable()); | 
| 5674 } | 5674 } | 
| 5675 | 5675 | 
| 5676 TEST_F(WebFrameTest, FullscreenMainFrameScrollable) | 5676 TEST_F(WebFrameTest, FullscreenMainFrameScrollable) | 
| 5677 { | 5677 { | 
| 5678     FakeCompositingWebViewClient client; | 5678     FakeCompositingWebViewClient client; | 
| 5679     registerMockedHttpURLLoad("fullscreen_div.html"); | 5679     registerMockedHttpURLLoad("fullscreen_div.html"); | 
| 5680     FrameTestHelpers::WebViewHelper webViewHelper; | 5680     FrameTestHelpers::WebViewHelper webViewHelper; | 
| 5681     int viewportWidth = 640; | 5681     int viewportWidth = 640; | 
| 5682     int viewportHeight = 480; | 5682     int viewportHeight = 480; | 
| 5683     WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "full
      screen_div.html", true, 0, &client, &configueCompositingWebView); | 5683     WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "full
      screen_div.html", true, 0, &client, &configueCompositingWebView); | 
| 5684     webViewImpl->resize(WebSize(viewportWidth, viewportHeight)); | 5684     webViewImpl->resize(WebSize(viewportWidth, viewportHeight)); | 
| 5685     webViewImpl->layout(); | 5685     webViewImpl->layout(); | 
| 5686 | 5686 | 
| 5687     Document* document = toWebLocalFrameImpl(webViewImpl->mainFrame())->frame()-
      >document(); | 5687     Document* document = toWebLocalFrameImpl(webViewImpl->mainFrame())->frame()-
      >document(); | 
| 5688     blink::UserGestureIndicator gesture(blink::DefinitelyProcessingUserGesture); | 5688     blink::UserGestureIndicator gesture(blink::DefinitelyProcessingUserGesture); | 
| 5689     FullscreenElementStack::from(*document).requestFullscreen(*document->documen
      tElement(), FullscreenElementStack::PrefixedRequest); | 5689     Fullscreen::from(*document).requestFullscreen(*document->documentElement(), 
      Fullscreen::PrefixedRequest); | 
| 5690     webViewImpl->willEnterFullScreen(); | 5690     webViewImpl->willEnterFullScreen(); | 
| 5691     webViewImpl->didEnterFullScreen(); | 5691     webViewImpl->didEnterFullScreen(); | 
| 5692     webViewImpl->layout(); | 5692     webViewImpl->layout(); | 
| 5693 | 5693 | 
| 5694     // Verify that the main frame is still scrollable. | 5694     // Verify that the main frame is still scrollable. | 
| 5695     ASSERT_TRUE(blink::FullscreenElementStack::isFullScreen(*document)); | 5695     ASSERT_TRUE(blink::Fullscreen::isFullScreen(*document)); | 
| 5696     WebLayer* webScrollLayer = webViewImpl->compositor()->scrollLayer()->platfor
      mLayer(); | 5696     WebLayer* webScrollLayer = webViewImpl->compositor()->scrollLayer()->platfor
      mLayer(); | 
| 5697     ASSERT_TRUE(webScrollLayer->scrollable()); | 5697     ASSERT_TRUE(webScrollLayer->scrollable()); | 
| 5698 } | 5698 } | 
| 5699 | 5699 | 
| 5700 TEST_F(WebFrameTest, RenderBlockPercentHeightDescendants) | 5700 TEST_F(WebFrameTest, RenderBlockPercentHeightDescendants) | 
| 5701 { | 5701 { | 
| 5702     registerMockedHttpURLLoad("percent-height-descendants.html"); | 5702     registerMockedHttpURLLoad("percent-height-descendants.html"); | 
| 5703     FrameTestHelpers::WebViewHelper webViewHelper; | 5703     FrameTestHelpers::WebViewHelper webViewHelper; | 
| 5704     webViewHelper.initializeAndLoad(m_baseURL + "percent-height-descendants.html
      "); | 5704     webViewHelper.initializeAndLoad(m_baseURL + "percent-height-descendants.html
      "); | 
| 5705 | 5705 | 
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 6077 | 6077 | 
| 6078     client.reset(); | 6078     client.reset(); | 
| 6079     // Try to load the request with cross origin access. Should succeed. | 6079     // Try to load the request with cross origin access. Should succeed. | 
| 6080     options.crossOriginRequestPolicy = blink::AllowCrossOriginRequests; | 6080     options.crossOriginRequestPolicy = blink::AllowCrossOriginRequests; | 
| 6081     blink::DocumentThreadableLoader::loadResourceSynchronously( | 6081     blink::DocumentThreadableLoader::loadResourceSynchronously( | 
| 6082         *frame->document(), blink::ResourceRequest(resourceUrl), client, options
      , resourceLoaderOptions); | 6082         *frame->document(), blink::ResourceRequest(resourceUrl), client, options
      , resourceLoaderOptions); | 
| 6083     EXPECT_FALSE(client.failed()); | 6083     EXPECT_FALSE(client.failed()); | 
| 6084 } | 6084 } | 
| 6085 | 6085 | 
| 6086 } // namespace | 6086 } // namespace | 
| OLD | NEW | 
|---|