| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All |
| 7 * rights reserved. | 7 * rights reserved. |
| 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
| 9 * (http://www.torchmobile.com/) | 9 * (http://www.torchmobile.com/) |
| 10 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 10 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 #include "core/html/HTMLIFrameElement.h" | 43 #include "core/html/HTMLIFrameElement.h" |
| 44 #include "core/input/EventHandler.h" | 44 #include "core/input/EventHandler.h" |
| 45 #include "core/inspector/ConsoleMessage.h" | 45 #include "core/inspector/ConsoleMessage.h" |
| 46 #include "core/layout/LayoutBlockFlow.h" | 46 #include "core/layout/LayoutBlockFlow.h" |
| 47 #include "core/layout/LayoutFullScreen.h" | 47 #include "core/layout/LayoutFullScreen.h" |
| 48 #include "core/layout/api/LayoutFullScreenItem.h" | 48 #include "core/layout/api/LayoutFullScreenItem.h" |
| 49 #include "core/page/ChromeClient.h" | 49 #include "core/page/ChromeClient.h" |
| 50 #include "core/svg/SVGSVGElement.h" | 50 #include "core/svg/SVGSVGElement.h" |
| 51 #include "platform/ScopedOrientationChangeIndicator.h" | 51 #include "platform/ScopedOrientationChangeIndicator.h" |
| 52 #include "platform/UserGestureIndicator.h" | 52 #include "platform/UserGestureIndicator.h" |
| 53 #include "public/platform/Platform.h" |
| 53 | 54 |
| 54 namespace blink { | 55 namespace blink { |
| 55 | 56 |
| 56 namespace { | 57 namespace { |
| 57 | 58 |
| 58 // https://html.spec.whatwg.org/multipage/embedded-content.html#allowed-to-use | 59 // https://html.spec.whatwg.org/multipage/embedded-content.html#allowed-to-use |
| 59 bool allowedToUseFullscreen(const Frame* frame) { | 60 bool allowedToUseFullscreen(const Frame* frame) { |
| 60 // To determine whether a Document object |document| is allowed to use the | 61 // To determine whether a Document object |document| is allowed to use the |
| 61 // feature indicated by attribute name |allowattribute|, run these steps: | 62 // feature indicated by attribute name |allowattribute|, run these steps: |
| 62 | 63 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 79 | 80 |
| 80 // 4. Return false. | 81 // 4. Return false. |
| 81 return false; | 82 return false; |
| 82 } | 83 } |
| 83 | 84 |
| 84 // If Feature Policy is enabled, then we need this hack to support it, until | 85 // If Feature Policy is enabled, then we need this hack to support it, until |
| 85 // we have proper support for <iframe allowfullscreen> in FP: | 86 // we have proper support for <iframe allowfullscreen> in FP: |
| 86 | 87 |
| 87 // 1. If FP, by itself, enables fullscreen in this document, then fullscreen | 88 // 1. If FP, by itself, enables fullscreen in this document, then fullscreen |
| 88 // is allowed. | 89 // is allowed. |
| 89 if (frame->securityContext()->getFeaturePolicy()->isFeatureEnabled( | 90 if (isFeatureEnabledInFrame(WebFeaturePolicyFeature::Fullscreen, frame)) { |
| 90 kFullscreenFeature)) { | |
| 91 return true; | 91 return true; |
| 92 } | 92 } |
| 93 | 93 |
| 94 // 2. Otherwise, if the embedding frame's document is allowed to use | 94 // 2. Otherwise, if the embedding frame's document is allowed to use |
| 95 // fullscreen (either through FP or otherwise), and either: | 95 // fullscreen (either through FP or otherwise), and either: |
| 96 // a) this is a same-origin embedded document, or | 96 // a) this is a same-origin embedded document, or |
| 97 // b) this document's iframe has the allowfullscreen attribute set, | 97 // b) this document's iframe has the allowfullscreen attribute set, |
| 98 // then fullscreen is allowed. | 98 // then fullscreen is allowed. |
| 99 if (!frame->isMainFrame()) { | 99 if (!frame->isMainFrame()) { |
| 100 if (allowedToUseFullscreen(frame->tree().parent())) { | 100 if (allowedToUseFullscreen(frame->tree().parent())) { |
| (...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 867 DEFINE_TRACE(Fullscreen) { | 867 DEFINE_TRACE(Fullscreen) { |
| 868 visitor->trace(m_pendingFullscreenElement); | 868 visitor->trace(m_pendingFullscreenElement); |
| 869 visitor->trace(m_fullscreenElementStack); | 869 visitor->trace(m_fullscreenElementStack); |
| 870 visitor->trace(m_currentFullScreenElement); | 870 visitor->trace(m_currentFullScreenElement); |
| 871 visitor->trace(m_eventQueue); | 871 visitor->trace(m_eventQueue); |
| 872 Supplement<Document>::trace(visitor); | 872 Supplement<Document>::trace(visitor); |
| 873 ContextLifecycleObserver::trace(visitor); | 873 ContextLifecycleObserver::trace(visitor); |
| 874 } | 874 } |
| 875 | 875 |
| 876 } // namespace blink | 876 } // namespace blink |
| OLD | NEW |