コード例 #1
0
static bool shouldAppendLayer(const PaintLayer& layer)
{
    Node* node = layer.layoutObject()->node();
    if (node && isHTMLVideoElement(*node)) {
        HTMLVideoElement* element = toHTMLVideoElement(node);
        if (element->isFullscreen() && element->usesOverlayFullscreenVideo())
            return false;
    }
    return true;
}
コード例 #2
0
void FullscreenController::didEnterFullScreen()
{
    if (!m_provisionalFullScreenElement)
        return;

    RefPtrWillBeRawPtr<Element> element = m_provisionalFullScreenElement.release();
    Document& document = element->document();
    m_fullScreenFrame = document.frame();

    if (!m_fullScreenFrame)
        return;

    if (!m_exitFullscreenPageScaleFactor) {
        m_exitFullscreenPageScaleFactor = m_webViewImpl->pageScaleFactor();
        m_exitFullscreenScrollOffset = m_webViewImpl->mainFrame()->scrollOffset();
        m_exitFullscreenVisualViewportOffset = m_webViewImpl->visualViewportOffset();

        updatePageScaleConstraints(false);
        m_webViewImpl->setPageScaleFactor(1.0f);
        m_webViewImpl->mainFrame()->setScrollOffset(WebSize());
        m_webViewImpl->setVisualViewportOffset(FloatPoint());
    }

    Fullscreen::from(document).didEnterFullScreenForElement(element.get());
    ASSERT(Fullscreen::currentFullScreenElementFrom(document) == element);

    if (isHTMLVideoElement(element)) {
        HTMLVideoElement* videoElement = toHTMLVideoElement(element);
        if (videoElement->usesOverlayFullscreenVideo()) {
            if (videoElement->webMediaPlayer()
                // FIXME: There is no embedder-side handling in layout test mode.
                && !LayoutTestSupport::isRunningLayoutTest()) {
                videoElement->webMediaPlayer()->enterFullscreen();
            }
            if (m_webViewImpl->layerTreeView())
                m_webViewImpl->layerTreeView()->setHasTransparentBackground(true);
        }
    }
}