REGRESSION (r150663): Using webkitAudioContext in Inspector makes it undefined everywhere
authorch.dumez@sisa.samsung.com <ch.dumez@sisa.samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Jun 2013 10:34:57 +0000 (10:34 +0000)
committerch.dumez@sisa.samsung.com <ch.dumez@sisa.samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Jun 2013 10:34:57 +0000 (10:34 +0000)
https://bugs.webkit.org/show_bug.cgi?id=117825

Reviewed by Kentaro Hara.

Source/WebCore:

Partially revert r150663 so that we use Settings to enable WebAudio instead of
RuntimeEnabledFeatures.

Introduce a new [EnabledBySetting] IDL extended attribute which behaves similarly to
the existing [EnabledAtRuntime] but relies on Settings instead of RuntimeEnabledFeatures
to determine if the feature should be enabled. Make use of this new IDL attribute for
webkitAudioContext interface.

No new tests, no behavior change.

* Modules/webaudio/AudioContext.idl:
* WebCore.exp.in:
* WebCore.order:
* bindings/generic/RuntimeEnabledFeatures.cpp:
* bindings/generic/RuntimeEnabledFeatures.h:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* bindings/scripts/IDLAttributes.txt:
* bindings/scripts/preprocess-idls.pl:
(GenerateConstructorAttribute):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjTestSubObjEnabledBySettingConstructor):
(WebCore::setJSTestObjTestSubObjEnabledBySettingConstructor):
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/ObjC/DOMTestObj.h:
* bindings/scripts/test/ObjC/DOMTestObj.mm:
(-[DOMTestObj TestSubObjEnabledBySetting]):
(-[DOMTestObj setTestSubObjEnabledBySetting:]):
* bindings/scripts/test/TestObj.idl:
* page/Settings.in:

Source/WebKit/efl:

Use Settings to enable Web Audio instead of RuntimeEnabledFeatures.

* WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
(DumpRenderTreeSupportEfl::setWebAudioEnabled):
* WebCoreSupport/DumpRenderTreeSupportEfl.h:
* ewk/ewk_view.cpp:
(_ewk_view_priv_new):

Source/WebKit/gtk:

Use Settings to enable Web Audio instead of RuntimeEnabledFeatures.

* webkit/webkitwebview.cpp:
(webkit_web_view_update_settings):
(webkit_web_view_settings_notify):

Source/WebKit/mac:

Use Settings to enable Web Audio instead of RuntimeEnabledFeatures.

* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKit/qt:

Use Settings to enable Web Audio instead of RuntimeEnabledFeatures.

* Api/qwebsettings.cpp:
(QWebSettingsPrivate::apply):

Source/WebKit/win:

Use Settings to enable Web Audio instead of RuntimeEnabledFeatures.

* WebView.cpp:
(WebView::notifyPreferencesChanged):

Source/WebKit2:

Use Settings to enable Web Audio instead of RuntimeEnabledFeatures.

* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

Tools:

DumpRenderTreeSupportEfl::setWebAudioEnabled() now requires an additional view argument.

* DumpRenderTree/efl/DumpRenderTreeChrome.cpp:
(DumpRenderTreeChrome::resetDefaultsToConsistentValues):
* DumpRenderTree/efl/TestRunnerEfl.cpp:
(TestRunner::overridePreference):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@151832 268f45cc-cd09-0410-ab3c-d52691b4dbfc

33 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/webaudio/AudioContext.idl
Source/WebCore/WebCore.exp.in
Source/WebCore/WebCore.order
Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp
Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bindings/scripts/IDLAttributes.txt
Source/WebCore/bindings/scripts/preprocess-idls.pl
Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestObj.h
Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h
Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm
Source/WebCore/bindings/scripts/test/TestObj.idl
Source/WebCore/page/Settings.in
Source/WebKit/efl/ChangeLog
Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp
Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.h
Source/WebKit/efl/ewk/ewk_view.cpp
Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/webkit/webkitwebview.cpp
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit/qt/Api/qwebsettings.cpp
Source/WebKit/qt/ChangeLog
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebView.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Tools/ChangeLog
Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp
Tools/DumpRenderTree/efl/TestRunnerEfl.cpp

index 8b75e01..69e39f3 100644 (file)
@@ -1,3 +1,41 @@
+2013-06-21  Christophe Dumez  <ch.dumez@sisa.samsung.com>
+
+        REGRESSION (r150663): Using webkitAudioContext in Inspector makes it undefined everywhere
+        https://bugs.webkit.org/show_bug.cgi?id=117825
+
+        Reviewed by Kentaro Hara.
+
+        Partially revert r150663 so that we use Settings to enable WebAudio instead of
+        RuntimeEnabledFeatures.
+
+        Introduce a new [EnabledBySetting] IDL extended attribute which behaves similarly to
+        the existing [EnabledAtRuntime] but relies on Settings instead of RuntimeEnabledFeatures
+        to determine if the feature should be enabled. Make use of this new IDL attribute for
+        webkitAudioContext interface.
+
+        No new tests, no behavior change.
+
+        * Modules/webaudio/AudioContext.idl:
+        * WebCore.exp.in:
+        * WebCore.order:
+        * bindings/generic/RuntimeEnabledFeatures.cpp:
+        * bindings/generic/RuntimeEnabledFeatures.h:
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateImplementation):
+        * bindings/scripts/IDLAttributes.txt:
+        * bindings/scripts/preprocess-idls.pl:
+        (GenerateConstructorAttribute):
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+        (WebCore::jsTestObjTestSubObjEnabledBySettingConstructor):
+        (WebCore::setJSTestObjTestSubObjEnabledBySettingConstructor):
+        * bindings/scripts/test/JS/JSTestObj.h:
+        * bindings/scripts/test/ObjC/DOMTestObj.h:
+        * bindings/scripts/test/ObjC/DOMTestObj.mm:
+        (-[DOMTestObj TestSubObjEnabledBySetting]):
+        (-[DOMTestObj setTestSubObjEnabledBySetting:]):
+        * bindings/scripts/test/TestObj.idl:
+        * page/Settings.in:
+
 2013-06-21  Krzysztof Czech  <k.czech@samsung.com>
 
         [ATK] Added support for aria-required attribute.
index 46f5186..9094fce 100644 (file)
@@ -24,7 +24,7 @@
  */
 
 [
-    EnabledAtRuntime,
+    EnabledBySetting=WebAudio,
     Conditional=WEB_AUDIO,
     ActiveDOMObject,
     CustomConstructor,
index 9d48126..b10b3ca 100644 (file)
@@ -2680,10 +2680,6 @@ __ZN7WebCore22RuntimeEnabledFeatures37isAuthorShadowDOMForAnyElementEnabledE
 __ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_10ShadowRootE
 #endif
 
-#if ENABLE(WEB_AUDIO)
-__ZN7WebCore22RuntimeEnabledFeatures17isWebAudioEnabledE
-#endif
-
 #if ENABLE(DIALOG_ELEMENT)
 __ZN7WebCore22RuntimeEnabledFeatures22isDialogElementEnabledE
 #endif
index 3434126..a84e9a1 100644 (file)
@@ -40789,7 +40789,6 @@ __ZN7WebCore23PlatformInstrumentation8m_clientE
 __ZN7WebCore21RenderLayerFilterInfo11s_filterMapE
 __ZN7WebCore23RenderSVGResourceMasker14s_resourceTypeE
 __ZN7WebCore15ResourceRequest23s_httpPipeliningEnabledE
-__ZN7WebCore22RuntimeEnabledFeatures17isWebAudioEnabledE
 __ZN7WebCore22RuntimeEnabledFeatures22isCSSExclusionsEnabledE
 __ZN7WebCore22RuntimeEnabledFeatures18isCSSShapesEnabledE
 __ZN7WebCore22RuntimeEnabledFeatures40isLangAttributeAwareFormControlUIEnabledE
index 3658145..4fa266c 100644 (file)
@@ -49,7 +49,6 @@ bool RuntimeEnabledFeatures::isApplicationCacheEnabled = true;
 bool RuntimeEnabledFeatures::isDataTransferItemsEnabled = true;
 bool RuntimeEnabledFeatures::isGeolocationEnabled = true;
 bool RuntimeEnabledFeatures::isIndexedDBEnabled = false;
-bool RuntimeEnabledFeatures::isWebAudioEnabled = false;
 bool RuntimeEnabledFeatures::isTouchEnabled = true;
 bool RuntimeEnabledFeatures::isDeviceMotionEnabled = true;
 bool RuntimeEnabledFeatures::isDeviceOrientationEnabled = true;
index 2cbba90..e7435a0 100644 (file)
@@ -152,12 +152,6 @@ public:
     static bool openDatabaseSyncEnabled();
 #endif
 
-#if ENABLE(WEB_AUDIO)
-    static void setWebAudioEnabled(bool isEnabled) { isWebAudioEnabled = isEnabled; }
-    static bool webkitAudioContextEnabled() { return isWebAudioEnabled; }
-    static bool webkitOfflineAudioContextEnabled() { return isWebAudioEnabled; }
-#endif
-
 #if ENABLE(TOUCH_EVENTS)
     static bool touchEnabled() { return isTouchEnabled; }
     static void setTouchEnabled(bool isEnabled) { isTouchEnabled = isEnabled; }
@@ -317,7 +311,6 @@ private:
     static bool isDataTransferItemsEnabled;
     static bool isGeolocationEnabled;
     static bool isIndexedDBEnabled;
-    static bool isWebAudioEnabled;
     static bool isTouchEnabled;
     static bool isDeviceMotionEnabled;
     static bool isDeviceOrientationEnabled;
index fb8b988..12d45ce 100644 (file)
@@ -2023,20 +2023,29 @@ sub GenerateImplementation
                 push(@implContent, "JSValue ${getFunctionName}(ExecState* exec, JSValue slotBase, PropertyName)\n");
                 push(@implContent, "{\n");
 
-                # Global constructors can be disabled at runtime.
-                if ($attribute->signature->extendedAttributes->{"EnabledAtRuntime"} && $attribute->signature->type =~ /Constructor$/) {
-                    AddToImplIncludes("RuntimeEnabledFeatures.h");
-                    my $enable_function = GetRuntimeEnableFunctionName($attribute->signature);
-                    push(@implContent, "    if (!${enable_function}())\n");
-                    push(@implContent, "        return jsUndefined();\n");
-                }
-
                 if (!$attribute->isStatic || $attribute->signature->type =~ /Constructor$/) {
                     push(@implContent, "    ${className}* castedThis = jsCast<$className*>(asObject(slotBase));\n");
                 } else {
                     push(@implContent, "    UNUSED_PARAM(slotBase);\n");
                 }
 
+                # Global constructors can be disabled at runtime.
+                if ($attribute->signature->type =~ /Constructor$/) {
+                    if ($attribute->signature->extendedAttributes->{"EnabledAtRuntime"}) {
+                        AddToImplIncludes("RuntimeEnabledFeatures.h");
+                        my $enable_function = GetRuntimeEnableFunctionName($attribute->signature);
+                        push(@implContent, "    if (!${enable_function}())\n");
+                        push(@implContent, "        return jsUndefined();\n");
+                    } elsif ($attribute->signature->extendedAttributes->{"EnabledBySetting"}) {
+                        AddToImplIncludes("Frame.h");
+                        AddToImplIncludes("Settings.h");
+                        my $enable_function = ToMethodName($attribute->signature->extendedAttributes->{"EnabledBySetting"}) . "Enabled";
+                        push(@implContent, "    Settings* settings = castedThis->impl()->frame() ? castedThis->impl()->frame()->settings() : 0;\n");
+                        push(@implContent, "    if (!settings || !settings->$enable_function())\n");
+                        push(@implContent, "        return jsUndefined();\n");
+                    }
+                }
+
                 if ($attribute->signature->extendedAttributes->{"CachedAttribute"}) {
                     $needsMarkChildren = 1;
                 }
index 180ee39..4259007 100644 (file)
@@ -53,6 +53,7 @@ DoNotCheckSecurity
 DoNotCheckSecurityOnGetter
 DoNotCheckSecurityOnSetter
 EnabledAtRuntime=*
+EnabledBySetting=*
 EnforceRange
 EventTarget
 ExtendsDOMGlobalObject
index e76c496..c5cd494 100644 (file)
@@ -183,7 +183,7 @@ sub GenerateConstructorAttribute
     my $code = "    ";
     my @extendedAttributesList;
     foreach my $attributeName (keys %{$extendedAttributes}) {
-      next unless ($attributeName eq "Conditional" || $attributeName eq "EnabledAtRuntime" || $attributeName eq "EnabledPerContext");
+      next unless ($attributeName eq "Conditional" || $attributeName eq "EnabledAtRuntime" || $attributeName eq "EnabledBySetting");
       my $extendedAttribute = $attributeName;
       $extendedAttribute .= "=" . $extendedAttributes->{$attributeName} unless $extendedAttributes->{$attributeName} eq "VALUE_IS_MISSING";
       push(@extendedAttributesList, $extendedAttribute);
index a056e17..a368577 100644 (file)
@@ -26,6 +26,7 @@
 #include "Dictionary.h"
 #include "Document.h"
 #include "ExceptionCode.h"
+#include "Frame.h"
 #include "HTMLNames.h"
 #include "JSDOMBinding.h"
 #include "JSDOMStringList.h"
@@ -48,6 +49,7 @@
 #include "ScriptCallStackFactory.h"
 #include "ScriptProfile.h"
 #include "SerializedScriptValue.h"
+#include "Settings.h"
 #include "TestObj.h"
 #include "bool.h"
 #include <runtime/Error.h>
@@ -79,6 +81,7 @@ static const HashTableValue JSTestObjTableValues[] =
     { "readOnlyLongAttr", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReadOnlyLongAttr), (intptr_t)0, NoIntrinsic },
     { "readOnlyStringAttr", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReadOnlyStringAttr), (intptr_t)0, NoIntrinsic },
     { "readOnlyTestObjAttr", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReadOnlyTestObjAttr), (intptr_t)0, NoIntrinsic },
+    { "TestSubObjEnabledBySetting", DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjTestSubObjEnabledBySettingConstructor), (intptr_t)setJSTestObjTestSubObjEnabledBySettingConstructor, NoIntrinsic },
     { "enumAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjEnumAttr), (intptr_t)setJSTestObjEnumAttr, NoIntrinsic },
     { "byteAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjByteAttr), (intptr_t)setJSTestObjByteAttr, NoIntrinsic },
     { "octetAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjOctetAttr), (intptr_t)setJSTestObjOctetAttr, NoIntrinsic },
@@ -455,6 +458,16 @@ JSValue jsTestObjConstructorTestSubObj(ExecState* exec, JSValue slotBase, Proper
 }
 
 
+JSValue jsTestObjTestSubObjEnabledBySettingConstructor(ExecState* exec, JSValue slotBase, PropertyName)
+{
+    JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
+    Settings* settings = castedThis->impl()->frame() ? castedThis->impl()->frame()->settings() : 0;
+    if (!settings || !settings->testSettingEnabled())
+        return jsUndefined();
+    return JSTestSubObj::getConstructor(exec, castedThis->globalObject());
+}
+
+
 JSValue jsTestObjEnumAttr(ExecState* exec, JSValue slotBase, PropertyName)
 {
     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
@@ -1106,6 +1119,14 @@ void setJSTestObjConstructorStaticStringAttr(ExecState* exec, JSObject*, JSValue
 }
 
 
+void setJSTestObjTestSubObjEnabledBySettingConstructor(ExecState* exec, JSObject* thisObject, JSValue value)
+{
+    UNUSED_PARAM(exec);
+    // Shadowing a built-in constructor
+    jsCast<JSTestObj*>(thisObject)->putDirect(exec->vm(), Identifier(exec, "TestSubObjEnabledBySetting"), value);
+}
+
+
 void setJSTestObjEnumAttr(ExecState* exec, JSObject* thisObject, JSValue value)
 {
     UNUSED_PARAM(exec);
index 7a2d6ec..63a8bb7 100644 (file)
@@ -241,6 +241,8 @@ JSC::JSValue jsTestObjConstructorStaticReadOnlyLongAttr(JSC::ExecState*, JSC::JS
 JSC::JSValue jsTestObjConstructorStaticStringAttr(JSC::ExecState*, JSC::JSValue, JSC::PropertyName);
 void setJSTestObjConstructorStaticStringAttr(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
 JSC::JSValue jsTestObjConstructorTestSubObj(JSC::ExecState*, JSC::JSValue, JSC::PropertyName);
+JSC::JSValue jsTestObjTestSubObjEnabledBySettingConstructor(JSC::ExecState*, JSC::JSValue, JSC::PropertyName);
+void setJSTestObjTestSubObjEnabledBySettingConstructor(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
 JSC::JSValue jsTestObjEnumAttr(JSC::ExecState*, JSC::JSValue, JSC::PropertyName);
 void setJSTestObjEnumAttr(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
 JSC::JSValue jsTestObjByteAttr(JSC::ExecState*, JSC::JSValue, JSC::PropertyName);
index e03d025..9c8cbdf 100644 (file)
@@ -39,6 +39,7 @@
 @class DOMTestObjectAConstructor;
 @class DOMTestObjectBConstructor;
 @class DOMTestObjectCConstructor;
+@class DOMTestSubObjConstructor;
 @class DOMany;
 @class DOMbool;
 @class NSString;
@@ -66,6 +67,7 @@ enum {
 @property(readonly) int readOnlyLongAttr;
 @property(readonly, copy) NSString *readOnlyStringAttr;
 @property(readonly, retain) DOMTestObj *readOnlyTestObjAttr;
+@property(retain) DOMTestSubObjConstructor *TestSubObjEnabledBySetting;
 @property char byteAttr;
 @property unsigned char octetAttr;
 @property short shortAttr;
index fe83118..9aa2e49 100644 (file)
@@ -45,6 +45,7 @@
 #import "DOMTestObjectAConstructorInternal.h"
 #import "DOMTestObjectBConstructorInternal.h"
 #import "DOMTestObjectCConstructorInternal.h"
+#import "DOMTestSubObjConstructorInternal.h"
 #import "DOManyInternal.h"
 #import "DOMboolInternal.h"
 #import "Dictionary.h"
@@ -65,6 +66,7 @@
 #import "TestObjectAConstructor.h"
 #import "TestObjectBConstructor.h"
 #import "TestObjectCConstructor.h"
+#import "TestSubObjConstructor.h"
 #import "ThreadCheck.h"
 #import "WebCoreObjCExtras.h"
 #import "WebScriptObjectPrivate.h"
     return kit(WTF::getPtr(IMPL->readOnlyTestObjAttr()));
 }
 
+- (DOMTestSubObjConstructor *)TestSubObjEnabledBySetting
+{
+    WebCore::JSMainThreadNullState state;
+    return kit(WTF::getPtr(IMPL->testSubObjEnabledBySetting()));
+}
+
+- (void)setTestSubObjEnabledBySetting:(DOMTestSubObjConstructor *)newTestSubObjEnabledBySetting
+{
+    WebCore::JSMainThreadNullState state;
+    ASSERT(newTestSubObjEnabledBySetting);
+
+    IMPL->setTestSubObjEnabledBySetting(core(newTestSubObjEnabledBySetting));
+}
+
 - (char)byteAttr
 {
     WebCore::JSMainThreadNullState state;
index 0679f37..71cae80 100644 (file)
@@ -43,6 +43,7 @@ enum TestEnumType { "", "EnumValue1", "EnumValue2", "EnumValue3" };
     static readonly attribute long     staticReadOnlyLongAttr;
     static attribute DOMString         staticStringAttr;
     static readonly attribute TestSubObjConstructor TestSubObj;
+    [EnabledBySetting=TestSetting] attribute TestSubObjConstructor TestSubObjEnabledBySetting;
     attribute TestEnumType             enumAttr;
     attribute byte                     byteAttr;
     attribute octet                    octetAttr;
index 122fb05..eab14a6 100644 (file)
@@ -115,6 +115,7 @@ privilegedWebGLExtensionsEnabled initial=false
 accelerated2dCanvasEnabled initial=false
 antialiased2dCanvasEnabled initial=true
 loadDeferringEnabled initial=true
+webAudioEnabled initial=false
 paginateDuringLayoutEnabled initial=false
 fullScreenEnabled initial=false, conditional=FULLSCREEN_API
 asynchronousSpellCheckingEnabled initial=false
index d934218..c752b1d 100644 (file)
@@ -1,3 +1,18 @@
+2013-06-21  Christophe Dumez  <ch.dumez@sisa.samsung.com>
+
+        REGRESSION (r150663): Using webkitAudioContext in Inspector makes it undefined everywhere
+        https://bugs.webkit.org/show_bug.cgi?id=117825
+
+        Reviewed by Kentaro Hara.
+
+        Use Settings to enable Web Audio instead of RuntimeEnabledFeatures.
+
+        * WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
+        (DumpRenderTreeSupportEfl::setWebAudioEnabled):
+        * WebCoreSupport/DumpRenderTreeSupportEfl.h:
+        * ewk/ewk_view.cpp:
+        (_ewk_view_priv_new):
+
 2013-06-17  Seokju Kwon  <seokju.kwon@gmail.com>
 
         [EFL] Remove unneeded WebCore namespace in FrameLoaderClientEfl
index 7490ac7..8c36069 100644 (file)
@@ -324,11 +324,14 @@ void DumpRenderTreeSupportEfl::setSeamlessIFramesEnabled(bool enabled)
 #endif
 }
 
-void DumpRenderTreeSupportEfl::setWebAudioEnabled(bool enabled)
+void DumpRenderTreeSupportEfl::setWebAudioEnabled(Evas_Object* ewkView, bool enabled)
 {
 #if ENABLE(WEB_AUDIO)
-    WebCore::RuntimeEnabledFeatures::setWebAudioEnabled(enabled);
+    DRT_SUPPRT_PAGE_GET_OR_RETURN(ewkView, page);
+
+    page->settings()->setWebAudioEnabled(enabled);
 #else
+    UNUSED_PARAM(ewkView);
     UNUSED_PARAM(enabled);
 #endif
 }
index dc61ea6..3bc2b4f 100644 (file)
@@ -81,7 +81,7 @@ public:
     static void setCSSGridLayoutEnabled(const Evas_Object* ewkView, bool enabled);
     static void setCSSRegionsEnabled(const Evas_Object* ewkView, bool enabled);
     static void setSeamlessIFramesEnabled(bool);
-    static void setWebAudioEnabled(bool);
+    static void setWebAudioEnabled(Evas_Object* ewkView, bool);
 
     static void forceLayout(Evas_Object* ewkFrame);
     static void setTracksRepaints(Evas_Object* ewkFrame, bool enabled);
index 2a7bd89..ab274b6 100644 (file)
@@ -759,7 +759,7 @@ static Ewk_View_Private_Data* _ewk_view_priv_new(Ewk_View_Smart_Data* smartData)
     priv->pageSettings->setUsesPageCache(true);
     priv->pageSettings->setUsesEncodingDetector(false);
 #if ENABLE(WEB_AUDIO)
-    WebCore::RuntimeEnabledFeatures::setWebAudioEnabled(false);
+    priv->pageSettings->setWebAudioEnabled(false);
 #endif
     priv->pageSettings->setWebGLEnabled(true);
     priv->pageSettings->setXSSAuditorEnabled(true);
index 6f8ff45..4ba2659 100644 (file)
@@ -1,3 +1,16 @@
+2013-06-21  Christophe Dumez  <ch.dumez@sisa.samsung.com>
+
+        REGRESSION (r150663): Using webkitAudioContext in Inspector makes it undefined everywhere
+        https://bugs.webkit.org/show_bug.cgi?id=117825
+
+        Reviewed by Kentaro Hara.
+
+        Use Settings to enable Web Audio instead of RuntimeEnabledFeatures.
+
+        * webkit/webkitwebview.cpp:
+        (webkit_web_view_update_settings):
+        (webkit_web_view_settings_notify):
+
 2013-06-18  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         Unreviewed. Update NEWS and Versions.m4 for 2.1.2 release.
index ec50a7b..76bbc1e 100644 (file)
@@ -3572,7 +3572,7 @@ static void webkit_web_view_update_settings(WebKitWebView* webView)
 #endif
 
 #if ENABLE(WEB_AUDIO)
-    WebCore::RuntimeEnabledFeatures::setWebAudioEnabled(settingsPrivate->enableWebAudio);
+    coreSettings->setWebAudioEnabled(settingsPrivate->enableWebAudio);
 #endif
 
 #if ENABLE(SMOOTH_SCROLLING)
@@ -3718,7 +3718,7 @@ static void webkit_web_view_settings_notify(WebKitWebSettings* webSettings, GPar
 
 #if ENABLE(WEB_AUDIO)
     else if (name == g_intern_string("enable-webaudio"))
-        RuntimeEnabledFeatures::setWebAudioEnabled(g_value_get_boolean(&value));
+        settings->setWebAudioEnabled(g_value_get_boolean(&value));
 #endif
 
 #if ENABLE(SMOOTH_SCROLLING)
index f306ee7..d31eac1 100644 (file)
@@ -1,3 +1,15 @@
+2013-06-21  Christophe Dumez  <ch.dumez@sisa.samsung.com>
+
+        REGRESSION (r150663): Using webkitAudioContext in Inspector makes it undefined everywhere
+        https://bugs.webkit.org/show_bug.cgi?id=117825
+
+        Reviewed by Kentaro Hara.
+
+        Use Settings to enable Web Audio instead of RuntimeEnabledFeatures.
+
+        * WebView/WebView.mm:
+        (-[WebView _preferencesChanged:]):
+
 2013-06-20  Simon Fraser  <simon.fraser@apple.com>
 
         FrameView needs to initialize paintsEntireContents on creation
index aa9fc24..28766d1 100644 (file)
@@ -1507,7 +1507,7 @@ static bool needsSelfRetainWhileLoadingQuirk()
     RuntimeEnabledFeatures::setCSSRegionsEnabled([preferences cssRegionsEnabled]);
     RuntimeEnabledFeatures::setCSSCompositingEnabled([preferences cssCompositingEnabled]);
 #if ENABLE(WEB_AUDIO)
-    RuntimeEnabledFeatures::setWebAudioEnabled([preferences webAudioEnabled]);
+    settings->setWebAudioEnabled([preferences webAudioEnabled]);
 #endif
 #if ENABLE(IFRAME_SEAMLESS)
     RuntimeEnabledFeatures::setSeamlessIFramesEnabled([preferences seamlessIFramesEnabled]);
index e8b79e9..7344bae 100644 (file)
@@ -175,7 +175,7 @@ void QWebSettingsPrivate::apply()
 #endif
 #if ENABLE(WEB_AUDIO)
         value = attributes.value(QWebSettings::WebAudioEnabled, global->attributes.value(QWebSettings::WebAudioEnabled));
-        WebCore::RuntimeEnabledFeatures::setWebAudioEnabled(value);
+        settings->setWebAudioEnabled(value);
 #endif
 
         value = attributes.value(QWebSettings::CSSRegionsEnabled,
index a4fd5bd..66c5161 100644 (file)
@@ -1,3 +1,15 @@
+2013-06-21  Christophe Dumez  <ch.dumez@sisa.samsung.com>
+
+        REGRESSION (r150663): Using webkitAudioContext in Inspector makes it undefined everywhere
+        https://bugs.webkit.org/show_bug.cgi?id=117825
+
+        Reviewed by Kentaro Hara.
+
+        Use Settings to enable Web Audio instead of RuntimeEnabledFeatures.
+
+        * Api/qwebsettings.cpp:
+        (QWebSettingsPrivate::apply):
+
 2013-06-17  Michael BrĂ¼ning  <michael.bruning@digia.com>
 
         [Qt] Remove Qt specific QTKIT flagged code.
index 5c64b69..825df7a 100644 (file)
@@ -1,3 +1,15 @@
+2013-06-21  Christophe Dumez  <ch.dumez@sisa.samsung.com>
+
+        REGRESSION (r150663): Using webkitAudioContext in Inspector makes it undefined everywhere
+        https://bugs.webkit.org/show_bug.cgi?id=117825
+
+        Reviewed by Kentaro Hara.
+
+        Use Settings to enable Web Audio instead of RuntimeEnabledFeatures.
+
+        * WebView.cpp:
+        (WebView::notifyPreferencesChanged):
+
 2013-06-19  Brent Fulgham  <bfulgham@apple.com>
 
         [Windows] Correct style on last patch.
index 8ce37f3..3453547 100644 (file)
@@ -4923,7 +4923,7 @@ HRESULT WebView::notifyPreferencesChanged(IWebNotification* notification)
     settings->setShowRepaintCounter(enabled);
 
 #if ENABLE(WEB_AUDIO)
-    RuntimeEnabledFeatures::setWebAudioEnabled(true);
+    settings->:setWebAudioEnabled(true);
 #endif // ENABLE(WEB_AUDIO)
 
 #if ENABLE(WEBGL)
index 15fcda9..b38991e 100644 (file)
@@ -1,3 +1,17 @@
+2013-06-21  Christophe Dumez  <ch.dumez@sisa.samsung.com>
+
+        REGRESSION (r150663): Using webkitAudioContext in Inspector makes it undefined everywhere
+        https://bugs.webkit.org/show_bug.cgi?id=117825
+
+        Reviewed by Kentaro Hara.
+
+        Use Settings to enable Web Audio instead of RuntimeEnabledFeatures.
+
+        * WebProcess/InjectedBundle/InjectedBundle.cpp:
+        (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::updatePreferences):
+
 2013-06-21  Sergio Correia  <sergio.correia@openbossa.org>
 
         [WK2][EFL]: Invalidate the ProcessLauncher when the process is terminated before it has finished launching
index 630d96a..ef4a82f 100644 (file)
@@ -206,11 +206,6 @@ void InjectedBundle::overrideBoolPreferenceForTestRunner(WebPageGroupProxy* page
         RuntimeEnabledFeatures::setCSSCompositingEnabled(enabled);
 #endif
 
-#if ENABLE(WEB_AUDIO)
-    if (preference == "WebKitWebAudioEnabled")
-        RuntimeEnabledFeatures::setWebAudioEnabled(enabled);
-#endif
-
     // Map the names used in LayoutTests with the names used in WebCore::Settings and WebPreferencesStore.
 #define FOR_EACH_OVERRIDE_BOOL_PREFERENCE(macro) \
     macro(WebKitAcceleratedCompositingEnabled, AcceleratedCompositingEnabled, acceleratedCompositingEnabled) \
@@ -225,6 +220,7 @@ void InjectedBundle::overrideBoolPreferenceForTestRunner(WebPageGroupProxy* page
     macro(WebKitPageCacheSupportsPluginsPreferenceKey, PageCacheSupportsPlugins, pageCacheSupportsPlugins) \
     macro(WebKitPluginsEnabled, PluginsEnabled, pluginsEnabled) \
     macro(WebKitUsesPageCachePreferenceKey, UsesPageCache, usesPageCache) \
+    macro(WebKitWebAudioEnabled, WebAudioEnabled, webAudioEnabled) \
     macro(WebKitWebGLEnabled, WebGLEnabled, webGLEnabled) \
     macro(WebKitXSSAuditorEnabled, XSSAuditorEnabled, xssAuditorEnabled) \
     macro(WebKitShouldRespectImageOrientation, ShouldRespectImageOrientation, shouldRespectImageOrientation) \
index 67e682f..01e0c00 100644 (file)
@@ -2520,7 +2520,7 @@ void WebPage::updatePreferences(const WebPreferencesStore& store)
 #endif
 
 #if ENABLE(WEB_AUDIO)
-    RuntimeEnabledFeatures::setWebAudioEnabled(store.getBoolValueForKey(WebPreferencesKey::webAudioEnabledKey()));
+    settings->setWebAudioEnabled(store.getBoolValueForKey(WebPreferencesKey::webAudioEnabledKey()));
 #endif
 
     settings->setApplicationChromeMode(store.getBoolValueForKey(WebPreferencesKey::applicationChromeModeKey()));
index bf67e14..003cf62 100644 (file)
@@ -1,3 +1,17 @@
+2013-06-21  Christophe Dumez  <ch.dumez@sisa.samsung.com>
+
+        REGRESSION (r150663): Using webkitAudioContext in Inspector makes it undefined everywhere
+        https://bugs.webkit.org/show_bug.cgi?id=117825
+
+        Reviewed by Kentaro Hara.
+
+        DumpRenderTreeSupportEfl::setWebAudioEnabled() now requires an additional view argument.
+
+        * DumpRenderTree/efl/DumpRenderTreeChrome.cpp:
+        (DumpRenderTreeChrome::resetDefaultsToConsistentValues):
+        * DumpRenderTree/efl/TestRunnerEfl.cpp:
+        (TestRunner::overridePreference):
+
 2013-06-21  Krzysztof Czech  <k.czech@samsung.com>
 
         [ATK] Added support for aria-required attribute.
index 8c0786a..5a63384 100644 (file)
@@ -324,7 +324,7 @@ void DumpRenderTreeChrome::resetDefaultsToConsistentValues()
     DumpRenderTreeSupportEfl::setShouldTrackVisitedLinks(false);
     DumpRenderTreeSupportEfl::setTracksRepaints(mainFrame(), false);
     DumpRenderTreeSupportEfl::setSeamlessIFramesEnabled(true);
-    DumpRenderTreeSupportEfl::setWebAudioEnabled(false);
+    DumpRenderTreeSupportEfl::setWebAudioEnabled(mainView(), false);
 
     // Reset capacities for the memory cache for dead objects.
     static const unsigned cacheTotalCapacity =  8192 * 1024;
index 85c70da..9f66e95 100644 (file)
@@ -661,7 +661,7 @@ void TestRunner::overridePreference(JSStringRef key, JSStringRef value)
     else if (equals(key, "WebKitCSSRegionsEnabled"))
         DumpRenderTreeSupportEfl::setCSSRegionsEnabled(browser->mainView(), toBool(value));
     else if (equals(key, "WebKitWebAudioEnabled"))
-        DumpRenderTreeSupportEfl::setWebAudioEnabled(toBool(value));
+        DumpRenderTreeSupportEfl::setWebAudioEnabled(browser->mainView(), toBool(value));
     else if (equals(key, "WebKitDisplayImagesKey"))
         ewk_view_setting_auto_load_images_set(browser->mainView(), toBool(value));
     else