| 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 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 if (!currentDoc->isActive()) | 322 if (!currentDoc->isActive()) |
| 323 return; | 323 return; |
| 324 | 324 |
| 325 // 2. If doc's fullscreen element stack is empty, terminate these steps. | 325 // 2. If doc's fullscreen element stack is empty, terminate these steps. |
| 326 if (m_fullScreenElementStack.isEmpty()) | 326 if (m_fullScreenElementStack.isEmpty()) |
| 327 return; | 327 return; |
| 328 | 328 |
| 329 // 3. Let descendants be all the doc's descendant browsing context's documen
ts with a non-empty fullscreen | 329 // 3. Let descendants be all the doc's descendant browsing context's documen
ts with a non-empty fullscreen |
| 330 // element stack (if any), ordered so that the child of the doc is last and
the document furthest | 330 // element stack (if any), ordered so that the child of the doc is last and
the document furthest |
| 331 // away from the doc is first. | 331 // away from the doc is first. |
| 332 WillBeHeapDeque<RefPtrWillBeMember<Document> > descendants; | 332 WillBeHeapDeque<RefPtrWillBeMember<Document>> descendants; |
| 333 for (Frame* descendant = document()->frame() ? document()->frame()->tree().t
raverseNext() : 0; descendant; descendant = descendant->tree().traverseNext()) { | 333 for (Frame* descendant = document()->frame() ? document()->frame()->tree().t
raverseNext() : 0; descendant; descendant = descendant->tree().traverseNext()) { |
| 334 if (!descendant->isLocalFrame()) | 334 if (!descendant->isLocalFrame()) |
| 335 continue; | 335 continue; |
| 336 ASSERT(toLocalFrame(descendant)->document()); | 336 ASSERT(toLocalFrame(descendant)->document()); |
| 337 if (fullscreenElementFrom(*toLocalFrame(descendant)->document())) | 337 if (fullscreenElementFrom(*toLocalFrame(descendant)->document())) |
| 338 descendants.prepend(toLocalFrame(descendant)->document()); | 338 descendants.prepend(toLocalFrame(descendant)->document()); |
| 339 } | 339 } |
| 340 | 340 |
| 341 // 4. For each descendant in descendants, empty descendant's fullscreen elem
ent stack, and queue a | 341 // 4. For each descendant in descendants, empty descendant's fullscreen elem
ent stack, and queue a |
| 342 // task to fire an event named fullscreenchange with its bubbles attribute s
et to true on descendant. | 342 // task to fire an event named fullscreenchange with its bubbles attribute s
et to true on descendant. |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 m_eventQueue.append(event); | 537 m_eventQueue.append(event); |
| 538 m_eventQueueTimer.startOneShot(0, FROM_HERE); | 538 m_eventQueueTimer.startOneShot(0, FROM_HERE); |
| 539 } | 539 } |
| 540 | 540 |
| 541 void Fullscreen::eventQueueTimerFired(Timer<Fullscreen>*) | 541 void Fullscreen::eventQueueTimerFired(Timer<Fullscreen>*) |
| 542 { | 542 { |
| 543 // Since we dispatch events in this function, it's possible that the | 543 // Since we dispatch events in this function, it's possible that the |
| 544 // document will be detached and GC'd. We protect it here to make sure we | 544 // document will be detached and GC'd. We protect it here to make sure we |
| 545 // can finish the function successfully. | 545 // can finish the function successfully. |
| 546 RefPtrWillBeRawPtr<Document> protectDocument(document()); | 546 RefPtrWillBeRawPtr<Document> protectDocument(document()); |
| 547 WillBeHeapDeque<RefPtrWillBeMember<Event> > eventQueue; | 547 WillBeHeapDeque<RefPtrWillBeMember<Event>> eventQueue; |
| 548 m_eventQueue.swap(eventQueue); | 548 m_eventQueue.swap(eventQueue); |
| 549 | 549 |
| 550 while (!eventQueue.isEmpty()) { | 550 while (!eventQueue.isEmpty()) { |
| 551 RefPtrWillBeRawPtr<Event> event = eventQueue.takeFirst(); | 551 RefPtrWillBeRawPtr<Event> event = eventQueue.takeFirst(); |
| 552 Node* target = event->target()->toNode(); | 552 Node* target = event->target()->toNode(); |
| 553 | 553 |
| 554 // If the element was removed from our tree, also message the documentEl
ement. | 554 // If the element was removed from our tree, also message the documentEl
ement. |
| 555 if (!target->inDocument() && document()->documentElement()) { | 555 if (!target->inDocument() && document()->documentElement()) { |
| 556 ASSERT(isPrefixed(event->type())); | 556 ASSERT(isPrefixed(event->type())); |
| 557 eventQueue.append(createEvent(event->type(), *document()->documentEl
ement())); | 557 eventQueue.append(createEvent(event->type(), *document()->documentEl
ement())); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 605 DEFINE_TRACE(Fullscreen) | 605 DEFINE_TRACE(Fullscreen) |
| 606 { | 606 { |
| 607 visitor->trace(m_fullScreenElement); | 607 visitor->trace(m_fullScreenElement); |
| 608 visitor->trace(m_fullScreenElementStack); | 608 visitor->trace(m_fullScreenElementStack); |
| 609 visitor->trace(m_eventQueue); | 609 visitor->trace(m_eventQueue); |
| 610 DocumentSupplement::trace(visitor); | 610 DocumentSupplement::trace(visitor); |
| 611 DocumentLifecycleObserver::trace(visitor); | 611 DocumentLifecycleObserver::trace(visitor); |
| 612 } | 612 } |
| 613 | 613 |
| 614 } // namespace blink | 614 } // namespace blink |
| OLD | NEW |