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

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: add dangling pointer check 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 38e67b70942a40af6a4ace09322dac6b4ff272d8..15815152c932421979264a3cf28e05d414080a21 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -1353,6 +1353,12 @@ void Element::attach(const AttachContext& context)
}
InspectorInstrumentation::didRecalculateStyleForElement(this);
+
+ if (FullscreenElementStack::isActiveFullScreenElement(this)) {
+ RenderView* view = document().topDocument()->renderView();
+ ASSERT(view);
+ view->setCurrentFullscreenRenderer(renderer());
+ }
}
void Element::unregisterNamedFlowContentNode()
@@ -1363,6 +1369,12 @@ void Element::unregisterNamedFlowContentNode()
void Element::detach(const AttachContext& context)
{
+ if (FullscreenElementStack::isActiveFullScreenElement(this)) {
+ RenderView* view = document().topDocument()->renderView();
+ if (view)
+ view->setCurrentFullscreenRenderer(0);
+ }
+
WidgetHierarchyUpdatesSuspensionScope suspendWidgetHierarchyUpdates;
unregisterNamedFlowContentNode();
cancelFocusAppearanceUpdate();
@@ -3648,4 +3660,18 @@ Attribute* UniqueElementData::attributeItem(unsigned index)
return &m_attributeVector.at(index);
}
+void Element::didBecomeFullscreenElement()
+{
+ RenderView* view = document().topDocument()->renderView();
+ ASSERT(view);
+ view->setCurrentFullscreenRenderer(renderer());
+}
+
+void Element::willStopBeingFullscreenElement()
+{
+ RenderView* view = document().topDocument()->renderView();
+ ASSERT(view);
+ view->setCurrentFullscreenRenderer(0);
+}
+
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698