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

Unified Diff: Source/core/html/HTMLVideoElement.cpp

Issue 304003002: Don't mutate the DOM from inside an Element's constructor (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix includes Created 6 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
« no previous file with comments | « Source/core/html/HTMLMediaElement.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLVideoElement.cpp
diff --git a/Source/core/html/HTMLVideoElement.cpp b/Source/core/html/HTMLVideoElement.cpp
index 7748b964d1893c7670773a8fea40ff6241c94855..4009845fde9f2db3b6f1f45f9bb48a584c6554ae 100644
--- a/Source/core/html/HTMLVideoElement.cpp
+++ b/Source/core/html/HTMLVideoElement.cpp
@@ -32,10 +32,11 @@
#include "core/dom/Attribute.h"
#include "core/dom/Document.h"
#include "core/dom/ExceptionCode.h"
+#include "core/dom/shadow/ShadowRoot.h"
+#include "core/frame/Settings.h"
#include "core/html/HTMLImageLoader.h"
#include "core/html/canvas/CanvasRenderingContext.h"
#include "core/html/parser/HTMLParserIdioms.h"
-#include "core/frame/Settings.h"
#include "core/rendering/RenderImage.h"
#include "core/rendering/RenderVideo.h"
#include "platform/UserGestureIndicator.h"
@@ -54,9 +55,10 @@ inline HTMLVideoElement::HTMLVideoElement(Document& document)
PassRefPtrWillBeRawPtr<HTMLVideoElement> HTMLVideoElement::create(Document& document)
{
- RefPtrWillBeRawPtr<HTMLVideoElement> videoElement(adoptRefWillBeRefCountedGarbageCollected(new HTMLVideoElement(document)));
- videoElement->suspendIfNeeded();
- return videoElement.release();
+ RefPtrWillBeRawPtr<HTMLVideoElement> video = adoptRefWillBeRefCountedGarbageCollected(new HTMLVideoElement(document));
+ video->ensureUserAgentShadowRoot();
+ video->suspendIfNeeded();
+ return video.release();
}
bool HTMLVideoElement::rendererIsNeeded(const RenderStyle& style)
« no previous file with comments | « Source/core/html/HTMLMediaElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698