Index: third_party/WebKit/Source/web/FullscreenController.cpp |
diff --git a/third_party/WebKit/Source/web/FullscreenController.cpp b/third_party/WebKit/Source/web/FullscreenController.cpp |
index 019c1d2e18be77f7baabaf7b55f91b3117a9926d..6089612df2ac888b8eeeb78312cccbdfbb256429 100644 |
--- a/third_party/WebKit/Source/web/FullscreenController.cpp |
+++ b/third_party/WebKit/Source/web/FullscreenController.cpp |
@@ -137,6 +137,13 @@ void FullscreenController::didExitFullScreen() |
void FullscreenController::enterFullScreenForElement(Element* element) |
{ |
+ // TODO(dsinclair): This should not be needed because we addToTopLayer |
+ // in Fullscreen::pushFullscreenElementStack but, the WebView code doesn't |
+ // call Fullscreen::requestFullscreen() and, instead, just enters and |
+ // exists itself. This should be unified so there is one way to go |
+ // fullscreen. crbug.com/538158 |
+ element->document().addToTopLayer(element); |
+ |
// We are already transitioning to fullscreen for a different element. |
if (m_provisionalFullScreenElement) { |
m_provisionalFullScreenElement = element; |
@@ -162,6 +169,13 @@ void FullscreenController::exitFullScreenForElement(Element* element) |
{ |
ASSERT(element); |
+ // TODO(dsinclair): This should not be needed because we addToTopLayer |
+ // in Fullscreen::popFullscreenElementStack but, the WebView code doesn't |
+ // call Fullscreen::requestFullscreen() and, instead, just enters and |
+ // exists itself. This should be unified so there is one way to go |
+ // fullscreen. crbug.com/538158 |
+ element->document().removeFromTopLayer(element); |
+ |
// The client is exiting full screen, so don't send a notification. |
if (m_isCancelingFullScreen) |
return; |
@@ -178,9 +192,9 @@ void FullscreenController::updateSize() |
updatePageScaleConstraints(false); |
- LayoutFullScreen* layoutObject = Fullscreen::from(*m_fullScreenFrame->document()).fullScreenLayoutObject(); |
- if (layoutObject) |
- layoutObject->updateStyle(); |
+ Document* document = m_fullScreenFrame->document(); |
+ if (Element* fullscreenElement = Fullscreen::currentFullScreenElementFrom(*document)) |
+ Fullscreen::from(fullscreenElement->document()).didUpdateSize(*fullscreenElement); |
} |
void FullscreenController::updatePageScaleConstraints(bool removeConstraints) |