Title: [290803] trunk/Source/WebCore
Revision
290803
Author
[email protected]
Date
2022-03-03 17:08:25 -0800 (Thu, 03 Mar 2022)

Log Message

Allow [SecureContext] extended attribute on namespaces.
https://bugs.webkit.org/show_bug.cgi?id=237401

Patch by Dan Glastonbury <[email protected]> on 2022-03-03
Reviewed by Alexey Shvayka.

* bindings/scripts/IDLAttributes.json:
Enable SecureContext as a valid extended attribute on namespace.
* bindings/scripts/test/BindingTestGlobalConstructors.idl:
* bindings/scripts/test/JS/*: Updated
* bindings/scripts/test/TestNamespaceObject.idl:
Added [SecureContext] to namespace

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (290802 => 290803)


--- trunk/Source/WebCore/ChangeLog	2022-03-04 01:06:26 UTC (rev 290802)
+++ trunk/Source/WebCore/ChangeLog	2022-03-04 01:08:25 UTC (rev 290803)
@@ -1,3 +1,17 @@
+2022-03-03  Dan Glastonbury  <[email protected]>
+
+        Allow [SecureContext] extended attribute on namespaces.
+        https://bugs.webkit.org/show_bug.cgi?id=237401
+
+        Reviewed by Alexey Shvayka.
+
+        * bindings/scripts/IDLAttributes.json:
+        Enable SecureContext as a valid extended attribute on namespace.
+        * bindings/scripts/test/BindingTestGlobalConstructors.idl:
+        * bindings/scripts/test/JS/*: Updated
+        * bindings/scripts/test/TestNamespaceObject.idl:
+        Added [SecureContext] to namespace
+
 2022-03-03  Simon Fraser  <[email protected]>
 
         nasa.gov page with fixed backgrounds paints incorrectly on scroll

Modified: trunk/Source/WebCore/bindings/scripts/IDLAttributes.json (290802 => 290803)


--- trunk/Source/WebCore/bindings/scripts/IDLAttributes.json	2022-03-04 01:06:26 UTC (rev 290802)
+++ trunk/Source/WebCore/bindings/scripts/IDLAttributes.json	2022-03-04 01:08:25 UTC (rev 290803)
@@ -461,7 +461,7 @@
             "unsupported": true
         },
         "SecureContext": {
-            "contextsAllowed": ["interface", "dictionary", "enum", "attribute", "operation", "constant"],
+            "contextsAllowed": ["interface", "namespace", "dictionary", "enum", "attribute", "operation", "constant"],
             "standard": {
                 "url": "https://webidl.spec.whatwg.org/#SecureContext"
             }

Modified: trunk/Source/WebCore/bindings/scripts/test/BindingTestGlobalConstructors.idl (290802 => 290803)


--- trunk/Source/WebCore/bindings/scripts/test/BindingTestGlobalConstructors.idl	2022-03-04 01:06:26 UTC (rev 290802)
+++ trunk/Source/WebCore/bindings/scripts/test/BindingTestGlobalConstructors.idl	2022-03-04 01:08:25 UTC (rev 290803)
@@ -45,7 +45,7 @@
     attribute TestNamedSetterWithLegacyOverrideBuiltInsConstructor TestNamedSetterWithLegacyOverrideBuiltIns;
     attribute TestNamedSetterWithLegacyUnforgeablePropertiesConstructor TestNamedSetterWithLegacyUnforgeableProperties;
     attribute TestNamedSetterWithLegacyUnforgeablePropertiesAndLegacyOverrideBuiltInsConstructor TestNamedSetterWithLegacyUnforgeablePropertiesAndLegacyOverrideBuiltIns;
-    attribute TestNamespaceObjectConstructor TestInterfaceName;
+    [SecureContext] attribute TestNamespaceObjectConstructor TestInterfaceName;
     [Conditional=ConditionDerived] attribute TestOperationConditionalConstructor TestOperationConditional;
     attribute TestOverloadedConstructorsWithSequenceConstructor TestOverloadedConstructorsWithSequence;
     attribute TestPluginInterfaceConstructor TestPluginInterface;

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp (290802 => 290803)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp	2022-03-04 01:06:26 UTC (rev 290802)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp	2022-03-04 01:08:25 UTC (rev 290803)
@@ -260,16 +260,15 @@
     { -1, -1 },
     { -1, -1 },
     { -1, -1 },
-    { 55, -1 },
+    { 54, -1 },
     { -1, -1 },
     { -1, -1 },
     { -1, -1 },
     { -1, -1 },
     { -1, -1 },
-    { 49, -1 },
     { -1, -1 },
-    { 64, -1 },
     { -1, -1 },
+    { 63, -1 },
     { -1, -1 },
     { -1, -1 },
     { -1, -1 },
@@ -282,6 +281,7 @@
     { -1, -1 },
     { -1, -1 },
     { -1, -1 },
+    { -1, -1 },
     { 35, -1 },
     { -1, -1 },
     { -1, -1 },
@@ -288,7 +288,7 @@
     { -1, -1 },
     { -1, -1 },
     { -1, -1 },
-    { 68, -1 },
+    { 67, -1 },
     { 13, 261 },
     { -1, -1 },
     { -1, -1 },
@@ -332,7 +332,7 @@
     { -1, -1 },
     { -1, -1 },
     { 30, -1 },
-    { 57, -1 },
+    { 56, -1 },
     { -1, -1 },
     { -1, -1 },
     { -1, -1 },
@@ -341,7 +341,7 @@
     { -1, -1 },
     { 9, 257 },
     { -1, -1 },
-    { 59, -1 },
+    { 58, -1 },
     { 19, -1 },
     { -1, -1 },
     { -1, -1 },
@@ -387,7 +387,7 @@
     { -1, -1 },
     { -1, -1 },
     { -1, -1 },
-    { 54, -1 },
+    { 53, -1 },
     { -1, -1 },
     { -1, -1 },
     { -1, -1 },
@@ -405,10 +405,10 @@
     { -1, -1 },
     { -1, -1 },
     { -1, -1 },
+    { 64, -1 },
+    { -1, -1 },
     { 65, -1 },
     { -1, -1 },
-    { 66, -1 },
-    { -1, -1 },
     { 27, -1 },
     { 32, -1 },
     { -1, -1 },
@@ -422,7 +422,7 @@
     { -1, -1 },
     { 15, 260 },
     { -1, -1 },
-    { 60, -1 },
+    { 59, -1 },
     { -1, -1 },
     { -1, -1 },
     { -1, -1 },
@@ -435,7 +435,7 @@
     { -1, -1 },
     { 16, 256 },
     { -1, -1 },
-    { 63, -1 },
+    { 62, -1 },
     { -1, -1 },
     { -1, -1 },
     { -1, -1 },
@@ -467,7 +467,7 @@
     { -1, -1 },
     { -1, -1 },
     { -1, -1 },
-    { 58, -1 },
+    { 57, -1 },
     { -1, -1 },
     { 1, -1 },
     { -1, -1 },
@@ -476,10 +476,10 @@
     { -1, -1 },
     { -1, -1 },
     { -1, -1 },
-    { 50, 264 },
+    { 49, 264 },
     { 7, 263 },
     { -1, -1 },
-    { 61, -1 },
+    { 60, -1 },
     { -1, -1 },
     { -1, -1 },
     { -1, -1 },
@@ -496,13 +496,13 @@
     { -1, -1 },
     { -1, -1 },
     { 3, -1 },
+    { 51, -1 },
+    { -1, -1 },
     { 52, -1 },
     { -1, -1 },
-    { 53, -1 },
     { -1, -1 },
     { -1, -1 },
     { -1, -1 },
-    { -1, -1 },
     { 17, -1 },
     { 23, 259 },
     { 26, 265 },
@@ -511,10 +511,10 @@
     { 40, -1 },
     { 42, -1 },
     { 44, -1 },
-    { 51, -1 },
-    { 56, -1 },
-    { 62, -1 },
-    { 67, -1 },
+    { 50, -1 },
+    { 55, -1 },
+    { 61, -1 },
+    { 66, -1 },
 };
 
 
@@ -577,7 +577,6 @@
     { "TestNamedSetterWithLegacyOverrideBuiltIns", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestGlobalObject_TestNamedSetterWithLegacyOverrideBuiltInsConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
     { "TestNamedSetterWithLegacyUnforgeableProperties", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestGlobalObject_TestNamedSetterWithLegacyUnforgeablePropertiesConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
     { "TestNamedSetterWithLegacyUnforgeablePropertiesAndLegacyOverrideBuiltIns", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestGlobalObject_TestNamedSetterWithLegacyUnforgeablePropertiesAndLegacyOverrideBuiltInsConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
-    { "TestInterfaceName", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestGlobalObject_TestInterfaceNameConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
 #if ENABLE(ConditionDerived)
     { "TestOperationConditional", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestGlobalObject_TestOperationConditionalConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
 #else
@@ -607,7 +606,7 @@
     { "regularOperation", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsTestGlobalObjectInstanceFunction_regularOperation), (intptr_t) (1) } },
 };
 
-static const HashTable JSTestGlobalObjectTable = { 69, 255, true, JSTestGlobalObject::info(), JSTestGlobalObjectTableValues, JSTestGlobalObjectTableIndex };
+static const HashTable JSTestGlobalObjectTable = { 68, 255, true, JSTestGlobalObject::info(), JSTestGlobalObjectTableValues, JSTestGlobalObjectTableIndex };
 /* Hash table for constructor */
 
 static const HashTableValue JSTestGlobalObjectConstructorTableValues[] =
@@ -677,6 +676,8 @@
     if (RuntimeEnabledFeatures::sharedFeatures().testFeatureEnabled())
         putDirectCustomAccessor(vm, static_cast<JSVMClientData*>(vm.clientData)->builtinNames().enabledAtRuntimeAttributePublicName(), CustomGetterSetter::create(vm, jsTestGlobalObject_enabledAtRuntimeAttribute, setJSTestGlobalObject_enabledAtRuntimeAttribute), attributesForStructure(static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor)));
 #endif
+    if (jsCast<JSDOMGlobalObject*>(globalObject())->scriptExecutionContext()->isSecureContext())
+        putDirectCustomAccessor(vm, static_cast<JSVMClientData*>(vm.clientData)->builtinNames().TestInterfaceNamePublicName(), CustomGetterSetter::create(vm, jsTestGlobalObject_TestInterfaceNameConstructor, nullptr), attributesForStructure(static_cast<unsigned>(JSC::PropertyAttribute::DontEnum)));
     putDirectCustomAccessor(vm, static_cast<JSVMClientData*>(vm.clientData)->builtinNames().publicAndPrivateAttributePrivateName(), CustomGetterSetter::create(vm, jsTestGlobalObject_publicAndPrivateAttribute, nullptr), attributesForStructure(JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly));
 #if ENABLE(TEST_FEATURE)
     putDirectCustomAccessor(vm, static_cast<JSVMClientData*>(vm.clientData)->builtinNames().publicAndPrivateConditionalAttributePrivateName(), CustomGetterSetter::create(vm, jsTestGlobalObject_publicAndPrivateConditionalAttribute, nullptr), attributesForStructure(JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly));

Modified: trunk/Source/WebCore/bindings/scripts/test/TestNamespaceObject.idl (290802 => 290803)


--- trunk/Source/WebCore/bindings/scripts/test/TestNamespaceObject.idl	2022-03-04 01:06:26 UTC (rev 290802)
+++ trunk/Source/WebCore/bindings/scripts/test/TestNamespaceObject.idl	2022-03-04 01:08:25 UTC (rev 290803)
@@ -28,6 +28,7 @@
 [
     InterfaceName=TestInterfaceName,
     Exposed=TestGlobalObject,
+    SecureContext
 ] namespace TestNamespaceObject {
     readonly attribute unsigned long namespaceAttribute;
     boolean overloadedNamespaceOperation(TestObj? objArg, DOMString strArg);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to