| 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 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 | 476 |
| 477 bool Fullscreen::fullscreenEnabled(Document& document) | 477 bool Fullscreen::fullscreenEnabled(Document& document) |
| 478 { | 478 { |
| 479 // 4. The fullscreenEnabled attribute must return true if the context object
has its | 479 // 4. The fullscreenEnabled attribute must return true if the context object
has its |
| 480 // fullscreen enabled flag set and fullscreen is supported, and false oth
erwise. | 480 // fullscreen enabled flag set and fullscreen is supported, and false oth
erwise. |
| 481 | 481 |
| 482 // Top-level browsing contexts are implied to have their allowFullScreen att
ribute set. | 482 // Top-level browsing contexts are implied to have their allowFullScreen att
ribute set. |
| 483 return fullscreenIsAllowedForAllOwners(document) && fullscreenIsSupported(do
cument); | 483 return fullscreenIsAllowedForAllOwners(document) && fullscreenIsSupported(do
cument); |
| 484 } | 484 } |
| 485 | 485 |
| 486 void Fullscreen::didEnterFullScreenForElement(Element* element) | 486 void Fullscreen::didEnterFullscreenForElement(Element* element) |
| 487 { | 487 { |
| 488 DCHECK(element); | 488 DCHECK(element); |
| 489 if (!document()->isActive()) | 489 if (!document()->isActive()) |
| 490 return; | 490 return; |
| 491 | 491 |
| 492 if (m_fullScreenLayoutObject) | 492 if (m_fullScreenLayoutObject) |
| 493 m_fullScreenLayoutObject->unwrapLayoutObject(); | 493 m_fullScreenLayoutObject->unwrapLayoutObject(); |
| 494 | 494 |
| 495 m_fullScreenElement = element; | 495 m_fullScreenElement = element; |
| 496 | 496 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 526 document()->updateStyleAndLayoutTree(); | 526 document()->updateStyleAndLayoutTree(); |
| 527 | 527 |
| 528 m_fullScreenElement->didBecomeFullscreenElement(); | 528 m_fullScreenElement->didBecomeFullscreenElement(); |
| 529 | 529 |
| 530 if (document()->frame()) | 530 if (document()->frame()) |
| 531 document()->frame()->eventHandler().scheduleHoverStateUpdate(); | 531 document()->frame()->eventHandler().scheduleHoverStateUpdate(); |
| 532 | 532 |
| 533 m_eventQueueTimer.startOneShot(0, BLINK_FROM_HERE); | 533 m_eventQueueTimer.startOneShot(0, BLINK_FROM_HERE); |
| 534 } | 534 } |
| 535 | 535 |
| 536 void Fullscreen::didExitFullScreenForElement() | 536 void Fullscreen::didExitFullscreen() |
| 537 { | 537 { |
| 538 if (!m_fullScreenElement) | 538 if (!m_fullScreenElement) |
| 539 return; | 539 return; |
| 540 | 540 |
| 541 if (!document()->isActive()) | 541 if (!document()->isActive()) |
| 542 return; | 542 return; |
| 543 | 543 |
| 544 m_fullScreenElement->willStopBeingFullscreenElement(); | 544 m_fullScreenElement->willStopBeingFullscreenElement(); |
| 545 | 545 |
| 546 if (m_forCrossProcessAncestor) | 546 if (m_forCrossProcessAncestor) |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 603 DCHECK(document.hasFullscreenSupplement()); | 603 DCHECK(document.hasFullscreenSupplement()); |
| 604 Fullscreen& fullscreen = from(document); | 604 Fullscreen& fullscreen = from(document); |
| 605 EventTarget* target = fullscreen.fullscreenElement(); | 605 EventTarget* target = fullscreen.fullscreenElement(); |
| 606 if (!target) | 606 if (!target) |
| 607 target = fullscreen.webkitCurrentFullScreenElement(); | 607 target = fullscreen.webkitCurrentFullScreenElement(); |
| 608 if (!target) | 608 if (!target) |
| 609 target = &document; | 609 target = &document; |
| 610 event = createEvent(EventTypeNames::webkitfullscreenchange, *target); | 610 event = createEvent(EventTypeNames::webkitfullscreenchange, *target); |
| 611 } | 611 } |
| 612 m_eventQueue.append(event); | 612 m_eventQueue.append(event); |
| 613 // NOTE: The timer is started in didEnterFullScreenForElement/didExitFullScr
eenForElement. | 613 // NOTE: The timer is started in didEnterFullscreenForElement/didExitFullscr
een. |
| 614 } | 614 } |
| 615 | 615 |
| 616 void Fullscreen::enqueueErrorEvent(Element& element, RequestType requestType) | 616 void Fullscreen::enqueueErrorEvent(Element& element, RequestType requestType) |
| 617 { | 617 { |
| 618 Event* event; | 618 Event* event; |
| 619 if (requestType == UnprefixedRequest) | 619 if (requestType == UnprefixedRequest) |
| 620 event = createEvent(EventTypeNames::fullscreenerror, element.document())
; | 620 event = createEvent(EventTypeNames::fullscreenerror, element.document())
; |
| 621 else | 621 else |
| 622 event = createEvent(EventTypeNames::webkitfullscreenerror, element); | 622 event = createEvent(EventTypeNames::webkitfullscreenerror, element); |
| 623 m_eventQueue.append(event); | 623 m_eventQueue.append(event); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 687 DEFINE_TRACE(Fullscreen) | 687 DEFINE_TRACE(Fullscreen) |
| 688 { | 688 { |
| 689 visitor->trace(m_fullScreenElement); | 689 visitor->trace(m_fullScreenElement); |
| 690 visitor->trace(m_fullScreenElementStack); | 690 visitor->trace(m_fullScreenElementStack); |
| 691 visitor->trace(m_eventQueue); | 691 visitor->trace(m_eventQueue); |
| 692 Supplement<Document>::trace(visitor); | 692 Supplement<Document>::trace(visitor); |
| 693 ContextLifecycleObserver::trace(visitor); | 693 ContextLifecycleObserver::trace(visitor); |
| 694 } | 694 } |
| 695 | 695 |
| 696 } // namespace blink | 696 } // namespace blink |
| OLD | NEW |