| 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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 // is not an ancestor of the context object. (NOTE: Ignore this requirem
ent if the request was | 164 // is not an ancestor of the context object. (NOTE: Ignore this requirem
ent if the request was |
| 165 // made via the legacy Mozilla-style API.) | 165 // made via the legacy Mozilla-style API.) |
| 166 if (!m_fullScreenElementStack.isEmpty() && !inLegacyMozillaMode) { | 166 if (!m_fullScreenElementStack.isEmpty() && !inLegacyMozillaMode) { |
| 167 Element* lastElementOnStack = m_fullScreenElementStack.last().get(); | 167 Element* lastElementOnStack = m_fullScreenElementStack.last().get(); |
| 168 if (lastElementOnStack == element || !lastElementOnStack->contains(e
lement)) | 168 if (lastElementOnStack == element || !lastElementOnStack->contains(e
lement)) |
| 169 break; | 169 break; |
| 170 } | 170 } |
| 171 | 171 |
| 172 // A descendant browsing context's document has a non-empty fullscreen e
lement stack. | 172 // A descendant browsing context's document has a non-empty fullscreen e
lement stack. |
| 173 bool descendentHasNonEmptyStack = false; | 173 bool descendentHasNonEmptyStack = false; |
| 174 for (Frame* descendant = document()->frame() ? document()->frame()->tree
()->traverseNext() : 0; descendant; descendant = descendant->tree()->traverseNex
t()) { | 174 for (Frame* descendant = document()->frame() ? document()->frame()->tree
().traverseNext() : 0; descendant; descendant = descendant->tree().traverseNext(
)) { |
| 175 if (fullscreenElementFrom(descendant->document())) { | 175 if (fullscreenElementFrom(descendant->document())) { |
| 176 descendentHasNonEmptyStack = true; | 176 descendentHasNonEmptyStack = true; |
| 177 break; | 177 break; |
| 178 } | 178 } |
| 179 } | 179 } |
| 180 if (descendentHasNonEmptyStack && !inLegacyMozillaMode) | 180 if (descendentHasNonEmptyStack && !inLegacyMozillaMode) |
| 181 break; | 181 break; |
| 182 | 182 |
| 183 // This algorithm is not allowed to show a pop-up: | 183 // This algorithm is not allowed to show a pop-up: |
| 184 // An algorithm is allowed to show a pop-up if, in the task in which t
he algorithm is running, either: | 184 // An algorithm is allowed to show a pop-up if, in the task in which t
he algorithm is running, either: |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 Document* currentDoc = document(); | 278 Document* currentDoc = document(); |
| 279 | 279 |
| 280 // 2. If doc's fullscreen element stack is empty, terminate these steps. | 280 // 2. If doc's fullscreen element stack is empty, terminate these steps. |
| 281 if (m_fullScreenElementStack.isEmpty()) | 281 if (m_fullScreenElementStack.isEmpty()) |
| 282 return; | 282 return; |
| 283 | 283 |
| 284 // 3. Let descendants be all the doc's descendant browsing context's documen
ts with a non-empty fullscreen | 284 // 3. Let descendants be all the doc's descendant browsing context's documen
ts with a non-empty fullscreen |
| 285 // element stack (if any), ordered so that the child of the doc is last and
the document furthest | 285 // element stack (if any), ordered so that the child of the doc is last and
the document furthest |
| 286 // away from the doc is first. | 286 // away from the doc is first. |
| 287 Deque<RefPtr<Document> > descendants; | 287 Deque<RefPtr<Document> > descendants; |
| 288 for (Frame* descendant = document()->frame() ? document()->frame()->tree()-
>traverseNext() : 0; descendant; descendant = descendant->tree()->traverseNext()
) { | 288 for (Frame* descendant = document()->frame() ? document()->frame()->tree().
traverseNext() : 0; descendant; descendant = descendant->tree().traverseNext())
{ |
| 289 if (fullscreenElementFrom(descendant->document())) | 289 if (fullscreenElementFrom(descendant->document())) |
| 290 descendants.prepend(descendant->document()); | 290 descendants.prepend(descendant->document()); |
| 291 } | 291 } |
| 292 | 292 |
| 293 // 4. For each descendant in descendants, empty descendant's fullscreen elem
ent stack, and queue a | 293 // 4. For each descendant in descendants, empty descendant's fullscreen elem
ent stack, and queue a |
| 294 // task to fire an event named fullscreenchange with its bubbles attribute s
et to true on descendant. | 294 // task to fire an event named fullscreenchange with its bubbles attribute s
et to true on descendant. |
| 295 for (Deque<RefPtr<Document> >::iterator i = descendants.begin(); i != descen
dants.end(); ++i) { | 295 for (Deque<RefPtr<Document> >::iterator i = descendants.begin(); i != descen
dants.end(); ++i) { |
| 296 from(i->get())->clearFullscreenElementStack(); | 296 from(i->get())->clearFullscreenElementStack(); |
| 297 addDocumentToFullScreenChangeEventQueue(i->get()); | 297 addDocumentToFullScreenChangeEventQueue(i->get()); |
| 298 } | 298 } |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 if (!target) | 556 if (!target) |
| 557 target = fullscreen->webkitCurrentFullScreenElement(); | 557 target = fullscreen->webkitCurrentFullScreenElement(); |
| 558 } | 558 } |
| 559 | 559 |
| 560 if (!target) | 560 if (!target) |
| 561 target = doc; | 561 target = doc; |
| 562 m_fullScreenChangeEventTargetQueue.append(target); | 562 m_fullScreenChangeEventTargetQueue.append(target); |
| 563 } | 563 } |
| 564 | 564 |
| 565 } // namespace WebCore | 565 } // namespace WebCore |
| OLD | NEW |