| Index: WebCore/dom/make_names.pl
|
| ===================================================================
|
| --- WebCore/dom/make_names.pl (revision 45140)
|
| +++ WebCore/dom/make_names.pl (working copy)
|
| @@ -287,8 +287,10 @@
|
| # Handle media elements.
|
| if ($tags{$tagName}{wrapperOnlyIfMediaIsAvailable}) {
|
| print F <<END
|
| - if (!MediaPlayer::isAvailable())
|
| + Settings* settings = document->settings();
|
| + if (!MediaPlayer::isAvailable() || (settings && !settings->isMediaEnabled()))
|
| return HTMLElement::create($constructorTagName, document);
|
| +
|
| END
|
| ;
|
| }
|
| @@ -638,7 +640,7 @@
|
| print F <<END
|
| #include <wtf/HashMap.h>
|
|
|
| -#if ENABLE(DASHBOARD_SUPPORT)
|
| +#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(VIDEO)
|
| #include "Document.h"
|
| #include "Settings.h"
|
| #endif
|
| @@ -839,7 +841,8 @@
|
| print F <<END
|
| static JSNode* create${JSInterfaceName}Wrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<$parameters{namespace}Element> element)
|
| {
|
| - if (!MediaPlayer::isAvailable())
|
| + Settings* settings = element->document()->settings();
|
| + if (!MediaPlayer::isAvailable() || (settings && !settings->isMediaEnabled()))
|
| return CREATE_DOM_NODE_WRAPPER(exec, globalObject, $parameters{namespace}Element, element.get());
|
| return CREATE_DOM_NODE_WRAPPER(exec, globalObject, ${JSInterfaceName}, element.get());
|
| }
|
| @@ -857,14 +860,29 @@
|
| ;
|
| }
|
| } elsif ($wrapperFactoryType eq "V8") {
|
| + if ($tags{$tagName}{wrapperOnlyIfMediaIsAvailable}) {
|
| + print F <<END
|
| +static v8::Handle<v8::Value> create${JSInterfaceName}Wrapper($parameters{namespace}Element* element)
|
| +{
|
| + Settings* settings = element->document()->settings();
|
| + if (!MediaPlayer::isAvailable() || (settings && !settings->isMediaEnabled()))
|
| + return toV8(static_cast<$parameters{namespace}Element*>(element));
|
| + return toV8(static_cast<${JSInterfaceName}*>(element));
|
| +}
|
| +
|
| +END
|
| +;
|
| + } else {
|
| print F <<END
|
| static v8::Handle<v8::Value> create${JSInterfaceName}Wrapper($parameters{namespace}Element* element)
|
| {
|
| return toV8(static_cast<${JSInterfaceName}*>(element));
|
| }
|
|
|
| +
|
| END
|
| ;
|
| + }
|
| }
|
|
|
| if ($conditional) {
|
| @@ -895,8 +913,17 @@
|
|
|
| printElementIncludes($F);
|
|
|
| - print F "\n#include <wtf/StdLibExtras.h>\n\n";
|
| + print F <<END
|
| +#include <wtf/StdLibExtras.h>
|
|
|
| +#if ENABLE(VIDEO)
|
| +#include "Document.h"
|
| +#include "Settings.h"
|
| +#endif
|
| +
|
| +END
|
| +;
|
| +
|
| if ($wrapperFactoryType eq "JS") {
|
| print F <<END
|
| using namespace JSC;
|
|
|