| Index: third_party/WebKit/Source/core/dom/Fullscreen.cpp | 
| diff --git a/third_party/WebKit/Source/core/dom/Fullscreen.cpp b/third_party/WebKit/Source/core/dom/Fullscreen.cpp | 
| index 110dec35632e5025f4c97611f0e4d89f4a900b58..f43f2d84e3aa3d376b225058c3afe72b7666ec65 100644 | 
| --- a/third_party/WebKit/Source/core/dom/Fullscreen.cpp | 
| +++ b/third_party/WebKit/Source/core/dom/Fullscreen.cpp | 
| @@ -28,6 +28,7 @@ | 
| #include "config.h" | 
| #include "core/dom/Fullscreen.h" | 
|  | 
| +#include "bindings/core/v8/ExceptionMessages.h" | 
| #include "core/HTMLNames.h" | 
| #include "core/dom/Document.h" | 
| #include "core/dom/ElementTraversal.h" | 
| @@ -41,8 +42,9 @@ | 
| #include "core/html/HTMLMediaElement.h" | 
| #include "core/input/EventHandler.h" | 
| #include "core/inspector/ConsoleMessage.h" | 
| -#include "core/layout/LayoutFullScreen.h" | 
| #include "core/page/ChromeClient.h" | 
| +#include "core/page/Page.h" | 
| +#include "core/style/ComputedStyle.h" | 
| #include "platform/UserGestureIndicator.h" | 
|  | 
| namespace blink { | 
| @@ -159,7 +161,6 @@ bool Fullscreen::isFullScreen(Document& document) | 
|  | 
| Fullscreen::Fullscreen(Document& document) | 
| : DocumentLifecycleObserver(&document) | 
| -    , m_fullScreenLayoutObject(nullptr) | 
| , m_eventQueueTimer(this, &Fullscreen::eventQueueTimerFired) | 
| { | 
| document.setHasFullscreenSupplement(); | 
| @@ -178,9 +179,6 @@ void Fullscreen::documentWasDetached() | 
| { | 
| m_eventQueue.clear(); | 
|  | 
| -    if (m_fullScreenLayoutObject) | 
| -        m_fullScreenLayoutObject->destroy(); | 
| - | 
| #if ENABLE(OILPAN) | 
| m_fullScreenElement = nullptr; | 
| m_fullScreenElementStack.clear(); | 
| @@ -425,28 +423,12 @@ bool Fullscreen::fullscreenEnabled(Document& document) | 
| void Fullscreen::didEnterFullScreenForElement(Element* element) | 
| { | 
| ASSERT(element); | 
| +    ASSERT(element->isInTopLayer()); | 
| + | 
| if (!document()->isActive()) | 
| return; | 
|  | 
| -    if (m_fullScreenLayoutObject) | 
| -        m_fullScreenLayoutObject->unwrapLayoutObject(); | 
| - | 
| m_fullScreenElement = element; | 
| - | 
| -    // Create a placeholder block for a the full-screen element, to keep the page from reflowing | 
| -    // when the element is removed from the normal flow. Only do this for a LayoutBox, as only | 
| -    // a box will have a frameRect. The placeholder will be created in setFullScreenLayoutObject() | 
| -    // during layout. | 
| -    LayoutObject* layoutObject = m_fullScreenElement->layoutObject(); | 
| -    bool shouldCreatePlaceholder = layoutObject && layoutObject->isBox(); | 
| -    if (shouldCreatePlaceholder) { | 
| -        m_savedPlaceholderFrameRect = toLayoutBox(layoutObject)->frameRect(); | 
| -        m_savedPlaceholderComputedStyle = ComputedStyle::clone(layoutObject->styleRef()); | 
| -    } | 
| - | 
| -    if (m_fullScreenElement != document()->documentElement()) | 
| -        LayoutFullScreen::wrapLayoutObject(layoutObject, layoutObject ? layoutObject->parent() : 0, document()); | 
| - | 
| m_fullScreenElement->setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries(true); | 
|  | 
| // FIXME: This should not call updateStyleIfNeeded. | 
| @@ -469,13 +451,11 @@ void Fullscreen::didExitFullScreenForElement(Element*) | 
| if (!document()->isActive()) | 
| return; | 
|  | 
| +    document()->removeFromTopLayer(m_fullScreenElement.get()); | 
| m_fullScreenElement->willStopBeingFullscreenElement(); | 
|  | 
| m_fullScreenElement->setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries(false); | 
|  | 
| -    if (m_fullScreenLayoutObject) | 
| -        m_fullScreenLayoutObject->unwrapLayoutObject(); | 
| - | 
| m_fullScreenElement = nullptr; | 
| document()->setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::FullScreen)); | 
|  | 
| @@ -492,28 +472,9 @@ void Fullscreen::didExitFullScreenForElement(Element*) | 
| from(*exitingDocument).m_eventQueueTimer.startOneShot(0, FROM_HERE); | 
| } | 
|  | 
| -void Fullscreen::setFullScreenLayoutObject(LayoutFullScreen* layoutObject) | 
| -{ | 
| -    if (layoutObject == m_fullScreenLayoutObject) | 
| -        return; | 
| - | 
| -    if (layoutObject && m_savedPlaceholderComputedStyle) { | 
| -        layoutObject->createPlaceholder(m_savedPlaceholderComputedStyle.release(), m_savedPlaceholderFrameRect); | 
| -    } else if (layoutObject && m_fullScreenLayoutObject && m_fullScreenLayoutObject->placeholder()) { | 
| -        LayoutBlock* placeholder = m_fullScreenLayoutObject->placeholder(); | 
| -        layoutObject->createPlaceholder(ComputedStyle::clone(placeholder->styleRef()), placeholder->frameRect()); | 
| -    } | 
| - | 
| -    if (m_fullScreenLayoutObject) | 
| -        m_fullScreenLayoutObject->unwrapLayoutObject(); | 
| -    ASSERT(!m_fullScreenLayoutObject); | 
| - | 
| -    m_fullScreenLayoutObject = layoutObject; | 
| -} | 
| - | 
| -void Fullscreen::fullScreenLayoutObjectDestroyed() | 
| +void Fullscreen::updatedSize(Element* element) | 
| { | 
| -    m_fullScreenLayoutObject = nullptr; | 
| +    element->setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::FullScreen)); | 
| } | 
|  | 
| void Fullscreen::enqueueChangeEvent(Document& document, RequestType requestType) | 
| @@ -602,12 +563,14 @@ void Fullscreen::popFullscreenElementStack() | 
| if (m_fullScreenElementStack.isEmpty()) | 
| return; | 
|  | 
| +    document()->removeFromTopLayer(m_fullScreenElementStack.last().first.get()); | 
| m_fullScreenElementStack.removeLast(); | 
| } | 
|  | 
| void Fullscreen::pushFullscreenElementStack(Element& element, RequestType requestType) | 
| { | 
| m_fullScreenElementStack.append(std::make_pair(&element, requestType)); | 
| +    document()->addToTopLayer(&element); | 
| } | 
|  | 
| DEFINE_TRACE(Fullscreen) | 
|  |