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

Unified Diff: Source/core/dom/Element.cpp

Issue 22454003: Support subtitles for native fullscreen video (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: enabling layout tests Created 7 years, 3 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: Source/core/dom/Element.cpp
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
index 02518c5bcfad6a3e0e43c5279e4d700cd817c74a..17df66fe879d75385cc852870a0eea65deb7df05 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -1353,6 +1353,11 @@ void Element::attach(const AttachContext& context)
}
InspectorInstrumentation::didRecalculateStyleForElement(this);
+
+ if (FullscreenElementStack::isActiveFullScreenElement(this)) {
+ if (FrameView* view = document().view())
esprehn 2013/09/13 02:46:07 All the null checks for view() look wrong in here.
trchen 2013/09/13 05:14:58 Okay I'll change it to ASSERT.
+ view->setCurrentFullscreenRenderer(renderer());
+ }
}
void Element::unregisterNamedFlowContentNode()
@@ -1363,6 +1368,11 @@ void Element::unregisterNamedFlowContentNode()
void Element::detach(const AttachContext& context)
{
+ if (FullscreenElementStack::isActiveFullScreenElement(this)) {
+ if (FrameView* view = document().view())
+ view->setCurrentFullscreenRenderer(0);
+ }
+
WidgetHierarchyUpdatesSuspensionScope suspendWidgetHierarchyUpdates;
unregisterNamedFlowContentNode();
cancelFocusAppearanceUpdate();
@@ -3639,4 +3649,20 @@ Attribute* UniqueElementData::attributeItem(unsigned index)
return &m_attributeVector.at(index);
}
+void Element::didBecomeFullscreenElement()
+{
+ FrameView* view = document().view();
+ if (!view)
esprehn 2013/09/13 02:46:07 It should be impossible to get here if there's no
trchen 2013/09/13 05:14:58 Will change to ASSERT too.
+ return;
+ view->setCurrentFullscreenRenderer(renderer());
+}
+
+void Element::willStopBeingFullscreenElement()
+{
+ FrameView* view = document().view();
+ if (!view)
+ return;
+ view->setCurrentFullscreenRenderer(0);
+}
+
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698