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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 } | 79 } |
80 | 80 |
81 FullscreenElementStack* FullscreenElementStack::fromIfExistsSlow(Document& docum
ent) | 81 FullscreenElementStack* FullscreenElementStack::fromIfExistsSlow(Document& docum
ent) |
82 { | 82 { |
83 return static_cast<FullscreenElementStack*>(DocumentSupplement::from(documen
t, supplementName())); | 83 return static_cast<FullscreenElementStack*>(DocumentSupplement::from(documen
t, supplementName())); |
84 } | 84 } |
85 | 85 |
86 Element* FullscreenElementStack::fullscreenElementFrom(Document& document) | 86 Element* FullscreenElementStack::fullscreenElementFrom(Document& document) |
87 { | 87 { |
88 if (FullscreenElementStack* found = fromIfExists(document)) | 88 if (FullscreenElementStack* found = fromIfExists(document)) |
89 return found->webkitFullscreenElement(); | 89 return found->fullscreenElement(); |
90 return 0; | 90 return 0; |
91 } | 91 } |
92 | 92 |
93 Element* FullscreenElementStack::currentFullScreenElementFrom(Document& document
) | 93 Element* FullscreenElementStack::currentFullScreenElementFrom(Document& document
) |
94 { | 94 { |
95 if (FullscreenElementStack* found = fromIfExists(document)) | 95 if (FullscreenElementStack* found = fromIfExists(document)) |
96 return found->webkitCurrentFullScreenElement(); | 96 return found->webkitCurrentFullScreenElement(); |
97 return 0; | 97 return 0; |
98 } | 98 } |
99 | 99 |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 // full screen stack. | 359 // full screen stack. |
360 if (!newTop) { | 360 if (!newTop) { |
361 host->chrome().client().exitFullScreenForElement(m_fullScreenElement.get
()); | 361 host->chrome().client().exitFullScreenForElement(m_fullScreenElement.get
()); |
362 return; | 362 return; |
363 } | 363 } |
364 | 364 |
365 // Otherwise, notify the chrome of the new full screen element. | 365 // Otherwise, notify the chrome of the new full screen element. |
366 host->chrome().client().enterFullScreenForElement(newTop); | 366 host->chrome().client().enterFullScreenForElement(newTop); |
367 } | 367 } |
368 | 368 |
369 bool FullscreenElementStack::webkitFullscreenEnabled(Document& document) | 369 bool FullscreenElementStack::fullscreenEnabled(Document& document) |
370 { | 370 { |
371 // 4. The fullscreenEnabled attribute must return true if the context object
and all ancestor | 371 // 4. The fullscreenEnabled attribute must return true if the context object
and all ancestor |
372 // browsing context's documents have their fullscreen enabled flag set, or f
alse otherwise. | 372 // browsing context's documents have their fullscreen enabled flag set, or f
alse otherwise. |
373 | 373 |
374 // Top-level browsing contexts are implied to have their allowFullScreen att
ribute set. | 374 // Top-level browsing contexts are implied to have their allowFullScreen att
ribute set. |
375 return fullscreenIsAllowedForAllOwners(document); | 375 return fullscreenIsAllowedForAllOwners(document); |
376 } | 376 } |
377 | 377 |
378 void FullscreenElementStack::webkitWillEnterFullScreenForElement(Element* elemen
t) | 378 void FullscreenElementStack::willEnterFullScreenForElement(Element* element) |
379 { | 379 { |
380 ASSERT(element); | 380 ASSERT(element); |
381 if (!document()->isActive()) | 381 if (!document()->isActive()) |
382 return; | 382 return; |
383 | 383 |
384 if (m_fullScreenRenderer) | 384 if (m_fullScreenRenderer) |
385 m_fullScreenRenderer->unwrapRenderer(); | 385 m_fullScreenRenderer->unwrapRenderer(); |
386 | 386 |
387 m_fullScreenElement = element; | 387 m_fullScreenElement = element; |
388 | 388 |
(...skipping 11 matching lines...) Expand all Loading... |
400 if (m_fullScreenElement != document()->documentElement()) | 400 if (m_fullScreenElement != document()->documentElement()) |
401 RenderFullScreen::wrapRenderer(renderer, renderer ? renderer->parent() :
0, document()); | 401 RenderFullScreen::wrapRenderer(renderer, renderer ? renderer->parent() :
0, document()); |
402 | 402 |
403 m_fullScreenElement->setContainsFullScreenElementOnAncestorsCrossingFrameBou
ndaries(true); | 403 m_fullScreenElement->setContainsFullScreenElementOnAncestorsCrossingFrameBou
ndaries(true); |
404 | 404 |
405 // FIXME: This should not call updateStyleIfNeeded. | 405 // FIXME: This should not call updateStyleIfNeeded. |
406 document()->setNeedsStyleRecalc(SubtreeStyleChange); | 406 document()->setNeedsStyleRecalc(SubtreeStyleChange); |
407 document()->updateRenderTreeIfNeeded(); | 407 document()->updateRenderTreeIfNeeded(); |
408 } | 408 } |
409 | 409 |
410 void FullscreenElementStack::webkitDidEnterFullScreenForElement(Element*) | 410 void FullscreenElementStack::didEnterFullScreenForElement(Element*) |
411 { | 411 { |
412 if (!m_fullScreenElement) | 412 if (!m_fullScreenElement) |
413 return; | 413 return; |
414 | 414 |
415 if (!document()->isActive()) | 415 if (!document()->isActive()) |
416 return; | 416 return; |
417 | 417 |
418 m_fullScreenElement->didBecomeFullscreenElement(); | 418 m_fullScreenElement->didBecomeFullscreenElement(); |
419 | 419 |
420 m_eventQueueTimer.startOneShot(0, FROM_HERE); | 420 m_eventQueueTimer.startOneShot(0, FROM_HERE); |
421 } | 421 } |
422 | 422 |
423 void FullscreenElementStack::webkitWillExitFullScreenForElement(Element*) | 423 void FullscreenElementStack::willExitFullScreenForElement(Element*) |
424 { | 424 { |
425 if (!m_fullScreenElement) | 425 if (!m_fullScreenElement) |
426 return; | 426 return; |
427 | 427 |
428 if (!document()->isActive()) | 428 if (!document()->isActive()) |
429 return; | 429 return; |
430 | 430 |
431 m_fullScreenElement->willStopBeingFullscreenElement(); | 431 m_fullScreenElement->willStopBeingFullscreenElement(); |
432 } | 432 } |
433 | 433 |
434 void FullscreenElementStack::webkitDidExitFullScreenForElement(Element*) | 434 void FullscreenElementStack::didExitFullScreenForElement(Element*) |
435 { | 435 { |
436 if (!m_fullScreenElement) | 436 if (!m_fullScreenElement) |
437 return; | 437 return; |
438 | 438 |
439 if (!document()->isActive()) | 439 if (!document()->isActive()) |
440 return; | 440 return; |
441 | 441 |
442 m_fullScreenElement->setContainsFullScreenElementOnAncestorsCrossingFrameBou
ndaries(false); | 442 m_fullScreenElement->setContainsFullScreenElementOnAncestorsCrossingFrameBou
ndaries(false); |
443 | 443 |
444 m_areKeysEnabledInFullScreen = false; | 444 m_areKeysEnabledInFullScreen = false; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 void FullscreenElementStack::fullScreenRendererDestroyed() | 481 void FullscreenElementStack::fullScreenRendererDestroyed() |
482 { | 482 { |
483 m_fullScreenRenderer = 0; | 483 m_fullScreenRenderer = 0; |
484 } | 484 } |
485 | 485 |
486 void FullscreenElementStack::enqueueChangeEvent(Document& document) | 486 void FullscreenElementStack::enqueueChangeEvent(Document& document) |
487 { | 487 { |
488 ASSERT(document.hasFullscreenElementStack()); | 488 ASSERT(document.hasFullscreenElementStack()); |
489 FullscreenElementStack& fullscreen = from(document); | 489 FullscreenElementStack& fullscreen = from(document); |
490 | 490 |
491 EventTarget* target = fullscreen.webkitFullscreenElement(); | 491 EventTarget* target = fullscreen.fullscreenElement(); |
492 if (!target) | 492 if (!target) |
493 target = fullscreen.webkitCurrentFullScreenElement(); | 493 target = fullscreen.webkitCurrentFullScreenElement(); |
494 if (!target) | 494 if (!target) |
495 target = &document; | 495 target = &document; |
496 m_eventQueue.append(createEvent(EventTypeNames::webkitfullscreenchange, *tar
get)); | 496 m_eventQueue.append(createEvent(EventTypeNames::webkitfullscreenchange, *tar
get)); |
497 // NOTE: The timer is started in webkitDidEnterFullScreenForElement/webkitDi
dExitFullScreenForElement. | 497 // NOTE: The timer is started in didEnterFullScreenForElement/didExitFullScr
eenForElement. |
498 } | 498 } |
499 | 499 |
500 void FullscreenElementStack::enqueueErrorEvent(Element& element) | 500 void FullscreenElementStack::enqueueErrorEvent(Element& element) |
501 { | 501 { |
502 m_eventQueue.append(createEvent(EventTypeNames::webkitfullscreenerror, eleme
nt)); | 502 m_eventQueue.append(createEvent(EventTypeNames::webkitfullscreenerror, eleme
nt)); |
503 m_eventQueueTimer.startOneShot(0, FROM_HERE); | 503 m_eventQueueTimer.startOneShot(0, FROM_HERE); |
504 } | 504 } |
505 | 505 |
506 void FullscreenElementStack::eventQueueTimerFired(Timer<FullscreenElementStack>*
) | 506 void FullscreenElementStack::eventQueueTimerFired(Timer<FullscreenElementStack>*
) |
507 { | 507 { |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
569 | 569 |
570 void FullscreenElementStack::trace(Visitor* visitor) | 570 void FullscreenElementStack::trace(Visitor* visitor) |
571 { | 571 { |
572 visitor->trace(m_fullScreenElement); | 572 visitor->trace(m_fullScreenElement); |
573 visitor->trace(m_fullScreenElementStack); | 573 visitor->trace(m_fullScreenElementStack); |
574 visitor->trace(m_eventQueue); | 574 visitor->trace(m_eventQueue); |
575 DocumentSupplement::trace(visitor); | 575 DocumentSupplement::trace(visitor); |
576 } | 576 } |
577 | 577 |
578 } // namespace WebCore | 578 } // namespace WebCore |
OLD | NEW |