| 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 r
ights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r
ights reserved. |
| 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
| 8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
| 9 * Copyright (C) 2013 Google Inc. All rights reserved. | 9 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 10 * | 10 * |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 #if !ENABLE(OILPAN) | 138 #if !ENABLE(OILPAN) |
| 139 void FullscreenElementStack::documentWasDisposed() | 139 void FullscreenElementStack::documentWasDisposed() |
| 140 { | 140 { |
| 141 // NOTE: the context dispose phase is not supported in oilpan. Please | 141 // NOTE: the context dispose phase is not supported in oilpan. Please |
| 142 // consider using the detach phase instead. | 142 // consider using the detach phase instead. |
| 143 m_fullScreenElement = nullptr; | 143 m_fullScreenElement = nullptr; |
| 144 m_fullScreenElementStack.clear(); | 144 m_fullScreenElementStack.clear(); |
| 145 } | 145 } |
| 146 #endif | 146 #endif |
| 147 | 147 |
| 148 void FullscreenElementStack::requestFullScreenForElement(Element& element, unsig
ned short flags, FullScreenCheckType checkType) | 148 void FullscreenElementStack::requestFullScreenForElement(Element& element, Reque
stType requestType) |
| 149 { | 149 { |
| 150 // Ignore this request if the document is not in a live frame. | 150 // Ignore this request if the document is not in a live frame. |
| 151 if (!document()->isActive()) | 151 if (!document()->isActive()) |
| 152 return; | 152 return; |
| 153 | 153 |
| 154 // The Mozilla Full Screen API <https://wiki.mozilla.org/Gecko:FullScreenAPI
> has different requirements | 154 // The Mozilla Full Screen API <https://wiki.mozilla.org/Gecko:FullScreenAPI
> has different requirements |
| 155 // for full screen mode, and do not have the concept of a full screen elemen
t stack. | 155 // for full screen mode, and do not have the concept of a full screen elemen
t stack. |
| 156 bool inLegacyMozillaMode = (flags & Element::LEGACY_MOZILLA_REQUEST); | 156 bool inLegacyMozillaMode = requestType == PrefixedMozillaRequest || requestT
ype == PrefixedMozillaAllowKeyboardInputRequest; |
| 157 | 157 |
| 158 do { | 158 do { |
| 159 // 1. If any of the following conditions are true, terminate these steps
and queue a task to fire | 159 // 1. If any of the following conditions are true, terminate these steps
and queue a task to fire |
| 160 // an event named fullscreenerror with its bubbles attribute set to true
on the context object's | 160 // an event named fullscreenerror with its bubbles attribute set to true
on the context object's |
| 161 // node document: | 161 // node document: |
| 162 | 162 |
| 163 // The context object is not in a document. | 163 // The context object is not in a document. |
| 164 if (!element.inDocument()) | 164 if (!element.inDocument()) |
| 165 break; | 165 break; |
| 166 | 166 |
| 167 // The context object's node document, or an ancestor browsing context's
document does not have | 167 // The context object's node document, or an ancestor browsing context's
document does not have |
| 168 // the fullscreen enabled flag set. | 168 // the fullscreen enabled flag set. |
| 169 if (checkType == EnforceIFrameAllowFullScreenRequirement && !fullscreenI
sAllowedForAllOwners(element.document())) | 169 if (requestType != PrefixedVideoRequest && !fullscreenIsAllowedForAllOwn
ers(element.document())) |
| 170 break; | 170 break; |
| 171 | 171 |
| 172 // The context object's node document fullscreen element stack is not em
pty and its top element | 172 // The context object's node document fullscreen element stack is not em
pty and its top element |
| 173 // is not an ancestor of the context object. (NOTE: Ignore this requirem
ent if the request was | 173 // is not an ancestor of the context object. (NOTE: Ignore this requirem
ent if the request was |
| 174 // made via the legacy Mozilla-style API.) | 174 // made via the legacy Mozilla-style API.) |
| 175 if (!m_fullScreenElementStack.isEmpty() && !inLegacyMozillaMode) { | 175 if (!m_fullScreenElementStack.isEmpty() && !inLegacyMozillaMode) { |
| 176 Element* lastElementOnStack = m_fullScreenElementStack.last().get(); | 176 Element* lastElementOnStack = m_fullScreenElementStack.last().get(); |
| 177 if (lastElementOnStack == &element || !lastElementOnStack->contains(
&element)) | 177 if (lastElementOnStack == &element || !lastElementOnStack->contains(
&element)) |
| 178 break; | 178 break; |
| 179 } | 179 } |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 from(*currentDoc).pushFullscreenElementStack(*followingDoc->owne
rElement()); | 242 from(*currentDoc).pushFullscreenElementStack(*followingDoc->owne
rElement()); |
| 243 addDocumentToFullScreenChangeEventQueue(*currentDoc); | 243 addDocumentToFullScreenChangeEventQueue(*currentDoc); |
| 244 continue; | 244 continue; |
| 245 } | 245 } |
| 246 | 246 |
| 247 // 4. Otherwise, do nothing for this document. It stays the same. | 247 // 4. Otherwise, do nothing for this document. It stays the same. |
| 248 } while (++current != docs.end()); | 248 } while (++current != docs.end()); |
| 249 | 249 |
| 250 // 5. Return, and run the remaining steps asynchronously. | 250 // 5. Return, and run the remaining steps asynchronously. |
| 251 // 6. Optionally, perform some animation. | 251 // 6. Optionally, perform some animation. |
| 252 m_areKeysEnabledInFullScreen = flags & Element::ALLOW_KEYBOARD_INPUT; | 252 m_areKeysEnabledInFullScreen = requestType != PrefixedMozillaRequest &&
requestType != PrefixedVideoRequest; |
| 253 document()->frameHost()->chrome().client().enterFullScreenForElement(&el
ement); | 253 document()->frameHost()->chrome().client().enterFullScreenForElement(&el
ement); |
| 254 | 254 |
| 255 // 7. Optionally, display a message indicating how the user can exit dis
playing the context object fullscreen. | 255 // 7. Optionally, display a message indicating how the user can exit dis
playing the context object fullscreen. |
| 256 return; | 256 return; |
| 257 } while (0); | 257 } while (0); |
| 258 | 258 |
| 259 m_fullScreenErrorEventTargetQueue.append(&element); | 259 m_fullScreenErrorEventTargetQueue.append(&element); |
| 260 m_fullScreenChangeDelayTimer.startOneShot(0, FROM_HERE); | 260 m_fullScreenChangeDelayTimer.startOneShot(0, FROM_HERE); |
| 261 } | 261 } |
| 262 | 262 |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 void FullscreenElementStack::trace(Visitor* visitor) | 581 void FullscreenElementStack::trace(Visitor* visitor) |
| 582 { | 582 { |
| 583 visitor->trace(m_fullScreenElement); | 583 visitor->trace(m_fullScreenElement); |
| 584 visitor->trace(m_fullScreenElementStack); | 584 visitor->trace(m_fullScreenElementStack); |
| 585 visitor->trace(m_fullScreenChangeEventTargetQueue); | 585 visitor->trace(m_fullScreenChangeEventTargetQueue); |
| 586 visitor->trace(m_fullScreenErrorEventTargetQueue); | 586 visitor->trace(m_fullScreenErrorEventTargetQueue); |
| 587 DocumentSupplement::trace(visitor); | 587 DocumentSupplement::trace(visitor); |
| 588 } | 588 } |
| 589 | 589 |
| 590 } // namespace WebCore | 590 } // namespace WebCore |
| OLD | NEW |