Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(270)

Unified Diff: third_party/WebKit/Source/core/dom/Fullscreen.cpp

Issue 1914643005: Add support for entering/exiting HTML fullscreen from OOPIFs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase (and deal with gfx:: -> display:: rename). Add replication CL as dependent and use its allowfullscreen test file. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 e2398d48e5034f604f927bf9099f59b68da460dd..58440dd00e87283f85c142f17de4adbca84da24e 100644
--- a/third_party/WebKit/Source/core/dom/Fullscreen.cpp
+++ b/third_party/WebKit/Source/core/dom/Fullscreen.cpp
@@ -410,7 +410,7 @@ bool Fullscreen::fullscreenEnabled(Document& document)
return fullscreenIsAllowedForAllOwners(document) && fullscreenIsSupported(document);
}
-void Fullscreen::didEnterFullScreenForElement(Element* element)
+void Fullscreen::didEnterFullScreenForElement(Element* element, bool isAncestorOfFullscreenElement)
{
DCHECK(element);
if (!document()->isActive())
@@ -432,10 +432,20 @@ void Fullscreen::didEnterFullScreenForElement(Element* element)
m_savedPlaceholderComputedStyle = ComputedStyle::clone(layoutObject->styleRef());
}
+ // TODO(alexmos): When |isAncestorOfFullscreenElement| is true, some of
+ // this layout work has already been done in another process, so it should
+ // not be necessary to repeat it here.
if (m_fullScreenElement != document()->documentElement())
LayoutFullScreen::wrapLayoutObject(layoutObject, layoutObject ? layoutObject->parent() : 0, document());
+ if (isAncestorOfFullscreenElement) {
+ DCHECK(m_fullScreenElement->isFrameOwnerElement());
+ DCHECK(toHTMLFrameOwnerElement(m_fullScreenElement)->contentFrame()->isRemoteFrame());
+ m_fullScreenElement->setContainsFullScreenElement(true);
+ }
+
m_fullScreenElement->setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries(true);
+
document()->styleEngine().ensureFullscreenUAStyle();
m_fullScreenElement->pseudoStateChanged(CSSSelector::PseudoFullScreen);
@@ -450,7 +460,7 @@ void Fullscreen::didEnterFullScreenForElement(Element* element)
m_eventQueueTimer.startOneShot(0, BLINK_FROM_HERE);
}
-void Fullscreen::didExitFullScreenForElement(Element*)
+void Fullscreen::didExitFullScreenForElement(bool isAncestorOfFullscreenElement)
dcheng 2016/05/18 01:04:34 See below comment. Wondering if we need this param
alexmos 2016/05/18 15:08:33 I actually started out with that approach, but tur
{
if (!m_fullScreenElement)
return;
@@ -460,6 +470,9 @@ void Fullscreen::didExitFullScreenForElement(Element*)
m_fullScreenElement->willStopBeingFullscreenElement();
+ if (isAncestorOfFullscreenElement)
+ m_fullScreenElement->setContainsFullScreenElement(false);
+
m_fullScreenElement->setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries(false);
if (m_fullScreenLayoutObject)

Powered by Google App Engine
This is Rietveld 408576698