| 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 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 | 433 |
| 434 // FIXME: This should not call updateStyleIfNeeded. | 434 // FIXME: This should not call updateStyleIfNeeded. |
| 435 document()->setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTrac
ing::create(StyleChangeReason::FullScreen)); | 435 document()->setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTrac
ing::create(StyleChangeReason::FullScreen)); |
| 436 document()->updateLayoutTreeIfNeeded(); | 436 document()->updateLayoutTreeIfNeeded(); |
| 437 | 437 |
| 438 m_fullScreenElement->didBecomeFullscreenElement(); | 438 m_fullScreenElement->didBecomeFullscreenElement(); |
| 439 | 439 |
| 440 if (document()->frame()) | 440 if (document()->frame()) |
| 441 document()->frame()->eventHandler().scheduleHoverStateUpdate(); | 441 document()->frame()->eventHandler().scheduleHoverStateUpdate(); |
| 442 | 442 |
| 443 m_eventQueueTimer.startOneShot(0, FROM_HERE); | 443 m_eventQueueTimer.startOneShot(0, BLINK_FROM_HERE); |
| 444 } | 444 } |
| 445 | 445 |
| 446 void Fullscreen::didExitFullScreenForElement(Element*) | 446 void Fullscreen::didExitFullScreenForElement(Element*) |
| 447 { | 447 { |
| 448 if (!m_fullScreenElement) | 448 if (!m_fullScreenElement) |
| 449 return; | 449 return; |
| 450 | 450 |
| 451 if (!document()->isActive()) | 451 if (!document()->isActive()) |
| 452 return; | 452 return; |
| 453 | 453 |
| 454 document()->removeFromTopLayer(m_fullScreenElement.get()); | 454 document()->removeFromTopLayer(m_fullScreenElement.get()); |
| 455 m_fullScreenElement->willStopBeingFullscreenElement(); | 455 m_fullScreenElement->willStopBeingFullscreenElement(); |
| 456 | 456 |
| 457 m_fullScreenElement->setContainsFullScreenElementOnAncestorsCrossingFrameBou
ndaries(false); | 457 m_fullScreenElement->setContainsFullScreenElementOnAncestorsCrossingFrameBou
ndaries(false); |
| 458 | 458 |
| 459 m_fullScreenElement = nullptr; | 459 m_fullScreenElement = nullptr; |
| 460 document()->setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTrac
ing::create(StyleChangeReason::FullScreen)); | 460 document()->setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTrac
ing::create(StyleChangeReason::FullScreen)); |
| 461 | 461 |
| 462 if (document()->frame()) | 462 if (document()->frame()) |
| 463 document()->frame()->eventHandler().scheduleHoverStateUpdate(); | 463 document()->frame()->eventHandler().scheduleHoverStateUpdate(); |
| 464 | 464 |
| 465 // When fullyExitFullscreen is called, we call exitFullscreen on the topDocu
ment(). That means | 465 // When fullyExitFullscreen is called, we call exitFullscreen on the topDocu
ment(). That means |
| 466 // that the events will be queued there. So if we have no events here, start
the timer on the | 466 // that the events will be queued there. So if we have no events here, start
the timer on the |
| 467 // exiting document. | 467 // exiting document. |
| 468 Document* exitingDocument = document(); | 468 Document* exitingDocument = document(); |
| 469 if (m_eventQueue.isEmpty()) | 469 if (m_eventQueue.isEmpty()) |
| 470 exitingDocument = &document()->topDocument(); | 470 exitingDocument = &document()->topDocument(); |
| 471 ASSERT(exitingDocument); | 471 ASSERT(exitingDocument); |
| 472 from(*exitingDocument).m_eventQueueTimer.startOneShot(0, FROM_HERE); | 472 from(*exitingDocument).m_eventQueueTimer.startOneShot(0, BLINK_FROM_HERE); |
| 473 } | 473 } |
| 474 | 474 |
| 475 void Fullscreen::didUpdateSize(Element& element) | 475 void Fullscreen::didUpdateSize(Element& element) |
| 476 { | 476 { |
| 477 // StyleAdjuster will set the size so we need to do a style recalc. | 477 // StyleAdjuster will set the size so we need to do a style recalc. |
| 478 // Normally changing size means layout so just doing a style recalc is a | 478 // Normally changing size means layout so just doing a style recalc is a |
| 479 // bit surprising. | 479 // bit surprising. |
| 480 element.setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::c
reate(StyleChangeReason::FullScreen)); | 480 element.setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::c
reate(StyleChangeReason::FullScreen)); |
| 481 } | 481 } |
| 482 | 482 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 500 } | 500 } |
| 501 | 501 |
| 502 void Fullscreen::enqueueErrorEvent(Element& element, RequestType requestType) | 502 void Fullscreen::enqueueErrorEvent(Element& element, RequestType requestType) |
| 503 { | 503 { |
| 504 RefPtrWillBeRawPtr<Event> event; | 504 RefPtrWillBeRawPtr<Event> event; |
| 505 if (requestType == UnprefixedRequest) | 505 if (requestType == UnprefixedRequest) |
| 506 event = createEvent(EventTypeNames::fullscreenerror, element.document())
; | 506 event = createEvent(EventTypeNames::fullscreenerror, element.document())
; |
| 507 else | 507 else |
| 508 event = createEvent(EventTypeNames::webkitfullscreenerror, element); | 508 event = createEvent(EventTypeNames::webkitfullscreenerror, element); |
| 509 m_eventQueue.append(event); | 509 m_eventQueue.append(event); |
| 510 m_eventQueueTimer.startOneShot(0, FROM_HERE); | 510 m_eventQueueTimer.startOneShot(0, BLINK_FROM_HERE); |
| 511 } | 511 } |
| 512 | 512 |
| 513 void Fullscreen::eventQueueTimerFired(Timer<Fullscreen>*) | 513 void Fullscreen::eventQueueTimerFired(Timer<Fullscreen>*) |
| 514 { | 514 { |
| 515 // Since we dispatch events in this function, it's possible that the | 515 // Since we dispatch events in this function, it's possible that the |
| 516 // document will be detached and GC'd. We protect it here to make sure we | 516 // document will be detached and GC'd. We protect it here to make sure we |
| 517 // can finish the function successfully. | 517 // can finish the function successfully. |
| 518 RefPtrWillBeRawPtr<Document> protectDocument(document()); | 518 RefPtrWillBeRawPtr<Document> protectDocument(document()); |
| 519 WillBeHeapDeque<RefPtrWillBeMember<Event>> eventQueue; | 519 WillBeHeapDeque<RefPtrWillBeMember<Event>> eventQueue; |
| 520 m_eventQueue.swap(eventQueue); | 520 m_eventQueue.swap(eventQueue); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 #if ENABLE(OILPAN) | 581 #if ENABLE(OILPAN) |
| 582 visitor->trace(m_fullScreenElement); | 582 visitor->trace(m_fullScreenElement); |
| 583 visitor->trace(m_fullScreenElementStack); | 583 visitor->trace(m_fullScreenElementStack); |
| 584 visitor->trace(m_eventQueue); | 584 visitor->trace(m_eventQueue); |
| 585 #endif | 585 #endif |
| 586 WillBeHeapSupplement<Document>::trace(visitor); | 586 WillBeHeapSupplement<Document>::trace(visitor); |
| 587 DocumentLifecycleObserver::trace(visitor); | 587 DocumentLifecycleObserver::trace(visitor); |
| 588 } | 588 } |
| 589 | 589 |
| 590 } // namespace blink | 590 } // namespace blink |
| OLD | NEW |