Title: [202728] trunk
Revision
202728
Author
[email protected]
Date
2016-07-01 00:47:14 -0700 (Fri, 01 Jul 2016)

Log Message

Add a runtime flag for DOM iterators
https://bugs.webkit.org/show_bug.cgi?id=159300

Patch by Youenn Fablet <[email protected]> on 2016-07-01
Reviewed by Alex Christensen.

Source/_javascript_Core:

* runtime/CommonIdentifiers.h:

Source/WebCore:

* Modules/fetch/FetchHeaders.idl: Making iterator runtime-enabled.
* bindings/generic/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setDOMIteratorEnabled):
(WebCore::RuntimeEnabledFeatures::domIteratorEnabled):
* bindings/scripts/CodeGeneratorJS.pm:
(ToMethodName): Fixing dOM -> dom casing issue.
(GenerateImplementation): Using addIterableProperties new method.
(addIterableProperties): Activating property addition according runtime flag if iterator is rnutime flagged.
* bindings/scripts/IDLParser.pm:
(parseOptionalIterableInterface): Adding extendedAttributes to iterable.
* bindings/scripts/test/JS/JSTestNode.cpp:
(WebCore::JSTestNodePrototype::finishCreation):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObjPrototype::finishCreation):
* bindings/scripts/test/TestNode.idl: Making iterator runtime-enabled.
* bindings/scripts/test/TestObj.idl: Ditto.
* css/FontFaceSet.idl: Ditto.
* dom/NodeList.idl: Ditto.

Source/WebKit/mac:

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(-[WebPreferences DOMIteratorEnabled]):
(-[WebPreferences setDOMIteratorEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKit/win:

* WebPreferenceKeysPrivate.h:
* WebPreferences.cpp:
(WebPreferences::domIteratorEnabled):
(WebPreferences::setDOMIteratorEnabled):
(WebView::notifyPreferencesChanged):
* WebPreferencesreferences.h:
* WebView.cpp:
(WebView::notifyPreferencesChanged):

Source/WebKit2:

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

Tools:

* DumpRenderTree/mac/DumpRenderTree.mm:
(resetWebPreferencesToConsistentValues):
* DumpRenderTree/win/DumpRenderTree.cpp:
(resetWebPreferencesToConsistentValues):
* Scripts/webkitperl/FeatureList.pm:
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::beginTesting):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setDOMIteratorEnabled):
* WebKitTestRunner/InjectedBundle/TestRunner.h:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (202727 => 202728)


--- trunk/Source/_javascript_Core/ChangeLog	2016-07-01 07:29:53 UTC (rev 202727)
+++ trunk/Source/_javascript_Core/ChangeLog	2016-07-01 07:47:14 UTC (rev 202728)
@@ -1,3 +1,12 @@
+2016-07-01  Youenn Fablet  <[email protected]>
+
+        Add a runtime flag for DOM iterators
+        https://bugs.webkit.org/show_bug.cgi?id=159300
+
+        Reviewed by Alex Christensen.
+
+        * runtime/CommonIdentifiers.h:
+
 2016-06-30  Joseph Pecoraro  <[email protected]>
 
         Web Inspector: Wrong function name next to scope

Modified: trunk/Source/_javascript_Core/runtime/CommonIdentifiers.h (202727 => 202728)


--- trunk/Source/_javascript_Core/runtime/CommonIdentifiers.h	2016-07-01 07:29:53 UTC (rev 202727)
+++ trunk/Source/_javascript_Core/runtime/CommonIdentifiers.h	2016-07-01 07:47:14 UTC (rev 202728)
@@ -38,6 +38,7 @@
     macro(Date) \
     macro(DateTimeFormat) \
     macro(DocumentTimeline) \
+    macro(DOMIterator) \
     macro(Error) \
     macro(EvalError) \
     macro(Function) \

Modified: trunk/Source/WebCore/ChangeLog (202727 => 202728)


--- trunk/Source/WebCore/ChangeLog	2016-07-01 07:29:53 UTC (rev 202727)
+++ trunk/Source/WebCore/ChangeLog	2016-07-01 07:47:14 UTC (rev 202728)
@@ -1,3 +1,29 @@
+2016-07-01  Youenn Fablet  <[email protected]>
+
+        Add a runtime flag for DOM iterators
+        https://bugs.webkit.org/show_bug.cgi?id=159300
+
+        Reviewed by Alex Christensen.
+
+        * Modules/fetch/FetchHeaders.idl: Making iterator runtime-enabled.
+        * bindings/generic/RuntimeEnabledFeatures.h:
+        (WebCore::RuntimeEnabledFeatures::setDOMIteratorEnabled):
+        (WebCore::RuntimeEnabledFeatures::domIteratorEnabled):
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (ToMethodName): Fixing dOM -> dom casing issue.
+        (GenerateImplementation): Using addIterableProperties new method.
+        (addIterableProperties): Activating property addition according runtime flag if iterator is rnutime flagged.
+        * bindings/scripts/IDLParser.pm:
+        (parseOptionalIterableInterface): Adding extendedAttributes to iterable.
+        * bindings/scripts/test/JS/JSTestNode.cpp:
+        (WebCore::JSTestNodePrototype::finishCreation):
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+        (WebCore::JSTestObjPrototype::finishCreation):
+        * bindings/scripts/test/TestNode.idl: Making iterator runtime-enabled.
+        * bindings/scripts/test/TestObj.idl: Ditto.
+        * css/FontFaceSet.idl: Ditto.
+        * dom/NodeList.idl: Ditto.
+
 2016-07-01  Frederic Wang  <fwang.igalia.com>
 
         Eliminate trailing whitespace in MathML code

Modified: trunk/Source/WebCore/Modules/fetch/FetchHeaders.idl (202727 => 202728)


--- trunk/Source/WebCore/Modules/fetch/FetchHeaders.idl	2016-07-01 07:29:53 UTC (rev 202727)
+++ trunk/Source/WebCore/Modules/fetch/FetchHeaders.idl	2016-07-01 07:47:14 UTC (rev 202728)
@@ -41,7 +41,7 @@
     [RaisesException] boolean has(DOMString name);
     [RaisesException] void set(DOMString name, DOMString value);
 
-    iterable<DOMString, DOMString>;
+    [EnabledAtRuntime=DOMIterator] iterable<DOMString, DOMString>;
 
     [PrivateIdentifier, RaisesException, ImplementedAs=append] void appendFromJS(DOMString name, DOMString value);
     [PrivateIdentifier, ImplementedAs=fill] void fillFromJS(FetchHeaders? headers);

Modified: trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h (202727 => 202728)


--- trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h	2016-07-01 07:29:53 UTC (rev 202727)
+++ trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h	2016-07-01 07:47:14 UTC (rev 202728)
@@ -58,6 +58,9 @@
     void setDataTransferItemsEnabled(bool isEnabled) { m_isDataTransferItemsEnabled = isEnabled; }
     bool dataTransferItemsEnabled() const { return m_isDataTransferItemsEnabled; }
 
+    void setDOMIteratorEnabled(bool isEnabled) { m_isDOMIteratorEnabled = isEnabled; }
+    bool domIteratorEnabled() const { return m_isDOMIteratorEnabled; }
+
     void setGeolocationEnabled(bool isEnabled) { m_isGeolocationEnabled = isEnabled; }
     bool geolocationEnabled() const { return m_isGeolocationEnabled; }
 
@@ -234,6 +237,7 @@
     bool m_isWebkitNotificationsEnabled;
     bool m_isApplicationCacheEnabled;
     bool m_isDataTransferItemsEnabled;
+    bool m_isDOMIteratorEnabled { true };
     bool m_isGeolocationEnabled;
     bool m_isTouchEnabled;
     bool m_isDeviceMotionEnabled;

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (202727 => 202728)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2016-07-01 07:29:53 UTC (rev 202727)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2016-07-01 07:47:14 UTC (rev 202728)
@@ -1956,12 +1956,13 @@
 {
     my $param = shift;
     my $ret = lcfirst($param);
+    $ret =~ s/cSS/css/ if $ret =~ /^cSS/;
+    $ret =~ s/dOM/dom/ if $ret =~ /^dOM/;
     $ret =~ s/hTML/html/ if $ret =~ /^hTML/;
+    $ret =~ s/jS/js/ if $ret =~ /^jS/;
     $ret =~ s/uRL/url/ if $ret =~ /^uRL/;
-    $ret =~ s/jS/js/ if $ret =~ /^jS/;
     $ret =~ s/xML/xml/ if $ret =~ /^xML/;
     $ret =~ s/xSLT/xslt/ if $ret =~ /^xSLT/;
-    $ret =~ s/cSS/css/ if $ret =~ /^cSS/;
 
     # For HTML5 FileSystem API Flags attributes.
     # (create is widely used to instantiate an object and must be avoided.)
@@ -2309,8 +2310,7 @@
         }
 
         if ($interface->iterable) {
-            my $functionName = GetFunctionName($interface, $className, @{$interface->iterable->functions}[0]);
-            push(@implContent, "    putDirect(vm, vm.propertyNames->iteratorSymbol, JSFunction::create(vm, globalObject(), 0, ASCIILiteral(\"[Symbol.Iterator]\"), $functionName), DontEnum);\n");
+            addIterableProperties($interface, $className);
         }
 
         push(@implContent, "}\n\n");
@@ -4247,6 +4247,26 @@
     }
 }
 
+sub addIterableProperties()
+{
+    my $interface = shift;
+    my $className = shift;
+
+    if ($interface->iterable->extendedAttributes->{"EnabledAtRuntime"}) {
+        AddToImplIncludes("RuntimeEnabledFeatures.h");
+        my $enable_function = GetRuntimeEnableFunctionName($interface->iterable);
+        push(@implContent, "    if (${enable_function}()) {\n    ");
+    }
+
+    my $functionName = GetFunctionName($interface, $className, @{$interface->iterable->functions}[0]);
+    push(@implContent, "    putDirect(vm, vm.propertyNames->iteratorSymbol, JSFunction::create(vm, globalObject(), 0, ASCIILiteral(\"[Symbol.Iterator]\"), $functionName), DontEnum);\n");
+
+    if ($interface->iterable->extendedAttributes->{"EnabledAtRuntime"}) {
+        push(@implContent, "    }\n");
+    }
+
+}
+
 sub GetNativeTypeFromSignature
 {
     my ($interface, $signature) = @_;

Modified: trunk/Source/WebCore/bindings/scripts/IDLParser.pm (202727 => 202728)


--- trunk/Source/WebCore/bindings/scripts/IDLParser.pm	2016-07-01 07:29:53 UTC (rev 202727)
+++ trunk/Source/WebCore/bindings/scripts/IDLParser.pm	2016-07-01 07:47:14 UTC (rev 202728)
@@ -93,6 +93,7 @@
     keyType => '$',   # Key type for map iterables
     valueType => '$', # Value type for map or set iterables
     functions => '@', # Iterable functions (entries, keys, values, [Symbol.Iterator], forEach)
+    extendedAttributes => '$', # Extended attributes
 });
 
 
@@ -1408,6 +1409,7 @@
     push(@{$forEachFunction->parameters}, ($forEachArgument));
 
     my $newDataNode = domIterable->new();
+    $newDataNode->extendedAttributes($extendedAttributeList);
     push(@{$newDataNode->functions}, $symbolIteratorFunction);
     push(@{$newDataNode->functions}, $entriesFunction);
     push(@{$newDataNode->functions}, $keysFunction);

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp (202727 => 202728)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp	2016-07-01 07:29:53 UTC (rev 202727)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp	2016-07-01 07:47:14 UTC (rev 202728)
@@ -25,6 +25,7 @@
 #include "JSDOMBinding.h"
 #include "JSDOMConstructor.h"
 #include "JSDOMIterator.h"
+#include "RuntimeEnabledFeatures.h"
 #include "URL.h"
 #include <runtime/Error.h>
 #include <runtime/JSString.h>
@@ -115,7 +116,29 @@
 {
     Base::finishCreation(vm);
     reifyStaticProperties(vm, JSTestNodePrototypeTableValues, *this);
-    putDirect(vm, vm.propertyNames->iteratorSymbol, JSFunction::create(vm, globalObject(), 0, ASCIILiteral("[Symbol.Iterator]"), jsTestNodePrototypeFunctionSymbolIterator), DontEnum);
+    if (!RuntimeEnabledFeatures::sharedFeatures().domIteratorEnabled()) {
+        Identifier propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>("entries"), strlen("entries"));
+        VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable);
+        JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName);
+    }
+    if (!RuntimeEnabledFeatures::sharedFeatures().domIteratorEnabled()) {
+        Identifier propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>("keys"), strlen("keys"));
+        VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable);
+        JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName);
+    }
+    if (!RuntimeEnabledFeatures::sharedFeatures().domIteratorEnabled()) {
+        Identifier propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>("values"), strlen("values"));
+        VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable);
+        JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName);
+    }
+    if (!RuntimeEnabledFeatures::sharedFeatures().domIteratorEnabled()) {
+        Identifier propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>("forEach"), strlen("forEach"));
+        VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable);
+        JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName);
+    }
+    if (RuntimeEnabledFeatures::sharedFeatures().domIteratorEnabled()) {
+        putDirect(vm, vm.propertyNames->iteratorSymbol, JSFunction::create(vm, globalObject(), 0, ASCIILiteral("[Symbol.Iterator]"), jsTestNodePrototypeFunctionSymbolIterator), DontEnum);
+    }
 }
 
 const ClassInfo JSTestNode::s_info = { "TestNode", &Base::s_info, 0, CREATE_METHOD_TABLE(JSTestNode) };

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (202727 => 202728)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp	2016-07-01 07:29:53 UTC (rev 202727)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp	2016-07-01 07:47:14 UTC (rev 202728)
@@ -1317,6 +1317,26 @@
         JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName);
     }
 #endif
+    if (!RuntimeEnabledFeatures::sharedFeatures().domIteratorEnabled()) {
+        Identifier propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>("entries"), strlen("entries"));
+        VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable);
+        JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName);
+    }
+    if (!RuntimeEnabledFeatures::sharedFeatures().domIteratorEnabled()) {
+        Identifier propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>("keys"), strlen("keys"));
+        VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable);
+        JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName);
+    }
+    if (!RuntimeEnabledFeatures::sharedFeatures().domIteratorEnabled()) {
+        Identifier propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>("values"), strlen("values"));
+        VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable);
+        JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName);
+    }
+    if (!RuntimeEnabledFeatures::sharedFeatures().domIteratorEnabled()) {
+        Identifier propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>("forEach"), strlen("forEach"));
+        VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable);
+        JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName);
+    }
 #if ENABLE(TEST_FEATURE)
     if (!RuntimeEnabledFeatures::sharedFeatures().testFeatureEnabled()) {
         Identifier propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>("enabledAtRuntimeAttribute"), strlen("enabledAtRuntimeAttribute"));
@@ -1327,7 +1347,9 @@
     JSVMClientData& clientData = *static_cast<JSVMClientData*>(vm.clientData);
     putDirect(vm, clientData.builtinNames().privateMethodPrivateName(), JSFunction::create(vm, globalObject(), 0, String(), jsTestObjPrototypeFunctionPrivateMethod), ReadOnly | DontEnum);
     putDirect(vm, clientData.builtinNames().publicAndPrivateMethodPrivateName(), JSFunction::create(vm, globalObject(), 0, String(), jsTestObjPrototypeFunctionPublicAndPrivateMethod), ReadOnly | DontEnum);
-    putDirect(vm, vm.propertyNames->iteratorSymbol, JSFunction::create(vm, globalObject(), 0, ASCIILiteral("[Symbol.Iterator]"), jsTestObjPrototypeFunctionSymbolIterator), DontEnum);
+    if (RuntimeEnabledFeatures::sharedFeatures().domIteratorEnabled()) {
+        putDirect(vm, vm.propertyNames->iteratorSymbol, JSFunction::create(vm, globalObject(), 0, ASCIILiteral("[Symbol.Iterator]"), jsTestObjPrototypeFunctionSymbolIterator), DontEnum);
+    }
 }
 
 const ClassInfo JSTestObj::s_info = { "TestObject", &Base::s_info, &JSTestObjTable, CREATE_METHOD_TABLE(JSTestObj) };

Modified: trunk/Source/WebCore/bindings/scripts/test/TestNode.idl (202727 => 202728)


--- trunk/Source/WebCore/bindings/scripts/test/TestNode.idl	2016-07-01 07:29:53 UTC (rev 202727)
+++ trunk/Source/WebCore/bindings/scripts/test/TestNode.idl	2016-07-01 07:47:14 UTC (rev 202728)
@@ -24,6 +24,6 @@
 ] interface TestNode : Node {
     attribute DOMString name;
 
-    iterable<TestNode>;
+    [EnabledAtRuntime=DOMIterator] iterable<TestNode>;
 };
 

Modified: trunk/Source/WebCore/bindings/scripts/test/TestObj.idl (202727 => 202728)


--- trunk/Source/WebCore/bindings/scripts/test/TestObj.idl	2016-07-01 07:29:53 UTC (rev 202727)
+++ trunk/Source/WebCore/bindings/scripts/test/TestObj.idl	2016-07-01 07:47:14 UTC (rev 202728)
@@ -95,7 +95,7 @@
     // TypedArray attribute
     attribute Float32Array typedArrayAttr;
 
-    iterable<DOMString, TestObj>;
+    [EnabledAtRuntime=DOMIterator] iterable<DOMString, TestObj>;
 
     // Methods
     void    voidMethod();

Modified: trunk/Source/WebCore/css/FontFaceSet.idl (202727 => 202728)


--- trunk/Source/WebCore/css/FontFaceSet.idl	2016-07-01 07:29:53 UTC (rev 202727)
+++ trunk/Source/WebCore/css/FontFaceSet.idl	2016-07-01 07:47:14 UTC (rev 202728)
@@ -35,7 +35,7 @@
     boolean has(FontFace font);
 
     // FIXME: We should add support for the setlike declaration.
-    iterable<FontFace>;
+    [EnabledAtRuntime=DOMIterator] iterable<FontFace>;
 
     readonly attribute long size;
 

Modified: trunk/Source/WebCore/dom/NodeList.idl (202727 => 202728)


--- trunk/Source/WebCore/dom/NodeList.idl	2016-07-01 07:29:53 UTC (rev 202727)
+++ trunk/Source/WebCore/dom/NodeList.idl	2016-07-01 07:47:14 UTC (rev 202728)
@@ -27,6 +27,6 @@
 ] interface NodeList {
     getter Node item(unsigned long index);
     readonly attribute unsigned long length;
-    iterable<Node>;
+    [EnabledAtRuntime=DOMIterator] iterable<Node>;
 };
 

Modified: trunk/Source/WebKit/mac/ChangeLog (202727 => 202728)


--- trunk/Source/WebKit/mac/ChangeLog	2016-07-01 07:29:53 UTC (rev 202727)
+++ trunk/Source/WebKit/mac/ChangeLog	2016-07-01 07:47:14 UTC (rev 202728)
@@ -1,3 +1,18 @@
+2016-07-01  Youenn Fablet  <[email protected]>
+
+        Add a runtime flag for DOM iterators
+        https://bugs.webkit.org/show_bug.cgi?id=159300
+
+        Reviewed by Alex Christensen.
+
+        * WebView/WebPreferenceKeysPrivate.h:
+        * WebView/WebPreferences.mm:
+        (-[WebPreferences DOMIteratorEnabled]):
+        (-[WebPreferences setDOMIteratorEnabled:]):
+        * WebView/WebPreferencesPrivate.h:
+        * WebView/WebView.mm:
+        (-[WebView _preferencesChanged:]):
+
 2016-06-30  Jiewen Tan  <[email protected]>
 
         Create a generic "linked-on-or-after" check for new CSP Rules

Modified: trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h (202727 => 202728)


--- trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h	2016-07-01 07:29:53 UTC (rev 202727)
+++ trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h	2016-07-01 07:47:14 UTC (rev 202728)
@@ -161,6 +161,7 @@
 #define WebKitMediaKeysStorageDirectoryKey @"WebKitMediaKeysStorageDirectory"
 #define WebKitShadowDOMEnabledPreferenceKey @"WebKitShadowDOMEnabled"
 #define WebKitCustomElementsEnabledPreferenceKey @"WebKitCustomElementsEnabled"
+#define WebKitDOMIteratorEnabledPreferenceKey @"WebKitDOMIteratorEnabled"
 #define WebKitFetchAPIEnabledPreferenceKey @"WebKitFetchAPIEnabled"
 #define WebKitDownloadAttributeEnabledPreferenceKey @"WebKitDownloadAttributeEnabled"
 #define WebKitCSSGridLayoutEnabledPreferenceKey @"WebKitCSSGridLayoutEnabled"

Modified: trunk/Source/WebKit/mac/WebView/WebPreferences.mm (202727 => 202728)


--- trunk/Source/WebKit/mac/WebView/WebPreferences.mm	2016-07-01 07:29:53 UTC (rev 202727)
+++ trunk/Source/WebKit/mac/WebView/WebPreferences.mm	2016-07-01 07:47:14 UTC (rev 202728)
@@ -2722,6 +2722,16 @@
     [self _setBoolValue:flag forKey:WebKitCustomElementsEnabledPreferenceKey];
 }
 
+- (BOOL)DOMIteratorEnabled
+{
+    return [self _boolValueForKey:WebKitDOMIteratorEnabledPreferenceKey];
+}
+
+- (void)setDOMIteratorEnabled:(BOOL)flag
+{
+    [self _setBoolValue:flag forKey:WebKitDOMIteratorEnabledPreferenceKey];
+}
+
 - (BOOL)fetchAPIEnabled
 {
     return [self _boolValueForKey:WebKitFetchAPIEnabledPreferenceKey];

Modified: trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h (202727 => 202728)


--- trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h	2016-07-01 07:29:53 UTC (rev 202727)
+++ trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h	2016-07-01 07:47:14 UTC (rev 202728)
@@ -481,6 +481,9 @@
 - (void)setCustomElementsEnabled:(BOOL)flag;
 - (BOOL)customElementsEnabled;
 
+- (void)setDOMIteratorEnabled:(BOOL)flag;
+- (BOOL)DOMIteratorEnabled;
+
 - (void)setFetchAPIEnabled:(BOOL)flag;
 - (BOOL)fetchAPIEnabled;
 

Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (202727 => 202728)


--- trunk/Source/WebKit/mac/WebView/WebView.mm	2016-07-01 07:29:53 UTC (rev 202727)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm	2016-07-01 07:47:14 UTC (rev 202728)
@@ -2498,6 +2498,8 @@
 
     RuntimeEnabledFeatures::sharedFeatures().setShadowDOMEnabled([preferences shadowDOMEnabled]);
 
+    RuntimeEnabledFeatures::sharedFeatures().setDOMIteratorEnabled([preferences DOMIteratorEnabled]);
+
 #if ENABLE(CUSTOM_ELEMENTS)
     RuntimeEnabledFeatures::sharedFeatures().setCustomElementsEnabled([preferences customElementsEnabled]);
 #endif

Modified: trunk/Source/WebKit/win/ChangeLog (202727 => 202728)


--- trunk/Source/WebKit/win/ChangeLog	2016-07-01 07:29:53 UTC (rev 202727)
+++ trunk/Source/WebKit/win/ChangeLog	2016-07-01 07:47:14 UTC (rev 202728)
@@ -1,3 +1,19 @@
+2016-07-01  Youenn Fablet  <[email protected]>
+
+        Add a runtime flag for DOM iterators
+        https://bugs.webkit.org/show_bug.cgi?id=159300
+
+        Reviewed by Alex Christensen.
+
+        * WebPreferenceKeysPrivate.h:
+        * WebPreferences.cpp:
+        (WebPreferences::domIteratorEnabled):
+        (WebPreferences::setDOMIteratorEnabled):
+        (WebView::notifyPreferencesChanged):
+        * WebPreferencesreferences.h:
+        * WebView.cpp:
+        (WebView::notifyPreferencesChanged):
+
 2016-06-28  Per Arne Vollan  <[email protected]>
 
         [Win] Custom elements tests are failing.

Modified: trunk/Source/WebKit/win/Interfaces/IWebPreferencesPrivate.idl (202727 => 202728)


--- trunk/Source/WebKit/win/Interfaces/IWebPreferencesPrivate.idl	2016-07-01 07:29:53 UTC (rev 202727)
+++ trunk/Source/WebKit/win/Interfaces/IWebPreferencesPrivate.idl	2016-07-01 07:47:14 UTC (rev 202728)
@@ -175,6 +175,8 @@
 {
     HRESULT showTiledScrollingIndicator([out, retval] BOOL* enabled);
     HRESULT setShowTiledScrollingIndicator([in] BOOL enabled);
+    HRESULT domIteratorEnabled([out, retval] BOOL* enabled);
+    HRESULT setDOMIteratorEnabled([in] BOOL enabled);
     HRESULT fetchAPIEnabled([out, retval] BOOL* enabled);
     HRESULT setFetchAPIEnabled([in] BOOL enabled);
     HRESULT shadowDOMEnabled([out, retval] BOOL* enabled);

Modified: trunk/Source/WebKit/win/WebPreferenceKeysPrivate.h (202727 => 202728)


--- trunk/Source/WebKit/win/WebPreferenceKeysPrivate.h	2016-07-01 07:29:53 UTC (rev 202727)
+++ trunk/Source/WebKit/win/WebPreferenceKeysPrivate.h	2016-07-01 07:47:14 UTC (rev 202728)
@@ -168,6 +168,8 @@
 
 #define WebKitShowTiledScrollingIndicatorPreferenceKey "WebKitShowTiledScrollingIndicator"
 
+#define WebKitDOMIteratorEnabledPreferenceKey "WebKitDOMIteratorEnabled"
+
 #define WebKitFetchAPIEnabledPreferenceKey "WebKitFetchAPIEnabled"
 
 #define WebKitShadowDOMEnabledPreferenceKey "WebKitShadowDOMEnabled"

Modified: trunk/Source/WebKit/win/WebPreferences.cpp (202727 => 202728)


--- trunk/Source/WebKit/win/WebPreferences.cpp	2016-07-01 07:29:53 UTC (rev 202727)
+++ trunk/Source/WebKit/win/WebPreferences.cpp	2016-07-01 07:47:14 UTC (rev 202728)
@@ -1938,6 +1938,20 @@
     return S_OK;
 }
 
+HRESULT WebPreferences::setDOMIteratorEnabled(BOOL enabled)
+{
+    setBoolValue(WebKitDOMIteratorEnabledPreferenceKey, enabled);
+    return S_OK;
+}
+
+HRESULT WebPreferences::domIteratorEnabled(_Out_ BOOL* enabled)
+{
+    if (!enabled)
+        return E_POINTER;
+    *enabled = boolValueForKey(WebKitDOMIteratorEnabledPreferenceKey);
+    return S_OK;
+}
+
 HRESULT WebPreferences::shadowDOMEnabled(_Out_ BOOL* enabled)
 {
     if (!enabled)

Modified: trunk/Source/WebKit/win/WebPreferences.h (202727 => 202728)


--- trunk/Source/WebKit/win/WebPreferences.h	2016-07-01 07:29:53 UTC (rev 202727)
+++ trunk/Source/WebKit/win/WebPreferences.h	2016-07-01 07:47:14 UTC (rev 202728)
@@ -235,6 +235,8 @@
     virtual HRESULT STDMETHODCALLTYPE setShowTiledScrollingIndicator(BOOL);
     virtual HRESULT STDMETHODCALLTYPE fetchAPIEnabled(_Out_ BOOL*);
     virtual HRESULT STDMETHODCALLTYPE setFetchAPIEnabled(BOOL);
+    virtual HRESULT STDMETHODCALLTYPE domIteratorEnabled(_Out_ BOOL*);
+    virtual HRESULT STDMETHODCALLTYPE setDOMIteratorEnabled(BOOL);
     virtual HRESULT STDMETHODCALLTYPE shadowDOMEnabled(_Out_ BOOL*);
     virtual HRESULT STDMETHODCALLTYPE setShadowDOMEnabled(BOOL);
     virtual HRESULT STDMETHODCALLTYPE customElementsEnabled(_Out_ BOOL*);

Modified: trunk/Source/WebKit/win/WebView.cpp (202727 => 202728)


--- trunk/Source/WebKit/win/WebView.cpp	2016-07-01 07:29:53 UTC (rev 202727)
+++ trunk/Source/WebKit/win/WebView.cpp	2016-07-01 07:47:14 UTC (rev 202728)
@@ -5040,6 +5040,11 @@
     RuntimeEnabledFeatures::sharedFeatures().setWebkitIndexedDBEnabled(true);
 #endif
 
+    hr = prefsPrivate->domIteratorEnabled(&enabled);
+    if (FAILED(hr))
+        return hr;
+    RuntimeEnabledFeatures::sharedFeatures().setDOMIteratorEnabled(!!enabled);
+
 #if ENABLE(FETCH_API)
     hr = prefsPrivate->fetchAPIEnabled(&enabled);
     if (FAILED(hr))

Modified: trunk/Source/WebKit2/ChangeLog (202727 => 202728)


--- trunk/Source/WebKit2/ChangeLog	2016-07-01 07:29:53 UTC (rev 202727)
+++ trunk/Source/WebKit2/ChangeLog	2016-07-01 07:47:14 UTC (rev 202728)
@@ -1,3 +1,16 @@
+2016-07-01  Youenn Fablet  <[email protected]>
+
+        Add a runtime flag for DOM iterators
+        https://bugs.webkit.org/show_bug.cgi?id=159300
+
+        Reviewed by Alex Christensen.
+
+        * Shared/WebPreferencesDefinitions.h:
+        * WebProcess/InjectedBundle/InjectedBundle.cpp:
+        (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::updatePreferences):
+
 2016-07-01  Andreas Kling  <[email protected]>
 
         [Mac] Get rid of the old timey rubber-banding linen pattern.

Modified: trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h (202727 => 202728)


--- trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h	2016-07-01 07:29:53 UTC (rev 202727)
+++ trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h	2016-07-01 07:47:14 UTC (rev 202728)
@@ -225,6 +225,7 @@
     macro(HTTPEquivEnabled, httpEquivEnabled, Bool, bool, true, "", "") \
     macro(MockCaptureDevicesEnabled, mockCaptureDevicesEnabled, Bool, bool, false, "", "") \
     macro(ShadowDOMEnabled, shadowDOMEnabled, Bool, bool, true, "Shadow DOM", "HTML Shadow DOM prototype") \
+    macro(DOMIteratorEnabled, domIteratorEnabled, Bool, bool, true, "", "") \
     macro(FetchAPIEnabled, fetchAPIEnabled, Bool, bool, false, "", "") \
     macro(DownloadAttributeEnabled, downloadAttributeEnabled, Bool, bool, false, "", "") \
     macro(SelectionPaintingWithoutSelectionGapsEnabled, selectionPaintingWithoutSelectionGapsEnabled, Bool, bool, DEFAULT_SELECTION_PAINTING_WITHOUT_SELECTION_GAPS_ENABLED, "", "") \

Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp (202727 => 202728)


--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp	2016-07-01 07:29:53 UTC (rev 202727)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp	2016-07-01 07:47:14 UTC (rev 202728)
@@ -196,6 +196,9 @@
     if (preference == "WebKitShadowDOMEnabled")
         RuntimeEnabledFeatures::sharedFeatures().setShadowDOMEnabled(enabled);
 
+    if (preference == "WebKitDOMIteratorEnabled")
+        RuntimeEnabledFeatures::sharedFeatures().setDOMIteratorEnabled(enabled);
+
 #if ENABLE(CSS_GRID_LAYOUT)
     if (preference == "WebKitCSSGridLayoutEnabled")
         RuntimeEnabledFeatures::sharedFeatures().setCSSGridLayoutEnabled(enabled);

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (202727 => 202728)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2016-07-01 07:29:53 UTC (rev 202727)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2016-07-01 07:47:14 UTC (rev 202728)
@@ -3149,6 +3149,8 @@
 
     RuntimeEnabledFeatures::sharedFeatures().setShadowDOMEnabled(store.getBoolValueForKey(WebPreferencesKey::shadowDOMEnabledKey()));
 
+    RuntimeEnabledFeatures::sharedFeatures().setDOMIteratorEnabled(store.getBoolValueForKey(WebPreferencesKey::domIteratorEnabledKey()));
+
     // Experimental Features.
 
 #if ENABLE(CSS_GRID_LAYOUT)

Modified: trunk/Tools/ChangeLog (202727 => 202728)


--- trunk/Tools/ChangeLog	2016-07-01 07:29:53 UTC (rev 202727)
+++ trunk/Tools/ChangeLog	2016-07-01 07:47:14 UTC (rev 202728)
@@ -1,3 +1,21 @@
+2016-07-01  Youenn Fablet  <[email protected]>
+
+        Add a runtime flag for DOM iterators
+        https://bugs.webkit.org/show_bug.cgi?id=159300
+
+        Reviewed by Alex Christensen.
+
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (resetWebPreferencesToConsistentValues):
+        * DumpRenderTree/win/DumpRenderTree.cpp:
+        (resetWebPreferencesToConsistentValues):
+        * Scripts/webkitperl/FeatureList.pm:
+        * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+        (WTR::InjectedBundle::beginTesting):
+        * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
+        (WTR::TestRunner::setDOMIteratorEnabled):
+        * WebKitTestRunner/InjectedBundle/TestRunner.h:
+
 2016-06-30  Tina Liu  <[email protected]>
 
         Add an API test for WKPageRestoreFromSessionStateWithoutNavigation.

Modified: trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm (202727 => 202728)


--- trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm	2016-07-01 07:29:53 UTC (rev 202727)
+++ trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm	2016-07-01 07:47:14 UTC (rev 202728)
@@ -979,6 +979,8 @@
     [preferences setShadowDOMEnabled:YES];
     [preferences setCustomElementsEnabled:YES];
 
+    [preferences setDOMIteratorEnabled:YES];
+
     [preferences setWebGL2Enabled:YES];
 
     [preferences setFetchAPIEnabled:YES];

Modified: trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp (202727 => 202728)


--- trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp	2016-07-01 07:29:53 UTC (rev 202727)
+++ trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp	2016-07-01 07:47:14 UTC (rev 202728)
@@ -853,6 +853,8 @@
     prefsPrivate3->setShadowDOMEnabled(TRUE);
     prefsPrivate3->setCustomElementsEnabled(TRUE);
 
+    prefsPrivate3->setDOMIteratorEnabled(TRUE);
+
     setAlwaysAcceptCookies(false);
 }
 

Modified: trunk/Tools/Scripts/webkitperl/FeatureList.pm (202727 => 202728)


--- trunk/Tools/Scripts/webkitperl/FeatureList.pm	2016-07-01 07:29:53 UTC (rev 202727)
+++ trunk/Tools/Scripts/webkitperl/FeatureList.pm	2016-07-01 07:47:14 UTC (rev 202728)
@@ -80,6 +80,7 @@
     $deviceOrientationSupport,
     $directoryUploadSupport,
     $dom4EventsConstructor,
+    $domIterator,
     $downloadAttributeSupport,
     $fetchAPISupport,
     $fontLoadEventsSupport,

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp (202727 => 202728)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp	2016-07-01 07:29:53 UTC (rev 202727)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp	2016-07-01 07:47:14 UTC (rev 202728)
@@ -314,6 +314,8 @@
     m_testRunner->setShadowDOMEnabled(true);
     m_testRunner->setCustomElementsEnabled(true);
 
+    m_testRunner->setDOMIteratorEnabled(true);
+
     m_testRunner->setWebGL2Enabled(true);
 
     m_testRunner->setFetchAPIEnabled(true);

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp (202727 => 202728)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp	2016-07-01 07:29:53 UTC (rev 202727)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp	2016-07-01 07:47:14 UTC (rev 202728)
@@ -348,6 +348,13 @@
     WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), key.get(), enabled);
 }
 
+void TestRunner::setDOMIteratorEnabled(bool enabled)
+{
+    WKRetainPtr<WKStringRef> key(AdoptWK, WKStringCreateWithUTF8CString("WebKitDOMIteratorEnabled"));
+    auto& injectedBundle = InjectedBundle::singleton();
+    WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), key.get(), enabled);
+}
+
 void TestRunner::setWebGL2Enabled(bool enabled)
 {
     WKRetainPtr<WKStringRef> key(AdoptWK, WKStringCreateWithUTF8CString("WebKitWebGL2Enabled"));

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h (202727 => 202728)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h	2016-07-01 07:29:53 UTC (rev 202727)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h	2016-07-01 07:47:14 UTC (rev 202728)
@@ -102,6 +102,7 @@
     void setXSSAuditorEnabled(bool);
     void setShadowDOMEnabled(bool);
     void setCustomElementsEnabled(bool);
+    void setDOMIteratorEnabled(bool);
     void setWebGL2Enabled(bool);
     void setFetchAPIEnabled(bool);
     void setAllowUniversalAccessFromFileURLs(bool);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to