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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 m_fullScreenElement = element; | 427 m_fullScreenElement = element; |
428 | 428 |
429 // Create a placeholder block for a the full-screen element, to keep the pag
e from reflowing | 429 // Create a placeholder block for a the full-screen element, to keep the pag
e from reflowing |
430 // when the element is removed from the normal flow. Only do this for a Layo
utBox, as only | 430 // when the element is removed from the normal flow. Only do this for a Layo
utBox, as only |
431 // a box will have a frameRect. The placeholder will be created in setFullSc
reenRenderer() | 431 // a box will have a frameRect. The placeholder will be created in setFullSc
reenRenderer() |
432 // during layout. | 432 // during layout. |
433 LayoutObject* renderer = m_fullScreenElement->layoutObject(); | 433 LayoutObject* renderer = m_fullScreenElement->layoutObject(); |
434 bool shouldCreatePlaceholder = renderer && renderer->isBox(); | 434 bool shouldCreatePlaceholder = renderer && renderer->isBox(); |
435 if (shouldCreatePlaceholder) { | 435 if (shouldCreatePlaceholder) { |
436 m_savedPlaceholderFrameRect = toLayoutBox(renderer)->frameRect(); | 436 m_savedPlaceholderFrameRect = toLayoutBox(renderer)->frameRect(); |
437 m_savedPlaceholderLayoutStyle = LayoutStyle::clone(renderer->styleRef())
; | 437 m_savedPlaceholderComputedStyle = ComputedStyle::clone(renderer->styleRe
f()); |
438 } | 438 } |
439 | 439 |
440 if (m_fullScreenElement != document()->documentElement()) | 440 if (m_fullScreenElement != document()->documentElement()) |
441 LayoutFullScreen::wrapRenderer(renderer, renderer ? renderer->parent() :
0, document()); | 441 LayoutFullScreen::wrapRenderer(renderer, renderer ? renderer->parent() :
0, document()); |
442 | 442 |
443 m_fullScreenElement->setContainsFullScreenElementOnAncestorsCrossingFrameBou
ndaries(true); | 443 m_fullScreenElement->setContainsFullScreenElementOnAncestorsCrossingFrameBou
ndaries(true); |
444 | 444 |
445 // FIXME: This should not call updateStyleIfNeeded. | 445 // FIXME: This should not call updateStyleIfNeeded. |
446 document()->setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTrac
ing::create(StyleChangeReason::FullScreen)); | 446 document()->setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTrac
ing::create(StyleChangeReason::FullScreen)); |
447 document()->updateRenderTreeIfNeeded(); | 447 document()->updateRenderTreeIfNeeded(); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 exitingDocument = &document()->topDocument(); | 483 exitingDocument = &document()->topDocument(); |
484 ASSERT(exitingDocument); | 484 ASSERT(exitingDocument); |
485 from(*exitingDocument).m_eventQueueTimer.startOneShot(0, FROM_HERE); | 485 from(*exitingDocument).m_eventQueueTimer.startOneShot(0, FROM_HERE); |
486 } | 486 } |
487 | 487 |
488 void Fullscreen::setFullScreenRenderer(LayoutFullScreen* renderer) | 488 void Fullscreen::setFullScreenRenderer(LayoutFullScreen* renderer) |
489 { | 489 { |
490 if (renderer == m_fullScreenRenderer) | 490 if (renderer == m_fullScreenRenderer) |
491 return; | 491 return; |
492 | 492 |
493 if (renderer && m_savedPlaceholderLayoutStyle) { | 493 if (renderer && m_savedPlaceholderComputedStyle) { |
494 renderer->createPlaceholder(m_savedPlaceholderLayoutStyle.release(), m_s
avedPlaceholderFrameRect); | 494 renderer->createPlaceholder(m_savedPlaceholderComputedStyle.release(), m
_savedPlaceholderFrameRect); |
495 } else if (renderer && m_fullScreenRenderer && m_fullScreenRenderer->placeho
lder()) { | 495 } else if (renderer && m_fullScreenRenderer && m_fullScreenRenderer->placeho
lder()) { |
496 LayoutBlock* placeholder = m_fullScreenRenderer->placeholder(); | 496 LayoutBlock* placeholder = m_fullScreenRenderer->placeholder(); |
497 renderer->createPlaceholder(LayoutStyle::clone(placeholder->styleRef()),
placeholder->frameRect()); | 497 renderer->createPlaceholder(ComputedStyle::clone(placeholder->styleRef()
), placeholder->frameRect()); |
498 } | 498 } |
499 | 499 |
500 if (m_fullScreenRenderer) | 500 if (m_fullScreenRenderer) |
501 m_fullScreenRenderer->unwrapRenderer(); | 501 m_fullScreenRenderer->unwrapRenderer(); |
502 ASSERT(!m_fullScreenRenderer); | 502 ASSERT(!m_fullScreenRenderer); |
503 | 503 |
504 m_fullScreenRenderer = renderer; | 504 m_fullScreenRenderer = renderer; |
505 } | 505 } |
506 | 506 |
507 void Fullscreen::fullScreenRendererDestroyed() | 507 void Fullscreen::fullScreenRendererDestroyed() |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
606 DEFINE_TRACE(Fullscreen) | 606 DEFINE_TRACE(Fullscreen) |
607 { | 607 { |
608 visitor->trace(m_fullScreenElement); | 608 visitor->trace(m_fullScreenElement); |
609 visitor->trace(m_fullScreenElementStack); | 609 visitor->trace(m_fullScreenElementStack); |
610 visitor->trace(m_eventQueue); | 610 visitor->trace(m_eventQueue); |
611 DocumentSupplement::trace(visitor); | 611 DocumentSupplement::trace(visitor); |
612 DocumentLifecycleObserver::trace(visitor); | 612 DocumentLifecycleObserver::trace(visitor); |
613 } | 613 } |
614 | 614 |
615 } // namespace blink | 615 } // namespace blink |
OLD | NEW |