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

Unified Diff: Source/core/html/HTMLAudioElement.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/dom/ContainerNode.cpp ('k') | Source/core/html/HTMLKeygenElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLAudioElement.cpp
diff --git a/Source/core/html/HTMLAudioElement.cpp b/Source/core/html/HTMLAudioElement.cpp
index ba03326322e4ad62404e8cc8dbf27d11a5b23d1c..a241c4927cfccd65c3cd73ba77954d16ef60d385 100644
--- a/Source/core/html/HTMLAudioElement.cpp
+++ b/Source/core/html/HTMLAudioElement.cpp
@@ -27,6 +27,7 @@
#include "core/html/HTMLAudioElement.h"
#include "HTMLNames.h"
+#include "core/dom/shadow/ShadowRoot.h"
namespace WebCore {
@@ -40,14 +41,16 @@ HTMLAudioElement::HTMLAudioElement(Document& document)
PassRefPtrWillBeRawPtr<HTMLAudioElement> HTMLAudioElement::create(Document& document)
{
- RefPtrWillBeRawPtr<HTMLAudioElement> audioElement(adoptRefWillBeRefCountedGarbageCollected(new HTMLAudioElement(document)));
- audioElement->suspendIfNeeded();
- return audioElement.release();
+ RefPtrWillBeRawPtr<HTMLAudioElement> audio = adoptRefWillBeRefCountedGarbageCollected(new HTMLAudioElement(document));
+ audio->ensureUserAgentShadowRoot();
+ audio->suspendIfNeeded();
+ return audio.release();
}
PassRefPtrWillBeRawPtr<HTMLAudioElement> HTMLAudioElement::createForJSConstructor(Document& document, const AtomicString& src)
{
RefPtrWillBeRawPtr<HTMLAudioElement> audio = adoptRefWillBeRefCountedGarbageCollected(new HTMLAudioElement(document));
+ audio->ensureUserAgentShadowRoot();
audio->setPreload(AtomicString("auto", AtomicString::ConstructFromLiteral));
if (!src.isNull())
audio->setSrc(src);
« no previous file with comments | « Source/core/dom/ContainerNode.cpp ('k') | Source/core/html/HTMLKeygenElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698