diff options
author | Steve Block <steveblock@google.com> | 2010-04-27 16:23:55 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-04-27 17:07:03 +0100 |
commit | 692e5dbf12901edacf14812a6fae25462920af42 (patch) | |
tree | d62802373a429e0a9dc093b6046c166b2c514285 /WebCore/bindings/v8/custom/V8HTMLAudioElementConstructor.cpp | |
parent | e24bea4efef1c414137d36a9778aa4e142e10c7d (diff) | |
download | external_webkit-692e5dbf12901edacf14812a6fae25462920af42.zip external_webkit-692e5dbf12901edacf14812a6fae25462920af42.tar.gz external_webkit-692e5dbf12901edacf14812a6fae25462920af42.tar.bz2 |
Merge webkit.org at r55033 : Initial merge by git
Change-Id: I98a4af828067cc243ec3dc5e5826154dd88074b5
Diffstat (limited to 'WebCore/bindings/v8/custom/V8HTMLAudioElementConstructor.cpp')
-rw-r--r-- | WebCore/bindings/v8/custom/V8HTMLAudioElementConstructor.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/WebCore/bindings/v8/custom/V8HTMLAudioElementConstructor.cpp b/WebCore/bindings/v8/custom/V8HTMLAudioElementConstructor.cpp index 06c6c1d..9b75db8 100644 --- a/WebCore/bindings/v8/custom/V8HTMLAudioElementConstructor.cpp +++ b/WebCore/bindings/v8/custom/V8HTMLAudioElementConstructor.cpp @@ -14,7 +14,7 @@ * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -60,15 +60,14 @@ static v8::Handle<v8::Value> v8HTMLAudioElementConstructorCallback(const v8::Arg return throwError("Audio constructor associated document is unavailable", V8Proxy::ReferenceError); // Make sure the document is added to the DOM Node map. Otherwise, the HTMLAudioElement instance - // may end up being the only node in the map and get garbage-ccollected prematurely. + // may end up being the only node in the map and get garbage-collected prematurely. toV8(document); - RefPtr<HTMLAudioElement> audio = new HTMLAudioElement(HTMLNames::audioTag, document); - audio->setAutobuffer(true); - if (args.Length() > 0) { - audio->setSrc(toWebCoreString(args[0])); - audio->scheduleLoad(); - } + + String src; + if (args.Length() > 0) + src = toWebCoreString(args[0]); + RefPtr<HTMLAudioElement> audio = HTMLAudioElement::createForJSConstructor(document, src); V8DOMWrapper::setDOMWrapper(args.Holder(), V8ClassIndex::ToInt(V8ClassIndex::AUDIO), audio.get()); audio->ref(); |