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/input/EventHandler.h" | 43 #include "core/input/EventHandler.h" |
44 #include "core/inspector/ConsoleMessage.h" | 44 #include "core/inspector/ConsoleMessage.h" |
45 #include "core/layout/LayoutBlockFlow.h" | 45 #include "core/layout/LayoutBlockFlow.h" |
46 #include "core/layout/LayoutFullScreen.h" | 46 #include "core/layout/LayoutFullScreen.h" |
47 #include "core/layout/api/LayoutFullScreenItem.h" | 47 #include "core/layout/api/LayoutFullScreenItem.h" |
48 #include "core/page/ChromeClient.h" | 48 #include "core/page/ChromeClient.h" |
49 #include "core/svg/SVGSVGElement.h" | 49 #include "core/svg/SVGSVGElement.h" |
50 #include "platform/ScopedOrientationChangeIndicator.h" | 50 #include "platform/ScopedOrientationChangeIndicator.h" |
51 #include "platform/UserGestureIndicator.h" | 51 #include "platform/UserGestureIndicator.h" |
52 | 52 |
| 53 #include "public/platform/Platform.h" |
| 54 |
53 namespace blink { | 55 namespace blink { |
54 | 56 |
55 namespace { | 57 namespace { |
56 | 58 |
57 // 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 |
58 bool allowedToUseFullscreen(const Frame* frame) { | 60 bool allowedToUseFullscreen(const Frame* frame) { |
59 // 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 |
60 // feature indicated by attribute name |allowattribute|, run these steps: | 62 // feature indicated by attribute name |allowattribute|, run these steps: |
61 | 63 |
62 // 1. If |document| has no browsing context, then return false. | 64 // 1. If |document| has no browsing context, then return false. |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 if (!RuntimeEnabledFeatures::featurePolicyEnabled()) { | 121 if (!RuntimeEnabledFeatures::featurePolicyEnabled()) { |
120 return fullscreenSupported; | 122 return fullscreenSupported; |
121 } | 123 } |
122 | 124 |
123 // TODO(lunalu): clean all of this up once iframe attributes are supported | 125 // TODO(lunalu): clean all of this up once iframe attributes are supported |
124 // for feature policy. | 126 // for feature policy. |
125 if (Frame* parent = frame->tree().parent()) { | 127 if (Frame* parent = frame->tree().parent()) { |
126 // If FeaturePolicy is enabled, check the fullscreen is not disabled by | 128 // If FeaturePolicy is enabled, check the fullscreen is not disabled by |
127 // policy in the parent frame. | 129 // policy in the parent frame. |
128 if (fullscreenSupported && | 130 if (fullscreenSupported && |
129 parent->securityContext()->getFeaturePolicy()->isFeatureEnabled( | 131 Platform::current()->isFeatureEnabledByPolicy( |
130 kFullscreenFeature)) { | 132 parent->securityContext()->getFeaturePolicy(), |
| 133 WebFeaturePolicyFeature::Fullscreen, |
| 134 WebSecurityOrigin(frame->securityContext()->getSecurityOrigin()))) { |
131 return true; | 135 return true; |
132 } | 136 } |
133 } | 137 } |
134 // Even if the iframe allowfullscreen attribute is not present, allow | 138 // Even if the iframe allowfullscreen attribute is not present, allow |
135 // fullscreen to be enabled by feature policy. | 139 // fullscreen to be enabled by feature policy. |
136 else if (isFeatureEnabledInFrame(kFullscreenFeature, frame)) { | 140 else if (isFeatureEnabledInFrame(WebFeaturePolicyFeature::Fullscreen, |
| 141 frame)) { |
137 return true; | 142 return true; |
138 } | 143 } |
139 | 144 |
140 document.addConsoleMessage(ConsoleMessage::create( | 145 document.addConsoleMessage(ConsoleMessage::create( |
141 JSMessageSource, WarningMessageLevel, | 146 JSMessageSource, WarningMessageLevel, |
142 "Fullscreen API is disabled by feature policy for this frame")); | 147 "Fullscreen API is disabled by feature policy for this frame")); |
143 return false; | 148 return false; |
144 } | 149 } |
145 | 150 |
146 // https://fullscreen.spec.whatwg.org/#fullscreen-element-ready-check | 151 // https://fullscreen.spec.whatwg.org/#fullscreen-element-ready-check |
(...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
912 } | 917 } |
913 | 918 |
914 DEFINE_TRACE(Fullscreen) { | 919 DEFINE_TRACE(Fullscreen) { |
915 visitor->trace(m_pendingRequests); | 920 visitor->trace(m_pendingRequests); |
916 visitor->trace(m_fullscreenElementStack); | 921 visitor->trace(m_fullscreenElementStack); |
917 Supplement<Document>::trace(visitor); | 922 Supplement<Document>::trace(visitor); |
918 ContextLifecycleObserver::trace(visitor); | 923 ContextLifecycleObserver::trace(visitor); |
919 } | 924 } |
920 | 925 |
921 } // namespace blink | 926 } // namespace blink |
OLD | NEW |