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

Unified Diff: Source/WebCore/html/HTMLMediaElement.cpp

Issue 10703186: Merge 122432 - [Shadow DOM] <video> with <shadow> crashes (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1180/
Patch Set: Created 8 years, 5 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
« no previous file with comments | « Source/WebCore/html/HTMLMediaElement.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/html/HTMLMediaElement.cpp
===================================================================
--- Source/WebCore/html/HTMLMediaElement.cpp (revision 122537)
+++ Source/WebCore/html/HTMLMediaElement.cpp (working copy)
@@ -488,7 +488,11 @@
bool HTMLMediaElement::childShouldCreateRenderer(const NodeRenderingContext& childContext) const
{
- return childContext.isOnUpperEncapsulationBoundary() && HTMLElement::childShouldCreateRenderer(childContext);
+ if (!hasMediaControls())
+ return false;
+ // Only allows nodes from the controls shadow subtree.
+ return (mediaControls()->treeScope() == childContext.node()->treeScope()
+ && childContext.isOnUpperEncapsulationBoundary() && HTMLElement::childShouldCreateRenderer(childContext));
}
Node::InsertionNotificationRequest HTMLMediaElement::insertedInto(ContainerNode* insertionPoint)
@@ -4144,12 +4148,12 @@
m_player->setPrivateBrowsingMode(privateMode);
}
-MediaControls* HTMLMediaElement::mediaControls()
+MediaControls* HTMLMediaElement::mediaControls() const
{
return toMediaControls(shadow()->oldestShadowRoot()->firstChild());
}
-bool HTMLMediaElement::hasMediaControls()
+bool HTMLMediaElement::hasMediaControls() const
{
ElementShadow* elementShadow = shadow();
if (!elementShadow)
« no previous file with comments | « Source/WebCore/html/HTMLMediaElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698