| 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 21 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 #include "SkBitmap.h" | 33 #include "SkBitmap.h" |
| 34 #include "SkCanvas.h" | 34 #include "SkCanvas.h" |
| 35 #include "bindings/core/v8/SerializedScriptValueFactory.h" | 35 #include "bindings/core/v8/SerializedScriptValueFactory.h" |
| 36 #include "bindings/core/v8/V8Node.h" | 36 #include "bindings/core/v8/V8Node.h" |
| 37 #include "core/clipboard/DataTransfer.h" | 37 #include "core/clipboard/DataTransfer.h" |
| 38 #include "core/css/StyleSheetContents.h" | 38 #include "core/css/StyleSheetContents.h" |
| 39 #include "core/css/resolver/StyleResolver.h" | 39 #include "core/css/resolver/StyleResolver.h" |
| 40 #include "core/css/resolver/ViewportStyleResolver.h" | 40 #include "core/css/resolver/ViewportStyleResolver.h" |
| 41 #include "core/dom/Document.h" | 41 #include "core/dom/Document.h" |
| 42 #include "core/dom/DocumentUserGestureToken.h" |
| 42 #include "core/dom/Fullscreen.h" | 43 #include "core/dom/Fullscreen.h" |
| 43 #include "core/dom/NodeComputedStyle.h" | 44 #include "core/dom/NodeComputedStyle.h" |
| 44 #include "core/dom/Range.h" | 45 #include "core/dom/Range.h" |
| 45 #include "core/editing/Editor.h" | 46 #include "core/editing/Editor.h" |
| 46 #include "core/editing/EphemeralRange.h" | 47 #include "core/editing/EphemeralRange.h" |
| 47 #include "core/editing/FrameSelection.h" | 48 #include "core/editing/FrameSelection.h" |
| 48 #include "core/editing/VisiblePosition.h" | 49 #include "core/editing/VisiblePosition.h" |
| 49 #include "core/editing/markers/DocumentMarkerController.h" | 50 #include "core/editing/markers/DocumentMarkerController.h" |
| 50 #include "core/editing/spellcheck/SpellChecker.h" | 51 #include "core/editing/spellcheck/SpellChecker.h" |
| 51 #include "core/events/MouseEvent.h" | 52 #include "core/events/MouseEvent.h" |
| (...skipping 6617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6669 toLocalFrame(webViewHelper.webView()->page()->mainFrame())->document(); | 6670 toLocalFrame(webViewHelper.webView()->page()->mainFrame())->document(); |
| 6670 KURL destination = toKURL(m_baseURL + "hello_world.html"); | 6671 KURL destination = toKURL(m_baseURL + "hello_world.html"); |
| 6671 | 6672 |
| 6672 // ctrl+click event | 6673 // ctrl+click event |
| 6673 Event* event = MouseEvent::create( | 6674 Event* event = MouseEvent::create( |
| 6674 EventTypeNames::click, false, false, document->domWindow(), 0, 0, 0, 0, 0, | 6675 EventTypeNames::click, false, false, document->domWindow(), 0, 0, 0, 0, 0, |
| 6675 0, 0, PlatformEvent::CtrlKey, 0, 0, nullptr, 0, | 6676 0, 0, PlatformEvent::CtrlKey, 0, 0, nullptr, 0, |
| 6676 PlatformMouseEvent::RealOrIndistinguishable, String(), nullptr); | 6677 PlatformMouseEvent::RealOrIndistinguishable, String(), nullptr); |
| 6677 FrameLoadRequest frameRequest(document, ResourceRequest(destination)); | 6678 FrameLoadRequest frameRequest(document, ResourceRequest(destination)); |
| 6678 frameRequest.setTriggeringEvent(event); | 6679 frameRequest.setTriggeringEvent(event); |
| 6679 UserGestureIndicator gesture(UserGestureToken::create()); | 6680 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); |
| 6680 toLocalFrame(webViewHelper.webView()->page()->mainFrame()) | 6681 toLocalFrame(webViewHelper.webView()->page()->mainFrame()) |
| 6681 ->loader() | 6682 ->loader() |
| 6682 .load(frameRequest); | 6683 .load(frameRequest); |
| 6683 FrameTestHelpers::pumpPendingRequestsForFrameToLoad( | 6684 FrameTestHelpers::pumpPendingRequestsForFrameToLoad( |
| 6684 webViewHelper.webView()->mainFrame()); | 6685 webViewHelper.webView()->mainFrame()); |
| 6685 | 6686 |
| 6686 // decidePolicyForNavigation should be called both for the original request | 6687 // decidePolicyForNavigation should be called both for the original request |
| 6687 // and the ctrl+click. | 6688 // and the ctrl+click. |
| 6688 EXPECT_EQ(2, webFrameClient.decidePolicyCallCount()); | 6689 EXPECT_EQ(2, webFrameClient.decidePolicyCallCount()); |
| 6689 } | 6690 } |
| (...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7391 int viewportHeight = 480; | 7392 int viewportHeight = 480; |
| 7392 client.m_screenInfo.rect.width = viewportWidth; | 7393 client.m_screenInfo.rect.width = viewportWidth; |
| 7393 client.m_screenInfo.rect.height = viewportHeight; | 7394 client.m_screenInfo.rect.height = viewportHeight; |
| 7394 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad( | 7395 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad( |
| 7395 m_baseURL + "fullscreen_div.html", true, nullptr, &client, nullptr, | 7396 m_baseURL + "fullscreen_div.html", true, nullptr, &client, nullptr, |
| 7396 configureAndroid); | 7397 configureAndroid); |
| 7397 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); | 7398 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); |
| 7398 webViewImpl->updateAllLifecyclePhases(); | 7399 webViewImpl->updateAllLifecyclePhases(); |
| 7399 | 7400 |
| 7400 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); | 7401 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); |
| 7401 UserGestureIndicator gesture(UserGestureToken::create()); | 7402 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); |
| 7402 Element* divFullscreen = document->getElementById("div1"); | 7403 Element* divFullscreen = document->getElementById("div1"); |
| 7403 Fullscreen::requestFullscreen(*divFullscreen, Fullscreen::PrefixedRequest); | 7404 Fullscreen::requestFullscreen(*divFullscreen, Fullscreen::PrefixedRequest); |
| 7404 webViewImpl->didEnterFullscreen(); | 7405 webViewImpl->didEnterFullscreen(); |
| 7405 webViewImpl->updateAllLifecyclePhases(); | 7406 webViewImpl->updateAllLifecyclePhases(); |
| 7406 EXPECT_EQ(Fullscreen::currentFullScreenElementFrom(*document), divFullscreen); | 7407 EXPECT_EQ(Fullscreen::currentFullScreenElementFrom(*document), divFullscreen); |
| 7407 | 7408 |
| 7408 // Verify that the element is sized to the viewport. | 7409 // Verify that the element is sized to the viewport. |
| 7409 LayoutFullScreen* fullscreenLayoutObject = | 7410 LayoutFullScreen* fullscreenLayoutObject = |
| 7410 Fullscreen::from(*document).fullScreenLayoutObject(); | 7411 Fullscreen::from(*document).fullScreenLayoutObject(); |
| 7411 EXPECT_EQ(viewportWidth, fullscreenLayoutObject->logicalWidth().toInt()); | 7412 EXPECT_EQ(viewportWidth, fullscreenLayoutObject->logicalWidth().toInt()); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 7426 FrameTestHelpers::WebViewHelper webViewHelper; | 7427 FrameTestHelpers::WebViewHelper webViewHelper; |
| 7427 int viewportWidth = 640; | 7428 int viewportWidth = 640; |
| 7428 int viewportHeight = 480; | 7429 int viewportHeight = 480; |
| 7429 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad( | 7430 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad( |
| 7430 m_baseURL + "fullscreen_div.html", true, nullptr, &client, nullptr, | 7431 m_baseURL + "fullscreen_div.html", true, nullptr, &client, nullptr, |
| 7431 configureAndroid); | 7432 configureAndroid); |
| 7432 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); | 7433 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); |
| 7433 webViewImpl->updateAllLifecyclePhases(); | 7434 webViewImpl->updateAllLifecyclePhases(); |
| 7434 | 7435 |
| 7435 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); | 7436 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); |
| 7436 UserGestureIndicator gesture(UserGestureToken::create()); | 7437 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); |
| 7437 Element* divFullscreen = document->getElementById("div1"); | 7438 Element* divFullscreen = document->getElementById("div1"); |
| 7438 Fullscreen::requestFullscreen(*divFullscreen, Fullscreen::PrefixedRequest); | 7439 Fullscreen::requestFullscreen(*divFullscreen, Fullscreen::PrefixedRequest); |
| 7439 webViewImpl->didEnterFullscreen(); | 7440 webViewImpl->didEnterFullscreen(); |
| 7440 webViewImpl->updateAllLifecyclePhases(); | 7441 webViewImpl->updateAllLifecyclePhases(); |
| 7441 | 7442 |
| 7442 // Verify that the viewports are nonscrollable. | 7443 // Verify that the viewports are nonscrollable. |
| 7443 EXPECT_EQ(Fullscreen::currentFullScreenElementFrom(*document), divFullscreen); | 7444 EXPECT_EQ(Fullscreen::currentFullScreenElementFrom(*document), divFullscreen); |
| 7444 FrameView* frameView = webViewHelper.webView()->mainFrameImpl()->frameView(); | 7445 FrameView* frameView = webViewHelper.webView()->mainFrameImpl()->frameView(); |
| 7445 WebLayer* layoutViewportScrollLayer = | 7446 WebLayer* layoutViewportScrollLayer = |
| 7446 webViewImpl->compositor()->scrollLayer()->platformLayer(); | 7447 webViewImpl->compositor()->scrollLayer()->platformLayer(); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 7470 FrameTestHelpers::WebViewHelper webViewHelper; | 7471 FrameTestHelpers::WebViewHelper webViewHelper; |
| 7471 int viewportWidth = 640; | 7472 int viewportWidth = 640; |
| 7472 int viewportHeight = 480; | 7473 int viewportHeight = 480; |
| 7473 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad( | 7474 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad( |
| 7474 m_baseURL + "fullscreen_div.html", true, nullptr, &client, nullptr, | 7475 m_baseURL + "fullscreen_div.html", true, nullptr, &client, nullptr, |
| 7475 configureAndroid); | 7476 configureAndroid); |
| 7476 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); | 7477 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); |
| 7477 webViewImpl->updateAllLifecyclePhases(); | 7478 webViewImpl->updateAllLifecyclePhases(); |
| 7478 | 7479 |
| 7479 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); | 7480 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); |
| 7480 UserGestureIndicator gesture(UserGestureToken::create()); | 7481 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); |
| 7481 Fullscreen::requestFullscreen(*document->documentElement(), | 7482 Fullscreen::requestFullscreen(*document->documentElement(), |
| 7482 Fullscreen::PrefixedRequest); | 7483 Fullscreen::PrefixedRequest); |
| 7483 webViewImpl->didEnterFullscreen(); | 7484 webViewImpl->didEnterFullscreen(); |
| 7484 webViewImpl->updateAllLifecyclePhases(); | 7485 webViewImpl->updateAllLifecyclePhases(); |
| 7485 | 7486 |
| 7486 // Verify that the main frame is still scrollable. | 7487 // Verify that the main frame is still scrollable. |
| 7487 EXPECT_EQ(Fullscreen::currentFullScreenElementFrom(*document), | 7488 EXPECT_EQ(Fullscreen::currentFullScreenElementFrom(*document), |
| 7488 document->documentElement()); | 7489 document->documentElement()); |
| 7489 WebLayer* webScrollLayer = | 7490 WebLayer* webScrollLayer = |
| 7490 webViewImpl->compositor()->scrollLayer()->platformLayer(); | 7491 webViewImpl->compositor()->scrollLayer()->platformLayer(); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 7511 int viewportHeight = 480; | 7512 int viewportHeight = 480; |
| 7512 client.m_screenInfo.rect.width = viewportWidth; | 7513 client.m_screenInfo.rect.width = viewportWidth; |
| 7513 client.m_screenInfo.rect.height = viewportHeight; | 7514 client.m_screenInfo.rect.height = viewportHeight; |
| 7514 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); | 7515 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); |
| 7515 webViewImpl->updateAllLifecyclePhases(); | 7516 webViewImpl->updateAllLifecyclePhases(); |
| 7516 | 7517 |
| 7517 Document* document = | 7518 Document* document = |
| 7518 toWebLocalFrameImpl(webViewHelper.webView()->mainFrame()->firstChild()) | 7519 toWebLocalFrameImpl(webViewHelper.webView()->mainFrame()->firstChild()) |
| 7519 ->frame() | 7520 ->frame() |
| 7520 ->document(); | 7521 ->document(); |
| 7521 UserGestureIndicator gesture(UserGestureToken::create()); | 7522 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); |
| 7522 Element* divFullscreen = document->getElementById("div1"); | 7523 Element* divFullscreen = document->getElementById("div1"); |
| 7523 Fullscreen::requestFullscreen(*divFullscreen, Fullscreen::PrefixedRequest); | 7524 Fullscreen::requestFullscreen(*divFullscreen, Fullscreen::PrefixedRequest); |
| 7524 webViewImpl->didEnterFullscreen(); | 7525 webViewImpl->didEnterFullscreen(); |
| 7525 webViewImpl->updateAllLifecyclePhases(); | 7526 webViewImpl->updateAllLifecyclePhases(); |
| 7526 | 7527 |
| 7527 // Verify that the element is sized to the viewport. | 7528 // Verify that the element is sized to the viewport. |
| 7528 LayoutFullScreen* fullscreenLayoutObject = | 7529 LayoutFullScreen* fullscreenLayoutObject = |
| 7529 Fullscreen::from(*document).fullScreenLayoutObject(); | 7530 Fullscreen::from(*document).fullScreenLayoutObject(); |
| 7530 EXPECT_EQ(viewportWidth, fullscreenLayoutObject->logicalWidth().toInt()); | 7531 EXPECT_EQ(viewportWidth, fullscreenLayoutObject->logicalWidth().toInt()); |
| 7531 EXPECT_EQ(viewportHeight, fullscreenLayoutObject->logicalHeight().toInt()); | 7532 EXPECT_EQ(viewportHeight, fullscreenLayoutObject->logicalHeight().toInt()); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 7555 | 7556 |
| 7556 LayoutViewItem layoutViewItem = | 7557 LayoutViewItem layoutViewItem = |
| 7557 webViewHelper.webView()->mainFrameImpl()->frameView()->layoutViewItem(); | 7558 webViewHelper.webView()->mainFrameImpl()->frameView()->layoutViewItem(); |
| 7558 EXPECT_EQ(320, layoutViewItem.logicalWidth().floor()); | 7559 EXPECT_EQ(320, layoutViewItem.logicalWidth().floor()); |
| 7559 EXPECT_EQ(533, layoutViewItem.logicalHeight().floor()); | 7560 EXPECT_EQ(533, layoutViewItem.logicalHeight().floor()); |
| 7560 EXPECT_FLOAT_EQ(1.2, webViewImpl->pageScaleFactor()); | 7561 EXPECT_FLOAT_EQ(1.2, webViewImpl->pageScaleFactor()); |
| 7561 EXPECT_FLOAT_EQ(1.2, webViewImpl->minimumPageScaleFactor()); | 7562 EXPECT_FLOAT_EQ(1.2, webViewImpl->minimumPageScaleFactor()); |
| 7562 EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor()); | 7563 EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor()); |
| 7563 | 7564 |
| 7564 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); | 7565 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); |
| 7565 UserGestureIndicator gesture(UserGestureToken::create()); | 7566 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); |
| 7566 Fullscreen::requestFullscreen(*document->documentElement(), | 7567 Fullscreen::requestFullscreen(*document->documentElement(), |
| 7567 Fullscreen::PrefixedRequest); | 7568 Fullscreen::PrefixedRequest); |
| 7568 webViewImpl->didEnterFullscreen(); | 7569 webViewImpl->didEnterFullscreen(); |
| 7569 webViewImpl->updateAllLifecyclePhases(); | 7570 webViewImpl->updateAllLifecyclePhases(); |
| 7570 EXPECT_EQ(384, layoutViewItem.logicalWidth().floor()); | 7571 EXPECT_EQ(384, layoutViewItem.logicalWidth().floor()); |
| 7571 EXPECT_EQ(640, layoutViewItem.logicalHeight().floor()); | 7572 EXPECT_EQ(640, layoutViewItem.logicalHeight().floor()); |
| 7572 EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor()); | 7573 EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor()); |
| 7573 EXPECT_FLOAT_EQ(1.0, webViewImpl->minimumPageScaleFactor()); | 7574 EXPECT_FLOAT_EQ(1.0, webViewImpl->minimumPageScaleFactor()); |
| 7574 EXPECT_FLOAT_EQ(1.0, webViewImpl->maximumPageScaleFactor()); | 7575 EXPECT_FLOAT_EQ(1.0, webViewImpl->maximumPageScaleFactor()); |
| 7575 | 7576 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 7592 int viewportWidth = 384; | 7593 int viewportWidth = 384; |
| 7593 int viewportHeight = 640; | 7594 int viewportHeight = 640; |
| 7594 client.m_screenInfo.rect.width = viewportWidth; | 7595 client.m_screenInfo.rect.width = viewportWidth; |
| 7595 client.m_screenInfo.rect.height = viewportHeight; | 7596 client.m_screenInfo.rect.height = viewportHeight; |
| 7596 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); | 7597 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); |
| 7597 webViewImpl->updateAllLifecyclePhases(); | 7598 webViewImpl->updateAllLifecyclePhases(); |
| 7598 | 7599 |
| 7599 LayoutViewItem layoutViewItem = | 7600 LayoutViewItem layoutViewItem = |
| 7600 webViewHelper.webView()->mainFrameImpl()->frameView()->layoutViewItem(); | 7601 webViewHelper.webView()->mainFrameImpl()->frameView()->layoutViewItem(); |
| 7601 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); | 7602 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); |
| 7602 UserGestureIndicator gesture(UserGestureToken::create()); | 7603 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); |
| 7603 Fullscreen::requestFullscreen(*document->documentElement(), | 7604 Fullscreen::requestFullscreen(*document->documentElement(), |
| 7604 Fullscreen::PrefixedRequest); | 7605 Fullscreen::PrefixedRequest); |
| 7605 webViewImpl->didEnterFullscreen(); | 7606 webViewImpl->didEnterFullscreen(); |
| 7606 webViewImpl->updateAllLifecyclePhases(); | 7607 webViewImpl->updateAllLifecyclePhases(); |
| 7607 EXPECT_EQ(384, layoutViewItem.logicalWidth().floor()); | 7608 EXPECT_EQ(384, layoutViewItem.logicalWidth().floor()); |
| 7608 EXPECT_EQ(640, layoutViewItem.logicalHeight().floor()); | 7609 EXPECT_EQ(640, layoutViewItem.logicalHeight().floor()); |
| 7609 EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor()); | 7610 EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor()); |
| 7610 EXPECT_FLOAT_EQ(1.0, webViewImpl->minimumPageScaleFactor()); | 7611 EXPECT_FLOAT_EQ(1.0, webViewImpl->minimumPageScaleFactor()); |
| 7611 EXPECT_FLOAT_EQ(1.0, webViewImpl->maximumPageScaleFactor()); | 7612 EXPECT_FLOAT_EQ(1.0, webViewImpl->maximumPageScaleFactor()); |
| 7612 | 7613 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7654 EXPECT_EQ(screenSizeMinusStatusBarsMinusUrlBar.width, | 7655 EXPECT_EQ(screenSizeMinusStatusBarsMinusUrlBar.width, |
| 7655 layoutViewItem.logicalWidth().floor()); | 7656 layoutViewItem.logicalWidth().floor()); |
| 7656 EXPECT_EQ(screenSizeMinusStatusBarsMinusUrlBar.height, | 7657 EXPECT_EQ(screenSizeMinusStatusBarsMinusUrlBar.height, |
| 7657 layoutViewItem.logicalHeight().floor()); | 7658 layoutViewItem.logicalHeight().floor()); |
| 7658 EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor()); | 7659 EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor()); |
| 7659 EXPECT_FLOAT_EQ(1.0, webViewImpl->minimumPageScaleFactor()); | 7660 EXPECT_FLOAT_EQ(1.0, webViewImpl->minimumPageScaleFactor()); |
| 7660 EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor()); | 7661 EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor()); |
| 7661 | 7662 |
| 7662 { | 7663 { |
| 7663 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); | 7664 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); |
| 7664 UserGestureIndicator gesture(UserGestureToken::create()); | 7665 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); |
| 7665 Fullscreen::requestFullscreen(*document->body(), | 7666 Fullscreen::requestFullscreen(*document->body(), |
| 7666 Fullscreen::PrefixedRequest); | 7667 Fullscreen::PrefixedRequest); |
| 7667 } | 7668 } |
| 7668 | 7669 |
| 7669 webViewImpl->didEnterFullscreen(); | 7670 webViewImpl->didEnterFullscreen(); |
| 7670 webViewImpl->updateAllLifecyclePhases(); | 7671 webViewImpl->updateAllLifecyclePhases(); |
| 7671 client.m_screenInfo.rect.width = screenSizeMinusStatusBars.width; | 7672 client.m_screenInfo.rect.width = screenSizeMinusStatusBars.width; |
| 7672 client.m_screenInfo.rect.height = screenSizeMinusStatusBars.height; | 7673 client.m_screenInfo.rect.height = screenSizeMinusStatusBars.height; |
| 7673 webViewHelper.resize(screenSizeMinusStatusBars); | 7674 webViewHelper.resize(screenSizeMinusStatusBars); |
| 7674 client.m_screenInfo.rect.width = screenSize.width; | 7675 client.m_screenInfo.rect.width = screenSize.width; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7716 LayoutViewItem layoutViewItem = | 7717 LayoutViewItem layoutViewItem = |
| 7717 webViewImpl->mainFrameImpl()->frameView()->layoutViewItem(); | 7718 webViewImpl->mainFrameImpl()->frameView()->layoutViewItem(); |
| 7718 EXPECT_EQ(320, layoutViewItem.logicalWidth().floor()); | 7719 EXPECT_EQ(320, layoutViewItem.logicalWidth().floor()); |
| 7719 EXPECT_EQ(640, layoutViewItem.logicalHeight().floor()); | 7720 EXPECT_EQ(640, layoutViewItem.logicalHeight().floor()); |
| 7720 EXPECT_FLOAT_EQ(0.3125, webViewImpl->pageScaleFactor()); | 7721 EXPECT_FLOAT_EQ(0.3125, webViewImpl->pageScaleFactor()); |
| 7721 EXPECT_FLOAT_EQ(0.3125, webViewImpl->minimumPageScaleFactor()); | 7722 EXPECT_FLOAT_EQ(0.3125, webViewImpl->minimumPageScaleFactor()); |
| 7722 EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor()); | 7723 EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor()); |
| 7723 | 7724 |
| 7724 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); | 7725 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); |
| 7725 UserGestureIndicator gesture( | 7726 UserGestureIndicator gesture( |
| 7726 UserGestureToken::create(UserGestureToken::NewGesture)); | 7727 DocumentUserGestureToken::create(document, UserGestureToken::NewGesture)); |
| 7727 Fullscreen::requestFullscreen(*document->documentElement(), | 7728 Fullscreen::requestFullscreen(*document->documentElement(), |
| 7728 Fullscreen::PrefixedRequest); | 7729 Fullscreen::PrefixedRequest); |
| 7729 webViewImpl->didEnterFullscreen(); | 7730 webViewImpl->didEnterFullscreen(); |
| 7730 webViewImpl->updateAllLifecyclePhases(); | 7731 webViewImpl->updateAllLifecyclePhases(); |
| 7731 | 7732 |
| 7732 // Entering fullscreen causes layout size and page scale limits to be | 7733 // Entering fullscreen causes layout size and page scale limits to be |
| 7733 // overridden. | 7734 // overridden. |
| 7734 EXPECT_EQ(100, layoutViewItem.logicalWidth().floor()); | 7735 EXPECT_EQ(100, layoutViewItem.logicalWidth().floor()); |
| 7735 EXPECT_EQ(200, layoutViewItem.logicalHeight().floor()); | 7736 EXPECT_EQ(200, layoutViewItem.logicalHeight().floor()); |
| 7736 EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor()); | 7737 EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor()); |
| (...skipping 2460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10197 webViewHelper.webView()->handleInputEvent(endEvent); | 10198 webViewHelper.webView()->handleInputEvent(endEvent); |
| 10198 webViewHelper.webView()->handleInputEvent(updateEvent); | 10199 webViewHelper.webView()->handleInputEvent(updateEvent); |
| 10199 | 10200 |
| 10200 // Try a full Begin/Update/End cycle. | 10201 // Try a full Begin/Update/End cycle. |
| 10201 webViewHelper.webView()->handleInputEvent(beginEvent); | 10202 webViewHelper.webView()->handleInputEvent(beginEvent); |
| 10202 webViewHelper.webView()->handleInputEvent(updateEvent); | 10203 webViewHelper.webView()->handleInputEvent(updateEvent); |
| 10203 webViewHelper.webView()->handleInputEvent(endEvent); | 10204 webViewHelper.webView()->handleInputEvent(endEvent); |
| 10204 } | 10205 } |
| 10205 | 10206 |
| 10206 } // namespace blink | 10207 } // namespace blink |
| OLD | NEW |