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 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 9b931c8f972e72b2a50c95120340873cf7342b7f..9b90c3b5c6df98a41703da3854c19aadbb949c4f 100644
--- a/third_party/WebKit/Source/core/dom/Fullscreen.cpp
+++ b/third_party/WebKit/Source/core/dom/Fullscreen.cpp
@@ -61,7 +61,7 @@ static bool fullscreenIsAllowedForAllOwners(const Document& document)
// replicated for this to work with OOPIFs. For now, deny fullscreen
// access inside OOPIFs until https://crbug.com/550497 is fixed.
if (frame->owner()->isRemote())
- return false;
+ return true;
alexmos 2016/05/10 21:36:24 This will go away once I rebase on the allowFullsc
HTMLFrameOwnerElement* owner = toHTMLFrameOwnerElement(frame->owner());
if (!isHTMLIFrameElement(owner))
@@ -418,7 +418,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())
@@ -440,10 +440,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.
alexmos 2016/05/10 21:36:24 Namely, the wrapLayoutObject call and stuff in Lay
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);
@@ -458,7 +468,7 @@ void Fullscreen::didEnterFullScreenForElement(Element* element)
m_eventQueueTimer.startOneShot(0, BLINK_FROM_HERE);
}
-void Fullscreen::didExitFullScreenForElement(Element*)
+void Fullscreen::didExitFullScreenForElement(bool isAncestorOfFullscreenElement)
{
if (!m_fullScreenElement)
return;
@@ -468,6 +478,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