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 13 matching lines...) Expand all Loading... |
24 * Boston, MA 02110-1301, USA. | 24 * Boston, MA 02110-1301, USA. |
25 * | 25 * |
26 */ | 26 */ |
27 | 27 |
28 #include "core/dom/Fullscreen.h" | 28 #include "core/dom/Fullscreen.h" |
29 | 29 |
30 #include "core/HTMLNames.h" | 30 #include "core/HTMLNames.h" |
31 #include "core/dom/Document.h" | 31 #include "core/dom/Document.h" |
32 #include "core/dom/ElementTraversal.h" | 32 #include "core/dom/ElementTraversal.h" |
33 #include "core/dom/StyleChangeReason.h" | 33 #include "core/dom/StyleChangeReason.h" |
| 34 #include "core/dom/StyleEngine.h" |
34 #include "core/events/Event.h" | 35 #include "core/events/Event.h" |
35 #include "core/frame/FrameHost.h" | 36 #include "core/frame/FrameHost.h" |
36 #include "core/frame/LocalFrame.h" | 37 #include "core/frame/LocalFrame.h" |
37 #include "core/frame/OriginsUsingFeatures.h" | 38 #include "core/frame/OriginsUsingFeatures.h" |
38 #include "core/frame/Settings.h" | 39 #include "core/frame/Settings.h" |
39 #include "core/frame/UseCounter.h" | 40 #include "core/frame/UseCounter.h" |
40 #include "core/html/HTMLIFrameElement.h" | 41 #include "core/html/HTMLIFrameElement.h" |
41 #include "core/html/HTMLMediaElement.h" | 42 #include "core/html/HTMLMediaElement.h" |
42 #include "core/input/EventHandler.h" | 43 #include "core/input/EventHandler.h" |
43 #include "core/inspector/ConsoleMessage.h" | 44 #include "core/inspector/ConsoleMessage.h" |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 if (shouldCreatePlaceholder) { | 440 if (shouldCreatePlaceholder) { |
440 m_savedPlaceholderFrameRect = toLayoutBox(layoutObject)->frameRect(); | 441 m_savedPlaceholderFrameRect = toLayoutBox(layoutObject)->frameRect(); |
441 m_savedPlaceholderComputedStyle = ComputedStyle::clone(layoutObject->sty
leRef()); | 442 m_savedPlaceholderComputedStyle = ComputedStyle::clone(layoutObject->sty
leRef()); |
442 } | 443 } |
443 | 444 |
444 if (m_fullScreenElement != document()->documentElement()) | 445 if (m_fullScreenElement != document()->documentElement()) |
445 LayoutFullScreen::wrapLayoutObject(layoutObject, layoutObject ? layoutOb
ject->parent() : 0, document()); | 446 LayoutFullScreen::wrapLayoutObject(layoutObject, layoutObject ? layoutOb
ject->parent() : 0, document()); |
446 | 447 |
447 m_fullScreenElement->setContainsFullScreenElementOnAncestorsCrossingFrameBou
ndaries(true); | 448 m_fullScreenElement->setContainsFullScreenElementOnAncestorsCrossingFrameBou
ndaries(true); |
448 | 449 |
449 // FIXME: This should not call updateStyleIfNeeded. | 450 document()->styleEngine().ensureFullscreenUAStyle(); |
450 document()->setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTrac
ing::create(StyleChangeReason::FullScreen)); | 451 m_fullScreenElement->pseudoStateChanged(CSSSelector::PseudoFullScreen); |
| 452 |
| 453 // FIXME: This should not call updateLayoutTree. |
451 document()->updateLayoutTree(); | 454 document()->updateLayoutTree(); |
452 | 455 |
453 m_fullScreenElement->didBecomeFullscreenElement(); | 456 m_fullScreenElement->didBecomeFullscreenElement(); |
454 | 457 |
455 if (document()->frame()) | 458 if (document()->frame()) |
456 document()->frame()->eventHandler().scheduleHoverStateUpdate(); | 459 document()->frame()->eventHandler().scheduleHoverStateUpdate(); |
457 | 460 |
458 m_eventQueueTimer.startOneShot(0, BLINK_FROM_HERE); | 461 m_eventQueueTimer.startOneShot(0, BLINK_FROM_HERE); |
459 } | 462 } |
460 | 463 |
461 void Fullscreen::didExitFullScreenForElement(Element*) | 464 void Fullscreen::didExitFullScreenForElement(Element*) |
462 { | 465 { |
463 if (!m_fullScreenElement) | 466 if (!m_fullScreenElement) |
464 return; | 467 return; |
465 | 468 |
466 if (!document()->isActive()) | 469 if (!document()->isActive()) |
467 return; | 470 return; |
468 | 471 |
469 m_fullScreenElement->willStopBeingFullscreenElement(); | 472 m_fullScreenElement->willStopBeingFullscreenElement(); |
470 | 473 |
471 m_fullScreenElement->setContainsFullScreenElementOnAncestorsCrossingFrameBou
ndaries(false); | 474 m_fullScreenElement->setContainsFullScreenElementOnAncestorsCrossingFrameBou
ndaries(false); |
472 | 475 |
473 if (m_fullScreenLayoutObject) | 476 if (m_fullScreenLayoutObject) |
474 LayoutFullScreenItem(m_fullScreenLayoutObject).unwrapLayoutObject(); | 477 LayoutFullScreenItem(m_fullScreenLayoutObject).unwrapLayoutObject(); |
475 | 478 |
| 479 m_fullScreenElement->pseudoStateChanged(CSSSelector::PseudoFullScreen); |
476 m_fullScreenElement = nullptr; | 480 m_fullScreenElement = nullptr; |
477 document()->setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTrac
ing::create(StyleChangeReason::FullScreen)); | |
478 | 481 |
479 if (document()->frame()) | 482 if (document()->frame()) |
480 document()->frame()->eventHandler().scheduleHoverStateUpdate(); | 483 document()->frame()->eventHandler().scheduleHoverStateUpdate(); |
481 | 484 |
482 // When fullyExitFullscreen is called, we call exitFullscreen on the topDocu
ment(). That means | 485 // When fullyExitFullscreen is called, we call exitFullscreen on the topDocu
ment(). That means |
483 // that the events will be queued there. So if we have no events here, start
the timer on the | 486 // that the events will be queued there. So if we have no events here, start
the timer on the |
484 // exiting document. | 487 // exiting document. |
485 Document* exitingDocument = document(); | 488 Document* exitingDocument = document(); |
486 if (m_eventQueue.isEmpty()) | 489 if (m_eventQueue.isEmpty()) |
487 exitingDocument = &document()->topDocument(); | 490 exitingDocument = &document()->topDocument(); |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 #if ENABLE(OILPAN) | 615 #if ENABLE(OILPAN) |
613 visitor->trace(m_fullScreenElement); | 616 visitor->trace(m_fullScreenElement); |
614 visitor->trace(m_fullScreenElementStack); | 617 visitor->trace(m_fullScreenElementStack); |
615 visitor->trace(m_eventQueue); | 618 visitor->trace(m_eventQueue); |
616 #endif | 619 #endif |
617 WillBeHeapSupplement<Document>::trace(visitor); | 620 WillBeHeapSupplement<Document>::trace(visitor); |
618 DocumentLifecycleObserver::trace(visitor); | 621 DocumentLifecycleObserver::trace(visitor); |
619 } | 622 } |
620 | 623 |
621 } // namespace blink | 624 } // namespace blink |
OLD | NEW |