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 21 matching lines...) Expand all Loading... |
32 #include "core/dom/Document.h" | 32 #include "core/dom/Document.h" |
33 #include "core/events/Event.h" | 33 #include "core/events/Event.h" |
34 #include "core/frame/FrameHost.h" | 34 #include "core/frame/FrameHost.h" |
35 #include "core/frame/LocalFrame.h" | 35 #include "core/frame/LocalFrame.h" |
36 #include "core/frame/Settings.h" | 36 #include "core/frame/Settings.h" |
37 #include "core/frame/UseCounter.h" | 37 #include "core/frame/UseCounter.h" |
38 #include "core/html/HTMLIFrameElement.h" | 38 #include "core/html/HTMLIFrameElement.h" |
39 #include "core/html/HTMLMediaElement.h" | 39 #include "core/html/HTMLMediaElement.h" |
40 #include "core/page/Chrome.h" | 40 #include "core/page/Chrome.h" |
41 #include "core/page/ChromeClient.h" | 41 #include "core/page/ChromeClient.h" |
| 42 #include "core/page/EventHandler.h" |
42 #include "core/rendering/RenderFullScreen.h" | 43 #include "core/rendering/RenderFullScreen.h" |
43 #include "platform/UserGestureIndicator.h" | 44 #include "platform/UserGestureIndicator.h" |
44 | 45 |
45 namespace blink { | 46 namespace blink { |
46 | 47 |
47 using namespace HTMLNames; | 48 using namespace HTMLNames; |
48 | 49 |
49 static bool fullscreenIsAllowedForAllOwners(const Document& document) | 50 static bool fullscreenIsAllowedForAllOwners(const Document& document) |
50 { | 51 { |
51 for (const Element* owner = document.ownerElement(); owner; owner = owner->d
ocument().ownerElement()) { | 52 for (const Element* owner = document.ownerElement(); owner; owner = owner->d
ocument().ownerElement()) { |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 RenderFullScreen::wrapRenderer(renderer, renderer ? renderer->parent() :
0, document()); | 436 RenderFullScreen::wrapRenderer(renderer, renderer ? renderer->parent() :
0, document()); |
436 | 437 |
437 m_fullScreenElement->setContainsFullScreenElementOnAncestorsCrossingFrameBou
ndaries(true); | 438 m_fullScreenElement->setContainsFullScreenElementOnAncestorsCrossingFrameBou
ndaries(true); |
438 | 439 |
439 // FIXME: This should not call updateStyleIfNeeded. | 440 // FIXME: This should not call updateStyleIfNeeded. |
440 document()->setNeedsStyleRecalc(SubtreeStyleChange); | 441 document()->setNeedsStyleRecalc(SubtreeStyleChange); |
441 document()->updateRenderTreeIfNeeded(); | 442 document()->updateRenderTreeIfNeeded(); |
442 | 443 |
443 m_fullScreenElement->didBecomeFullscreenElement(); | 444 m_fullScreenElement->didBecomeFullscreenElement(); |
444 | 445 |
| 446 if (document()->frame()) |
| 447 document()->frame()->eventHandler().scheduleHoverStateUpdate(); |
| 448 |
445 m_eventQueueTimer.startOneShot(0, FROM_HERE); | 449 m_eventQueueTimer.startOneShot(0, FROM_HERE); |
446 } | 450 } |
447 | 451 |
448 void Fullscreen::didExitFullScreenForElement(Element*) | 452 void Fullscreen::didExitFullScreenForElement(Element*) |
449 { | 453 { |
450 if (!m_fullScreenElement) | 454 if (!m_fullScreenElement) |
451 return; | 455 return; |
452 | 456 |
453 if (!document()->isActive()) | 457 if (!document()->isActive()) |
454 return; | 458 return; |
455 | 459 |
456 m_fullScreenElement->willStopBeingFullscreenElement(); | 460 m_fullScreenElement->willStopBeingFullscreenElement(); |
457 | 461 |
458 m_fullScreenElement->setContainsFullScreenElementOnAncestorsCrossingFrameBou
ndaries(false); | 462 m_fullScreenElement->setContainsFullScreenElementOnAncestorsCrossingFrameBou
ndaries(false); |
459 | 463 |
460 m_areKeysEnabledInFullScreen = false; | 464 m_areKeysEnabledInFullScreen = false; |
461 | 465 |
462 if (m_fullScreenRenderer) | 466 if (m_fullScreenRenderer) |
463 m_fullScreenRenderer->unwrapRenderer(); | 467 m_fullScreenRenderer->unwrapRenderer(); |
464 | 468 |
465 m_fullScreenElement = nullptr; | 469 m_fullScreenElement = nullptr; |
466 document()->setNeedsStyleRecalc(SubtreeStyleChange); | 470 document()->setNeedsStyleRecalc(SubtreeStyleChange); |
467 | 471 |
| 472 if (document()->frame()) |
| 473 document()->frame()->eventHandler().scheduleHoverStateUpdate(); |
| 474 |
468 // When fullyExitFullscreen is called, we call exitFullscreen on the topDocu
ment(). That means | 475 // When fullyExitFullscreen is called, we call exitFullscreen on the topDocu
ment(). That means |
469 // that the events will be queued there. So if we have no events here, start
the timer on the | 476 // that the events will be queued there. So if we have no events here, start
the timer on the |
470 // exiting document. | 477 // exiting document. |
471 Document* exitingDocument = document(); | 478 Document* exitingDocument = document(); |
472 if (m_eventQueue.isEmpty()) | 479 if (m_eventQueue.isEmpty()) |
473 exitingDocument = &document()->topDocument(); | 480 exitingDocument = &document()->topDocument(); |
474 ASSERT(exitingDocument); | 481 ASSERT(exitingDocument); |
475 from(*exitingDocument).m_eventQueueTimer.startOneShot(0, FROM_HERE); | 482 from(*exitingDocument).m_eventQueueTimer.startOneShot(0, FROM_HERE); |
476 } | 483 } |
477 | 484 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
596 void Fullscreen::trace(Visitor* visitor) | 603 void Fullscreen::trace(Visitor* visitor) |
597 { | 604 { |
598 visitor->trace(m_fullScreenElement); | 605 visitor->trace(m_fullScreenElement); |
599 visitor->trace(m_fullScreenElementStack); | 606 visitor->trace(m_fullScreenElementStack); |
600 visitor->trace(m_fullScreenRenderer); | 607 visitor->trace(m_fullScreenRenderer); |
601 visitor->trace(m_eventQueue); | 608 visitor->trace(m_eventQueue); |
602 DocumentSupplement::trace(visitor); | 609 DocumentSupplement::trace(visitor); |
603 } | 610 } |
604 | 611 |
605 } // namespace blink | 612 } // namespace blink |
OLD | NEW |