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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 // is not an ancestor of the context object. (NOTE: Ignore this requirem
ent if the request was | 182 // is not an ancestor of the context object. (NOTE: Ignore this requirem
ent if the request was |
183 // made via the legacy Mozilla-style API.) | 183 // made via the legacy Mozilla-style API.) |
184 if (!m_fullScreenElementStack.isEmpty() && !inLegacyMozillaMode) { | 184 if (!m_fullScreenElementStack.isEmpty() && !inLegacyMozillaMode) { |
185 Element* lastElementOnStack = m_fullScreenElementStack.last().get(); | 185 Element* lastElementOnStack = m_fullScreenElementStack.last().get(); |
186 if (lastElementOnStack == element || !lastElementOnStack->contains(e
lement)) | 186 if (lastElementOnStack == element || !lastElementOnStack->contains(e
lement)) |
187 break; | 187 break; |
188 } | 188 } |
189 | 189 |
190 // A descendant browsing context's document has a non-empty fullscreen e
lement stack. | 190 // A descendant browsing context's document has a non-empty fullscreen e
lement stack. |
191 bool descendentHasNonEmptyStack = false; | 191 bool descendentHasNonEmptyStack = false; |
192 for (LocalFrame* descendant = document()->frame() ? document()->frame()-
>tree().traverseNext() : 0; descendant; descendant = descendant->tree().traverse
Next()) { | 192 for (Frame* descendant = document()->frame() ? document()->frame()->tree
().traverseNext() : 0; descendant; descendant = descendant->tree().traverseNext(
)) { |
193 ASSERT(descendant->document()); | 193 if (!descendant->isLocalFrame()) |
194 if (fullscreenElementFrom(*descendant->document())) { | 194 continue; |
| 195 ASSERT(toLocalFrame(descendant)->document()); |
| 196 if (fullscreenElementFrom(*toLocalFrame(descendant)->document())) { |
195 descendentHasNonEmptyStack = true; | 197 descendentHasNonEmptyStack = true; |
196 break; | 198 break; |
197 } | 199 } |
198 } | 200 } |
199 if (descendentHasNonEmptyStack && !inLegacyMozillaMode) | 201 if (descendentHasNonEmptyStack && !inLegacyMozillaMode) |
200 break; | 202 break; |
201 | 203 |
202 // This algorithm is not allowed to show a pop-up: | 204 // This algorithm is not allowed to show a pop-up: |
203 // An algorithm is allowed to show a pop-up if, in the task in which t
he algorithm is running, either: | 205 // An algorithm is allowed to show a pop-up if, in the task in which t
he algorithm is running, either: |
204 // - an activation behavior is currently being processed whose click e
vent was trusted, or | 206 // - an activation behavior is currently being processed whose click e
vent was trusted, or |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 return; | 297 return; |
296 | 298 |
297 // 2. If doc's fullscreen element stack is empty, terminate these steps. | 299 // 2. If doc's fullscreen element stack is empty, terminate these steps. |
298 if (m_fullScreenElementStack.isEmpty()) | 300 if (m_fullScreenElementStack.isEmpty()) |
299 return; | 301 return; |
300 | 302 |
301 // 3. Let descendants be all the doc's descendant browsing context's documen
ts with a non-empty fullscreen | 303 // 3. Let descendants be all the doc's descendant browsing context's documen
ts with a non-empty fullscreen |
302 // element stack (if any), ordered so that the child of the doc is last and
the document furthest | 304 // element stack (if any), ordered so that the child of the doc is last and
the document furthest |
303 // away from the doc is first. | 305 // away from the doc is first. |
304 WillBeHeapDeque<RefPtrWillBeMember<Document> > descendants; | 306 WillBeHeapDeque<RefPtrWillBeMember<Document> > descendants; |
305 for (LocalFrame* descendant = document()->frame() ? document()->frame()->tr
ee().traverseNext() : 0; descendant; descendant = descendant->tree().traverseNex
t()) { | 307 for (Frame* descendant = document()->frame() ? document()->frame()->tree().t
raverseNext() : 0; descendant; descendant = descendant->tree().traverseNext()) { |
306 ASSERT(descendant->document()); | 308 if (!descendant->isLocalFrame()) |
307 if (fullscreenElementFrom(*descendant->document())) | 309 continue; |
308 descendants.prepend(descendant->document()); | 310 ASSERT(toLocalFrame(descendant)->document()); |
| 311 if (fullscreenElementFrom(*toLocalFrame(descendant)->document())) |
| 312 descendants.prepend(toLocalFrame(descendant)->document()); |
309 } | 313 } |
310 | 314 |
311 // 4. For each descendant in descendants, empty descendant's fullscreen elem
ent stack, and queue a | 315 // 4. For each descendant in descendants, empty descendant's fullscreen elem
ent stack, and queue a |
312 // task to fire an event named fullscreenchange with its bubbles attribute s
et to true on descendant. | 316 // task to fire an event named fullscreenchange with its bubbles attribute s
et to true on descendant. |
313 for (WillBeHeapDeque<RefPtrWillBeMember<Document> >::iterator i = descendant
s.begin(); i != descendants.end(); ++i) { | 317 for (WillBeHeapDeque<RefPtrWillBeMember<Document> >::iterator i = descendant
s.begin(); i != descendants.end(); ++i) { |
314 ASSERT(*i); | 318 ASSERT(*i); |
315 from(**i).clearFullscreenElementStack(); | 319 from(**i).clearFullscreenElementStack(); |
316 addDocumentToFullScreenChangeEventQueue(i->get()); | 320 addDocumentToFullScreenChangeEventQueue(i->get()); |
317 } | 321 } |
318 | 322 |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
588 void FullscreenElementStack::trace(Visitor* visitor) | 592 void FullscreenElementStack::trace(Visitor* visitor) |
589 { | 593 { |
590 visitor->trace(m_fullScreenElement); | 594 visitor->trace(m_fullScreenElement); |
591 visitor->trace(m_fullScreenElementStack); | 595 visitor->trace(m_fullScreenElementStack); |
592 visitor->trace(m_fullScreenChangeEventTargetQueue); | 596 visitor->trace(m_fullScreenChangeEventTargetQueue); |
593 visitor->trace(m_fullScreenErrorEventTargetQueue); | 597 visitor->trace(m_fullScreenErrorEventTargetQueue); |
594 DocumentSupplement::trace(visitor); | 598 DocumentSupplement::trace(visitor); |
595 } | 599 } |
596 | 600 |
597 } // namespace WebCore | 601 } // namespace WebCore |
OLD | NEW |