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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 #include "core/html/HTMLIFrameElement.h" | 42 #include "core/html/HTMLIFrameElement.h" |
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 #include "platform/feature_policy/FeaturePolicy.h" |
52 | 53 |
53 namespace blink { | 54 namespace blink { |
54 | 55 |
55 namespace { | 56 namespace { |
56 | 57 |
57 // https://html.spec.whatwg.org/multipage/embedded-content.html#allowed-to-use | 58 // https://html.spec.whatwg.org/multipage/embedded-content.html#allowed-to-use |
58 bool AllowedToUseFullscreen(const Frame* frame) { | 59 bool AllowedToUseFullscreen(const Frame* frame) { |
59 // To determine whether a Document object |document| is allowed to use the | 60 // To determine whether a Document object |document| is allowed to use the |
60 // feature indicated by attribute name |allowattribute|, run these steps: | 61 // feature indicated by attribute name |allowattribute|, run these steps: |
61 | 62 |
62 // 1. If |document| has no browsing context, then return false. | 63 // 1. If |document| has no browsing context, then return false. |
63 if (!frame) | 64 if (!frame) |
64 return false; | 65 return false; |
65 | 66 |
66 if (!RuntimeEnabledFeatures::featurePolicyEnabled()) { | 67 if (!IsSupportedInFeaturePolicy(WebFeaturePolicyFeature::kFullscreen)) { |
67 // 2. If |document|'s browsing context is a top-level browsing context, then | 68 // 2. If |document|'s browsing context is a top-level browsing context, then |
68 // return true. | 69 // return true. |
69 if (frame->IsMainFrame()) | 70 if (frame->IsMainFrame()) |
70 return true; | 71 return true; |
71 | 72 |
72 // 3. If |document|'s browsing context has a browsing context container that | 73 // 3. If |document|'s browsing context has a browsing context container that |
73 // is an iframe element with an |allowattribute| attribute specified, and | 74 // is an iframe element with an |allowattribute| attribute specified, and |
74 // whose node document is allowed to use the feature indicated by | 75 // whose node document is allowed to use the feature indicated by |
75 // |allowattribute|, then return true. | 76 // |allowattribute|, then return true. |
76 if (frame->Owner() && frame->Owner()->AllowFullscreen()) | 77 if (frame->Owner() && frame->Owner()->AllowFullscreen()) |
(...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
847 DEFINE_TRACE(Fullscreen) { | 848 DEFINE_TRACE(Fullscreen) { |
848 visitor->Trace(pending_fullscreen_element_); | 849 visitor->Trace(pending_fullscreen_element_); |
849 visitor->Trace(fullscreen_element_stack_); | 850 visitor->Trace(fullscreen_element_stack_); |
850 visitor->Trace(current_full_screen_element_); | 851 visitor->Trace(current_full_screen_element_); |
851 visitor->Trace(event_queue_); | 852 visitor->Trace(event_queue_); |
852 Supplement<Document>::Trace(visitor); | 853 Supplement<Document>::Trace(visitor); |
853 ContextLifecycleObserver::Trace(visitor); | 854 ContextLifecycleObserver::Trace(visitor); |
854 } | 855 } |
855 | 856 |
856 } // namespace blink | 857 } // namespace blink |
OLD | NEW |