[WebIDL] Remove the now-unused [CustomEnabled] extended attribute
https://bugs.webkit.org/show_bug.cgi?id=235608
Patch by Alexey Shvayka <ashvayka@apple.com> on 2022-01-25
Reviewed by Darin Adler.
It's unlikely we will ever need it, and it's limited to Window only,
and it generates a call to a free function rather than a method.
No new tests, no behavior change.
* bindings/scripts/CodeGeneratorJS.pm:
(NeedsRuntimeCheck):
(GenerateRuntimeEnableConditionalString):
* bindings/scripts/IDLAttributes.json:
* bindings/scripts/preprocess-idls.pl:
(GenerateConstructorAttributes):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@288594 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 956a3e5..ded446b 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,5 +1,24 @@
2022-01-25 Alexey Shvayka <ashvayka@apple.com>
+ [WebIDL] Remove the now-unused [CustomEnabled] extended attribute
+ https://bugs.webkit.org/show_bug.cgi?id=235608
+
+ Reviewed by Darin Adler.
+
+ It's unlikely we will ever need it, and it's limited to Window only,
+ and it generates a call to a free function rather than a method.
+
+ No new tests, no behavior change.
+
+ * bindings/scripts/CodeGeneratorJS.pm:
+ (NeedsRuntimeCheck):
+ (GenerateRuntimeEnableConditionalString):
+ * bindings/scripts/IDLAttributes.json:
+ * bindings/scripts/preprocess-idls.pl:
+ (GenerateConstructorAttributes):
+
+2022-01-25 Alexey Shvayka <ashvayka@apple.com>
+
[WebIDL] Blob-related methods should use _relevant_ context instead of _current_
https://bugs.webkit.org/show_bug.cgi?id=235279
diff --git a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm b/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
index 7920c9b..873181d 100644
--- a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
+++ b/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
@@ -1994,8 +1994,7 @@
|| $context->extendedAttributes->{EnabledBySetting}
|| $context->extendedAttributes->{EnabledByQuirk}
|| $context->extendedAttributes->{DisabledByQuirk}
- || $context->extendedAttributes->{SecureContext}
- || $context->extendedAttributes->{CustomEnabled};
+ || $context->extendedAttributes->{SecureContext};
}
sub NeedsRuntimeReadWriteCheck
@@ -4046,13 +4045,6 @@
}
}
- if ($context->extendedAttributes->{CustomEnabled}) {
- assert("CustomEnabled can only be used by interfaces only exposed to the Window") if $interface->extendedAttributes->{Exposed} && $interface->extendedAttributes->{Exposed} ne "Window";
-
- my $className = "JS" . $interface->type->name;
- push(@conjuncts, "${className}" . $codeGenerator->WK_ucfirst($context->name) . "IsEnabled()");
- }
-
if ($context->extendedAttributes->{EnabledByQuirk}) {
assert("Must specify value for EnabledByQuirk.") if $context->extendedAttributes->{DisabledByQuirk} eq "VALUE_IS_MISSING";
diff --git a/Source/WebCore/bindings/scripts/IDLAttributes.json b/Source/WebCore/bindings/scripts/IDLAttributes.json
index ba5c0db..78dfdf1 100644
--- a/Source/WebCore/bindings/scripts/IDLAttributes.json
+++ b/Source/WebCore/bindings/scripts/IDLAttributes.json
@@ -144,9 +144,6 @@
"CustomToJSObject": {
"contextsAllowed": ["interface"]
},
- "CustomEnabled": {
- "contextsAllowed": ["interface", "dictionary", "enum", "attribute", "operation", "constant", "iterable"]
- },
"DOMJIT": {
"contextsAllowed": ["interface", "attribute", "operation"],
"values": ["", "ReadDOM", "Getter"],
diff --git a/Source/WebCore/bindings/scripts/preprocess-idls.pl b/Source/WebCore/bindings/scripts/preprocess-idls.pl
index 741a58b..e2f1e35 100644
--- a/Source/WebCore/bindings/scripts/preprocess-idls.pl
+++ b/Source/WebCore/bindings/scripts/preprocess-idls.pl
@@ -480,7 +480,7 @@
next unless ($attributeName eq "Conditional" || $attributeName eq "EnabledAtRuntime" || $attributeName eq "EnabledForWorld"
|| $attributeName eq "EnabledBySetting" || $attributeName eq "SecureContext" || $attributeName eq "PrivateIdentifier"
|| $attributeName eq "PublicIdentifier" || $attributeName eq "DisabledByQuirk" || $attributeName eq "EnabledByQuirk"
- || $attributeName eq "EnabledForContext" || $attributeName eq "CustomEnabled") || $attributeName eq "LegacyFactoryFunctionEnabledBySetting";
+ || $attributeName eq "EnabledForContext") || $attributeName eq "LegacyFactoryFunctionEnabledBySetting";
my $extendedAttribute = $attributeName;
$extendedAttribute .= "=" . $extendedAttributes->{$attributeName} unless $extendedAttributes->{$attributeName} eq "VALUE_IS_MISSING";