WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-222518-20210403122023.patch (text/plain), 111.83 KB, created by
Sam Weinig
on 2021-04-03 12:20:25 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Sam Weinig
Created:
2021-04-03 12:20:25 PDT
Size:
111.83 KB
patch
obsolete
>Index: Source/WTF/ChangeLog >=================================================================== >--- Source/WTF/ChangeLog (revision 275450) >+++ Source/WTF/ChangeLog (working copy) >@@ -1,3 +1,15 @@ >+2021-04-02 Sam Weinig <weinig@apple.com> >+ >+ Reduce compile time and binary size cost of enabling proper CSSStyleDeclaration property access behavior >+ https://bugs.webkit.org/show_bug.cgi?id=222518 >+ <rdar://problem/75136887> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * wtf/PlatformEnable.h: >+ Turn on ENABLE_ATTRIBUTE_BASED_PROPERTIES_FOR_CSS_STYLE_DECLARATION, now that we have it using shared >+ delegating synthetic attributes. >+ > 2021-04-02 Simon Fraser <simon.fraser@apple.com> > > Enable PreferPageRenderingUpdatesNear60FPSEnabled by default >Index: Source/WTF/wtf/PlatformEnable.h >=================================================================== >--- Source/WTF/wtf/PlatformEnable.h (revision 275450) >+++ Source/WTF/wtf/PlatformEnable.h (working copy) >@@ -337,7 +337,7 @@ > #endif > > #if !defined(ENABLE_ATTRIBUTE_BASED_PROPERTIES_FOR_CSS_STYLE_DECLARATION) >-#define ENABLE_ATTRIBUTE_BASED_PROPERTIES_FOR_CSS_STYLE_DECLARATION 0 >+#define ENABLE_ATTRIBUTE_BASED_PROPERTIES_FOR_CSS_STYLE_DECLARATION 1 > #endif > > #if !defined(ENABLE_LETTERPRESS) >Index: Source/WebCore/ChangeLog >=================================================================== >--- Source/WebCore/ChangeLog (revision 275450) >+++ Source/WebCore/ChangeLog (working copy) >@@ -1,3 +1,97 @@ >+2021-04-02 Sam Weinig <weinig@apple.com> >+ >+ Reduce compile time and binary size cost of enabling proper CSSStyleDeclaration property access behavior >+ https://bugs.webkit.org/show_bug.cgi?id=222518 >+ <rdar://problem/75136887> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Re-implement proper (not using named-getters) support for the CSSStyleDeclaration bindings >+ using a new DelegateToSharedSyntheticAttribute extended atttribute which allows IDL attributes >+ to share a custom getter / setter implementation and delegate their implementation to it. When >+ using this functionality, the synthetic attribute's implementation is passed the original property >+ name so it can implement functionality based on it. >+ >+ We use this for CSSStyleDeclaration by breaking the huge list of generated properties into >+ four groups, each with their own synthetic attribute. The groups are based on the different >+ transformation rules in the spec. >+ >+ * bindings/js/JSDOMAttribute.h: >+ (WebCore::IDLAttribute::setPassingPropertyName): >+ (WebCore::IDLAttribute::getPassingPropertyName): >+ * bindings/scripts/CodeGeneratorJS.pm: >+ (GetAttributeGetterName): >+ (GetAttributeSetterName): >+ (GenerateImplementation): >+ (GenerateSharedSyntheticAttributeDefinition): >+ (GenerateAttributeGetterBodyDefinition): >+ (GenerateAttributeGetterTrampolineDefinition): >+ (GenerateAttributeGetterAndSetterDeclaration): >+ (GenerateAttributeSetterBodyDefinition): >+ (GenerateAttributeSetterTrampolineDefinition): >+ (GenerateAttributeSetterDefinition): >+ (MakeSharedSyntheticAttribute): >+ (ComputeSharedSyntheticAttributes): >+ (NeedsDelegationToSharedSyntheticAttribute): >+ (GetSharedSyntheticAttribute): >+ (NeedsPropertyNamePassedToAttributeBody): >+ * bindings/scripts/IDLAttributes.json: >+ * bindings/scripts/test/BindingTestGlobalConstructors.idl: >+ * bindings/scripts/test/JS/JSTestCSSProperty.cpp: Removed. >+ * bindings/scripts/test/JS/JSTestCSSProperty.h: Removed. >+ * bindings/scripts/test/JS/JSTestDelegateToSharedSyntheticAttribute.cpp: Added. >+ (WebCore::JSTestDelegateToSharedSyntheticAttributeDOMConstructor::prototypeForStructure): >+ (WebCore::JSTestDelegateToSharedSyntheticAttributeDOMConstructor::initializeProperties): >+ (WebCore::JSTestDelegateToSharedSyntheticAttributePrototype::finishCreation): >+ (WebCore::JSTestDelegateToSharedSyntheticAttribute::JSTestDelegateToSharedSyntheticAttribute): >+ (WebCore::JSTestDelegateToSharedSyntheticAttribute::finishCreation): >+ (WebCore::JSTestDelegateToSharedSyntheticAttribute::createPrototype): >+ (WebCore::JSTestDelegateToSharedSyntheticAttribute::prototype): >+ (WebCore::JSTestDelegateToSharedSyntheticAttribute::getConstructor): >+ (WebCore::JSTestDelegateToSharedSyntheticAttribute::destroy): >+ (WebCore::IDLAttribute<JSTestDelegateToSharedSyntheticAttribute>::cast): >+ (WebCore::JSC_DEFINE_CUSTOM_GETTER): >+ (WebCore::jsTestDelegateToSharedSyntheticAttribute_sharedAttribute1Body): >+ (WebCore::setJSTestDelegateToSharedSyntheticAttribute_sharedAttribute1Body): >+ (WebCore::JSC_DEFINE_CUSTOM_SETTER): >+ (WebCore::jsTestDelegateToSharedSyntheticAttribute_sharedAttribute2Body): >+ (WebCore::setJSTestDelegateToSharedSyntheticAttribute_sharedAttribute2Body): >+ (WebCore::JSTestDelegateToSharedSyntheticAttribute::subspaceForImpl): >+ (WebCore::JSTestDelegateToSharedSyntheticAttribute::analyzeHeap): >+ (WebCore::JSTestDelegateToSharedSyntheticAttributeOwner::isReachableFromOpaqueRoots): >+ (WebCore::JSTestDelegateToSharedSyntheticAttributeOwner::finalize): >+ (WebCore::toJSNewlyCreated): >+ (WebCore::toJS): >+ (WebCore::JSTestDelegateToSharedSyntheticAttribute::toWrapped): >+ * bindings/scripts/test/JS/JSTestDelegateToSharedSyntheticAttribute.h: Added. >+ (WebCore::JSTestDelegateToSharedSyntheticAttribute::create): >+ (WebCore::JSTestDelegateToSharedSyntheticAttribute::createStructure): >+ (WebCore::JSTestDelegateToSharedSyntheticAttribute::subspaceFor): >+ (WebCore::wrapperOwner): >+ (WebCore::wrapperKey): >+ (WebCore::toJS): >+ (WebCore::toJSNewlyCreated): >+ * bindings/scripts/test/JS/JSTestGlobalObject.cpp: >+ (WebCore::jsTestGlobalObject_TestDelegateToSharedSyntheticAttributeConstructorGetter): >+ (WebCore::JSC_DEFINE_CUSTOM_GETTER): >+ (WebCore::jsTestGlobalObject_TestCSSPropertyConstructorGetter): Deleted. >+ * bindings/scripts/test/SupplementalDependencies.dep: >+ * bindings/scripts/test/TestCSSProperty.idl: Removed. >+ * bindings/scripts/test/TestDelegateToSharedSyntheticAttribute.idl: Added. >+ * css/CSSStyleDeclaration.cpp: >+ (WebCore::lookupCSSPropertyFromIDLAttributeRequiringConversion): >+ (WebCore::lookupCSSPropertyFromIDLAttributeRequiringNoConversion): >+ (WebCore::CSSStyleDeclaration::propertyValueForCamelCasedIDLAttribute): >+ (WebCore::CSSStyleDeclaration::setPropertyValueForCamelCasedIDLAttribute): >+ (WebCore::CSSStyleDeclaration::propertyValueForWebKitCasedIDLAttribute): >+ (WebCore::CSSStyleDeclaration::setPropertyValueForWebKitCasedIDLAttribute): >+ (WebCore::CSSStyleDeclaration::propertyValueForDashedIDLAttribute): >+ (WebCore::CSSStyleDeclaration::setPropertyValueForDashedIDLAttribute): >+ (WebCore::CSSStyleDeclaration::propertyValueForEpubCasedIDLAttribute): >+ (WebCore::CSSStyleDeclaration::setPropertyValueForEpubCasedIDLAttribute): >+ * css/CSSStyleDeclaration.h: >+ * css/makeprop.pl: >+ > 2021-04-02 Ryosuke Niwa <rniwa@webkit.org> > > PendingImageBitmap gets created on a stopped script execution context. >Index: Source/WebCore/bindings/js/JSDOMAttribute.h >=================================================================== >--- Source/WebCore/bindings/js/JSDOMAttribute.h (revision 275450) >+++ Source/WebCore/bindings/js/JSDOMAttribute.h (working copy) >@@ -32,8 +32,10 @@ template<typename JSClass> > class IDLAttribute { > public: > using Setter = bool(JSC::JSGlobalObject&, JSClass&, JSC::JSValue); >+ using SetterPassingPropertyName = bool(JSC::JSGlobalObject&, JSClass&, JSC::JSValue, JSC::PropertyName); > using StaticSetter = bool(JSC::JSGlobalObject&, JSC::JSValue); > using Getter = JSC::JSValue(JSC::JSGlobalObject&, JSClass&); >+ using GetterPassingPropertyName = JSC::JSValue(JSC::JSGlobalObject&, JSClass&, JSC::PropertyName); > using StaticGetter = JSC::JSValue(JSC::JSGlobalObject&); > > static JSClass* cast(JSC::JSGlobalObject&, JSC::EncodedJSValue); >@@ -53,7 +55,24 @@ public: > > RELEASE_AND_RETURN(throwScope, (setter(lexicalGlobalObject, *thisObject, JSC::JSValue::decode(encodedValue)))); > } >- >+ >+ // FIXME: This can be merged with `set` if we replace the explicit setter function template parameter with a generic lambda. >+ template<SetterPassingPropertyName setter, CastedThisErrorBehavior shouldThrow = CastedThisErrorBehavior::Throw> >+ static bool setPassingPropertyName(JSC::JSGlobalObject& lexicalGlobalObject, JSC::EncodedJSValue thisValue, JSC::EncodedJSValue encodedValue, JSC::PropertyName attributeName) >+ { >+ auto throwScope = DECLARE_THROW_SCOPE(JSC::getVM(&lexicalGlobalObject)); >+ >+ auto* thisObject = cast(lexicalGlobalObject, thisValue); >+ if (UNLIKELY(!thisObject)) { >+ if constexpr (shouldThrow == CastedThisErrorBehavior::Throw) >+ return JSC::throwVMDOMAttributeSetterTypeError(&lexicalGlobalObject, throwScope, JSClass::info(), attributeName); >+ else >+ return false; >+ } >+ >+ RELEASE_AND_RETURN(throwScope, (setter(lexicalGlobalObject, *thisObject, JSC::JSValue::decode(encodedValue), attributeName))); >+ } >+ > template<StaticSetter setter, CastedThisErrorBehavior shouldThrow = CastedThisErrorBehavior::Throw> > static bool setStatic(JSC::JSGlobalObject& lexicalGlobalObject, JSC::EncodedJSValue, JSC::EncodedJSValue encodedValue, JSC::PropertyName) > { >@@ -83,7 +102,32 @@ public: > RELEASE_AND_RETURN(throwScope, (JSC::JSValue::encode(getter(lexicalGlobalObject, *thisObject)))); > } > } >- >+ >+ // FIXME: This can be merged with `get` if we replace the explicit setter function template parameter with a generic lambda. >+ template<GetterPassingPropertyName getter, CastedThisErrorBehavior shouldThrow = CastedThisErrorBehavior::Throw> >+ static JSC::EncodedJSValue getPassingPropertyName(JSC::JSGlobalObject& lexicalGlobalObject, JSC::EncodedJSValue thisValue, JSC::PropertyName attributeName) >+ { >+ auto throwScope = DECLARE_THROW_SCOPE(JSC::getVM(&lexicalGlobalObject)); >+ >+ if constexpr (shouldThrow == CastedThisErrorBehavior::Assert) { >+ ASSERT(cast(lexicalGlobalObject, thisValue)); >+ auto* thisObject = JSC::jsCast<JSClass*>(JSC::JSValue::decode(thisValue)); >+ RELEASE_AND_RETURN(throwScope, (JSC::JSValue::encode(getter(lexicalGlobalObject, *thisObject, attributeName)))); >+ } else { >+ auto* thisObject = cast(lexicalGlobalObject, thisValue); >+ if (UNLIKELY(!thisObject)) { >+ if constexpr (shouldThrow == CastedThisErrorBehavior::Throw) >+ return JSC::throwVMDOMAttributeGetterTypeError(&lexicalGlobalObject, throwScope, JSClass::info(), attributeName); >+ else if constexpr (shouldThrow == CastedThisErrorBehavior::RejectPromise) >+ RELEASE_AND_RETURN(throwScope, rejectPromiseWithGetterTypeError(lexicalGlobalObject, JSClass::info(), attributeName)); >+ else >+ return JSC::JSValue::encode(JSC::jsUndefined()); >+ } >+ >+ RELEASE_AND_RETURN(throwScope, (JSC::JSValue::encode(getter(lexicalGlobalObject, *thisObject, attributeName)))); >+ } >+ } >+ > template<StaticGetter getter, CastedThisErrorBehavior shouldThrow = CastedThisErrorBehavior::Throw> > static JSC::EncodedJSValue getStatic(JSC::JSGlobalObject& lexicalGlobalObject, JSC::EncodedJSValue, JSC::PropertyName) > { >Index: Source/WebCore/bindings/scripts/CodeGeneratorJS.pm >=================================================================== >--- Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (revision 275450) >+++ Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (working copy) >@@ -1840,6 +1840,7 @@ sub GetAttributeGetterName > { > my ($interface, $className, $attribute) = @_; > >+ return GetAttributeGetterName($interface, $className, GetSharedSyntheticAttribute($interface, $attribute)) if $attribute->extendedAttributes->{DelegateToSharedSyntheticAttribute}; > return GetJSBuiltinFunctionName($className, $attribute) if IsJSBuiltin($interface, $attribute); > return $codeGenerator->WK_lcfirst($className) . "Constructor" . MangleAttributeOrFunctionName($attribute->name) if $attribute->isStatic; > return $codeGenerator->WK_lcfirst($className) . MangleAttributeOrFunctionName($attribute->name) . "Constructor" if $codeGenerator->IsConstructorType($attribute->type); >@@ -1850,6 +1851,7 @@ sub GetAttributeSetterName > { > my ($interface, $className, $attribute) = @_; > >+ return GetAttributeSetterName($interface, $className, GetSharedSyntheticAttribute($interface, $attribute)) if $attribute->extendedAttributes->{DelegateToSharedSyntheticAttribute}; > return "set" . $codeGenerator->WK_ucfirst(GetJSBuiltinFunctionName($className, $attribute)) if IsJSBuiltin($interface, $attribute); > return "set" . $codeGenerator->WK_ucfirst($className) . "Constructor" . MangleAttributeOrFunctionName($attribute->name) if $attribute->isStatic; > return "set" . $codeGenerator->WK_ucfirst($className) . MangleAttributeOrFunctionName($attribute->name); >@@ -4280,24 +4282,16 @@ sub GenerateImplementation > push(@implContent, "static JSC_DECLARE_CUSTOM_GETTER(${constructorGetter});\n"); > } > >+ if (NeedsDelegationToSharedSyntheticAttribute($interface)) { >+ foreach my $attribute (@{$interface->extendedAttributes->{SyntheticIDLAttributes}}) { >+ GenerateAttributeGetterAndSetterDeclaration(\@implContent, $interface, $className, $attribute); >+ } >+ } >+ > foreach my $attribute (@{$interface->attributes}) { >- next if IsJSBuiltin($interface, $attribute); >+ next if $attribute->extendedAttributes->{DelegateToSharedSyntheticAttribute}; > >- my $conditionalString = $codeGenerator->GenerateConditionalString($attribute); >- push(@implContent, "#if ${conditionalString}\n") if $conditionalString; >- my $getter = GetAttributeGetterName($interface, $className, $attribute); >- push(@implContent, "static JSC_DECLARE_CUSTOM_GETTER(${getter});\n"); >- unless (IsReadonly($attribute) || $codeGenerator->IsConstructorType($attribute->type)) { >- my $readWriteConditional = $attribute->extendedAttributes->{ConditionallyReadWrite}; >- if ($readWriteConditional) { >- my $readWriteConditionalString = $codeGenerator->GenerateConditionalStringFromAttributeValue($readWriteConditional); >- push(@implContent, "#if ${readWriteConditionalString}\n"); >- } >- my $setter = GetAttributeSetterName($interface, $className, $attribute); >- push(@implContent, "static JSC_DECLARE_CUSTOM_SETTER(${setter});\n"); >- push(@implContent, "#endif\n") if $readWriteConditional; >- } >- push(@implContent, "#endif\n") if $conditionalString; >+ GenerateAttributeGetterAndSetterDeclaration(\@implContent, $interface, $className, $attribute); > } > > push(@implContent, "\n"); >@@ -4876,7 +4870,16 @@ sub GenerateImplementation > push(@implContent, "}\n\n"); > } > >+ if (NeedsDelegationToSharedSyntheticAttribute($interface)) { >+ foreach my $attribute (@{$interface->extendedAttributes->{SyntheticIDLAttributes}}) { >+ GenerateAttributeGetterDefinition(\@implContent, $interface, $className, $attribute); >+ GenerateAttributeSetterDefinition(\@implContent, $interface, $className, $attribute); >+ } >+ } >+ > foreach my $attribute (@{$interface->attributes}) { >+ next if $attribute->extendedAttributes->{DelegateToSharedSyntheticAttribute}; >+ > GenerateAttributeGetterDefinition(\@implContent, $interface, $className, $attribute); > GenerateAttributeSetterDefinition(\@implContent, $interface, $className, $attribute); > } >@@ -5207,7 +5210,8 @@ sub GenerateAttributeGetterBodyDefinitio > my @signatureArguments = (); > push(@signatureArguments, "JSGlobalObject& lexicalGlobalObject"); > push(@signatureArguments, "${className}& thisObject") if !$attribute->isStatic; >- >+ push(@signatureArguments, "PropertyName propertyName") if NeedsPropertyNamePassedToAttributeBody($attribute); >+ > my $needSecurityCheck = $interface->extendedAttributes->{CheckSecurity} && !$attribute->extendedAttributes->{DoNotCheckSecurity} && !$attribute->extendedAttributes->{DoNotCheckSecurityOnGetter}; > my $hasCustomGetter = HasCustomGetter($attribute); > my $isEventHandler = $attribute->type->name eq "EventHandler"; >@@ -5269,13 +5273,6 @@ sub GenerateAttributeGetterBodyDefinitio > } else { > push(@$outputArray, " return JS" . $constructorType . "::${constructorGetter}(JSC::getVM(&lexicalGlobalObject), thisObject.globalObject());\n"); > } >- } elsif ($attribute->extendedAttributes->{CSSProperty}) { >- $implIncludes{"CSSPropertyNames.h"} = 1; >- my $propertyID = $attribute->extendedAttributes->{CSSProperty}; >- >- my $toJSExpression = NativeToJSValueUsingReferences($attribute, $interface, "impl.getPropertyValueInternal(CSSProperty${propertyID})", "*thisObject.globalObject()"); >- push(@$outputArray, " auto& impl = thisObject.wrapped();\n"); >- push(@$outputArray, " RELEASE_AND_RETURN(throwScope, (${toJSExpression}));\n"); > } else { > if ($attribute->extendedAttributes->{CachedAttribute}) { > push(@$outputArray, " if (JSValue cachedValue = thisObject.m_" . $attribute->name . ".get())\n"); >@@ -5324,6 +5321,7 @@ sub GenerateAttributeGetterTrampolineDef > > my $callAttributeGetterName = "get"; > $callAttributeGetterName .= "Static" if $attribute->isStatic; >+ $callAttributeGetterName .= "PassingPropertyName" if NeedsPropertyNamePassedToAttributeBody($attribute); > > my @templateParameters = (); > push(@templateParameters, $attributeGetterBodyName); >@@ -5341,6 +5339,29 @@ sub GenerateAttributeGetterTrampolineDef > push(@$outputArray, "}\n\n"); > } > >+sub GenerateAttributeGetterAndSetterDeclaration >+{ >+ my ($outputArray, $interface, $className, $attribute) = @_; >+ >+ return if IsJSBuiltin($interface, $attribute); >+ >+ my $conditionalString = $codeGenerator->GenerateConditionalString($attribute); >+ push(@$outputArray, "#if ${conditionalString}\n") if $conditionalString; >+ my $getter = GetAttributeGetterName($interface, $className, $attribute); >+ push(@$outputArray, "static JSC_DECLARE_CUSTOM_GETTER(${getter});\n"); >+ unless (IsReadonly($attribute) || $codeGenerator->IsConstructorType($attribute->type)) { >+ my $readWriteConditional = $attribute->extendedAttributes->{ConditionallyReadWrite}; >+ if ($readWriteConditional) { >+ my $readWriteConditionalString = $codeGenerator->GenerateConditionalStringFromAttributeValue($readWriteConditional); >+ push(@$outputArray, "#if ${readWriteConditionalString}\n"); >+ } >+ my $setter = GetAttributeSetterName($interface, $className, $attribute); >+ push(@$outputArray, "static JSC_DECLARE_CUSTOM_SETTER(${setter});\n"); >+ push(@$outputArray, "#endif\n") if $readWriteConditional; >+ } >+ push(@$outputArray, "#endif\n") if $conditionalString; >+} >+ > sub GenerateAttributeGetterDefinition > { > my ($outputArray, $interface, $className, $attribute) = @_; >@@ -5370,6 +5391,7 @@ sub GenerateAttributeSetterBodyDefinitio > push(@signatureArguments, "JSGlobalObject& lexicalGlobalObject"); > push(@signatureArguments, "${className}& thisObject") if !$attribute->isStatic; > push(@signatureArguments, "JSValue value"); >+ push(@signatureArguments, "PropertyName propertyName") if NeedsPropertyNamePassedToAttributeBody($attribute); > > my $needSecurityCheck = $interface->extendedAttributes->{CheckSecurity} && !$attribute->extendedAttributes->{DoNotCheckSecurity} && !$attribute->extendedAttributes->{DoNotCheckSecurityOnSetter}; > my $hasCustomSetter = HasCustomSetter($attribute); >@@ -5419,21 +5441,6 @@ sub GenerateAttributeSetterBodyDefinitio > push(@$outputArray, " vm.heap.writeBarrier(&thisObject, value);\n"); > push(@$outputArray, " ensureStillAliveHere(value);\n\n"); > push(@$outputArray, " return true;\n"); >- } elsif ($attribute->extendedAttributes->{CSSProperty}) { >- $implIncludes{"CSSPropertyNames.h"} = 1; >- >- my $propertyID = $attribute->extendedAttributes->{CSSProperty}; >- >- my $exceptionThrower = GetAttributeExceptionThrower($interface, $attribute); >- my $toNativeExpression = JSValueToNative($interface, $attribute, "value", $attribute->extendedAttributes->{Conditional}, "&lexicalGlobalObject", "lexicalGlobalObject", "thisObject", "*thisObject.globalObject()", $exceptionThrower); >- >- push(@$outputArray, " auto& impl = thisObject.wrapped();\n"); >- push(@$outputArray, " auto nativeValue = ${toNativeExpression};\n"); >- push(@$outputArray, " RETURN_IF_EXCEPTION(throwScope, false);\n"); >- push(@$outputArray, " invokeFunctorPropagatingExceptionIfNecessary(lexicalGlobalObject, throwScope, [&] {\n"); >- push(@$outputArray, " return impl.setPropertyInternal(CSSProperty${propertyID}, WTFMove(nativeValue), false);\n"); >- push(@$outputArray, " });\n"); >- push(@$outputArray, " return true;\n"); > } elsif ($isReplaceable) { > my $id = $attribute->name; > push(@$outputArray, " // Shadowing a built-in property.\n"); >@@ -5521,6 +5528,7 @@ sub GenerateAttributeSetterTrampolineDef > > my $callAttributeSetterName = "set"; > $callAttributeSetterName .= "Static" if $attribute->isStatic; >+ $callAttributeSetterName .= "PassingPropertyName" if NeedsPropertyNamePassedToAttributeBody($attribute); > > my @templateParameters = (); > push(@templateParameters, $attributeSetterBodyName); >@@ -6003,6 +6011,10 @@ sub GenerateCallWith > if ($codeGenerator->ExtendedAttributeContains($callWith, "World")) { > push(@callWithArgs, "worldForDOMObject(${thisReference})"); > } >+ if ($codeGenerator->ExtendedAttributeContains($callWith, "PropertyName")) { >+ AddToImplIncludes("JSDOMConvertStrings.h"); >+ push(@callWithArgs, "propertyNameToAtomString(propertyName)"); >+ } > > return @callWithArgs; > } >@@ -8045,4 +8057,73 @@ sub GenerateCustomElementReactionsStackI > } > } > >+sub MakeSharedSyntheticAttribute >+{ >+ my ($name, $baseAttribute) = @_; >+ >+ my $sharedAttribute = IDLAttribute->new(); >+ $sharedAttribute->name($name); >+ $sharedAttribute->type(IDLParser::cloneType($baseAttribute->type)); >+ IDLParser::copyExtendedAttributes($sharedAttribute->extendedAttributes, $baseAttribute->extendedAttributes); >+ >+ delete $sharedAttribute->extendedAttributes->{DelegateToSharedSyntheticAttribute}; >+ $sharedAttribute->extendedAttributes->{IsSharedSyntheticAttribute} = 1; >+ $sharedAttribute->extendedAttributes->{CallWith} = "PropertyName"; >+ >+ return $sharedAttribute; >+} >+ >+sub ComputeSharedSyntheticAttributes >+{ >+ my $interface = shift; >+ >+ # Use a fake extended attribute, SyntheticIDLAttributes, to store the new attributes >+ if (not exists $interface->extendedAttributes->{SyntheticIDLAttributes}) { >+ my %syntheticIDLAttributes = ( ); >+ my @attributes = (); >+ foreach my $attribute (@{$interface->attributes}) { >+ if ($attribute->extendedAttributes->{DelegateToSharedSyntheticAttribute}) { >+ my $name = $attribute->extendedAttributes->{DelegateToSharedSyntheticAttribute}; >+ if (not $syntheticIDLAttributes{$name}) { >+ my $syntheticAttribute = MakeSharedSyntheticAttribute($name, $attribute); >+ $syntheticIDLAttributes{$name} = 1; >+ push(@attributes, $syntheticAttribute); >+ } >+ } >+ } >+ $interface->extendedAttributes->{SyntheticIDLAttributes} = \@attributes; >+ } >+} >+ >+sub NeedsDelegationToSharedSyntheticAttribute >+{ >+ my $interface = shift; >+ >+ ComputeSharedSyntheticAttributes($interface); >+ >+ return scalar @{$interface->extendedAttributes->{SyntheticIDLAttributes}}; >+} >+ >+sub GetSharedSyntheticAttribute >+{ >+ my ($interface, $attribute) = @_; >+ >+ ComputeSharedSyntheticAttributes($interface); >+ >+ foreach my $syntheticAttribute (@{$interface->extendedAttributes->{SyntheticIDLAttributes}}) { >+ if ($attribute->extendedAttributes->{DelegateToSharedSyntheticAttribute} eq $syntheticAttribute->name()) { >+ return $syntheticAttribute; >+ } >+ } >+ >+ return undef; >+} >+ >+sub NeedsPropertyNamePassedToAttributeBody >+{ >+ my $attribute = shift; >+ >+ return $codeGenerator->ExtendedAttributeContains($attribute->extendedAttributes->{CallWith}, "PropertyName"); >+} >+ > 1; >Index: Source/WebCore/bindings/scripts/IDLAttributes.json >=================================================================== >--- Source/WebCore/bindings/scripts/IDLAttributes.json (revision 275450) >+++ Source/WebCore/bindings/scripts/IDLAttributes.json (working copy) >@@ -38,10 +38,6 @@ > "url": "https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions" > } > }, >- "CSSProperty": { >- "contextsAllowed": ["attribute"], >- "values": ["*"] >- }, > "CachedAttribute": { > "contextsAllowed": ["attribute"] > }, >@@ -154,6 +150,9 @@ > "DefaultDefineOwnProperty": { > "contextsAllowed": ["interface"] > }, >+ "DelegateToSharedSyntheticAttribute": { >+ "contextsAllowed": ["attribute"] >+ }, > "DisabledByQuirk": { > "contextsAllowed": ["interface", "dictionary", "enum", "attribute", "operation", "constant", "dictionary-member", "includes"], > "values": ["*"], >Index: Source/WebCore/bindings/scripts/test/BindingTestGlobalConstructors.idl >=================================================================== >--- Source/WebCore/bindings/scripts/test/BindingTestGlobalConstructors.idl (revision 275450) >+++ Source/WebCore/bindings/scripts/test/BindingTestGlobalConstructors.idl (working copy) >@@ -1,7 +1,6 @@ > partial interface TestGlobalObject { > attribute TestCEReactionsConstructor TestCEReactions; > attribute TestCEReactionsStringifierConstructor TestCEReactionsStringifier; >- attribute TestCSSPropertyConstructor TestCSSProperty; > attribute TestCallTracerConstructor TestCallTracer; > [Conditional=TEST_CONDITIONAL] attribute TestCallbackInterfaceConstructor TestCallbackInterface; > attribute TestClassWithJSBuiltinConstructorConstructor TestClassWithJSBuiltinConstructor; >@@ -9,6 +8,7 @@ partial interface TestGlobalObject { > attribute TestDefaultToJSONIndirectInheritanceConstructor TestDefaultToJSONIndirectInheritance; > attribute TestDefaultToJSONInheritConstructor TestDefaultToJSONInherit; > attribute TestDefaultToJSONInheritFinalConstructor TestDefaultToJSONInheritFinal; >+ attribute TestDelegateToSharedSyntheticAttributeConstructor TestDelegateToSharedSyntheticAttribute; > attribute TestDomainSecurityConstructor TestDomainSecurity; > attribute TestEventConstructorConstructor TestEventConstructor; > attribute TestEventTargetConstructor TestEventTarget; >Index: Source/WebCore/bindings/scripts/test/SupplementalDependencies.dep >=================================================================== >--- Source/WebCore/bindings/scripts/test/SupplementalDependencies.dep (revision 275450) >+++ Source/WebCore/bindings/scripts/test/SupplementalDependencies.dep (working copy) >@@ -24,9 +24,6 @@ WebDOMTestCEReactions.h: > JSTestCEReactionsStringifier.h: > DOMTestCEReactionsStringifier.h: > WebDOMTestCEReactionsStringifier.h: >-JSTestCSSProperty.h: >-DOMTestCSSProperty.h: >-WebDOMTestCSSProperty.h: > JSTestCallTracer.h: > DOMTestCallTracer.h: > WebDOMTestCallTracer.h: >@@ -76,6 +73,9 @@ WebDOMTestDefaultToJSONInherit.h: > JSTestDefaultToJSONInheritFinal.h: > DOMTestDefaultToJSONInheritFinal.h: > WebDOMTestDefaultToJSONInheritFinal.h: >+JSTestDelegateToSharedSyntheticAttribute.h: >+DOMTestDelegateToSharedSyntheticAttribute.h: >+WebDOMTestDelegateToSharedSyntheticAttribute.h: > JSTestDerivedDictionary.h: > DOMTestDerivedDictionary.h: > WebDOMTestDerivedDictionary.h: >Index: Source/WebCore/bindings/scripts/test/TestCSSProperty.idl >=================================================================== >--- Source/WebCore/bindings/scripts/test/TestCSSProperty.idl (revision 275450) >+++ Source/WebCore/bindings/scripts/test/TestCSSProperty.idl (nonexistent) >@@ -1,32 +0,0 @@ >-/* >- * Copyright (C) 2021 Apple Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >- * THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-typedef USVString CSSOMString; >- >-[ >- Exposed=TestGlobalObject >-] interface TestCSSProperty { >- [CEReactions, CSSProperty=PropertyName] attribute [LegacyNullToEmptyString] CSSOMString property; >-}; >Index: Source/WebCore/bindings/scripts/test/TestDelegateToSharedSyntheticAttribute.idl >=================================================================== >--- Source/WebCore/bindings/scripts/test/TestDelegateToSharedSyntheticAttribute.idl (nonexistent) >+++ Source/WebCore/bindings/scripts/test/TestDelegateToSharedSyntheticAttribute.idl (working copy) >@@ -0,0 +1,36 @@ >+/* >+ * Copyright (C) 2021 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+typedef USVString CSSOMString; >+ >+[ >+ Exposed=TestGlobalObject >+] interface TestDelegateToSharedSyntheticAttribute { >+ [CEReactions, DelegateToSharedSyntheticAttribute=sharedAttribute1] attribute [LegacyNullToEmptyString] CSSOMString property1; >+ [CEReactions, DelegateToSharedSyntheticAttribute=sharedAttribute1] attribute [LegacyNullToEmptyString] CSSOMString property2; >+ [CEReactions, DelegateToSharedSyntheticAttribute=sharedAttribute1] attribute [LegacyNullToEmptyString] CSSOMString property3; >+ [CEReactions, DelegateToSharedSyntheticAttribute=sharedAttribute2] attribute [LegacyNullToEmptyString] CSSOMString property4; >+ [CEReactions, DelegateToSharedSyntheticAttribute=sharedAttribute2] attribute [LegacyNullToEmptyString] CSSOMString property5; >+}; >Index: Source/WebCore/bindings/scripts/test/JS/JSTestCSSProperty.cpp >=================================================================== >--- Source/WebCore/bindings/scripts/test/JS/JSTestCSSProperty.cpp (revision 275450) >+++ Source/WebCore/bindings/scripts/test/JS/JSTestCSSProperty.cpp (nonexistent) >@@ -1,298 +0,0 @@ >-/* >- This file is part of the WebKit open source project. >- This file has been generated by generate-bindings.pl. DO NOT MODIFY! >- >- This library is free software; you can redistribute it and/or >- modify it under the terms of the GNU Library General Public >- License as published by the Free Software Foundation; either >- version 2 of the License, or (at your option) any later version. >- >- This library is distributed in the hope that it will be useful, >- but WITHOUT ANY WARRANTY; without even the implied warranty of >- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >- Library General Public License for more details. >- >- You should have received a copy of the GNU Library General Public License >- along with this library; see the file COPYING.LIB. If not, write to >- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >- Boston, MA 02110-1301, USA. >-*/ >- >-#include "config.h" >-#include "JSTestCSSProperty.h" >- >-#include "ActiveDOMObject.h" >-#include "CSSPropertyNames.h" >-#include "CustomElementReactionQueue.h" >-#include "DOMIsoSubspaces.h" >-#include "JSDOMAttribute.h" >-#include "JSDOMBinding.h" >-#include "JSDOMConstructorNotConstructable.h" >-#include "JSDOMConvertStrings.h" >-#include "JSDOMExceptionHandling.h" >-#include "JSDOMWrapperCache.h" >-#include "ScriptExecutionContext.h" >-#include "WebCoreJSClientData.h" >-#include <JavaScriptCore/FunctionPrototype.h> >-#include <JavaScriptCore/HeapAnalyzer.h> >-#include <JavaScriptCore/JSCInlines.h> >-#include <JavaScriptCore/JSDestructibleObjectHeapCellType.h> >-#include <JavaScriptCore/SlotVisitorMacros.h> >-#include <JavaScriptCore/SubspaceInlines.h> >-#include <wtf/GetPtr.h> >-#include <wtf/PointerPreparations.h> >-#include <wtf/URL.h> >- >- >-namespace WebCore { >-using namespace JSC; >- >-// Attributes >- >-static JSC_DECLARE_CUSTOM_GETTER(jsTestCSSPropertyConstructor); >-static JSC_DECLARE_CUSTOM_GETTER(jsTestCSSProperty_property); >-static JSC_DECLARE_CUSTOM_SETTER(setJSTestCSSProperty_property); >- >-class JSTestCSSPropertyPrototype final : public JSC::JSNonFinalObject { >-public: >- using Base = JSC::JSNonFinalObject; >- static JSTestCSSPropertyPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure) >- { >- JSTestCSSPropertyPrototype* ptr = new (NotNull, JSC::allocateCell<JSTestCSSPropertyPrototype>(vm.heap)) JSTestCSSPropertyPrototype(vm, globalObject, structure); >- ptr->finishCreation(vm); >- return ptr; >- } >- >- DECLARE_INFO; >- template<typename CellType, JSC::SubspaceAccess> >- static JSC::IsoSubspace* subspaceFor(JSC::VM& vm) >- { >- STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSTestCSSPropertyPrototype, Base); >- return &vm.plainObjectSpace; >- } >- static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) >- { >- return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info()); >- } >- >-private: >- JSTestCSSPropertyPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure) >- : JSC::JSNonFinalObject(vm, structure) >- { >- } >- >- void finishCreation(JSC::VM&); >-}; >-STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSTestCSSPropertyPrototype, JSTestCSSPropertyPrototype::Base); >- >-using JSTestCSSPropertyDOMConstructor = JSDOMConstructorNotConstructable<JSTestCSSProperty>; >- >-template<> JSValue JSTestCSSPropertyDOMConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject) >-{ >- UNUSED_PARAM(vm); >- return globalObject.functionPrototype(); >-} >- >-template<> void JSTestCSSPropertyDOMConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject) >-{ >- putDirect(vm, vm.propertyNames->prototype, JSTestCSSProperty::prototype(vm, globalObject), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); >- putDirect(vm, vm.propertyNames->name, jsNontrivialString(vm, "TestCSSProperty"_s), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); >- putDirect(vm, vm.propertyNames->length, jsNumber(0), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); >-} >- >-template<> const ClassInfo JSTestCSSPropertyDOMConstructor::s_info = { "TestCSSProperty", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestCSSPropertyDOMConstructor) }; >- >-/* Hash table for prototype */ >- >-static const HashTableValue JSTestCSSPropertyPrototypeTableValues[] = >-{ >- { "constructor", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestCSSPropertyConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, >- { "property", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestCSSProperty_property), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestCSSProperty_property) } }, >-}; >- >-const ClassInfo JSTestCSSPropertyPrototype::s_info = { "TestCSSProperty", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestCSSPropertyPrototype) }; >- >-void JSTestCSSPropertyPrototype::finishCreation(VM& vm) >-{ >- Base::finishCreation(vm); >- reifyStaticProperties(vm, JSTestCSSProperty::info(), JSTestCSSPropertyPrototypeTableValues, *this); >- JSC_TO_STRING_TAG_WITHOUT_TRANSITION(); >-} >- >-const ClassInfo JSTestCSSProperty::s_info = { "TestCSSProperty", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestCSSProperty) }; >- >-JSTestCSSProperty::JSTestCSSProperty(Structure* structure, JSDOMGlobalObject& globalObject, Ref<TestCSSProperty>&& impl) >- : JSDOMWrapper<TestCSSProperty>(structure, globalObject, WTFMove(impl)) >-{ >-} >- >-void JSTestCSSProperty::finishCreation(VM& vm) >-{ >- Base::finishCreation(vm); >- ASSERT(inherits(vm, info())); >- >- static_assert(!std::is_base_of<ActiveDOMObject, TestCSSProperty>::value, "Interface is not marked as [ActiveDOMObject] even though implementation class subclasses ActiveDOMObject."); >- >-} >- >-JSObject* JSTestCSSProperty::createPrototype(VM& vm, JSDOMGlobalObject& globalObject) >-{ >- return JSTestCSSPropertyPrototype::create(vm, &globalObject, JSTestCSSPropertyPrototype::createStructure(vm, &globalObject, globalObject.objectPrototype())); >-} >- >-JSObject* JSTestCSSProperty::prototype(VM& vm, JSDOMGlobalObject& globalObject) >-{ >- return getDOMPrototype<JSTestCSSProperty>(vm, globalObject); >-} >- >-JSValue JSTestCSSProperty::getConstructor(VM& vm, const JSGlobalObject* globalObject) >-{ >- return getDOMConstructor<JSTestCSSPropertyDOMConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject)); >-} >- >-void JSTestCSSProperty::destroy(JSC::JSCell* cell) >-{ >- JSTestCSSProperty* thisObject = static_cast<JSTestCSSProperty*>(cell); >- thisObject->JSTestCSSProperty::~JSTestCSSProperty(); >-} >- >-template<> inline JSTestCSSProperty* IDLAttribute<JSTestCSSProperty>::cast(JSGlobalObject& lexicalGlobalObject, EncodedJSValue thisValue) >-{ >- return jsDynamicCast<JSTestCSSProperty*>(JSC::getVM(&lexicalGlobalObject), JSValue::decode(thisValue)); >-} >- >-JSC_DEFINE_CUSTOM_GETTER(jsTestCSSPropertyConstructor, (JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName)) >-{ >- VM& vm = JSC::getVM(lexicalGlobalObject); >- auto throwScope = DECLARE_THROW_SCOPE(vm); >- auto* prototype = jsDynamicCast<JSTestCSSPropertyPrototype*>(vm, JSValue::decode(thisValue)); >- if (UNLIKELY(!prototype)) >- return throwVMTypeError(lexicalGlobalObject, throwScope); >- return JSValue::encode(JSTestCSSProperty::getConstructor(JSC::getVM(lexicalGlobalObject), prototype->globalObject())); >-} >- >-static inline JSValue jsTestCSSProperty_propertyGetter(JSGlobalObject& lexicalGlobalObject, JSTestCSSProperty& thisObject) >-{ >- auto& vm = JSC::getVM(&lexicalGlobalObject); >- auto throwScope = DECLARE_THROW_SCOPE(vm); >- auto& impl = thisObject.wrapped(); >- RELEASE_AND_RETURN(throwScope, (toJS<IDLLegacyNullToEmptyStringAdaptor<IDLUSVString>>(lexicalGlobalObject, throwScope, impl.getPropertyValueInternal(CSSPropertyPropertyName)))); >-} >- >-JSC_DEFINE_CUSTOM_GETTER(jsTestCSSProperty_property, (JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName)) >-{ >- return IDLAttribute<JSTestCSSProperty>::get<jsTestCSSProperty_propertyGetter, CastedThisErrorBehavior::Assert>(*lexicalGlobalObject, thisValue, attributeName); >-} >- >-static inline bool setJSTestCSSProperty_propertySetter(JSGlobalObject& lexicalGlobalObject, JSTestCSSProperty& thisObject, JSValue value) >-{ >- auto& vm = JSC::getVM(&lexicalGlobalObject); >- auto throwScope = DECLARE_THROW_SCOPE(vm); >- CustomElementReactionStack customElementReactionStack(lexicalGlobalObject); >- auto& impl = thisObject.wrapped(); >- auto nativeValue = convert<IDLLegacyNullToEmptyStringAdaptor<IDLUSVString>>(lexicalGlobalObject, value); >- RETURN_IF_EXCEPTION(throwScope, false); >- invokeFunctorPropagatingExceptionIfNecessary(lexicalGlobalObject, throwScope, [&] { >- return impl.setPropertyInternal(CSSPropertyPropertyName, WTFMove(nativeValue), false); >- }); >- return true; >-} >- >-JSC_DEFINE_CUSTOM_SETTER(setJSTestCSSProperty_property, (JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue, PropertyName attributeName)) >-{ >- return IDLAttribute<JSTestCSSProperty>::set<setJSTestCSSProperty_propertySetter>(*lexicalGlobalObject, thisValue, encodedValue, attributeName); >-} >- >-JSC::IsoSubspace* JSTestCSSProperty::subspaceForImpl(JSC::VM& vm) >-{ >- auto& clientData = *static_cast<JSVMClientData*>(vm.clientData); >- auto& spaces = clientData.subspaces(); >- if (auto* space = spaces.m_subspaceForTestCSSProperty.get()) >- return space; >- static_assert(std::is_base_of_v<JSC::JSDestructibleObject, JSTestCSSProperty> || !JSTestCSSProperty::needsDestruction); >- if constexpr (std::is_base_of_v<JSC::JSDestructibleObject, JSTestCSSProperty>) >- spaces.m_subspaceForTestCSSProperty = makeUnique<IsoSubspace> ISO_SUBSPACE_INIT(vm.heap, vm.destructibleObjectHeapCellType.get(), JSTestCSSProperty); >- else >- spaces.m_subspaceForTestCSSProperty = makeUnique<IsoSubspace> ISO_SUBSPACE_INIT(vm.heap, vm.cellHeapCellType.get(), JSTestCSSProperty); >- auto* space = spaces.m_subspaceForTestCSSProperty.get(); >-IGNORE_WARNINGS_BEGIN("unreachable-code") >-IGNORE_WARNINGS_BEGIN("tautological-compare") >- void (*myVisitOutputConstraint)(JSC::JSCell*, JSC::SlotVisitor&) = JSTestCSSProperty::visitOutputConstraints; >- void (*jsCellVisitOutputConstraint)(JSC::JSCell*, JSC::SlotVisitor&) = JSC::JSCell::visitOutputConstraints; >- if (myVisitOutputConstraint != jsCellVisitOutputConstraint) >- clientData.outputConstraintSpaces().append(space); >-IGNORE_WARNINGS_END >-IGNORE_WARNINGS_END >- return space; >-} >- >-void JSTestCSSProperty::analyzeHeap(JSCell* cell, HeapAnalyzer& analyzer) >-{ >- auto* thisObject = jsCast<JSTestCSSProperty*>(cell); >- analyzer.setWrappedObjectForCell(cell, &thisObject->wrapped()); >- if (thisObject->scriptExecutionContext()) >- analyzer.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string()); >- Base::analyzeHeap(cell, analyzer); >-} >- >-bool JSTestCSSPropertyOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, AbstractSlotVisitor& visitor, const char** reason) >-{ >- UNUSED_PARAM(handle); >- UNUSED_PARAM(visitor); >- UNUSED_PARAM(reason); >- return false; >-} >- >-void JSTestCSSPropertyOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context) >-{ >- auto* jsTestCSSProperty = static_cast<JSTestCSSProperty*>(handle.slot()->asCell()); >- auto& world = *static_cast<DOMWrapperWorld*>(context); >- uncacheWrapper(world, &jsTestCSSProperty->wrapped(), jsTestCSSProperty); >-} >- >-#if ENABLE(BINDING_INTEGRITY) >-#if PLATFORM(WIN) >-#pragma warning(disable: 4483) >-extern "C" { extern void (*const __identifier("??_7TestCSSProperty@WebCore@@6B@")[])(); } >-#else >-extern "C" { extern void* _ZTVN7WebCore15TestCSSPropertyE[]; } >-#endif >-#endif >- >-JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject*, JSDOMGlobalObject* globalObject, Ref<TestCSSProperty>&& impl) >-{ >- >-#if ENABLE(BINDING_INTEGRITY) >- const void* actualVTablePointer = getVTablePointer(impl.ptr()); >-#if PLATFORM(WIN) >- void* expectedVTablePointer = __identifier("??_7TestCSSProperty@WebCore@@6B@"); >-#else >- void* expectedVTablePointer = &_ZTVN7WebCore15TestCSSPropertyE[2]; >-#endif >- >- // If this fails TestCSSProperty does not have a vtable, so you need to add the >- // ImplementationLacksVTable attribute to the interface definition >- static_assert(std::is_polymorphic<TestCSSProperty>::value, "TestCSSProperty is not polymorphic"); >- >- // If you hit this assertion you either have a use after free bug, or >- // TestCSSProperty has subclasses. If TestCSSProperty has subclasses that get passed >- // to toJS() we currently require TestCSSProperty you to opt out of binding hardening >- // by adding the SkipVTableValidation attribute to the interface IDL definition >- RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer); >-#endif >- return createWrapper<TestCSSProperty>(globalObject, WTFMove(impl)); >-} >- >-JSC::JSValue toJS(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, TestCSSProperty& impl) >-{ >- return wrap(lexicalGlobalObject, globalObject, impl); >-} >- >-TestCSSProperty* JSTestCSSProperty::toWrapped(JSC::VM& vm, JSC::JSValue value) >-{ >- if (auto* wrapper = jsDynamicCast<JSTestCSSProperty*>(vm, value)) >- return &wrapper->wrapped(); >- return nullptr; >-} >- >-} >Index: Source/WebCore/bindings/scripts/test/JS/JSTestCSSProperty.h >=================================================================== >--- Source/WebCore/bindings/scripts/test/JS/JSTestCSSProperty.h (revision 275450) >+++ Source/WebCore/bindings/scripts/test/JS/JSTestCSSProperty.h (nonexistent) >@@ -1,93 +0,0 @@ >-/* >- This file is part of the WebKit open source project. >- This file has been generated by generate-bindings.pl. DO NOT MODIFY! >- >- This library is free software; you can redistribute it and/or >- modify it under the terms of the GNU Library General Public >- License as published by the Free Software Foundation; either >- version 2 of the License, or (at your option) any later version. >- >- This library is distributed in the hope that it will be useful, >- but WITHOUT ANY WARRANTY; without even the implied warranty of >- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >- Library General Public License for more details. >- >- You should have received a copy of the GNU Library General Public License >- along with this library; see the file COPYING.LIB. If not, write to >- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >- Boston, MA 02110-1301, USA. >-*/ >- >-#pragma once >- >-#include "JSDOMWrapper.h" >-#include "TestCSSProperty.h" >-#include <wtf/NeverDestroyed.h> >- >-namespace WebCore { >- >-class JSTestCSSProperty : public JSDOMWrapper<TestCSSProperty> { >-public: >- using Base = JSDOMWrapper<TestCSSProperty>; >- static JSTestCSSProperty* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestCSSProperty>&& impl) >- { >- JSTestCSSProperty* ptr = new (NotNull, JSC::allocateCell<JSTestCSSProperty>(globalObject->vm().heap)) JSTestCSSProperty(structure, *globalObject, WTFMove(impl)); >- ptr->finishCreation(globalObject->vm()); >- return ptr; >- } >- >- static JSC::JSObject* createPrototype(JSC::VM&, JSDOMGlobalObject&); >- static JSC::JSObject* prototype(JSC::VM&, JSDOMGlobalObject&); >- static TestCSSProperty* toWrapped(JSC::VM&, JSC::JSValue); >- static void destroy(JSC::JSCell*); >- >- DECLARE_INFO; >- >- static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) >- { >- return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info(), JSC::NonArray); >- } >- >- static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); >- template<typename, JSC::SubspaceAccess mode> static JSC::IsoSubspace* subspaceFor(JSC::VM& vm) >- { >- if constexpr (mode == JSC::SubspaceAccess::Concurrently) >- return nullptr; >- return subspaceForImpl(vm); >- } >- static JSC::IsoSubspace* subspaceForImpl(JSC::VM& vm); >- static void analyzeHeap(JSCell*, JSC::HeapAnalyzer&); >-protected: >- JSTestCSSProperty(JSC::Structure*, JSDOMGlobalObject&, Ref<TestCSSProperty>&&); >- >- void finishCreation(JSC::VM&); >-}; >- >-class JSTestCSSPropertyOwner final : public JSC::WeakHandleOwner { >-public: >- bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::AbstractSlotVisitor&, const char**) final; >- void finalize(JSC::Handle<JSC::Unknown>, void* context) final; >-}; >- >-inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld&, TestCSSProperty*) >-{ >- static NeverDestroyed<JSTestCSSPropertyOwner> owner; >- return &owner.get(); >-} >- >-inline void* wrapperKey(TestCSSProperty* wrappableObject) >-{ >- return wrappableObject; >-} >- >-JSC::JSValue toJS(JSC::JSGlobalObject*, JSDOMGlobalObject*, TestCSSProperty&); >-inline JSC::JSValue toJS(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, TestCSSProperty* impl) { return impl ? toJS(lexicalGlobalObject, globalObject, *impl) : JSC::jsNull(); } >-JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject*, JSDOMGlobalObject*, Ref<TestCSSProperty>&&); >-inline JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, RefPtr<TestCSSProperty>&& impl) { return impl ? toJSNewlyCreated(lexicalGlobalObject, globalObject, impl.releaseNonNull()) : JSC::jsNull(); } >- >-template<> struct JSDOMWrapperConverterTraits<TestCSSProperty> { >- using WrapperClass = JSTestCSSProperty; >- using ToWrappedReturnType = TestCSSProperty*; >-}; >- >-} // namespace WebCore >Index: Source/WebCore/bindings/scripts/test/JS/JSTestDelegateToSharedSyntheticAttribute.cpp >=================================================================== >--- Source/WebCore/bindings/scripts/test/JS/JSTestDelegateToSharedSyntheticAttribute.cpp (nonexistent) >+++ Source/WebCore/bindings/scripts/test/JS/JSTestDelegateToSharedSyntheticAttribute.cpp (working copy) >@@ -0,0 +1,335 @@ >+/* >+ This file is part of the WebKit open source project. >+ This file has been generated by generate-bindings.pl. DO NOT MODIFY! >+ >+ This library is free software; you can redistribute it and/or >+ modify it under the terms of the GNU Library General Public >+ License as published by the Free Software Foundation; either >+ version 2 of the License, or (at your option) any later version. >+ >+ This library is distributed in the hope that it will be useful, >+ but WITHOUT ANY WARRANTY; without even the implied warranty of >+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >+ Library General Public License for more details. >+ >+ You should have received a copy of the GNU Library General Public License >+ along with this library; see the file COPYING.LIB. If not, write to >+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >+ Boston, MA 02110-1301, USA. >+*/ >+ >+#include "config.h" >+#include "JSTestDelegateToSharedSyntheticAttribute.h" >+ >+#include "ActiveDOMObject.h" >+#include "CustomElementReactionQueue.h" >+#include "DOMIsoSubspaces.h" >+#include "JSDOMAttribute.h" >+#include "JSDOMBinding.h" >+#include "JSDOMConstructorNotConstructable.h" >+#include "JSDOMConvertStrings.h" >+#include "JSDOMExceptionHandling.h" >+#include "JSDOMWrapperCache.h" >+#include "ScriptExecutionContext.h" >+#include "WebCoreJSClientData.h" >+#include <JavaScriptCore/FunctionPrototype.h> >+#include <JavaScriptCore/HeapAnalyzer.h> >+#include <JavaScriptCore/JSCInlines.h> >+#include <JavaScriptCore/JSDestructibleObjectHeapCellType.h> >+#include <JavaScriptCore/SlotVisitorMacros.h> >+#include <JavaScriptCore/SubspaceInlines.h> >+#include <wtf/GetPtr.h> >+#include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> >+ >+ >+namespace WebCore { >+using namespace JSC; >+ >+// Attributes >+ >+static JSC_DECLARE_CUSTOM_GETTER(jsTestDelegateToSharedSyntheticAttributeConstructor); >+static JSC_DECLARE_CUSTOM_GETTER(jsTestDelegateToSharedSyntheticAttribute_sharedAttribute1); >+static JSC_DECLARE_CUSTOM_SETTER(setJSTestDelegateToSharedSyntheticAttribute_sharedAttribute1); >+static JSC_DECLARE_CUSTOM_GETTER(jsTestDelegateToSharedSyntheticAttribute_sharedAttribute2); >+static JSC_DECLARE_CUSTOM_SETTER(setJSTestDelegateToSharedSyntheticAttribute_sharedAttribute2); >+ >+class JSTestDelegateToSharedSyntheticAttributePrototype final : public JSC::JSNonFinalObject { >+public: >+ using Base = JSC::JSNonFinalObject; >+ static JSTestDelegateToSharedSyntheticAttributePrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure) >+ { >+ JSTestDelegateToSharedSyntheticAttributePrototype* ptr = new (NotNull, JSC::allocateCell<JSTestDelegateToSharedSyntheticAttributePrototype>(vm.heap)) JSTestDelegateToSharedSyntheticAttributePrototype(vm, globalObject, structure); >+ ptr->finishCreation(vm); >+ return ptr; >+ } >+ >+ DECLARE_INFO; >+ template<typename CellType, JSC::SubspaceAccess> >+ static JSC::IsoSubspace* subspaceFor(JSC::VM& vm) >+ { >+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSTestDelegateToSharedSyntheticAttributePrototype, Base); >+ return &vm.plainObjectSpace; >+ } >+ static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) >+ { >+ return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info()); >+ } >+ >+private: >+ JSTestDelegateToSharedSyntheticAttributePrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure) >+ : JSC::JSNonFinalObject(vm, structure) >+ { >+ } >+ >+ void finishCreation(JSC::VM&); >+}; >+STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSTestDelegateToSharedSyntheticAttributePrototype, JSTestDelegateToSharedSyntheticAttributePrototype::Base); >+ >+using JSTestDelegateToSharedSyntheticAttributeDOMConstructor = JSDOMConstructorNotConstructable<JSTestDelegateToSharedSyntheticAttribute>; >+ >+template<> JSValue JSTestDelegateToSharedSyntheticAttributeDOMConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject) >+{ >+ UNUSED_PARAM(vm); >+ return globalObject.functionPrototype(); >+} >+ >+template<> void JSTestDelegateToSharedSyntheticAttributeDOMConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject) >+{ >+ putDirect(vm, vm.propertyNames->prototype, JSTestDelegateToSharedSyntheticAttribute::prototype(vm, globalObject), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); >+ putDirect(vm, vm.propertyNames->name, jsNontrivialString(vm, "TestDelegateToSharedSyntheticAttribute"_s), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); >+ putDirect(vm, vm.propertyNames->length, jsNumber(0), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); >+} >+ >+template<> const ClassInfo JSTestDelegateToSharedSyntheticAttributeDOMConstructor::s_info = { "TestDelegateToSharedSyntheticAttribute", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestDelegateToSharedSyntheticAttributeDOMConstructor) }; >+ >+/* Hash table for prototype */ >+ >+static const HashTableValue JSTestDelegateToSharedSyntheticAttributePrototypeTableValues[] = >+{ >+ { "constructor", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestDelegateToSharedSyntheticAttributeConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, >+ { "property1", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestDelegateToSharedSyntheticAttribute_sharedAttribute1), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestDelegateToSharedSyntheticAttribute_sharedAttribute1) } }, >+ { "property2", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestDelegateToSharedSyntheticAttribute_sharedAttribute1), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestDelegateToSharedSyntheticAttribute_sharedAttribute1) } }, >+ { "property3", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestDelegateToSharedSyntheticAttribute_sharedAttribute1), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestDelegateToSharedSyntheticAttribute_sharedAttribute1) } }, >+ { "property4", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestDelegateToSharedSyntheticAttribute_sharedAttribute2), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestDelegateToSharedSyntheticAttribute_sharedAttribute2) } }, >+ { "property5", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestDelegateToSharedSyntheticAttribute_sharedAttribute2), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestDelegateToSharedSyntheticAttribute_sharedAttribute2) } }, >+}; >+ >+const ClassInfo JSTestDelegateToSharedSyntheticAttributePrototype::s_info = { "TestDelegateToSharedSyntheticAttribute", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestDelegateToSharedSyntheticAttributePrototype) }; >+ >+void JSTestDelegateToSharedSyntheticAttributePrototype::finishCreation(VM& vm) >+{ >+ Base::finishCreation(vm); >+ reifyStaticProperties(vm, JSTestDelegateToSharedSyntheticAttribute::info(), JSTestDelegateToSharedSyntheticAttributePrototypeTableValues, *this); >+ JSC_TO_STRING_TAG_WITHOUT_TRANSITION(); >+} >+ >+const ClassInfo JSTestDelegateToSharedSyntheticAttribute::s_info = { "TestDelegateToSharedSyntheticAttribute", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestDelegateToSharedSyntheticAttribute) }; >+ >+JSTestDelegateToSharedSyntheticAttribute::JSTestDelegateToSharedSyntheticAttribute(Structure* structure, JSDOMGlobalObject& globalObject, Ref<TestDelegateToSharedSyntheticAttribute>&& impl) >+ : JSDOMWrapper<TestDelegateToSharedSyntheticAttribute>(structure, globalObject, WTFMove(impl)) >+{ >+} >+ >+void JSTestDelegateToSharedSyntheticAttribute::finishCreation(VM& vm) >+{ >+ Base::finishCreation(vm); >+ ASSERT(inherits(vm, info())); >+ >+ static_assert(!std::is_base_of<ActiveDOMObject, TestDelegateToSharedSyntheticAttribute>::value, "Interface is not marked as [ActiveDOMObject] even though implementation class subclasses ActiveDOMObject."); >+ >+} >+ >+JSObject* JSTestDelegateToSharedSyntheticAttribute::createPrototype(VM& vm, JSDOMGlobalObject& globalObject) >+{ >+ return JSTestDelegateToSharedSyntheticAttributePrototype::create(vm, &globalObject, JSTestDelegateToSharedSyntheticAttributePrototype::createStructure(vm, &globalObject, globalObject.objectPrototype())); >+} >+ >+JSObject* JSTestDelegateToSharedSyntheticAttribute::prototype(VM& vm, JSDOMGlobalObject& globalObject) >+{ >+ return getDOMPrototype<JSTestDelegateToSharedSyntheticAttribute>(vm, globalObject); >+} >+ >+JSValue JSTestDelegateToSharedSyntheticAttribute::getConstructor(VM& vm, const JSGlobalObject* globalObject) >+{ >+ return getDOMConstructor<JSTestDelegateToSharedSyntheticAttributeDOMConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject)); >+} >+ >+void JSTestDelegateToSharedSyntheticAttribute::destroy(JSC::JSCell* cell) >+{ >+ JSTestDelegateToSharedSyntheticAttribute* thisObject = static_cast<JSTestDelegateToSharedSyntheticAttribute*>(cell); >+ thisObject->JSTestDelegateToSharedSyntheticAttribute::~JSTestDelegateToSharedSyntheticAttribute(); >+} >+ >+template<> inline JSTestDelegateToSharedSyntheticAttribute* IDLAttribute<JSTestDelegateToSharedSyntheticAttribute>::cast(JSGlobalObject& lexicalGlobalObject, EncodedJSValue thisValue) >+{ >+ return jsDynamicCast<JSTestDelegateToSharedSyntheticAttribute*>(JSC::getVM(&lexicalGlobalObject), JSValue::decode(thisValue)); >+} >+ >+JSC_DEFINE_CUSTOM_GETTER(jsTestDelegateToSharedSyntheticAttributeConstructor, (JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName)) >+{ >+ VM& vm = JSC::getVM(lexicalGlobalObject); >+ auto throwScope = DECLARE_THROW_SCOPE(vm); >+ auto* prototype = jsDynamicCast<JSTestDelegateToSharedSyntheticAttributePrototype*>(vm, JSValue::decode(thisValue)); >+ if (UNLIKELY(!prototype)) >+ return throwVMTypeError(lexicalGlobalObject, throwScope); >+ return JSValue::encode(JSTestDelegateToSharedSyntheticAttribute::getConstructor(JSC::getVM(lexicalGlobalObject), prototype->globalObject())); >+} >+ >+static inline JSValue jsTestDelegateToSharedSyntheticAttribute_sharedAttribute1Getter(JSGlobalObject& lexicalGlobalObject, JSTestDelegateToSharedSyntheticAttribute& thisObject, PropertyName propertyName) >+{ >+ auto& vm = JSC::getVM(&lexicalGlobalObject); >+ auto throwScope = DECLARE_THROW_SCOPE(vm); >+ auto& impl = thisObject.wrapped(); >+ RELEASE_AND_RETURN(throwScope, (toJS<IDLLegacyNullToEmptyStringAdaptor<IDLUSVString>>(lexicalGlobalObject, throwScope, impl.sharedAttribute1(propertyNameToAtomString(propertyName))))); >+} >+ >+JSC_DEFINE_CUSTOM_GETTER(jsTestDelegateToSharedSyntheticAttribute_sharedAttribute1, (JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName)) >+{ >+ return IDLAttribute<JSTestDelegateToSharedSyntheticAttribute>::getPassingPropertyName<jsTestDelegateToSharedSyntheticAttribute_sharedAttribute1Getter, CastedThisErrorBehavior::Assert>(*lexicalGlobalObject, thisValue, attributeName); >+} >+ >+static inline bool setJSTestDelegateToSharedSyntheticAttribute_sharedAttribute1Setter(JSGlobalObject& lexicalGlobalObject, JSTestDelegateToSharedSyntheticAttribute& thisObject, JSValue value, PropertyName propertyName) >+{ >+ auto& vm = JSC::getVM(&lexicalGlobalObject); >+ auto throwScope = DECLARE_THROW_SCOPE(vm); >+ CustomElementReactionStack customElementReactionStack(lexicalGlobalObject); >+ auto& impl = thisObject.wrapped(); >+ auto nativeValue = convert<IDLLegacyNullToEmptyStringAdaptor<IDLUSVString>>(lexicalGlobalObject, value); >+ RETURN_IF_EXCEPTION(throwScope, false); >+ invokeFunctorPropagatingExceptionIfNecessary(lexicalGlobalObject, throwScope, [&] { >+ return impl.setSharedAttribute1(propertyNameToAtomString(propertyName), WTFMove(nativeValue)); >+ }); >+ return true; >+} >+ >+JSC_DEFINE_CUSTOM_SETTER(setJSTestDelegateToSharedSyntheticAttribute_sharedAttribute1, (JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue, PropertyName attributeName)) >+{ >+ return IDLAttribute<JSTestDelegateToSharedSyntheticAttribute>::setPassingPropertyName<setJSTestDelegateToSharedSyntheticAttribute_sharedAttribute1Setter>(*lexicalGlobalObject, thisValue, encodedValue, attributeName); >+} >+ >+static inline JSValue jsTestDelegateToSharedSyntheticAttribute_sharedAttribute2Getter(JSGlobalObject& lexicalGlobalObject, JSTestDelegateToSharedSyntheticAttribute& thisObject, PropertyName propertyName) >+{ >+ auto& vm = JSC::getVM(&lexicalGlobalObject); >+ auto throwScope = DECLARE_THROW_SCOPE(vm); >+ auto& impl = thisObject.wrapped(); >+ RELEASE_AND_RETURN(throwScope, (toJS<IDLLegacyNullToEmptyStringAdaptor<IDLUSVString>>(lexicalGlobalObject, throwScope, impl.sharedAttribute2(propertyNameToAtomString(propertyName))))); >+} >+ >+JSC_DEFINE_CUSTOM_GETTER(jsTestDelegateToSharedSyntheticAttribute_sharedAttribute2, (JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName)) >+{ >+ return IDLAttribute<JSTestDelegateToSharedSyntheticAttribute>::getPassingPropertyName<jsTestDelegateToSharedSyntheticAttribute_sharedAttribute2Getter, CastedThisErrorBehavior::Assert>(*lexicalGlobalObject, thisValue, attributeName); >+} >+ >+static inline bool setJSTestDelegateToSharedSyntheticAttribute_sharedAttribute2Setter(JSGlobalObject& lexicalGlobalObject, JSTestDelegateToSharedSyntheticAttribute& thisObject, JSValue value, PropertyName propertyName) >+{ >+ auto& vm = JSC::getVM(&lexicalGlobalObject); >+ auto throwScope = DECLARE_THROW_SCOPE(vm); >+ CustomElementReactionStack customElementReactionStack(lexicalGlobalObject); >+ auto& impl = thisObject.wrapped(); >+ auto nativeValue = convert<IDLLegacyNullToEmptyStringAdaptor<IDLUSVString>>(lexicalGlobalObject, value); >+ RETURN_IF_EXCEPTION(throwScope, false); >+ invokeFunctorPropagatingExceptionIfNecessary(lexicalGlobalObject, throwScope, [&] { >+ return impl.setSharedAttribute2(propertyNameToAtomString(propertyName), WTFMove(nativeValue)); >+ }); >+ return true; >+} >+ >+JSC_DEFINE_CUSTOM_SETTER(setJSTestDelegateToSharedSyntheticAttribute_sharedAttribute2, (JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue, PropertyName attributeName)) >+{ >+ return IDLAttribute<JSTestDelegateToSharedSyntheticAttribute>::setPassingPropertyName<setJSTestDelegateToSharedSyntheticAttribute_sharedAttribute2Setter>(*lexicalGlobalObject, thisValue, encodedValue, attributeName); >+} >+ >+JSC::IsoSubspace* JSTestDelegateToSharedSyntheticAttribute::subspaceForImpl(JSC::VM& vm) >+{ >+ auto& clientData = *static_cast<JSVMClientData*>(vm.clientData); >+ auto& spaces = clientData.subspaces(); >+ if (auto* space = spaces.m_subspaceForTestDelegateToSharedSyntheticAttribute.get()) >+ return space; >+ static_assert(std::is_base_of_v<JSC::JSDestructibleObject, JSTestDelegateToSharedSyntheticAttribute> || !JSTestDelegateToSharedSyntheticAttribute::needsDestruction); >+ if constexpr (std::is_base_of_v<JSC::JSDestructibleObject, JSTestDelegateToSharedSyntheticAttribute>) >+ spaces.m_subspaceForTestDelegateToSharedSyntheticAttribute = makeUnique<IsoSubspace> ISO_SUBSPACE_INIT(vm.heap, vm.destructibleObjectHeapCellType.get(), JSTestDelegateToSharedSyntheticAttribute); >+ else >+ spaces.m_subspaceForTestDelegateToSharedSyntheticAttribute = makeUnique<IsoSubspace> ISO_SUBSPACE_INIT(vm.heap, vm.cellHeapCellType.get(), JSTestDelegateToSharedSyntheticAttribute); >+ auto* space = spaces.m_subspaceForTestDelegateToSharedSyntheticAttribute.get(); >+IGNORE_WARNINGS_BEGIN("unreachable-code") >+IGNORE_WARNINGS_BEGIN("tautological-compare") >+ void (*myVisitOutputConstraint)(JSC::JSCell*, JSC::SlotVisitor&) = JSTestDelegateToSharedSyntheticAttribute::visitOutputConstraints; >+ void (*jsCellVisitOutputConstraint)(JSC::JSCell*, JSC::SlotVisitor&) = JSC::JSCell::visitOutputConstraints; >+ if (myVisitOutputConstraint != jsCellVisitOutputConstraint) >+ clientData.outputConstraintSpaces().append(space); >+IGNORE_WARNINGS_END >+IGNORE_WARNINGS_END >+ return space; >+} >+ >+void JSTestDelegateToSharedSyntheticAttribute::analyzeHeap(JSCell* cell, HeapAnalyzer& analyzer) >+{ >+ auto* thisObject = jsCast<JSTestDelegateToSharedSyntheticAttribute*>(cell); >+ analyzer.setWrappedObjectForCell(cell, &thisObject->wrapped()); >+ if (thisObject->scriptExecutionContext()) >+ analyzer.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string()); >+ Base::analyzeHeap(cell, analyzer); >+} >+ >+bool JSTestDelegateToSharedSyntheticAttributeOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, AbstractSlotVisitor& visitor, const char** reason) >+{ >+ UNUSED_PARAM(handle); >+ UNUSED_PARAM(visitor); >+ UNUSED_PARAM(reason); >+ return false; >+} >+ >+void JSTestDelegateToSharedSyntheticAttributeOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context) >+{ >+ auto* jsTestDelegateToSharedSyntheticAttribute = static_cast<JSTestDelegateToSharedSyntheticAttribute*>(handle.slot()->asCell()); >+ auto& world = *static_cast<DOMWrapperWorld*>(context); >+ uncacheWrapper(world, &jsTestDelegateToSharedSyntheticAttribute->wrapped(), jsTestDelegateToSharedSyntheticAttribute); >+} >+ >+#if ENABLE(BINDING_INTEGRITY) >+#if PLATFORM(WIN) >+#pragma warning(disable: 4483) >+extern "C" { extern void (*const __identifier("??_7TestDelegateToSharedSyntheticAttribute@WebCore@@6B@")[])(); } >+#else >+extern "C" { extern void* _ZTVN7WebCore38TestDelegateToSharedSyntheticAttributeE[]; } >+#endif >+#endif >+ >+JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject*, JSDOMGlobalObject* globalObject, Ref<TestDelegateToSharedSyntheticAttribute>&& impl) >+{ >+ >+#if ENABLE(BINDING_INTEGRITY) >+ const void* actualVTablePointer = getVTablePointer(impl.ptr()); >+#if PLATFORM(WIN) >+ void* expectedVTablePointer = __identifier("??_7TestDelegateToSharedSyntheticAttribute@WebCore@@6B@"); >+#else >+ void* expectedVTablePointer = &_ZTVN7WebCore38TestDelegateToSharedSyntheticAttributeE[2]; >+#endif >+ >+ // If this fails TestDelegateToSharedSyntheticAttribute does not have a vtable, so you need to add the >+ // ImplementationLacksVTable attribute to the interface definition >+ static_assert(std::is_polymorphic<TestDelegateToSharedSyntheticAttribute>::value, "TestDelegateToSharedSyntheticAttribute is not polymorphic"); >+ >+ // If you hit this assertion you either have a use after free bug, or >+ // TestDelegateToSharedSyntheticAttribute has subclasses. If TestDelegateToSharedSyntheticAttribute has subclasses that get passed >+ // to toJS() we currently require TestDelegateToSharedSyntheticAttribute you to opt out of binding hardening >+ // by adding the SkipVTableValidation attribute to the interface IDL definition >+ RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer); >+#endif >+ return createWrapper<TestDelegateToSharedSyntheticAttribute>(globalObject, WTFMove(impl)); >+} >+ >+JSC::JSValue toJS(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, TestDelegateToSharedSyntheticAttribute& impl) >+{ >+ return wrap(lexicalGlobalObject, globalObject, impl); >+} >+ >+TestDelegateToSharedSyntheticAttribute* JSTestDelegateToSharedSyntheticAttribute::toWrapped(JSC::VM& vm, JSC::JSValue value) >+{ >+ if (auto* wrapper = jsDynamicCast<JSTestDelegateToSharedSyntheticAttribute*>(vm, value)) >+ return &wrapper->wrapped(); >+ return nullptr; >+} >+ >+} >Index: Source/WebCore/bindings/scripts/test/JS/JSTestDelegateToSharedSyntheticAttribute.h >=================================================================== >--- Source/WebCore/bindings/scripts/test/JS/JSTestDelegateToSharedSyntheticAttribute.h (nonexistent) >+++ Source/WebCore/bindings/scripts/test/JS/JSTestDelegateToSharedSyntheticAttribute.h (working copy) >@@ -0,0 +1,93 @@ >+/* >+ This file is part of the WebKit open source project. >+ This file has been generated by generate-bindings.pl. DO NOT MODIFY! >+ >+ This library is free software; you can redistribute it and/or >+ modify it under the terms of the GNU Library General Public >+ License as published by the Free Software Foundation; either >+ version 2 of the License, or (at your option) any later version. >+ >+ This library is distributed in the hope that it will be useful, >+ but WITHOUT ANY WARRANTY; without even the implied warranty of >+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >+ Library General Public License for more details. >+ >+ You should have received a copy of the GNU Library General Public License >+ along with this library; see the file COPYING.LIB. If not, write to >+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >+ Boston, MA 02110-1301, USA. >+*/ >+ >+#pragma once >+ >+#include "JSDOMWrapper.h" >+#include "TestDelegateToSharedSyntheticAttribute.h" >+#include <wtf/NeverDestroyed.h> >+ >+namespace WebCore { >+ >+class JSTestDelegateToSharedSyntheticAttribute : public JSDOMWrapper<TestDelegateToSharedSyntheticAttribute> { >+public: >+ using Base = JSDOMWrapper<TestDelegateToSharedSyntheticAttribute>; >+ static JSTestDelegateToSharedSyntheticAttribute* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestDelegateToSharedSyntheticAttribute>&& impl) >+ { >+ JSTestDelegateToSharedSyntheticAttribute* ptr = new (NotNull, JSC::allocateCell<JSTestDelegateToSharedSyntheticAttribute>(globalObject->vm().heap)) JSTestDelegateToSharedSyntheticAttribute(structure, *globalObject, WTFMove(impl)); >+ ptr->finishCreation(globalObject->vm()); >+ return ptr; >+ } >+ >+ static JSC::JSObject* createPrototype(JSC::VM&, JSDOMGlobalObject&); >+ static JSC::JSObject* prototype(JSC::VM&, JSDOMGlobalObject&); >+ static TestDelegateToSharedSyntheticAttribute* toWrapped(JSC::VM&, JSC::JSValue); >+ static void destroy(JSC::JSCell*); >+ >+ DECLARE_INFO; >+ >+ static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) >+ { >+ return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info(), JSC::NonArray); >+ } >+ >+ static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); >+ template<typename, JSC::SubspaceAccess mode> static JSC::IsoSubspace* subspaceFor(JSC::VM& vm) >+ { >+ if constexpr (mode == JSC::SubspaceAccess::Concurrently) >+ return nullptr; >+ return subspaceForImpl(vm); >+ } >+ static JSC::IsoSubspace* subspaceForImpl(JSC::VM& vm); >+ static void analyzeHeap(JSCell*, JSC::HeapAnalyzer&); >+protected: >+ JSTestDelegateToSharedSyntheticAttribute(JSC::Structure*, JSDOMGlobalObject&, Ref<TestDelegateToSharedSyntheticAttribute>&&); >+ >+ void finishCreation(JSC::VM&); >+}; >+ >+class JSTestDelegateToSharedSyntheticAttributeOwner final : public JSC::WeakHandleOwner { >+public: >+ bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::AbstractSlotVisitor&, const char**) final; >+ void finalize(JSC::Handle<JSC::Unknown>, void* context) final; >+}; >+ >+inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld&, TestDelegateToSharedSyntheticAttribute*) >+{ >+ static NeverDestroyed<JSTestDelegateToSharedSyntheticAttributeOwner> owner; >+ return &owner.get(); >+} >+ >+inline void* wrapperKey(TestDelegateToSharedSyntheticAttribute* wrappableObject) >+{ >+ return wrappableObject; >+} >+ >+JSC::JSValue toJS(JSC::JSGlobalObject*, JSDOMGlobalObject*, TestDelegateToSharedSyntheticAttribute&); >+inline JSC::JSValue toJS(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, TestDelegateToSharedSyntheticAttribute* impl) { return impl ? toJS(lexicalGlobalObject, globalObject, *impl) : JSC::jsNull(); } >+JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject*, JSDOMGlobalObject*, Ref<TestDelegateToSharedSyntheticAttribute>&&); >+inline JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, RefPtr<TestDelegateToSharedSyntheticAttribute>&& impl) { return impl ? toJSNewlyCreated(lexicalGlobalObject, globalObject, impl.releaseNonNull()) : JSC::jsNull(); } >+ >+template<> struct JSDOMWrapperConverterTraits<TestDelegateToSharedSyntheticAttribute> { >+ using WrapperClass = JSTestDelegateToSharedSyntheticAttribute; >+ using ToWrappedReturnType = TestDelegateToSharedSyntheticAttribute*; >+}; >+ >+} // namespace WebCore >Index: Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp >=================================================================== >--- Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp (revision 275450) >+++ Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp (working copy) >@@ -41,13 +41,13 @@ > #include "JSDOMWrapperCache.h" > #include "JSTestCEReactions.h" > #include "JSTestCEReactionsStringifier.h" >-#include "JSTestCSSProperty.h" > #include "JSTestCallTracer.h" > #include "JSTestClassWithJSBuiltinConstructor.h" > #include "JSTestDOMJIT.h" > #include "JSTestDefaultToJSONIndirectInheritance.h" > #include "JSTestDefaultToJSONInherit.h" > #include "JSTestDefaultToJSONInheritFinal.h" >+#include "JSTestDelegateToSharedSyntheticAttribute.h" > #include "JSTestDomainSecurity.h" > #include "JSTestEventConstructor.h" > #include "JSTestEventTarget.h" >@@ -167,7 +167,6 @@ static JSC_DECLARE_CUSTOM_SETTER(setJSTe > #endif > static JSC_DECLARE_CUSTOM_GETTER(jsTestGlobalObject_TestCEReactionsConstructor); > static JSC_DECLARE_CUSTOM_GETTER(jsTestGlobalObject_TestCEReactionsStringifierConstructor); >-static JSC_DECLARE_CUSTOM_GETTER(jsTestGlobalObject_TestCSSPropertyConstructor); > static JSC_DECLARE_CUSTOM_GETTER(jsTestGlobalObject_TestCallTracerConstructor); > #if ENABLE(TEST_CONDITIONAL) > static JSC_DECLARE_CUSTOM_GETTER(jsTestGlobalObject_TestCallbackInterfaceConstructor); >@@ -177,6 +176,7 @@ static JSC_DECLARE_CUSTOM_GETTER(jsTestG > static JSC_DECLARE_CUSTOM_GETTER(jsTestGlobalObject_TestDefaultToJSONIndirectInheritanceConstructor); > static JSC_DECLARE_CUSTOM_GETTER(jsTestGlobalObject_TestDefaultToJSONInheritConstructor); > static JSC_DECLARE_CUSTOM_GETTER(jsTestGlobalObject_TestDefaultToJSONInheritFinalConstructor); >+static JSC_DECLARE_CUSTOM_GETTER(jsTestGlobalObject_TestDelegateToSharedSyntheticAttributeConstructor); > static JSC_DECLARE_CUSTOM_GETTER(jsTestGlobalObject_TestDomainSecurityConstructor); > static JSC_DECLARE_CUSTOM_GETTER(jsTestGlobalObject_TestEventConstructorConstructor); > static JSC_DECLARE_CUSTOM_GETTER(jsTestGlobalObject_TestEventTargetConstructor); >@@ -238,7 +238,7 @@ using JSTestGlobalObjectDOMConstructor = > > /* Hash table */ > >-static const struct CompactHashIndex JSTestGlobalObjectTableIndex[268] = { >+static const struct CompactHashIndex JSTestGlobalObjectTableIndex[267] = { > { -1, -1 }, > { 40, -1 }, > { -1, -1 }, >@@ -280,7 +280,7 @@ static const struct CompactHashIndex JST > { -1, -1 }, > { -1, -1 }, > { -1, -1 }, >- { 5, 267 }, >+ { 65, -1 }, > { 13, 260 }, > { -1, -1 }, > { -1, -1 }, >@@ -291,7 +291,7 @@ static const struct CompactHashIndex JST > { -1, -1 }, > { 38, -1 }, > { 19, 257 }, >- { 7, -1 }, >+ { 6, -1 }, > { -1, -1 }, > { 45, -1 }, > { -1, -1 }, >@@ -315,7 +315,7 @@ static const struct CompactHashIndex JST > { -1, -1 }, > { -1, -1 }, > { -1, -1 }, >- { 6, -1 }, >+ { 5, -1 }, > { -1, -1 }, > { -1, -1 }, > { -1, -1 }, >@@ -331,7 +331,7 @@ static const struct CompactHashIndex JST > { -1, -1 }, > { -1, -1 }, > { -1, -1 }, >- { 10, 256 }, >+ { 9, 256 }, > { -1, -1 }, > { 57, -1 }, > { 18, -1 }, >@@ -390,7 +390,7 @@ static const struct CompactHashIndex JST > { 47, -1 }, > { -1, -1 }, > { -1, -1 }, >- { 11, -1 }, >+ { 10, -1 }, > { -1, -1 }, > { -1, -1 }, > { -1, -1 }, >@@ -438,7 +438,7 @@ static const struct CompactHashIndex JST > { -1, -1 }, > { -1, -1 }, > { -1, -1 }, >- { -1, -1 }, >+ { 12, -1 }, > { -1, -1 }, > { -1, -1 }, > { -1, -1 }, >@@ -450,7 +450,7 @@ static const struct CompactHashIndex JST > { -1, -1 }, > { -1, -1 }, > { -1, -1 }, >- { 12, -1 }, >+ { 11, -1 }, > { -1, -1 }, > { -1, -1 }, > { -1, -1 }, >@@ -463,13 +463,13 @@ static const struct CompactHashIndex JST > { -1, -1 }, > { 1, -1 }, > { -1, -1 }, >- { 9, -1 }, >+ { 8, -1 }, > { -1, -1 }, > { -1, -1 }, > { -1, -1 }, > { -1, -1 }, > { 48, 263 }, >- { 8, 262 }, >+ { 7, 262 }, > { -1, -1 }, > { 59, -1 }, > { -1, -1 }, >@@ -506,7 +506,6 @@ static const struct CompactHashIndex JST > { 54, -1 }, > { 60, -1 }, > { 64, -1 }, >- { 65, -1 }, > }; > > >@@ -521,7 +520,6 @@ static const HashTableValue JSTestGlobal > #endif > { "TestCEReactions", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestGlobalObject_TestCEReactionsConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, > { "TestCEReactionsStringifier", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestGlobalObject_TestCEReactionsStringifierConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, >- { "TestCSSProperty", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestGlobalObject_TestCSSPropertyConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, > { "TestCallTracer", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestGlobalObject_TestCallTracerConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, > #if ENABLE(TEST_CONDITIONAL) > { "TestCallbackInterface", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestGlobalObject_TestCallbackInterfaceConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, >@@ -533,6 +531,7 @@ static const HashTableValue JSTestGlobal > { "TestDefaultToJSONIndirectInheritance", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestGlobalObject_TestDefaultToJSONIndirectInheritanceConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, > { "TestDefaultToJSONInherit", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestGlobalObject_TestDefaultToJSONInheritConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, > { "TestDefaultToJSONInheritFinal", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestGlobalObject_TestDefaultToJSONInheritFinalConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, >+ { "TestDelegateToSharedSyntheticAttribute", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestGlobalObject_TestDelegateToSharedSyntheticAttributeConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, > { "TestDomainSecurity", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestGlobalObject_TestDomainSecurityConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, > { "TestEventConstructor", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestGlobalObject_TestEventConstructorConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, > { "TestEventTarget", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestGlobalObject_TestEventTargetConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, >@@ -889,17 +888,6 @@ JSC_DEFINE_CUSTOM_GETTER(jsTestGlobalObj > return IDLAttribute<JSTestGlobalObject>::get<jsTestGlobalObject_TestCEReactionsStringifierConstructorGetter>(*lexicalGlobalObject, thisValue, attributeName); > } > >-static inline JSValue jsTestGlobalObject_TestCSSPropertyConstructorGetter(JSGlobalObject& lexicalGlobalObject, JSTestGlobalObject& thisObject) >-{ >- UNUSED_PARAM(lexicalGlobalObject); >- return JSTestCSSProperty::getConstructor(JSC::getVM(&lexicalGlobalObject), &thisObject); >-} >- >-JSC_DEFINE_CUSTOM_GETTER(jsTestGlobalObject_TestCSSPropertyConstructor, (JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName)) >-{ >- return IDLAttribute<JSTestGlobalObject>::get<jsTestGlobalObject_TestCSSPropertyConstructorGetter>(*lexicalGlobalObject, thisValue, attributeName); >-} >- > static inline JSValue jsTestGlobalObject_TestCallTracerConstructorGetter(JSGlobalObject& lexicalGlobalObject, JSTestGlobalObject& thisObject) > { > UNUSED_PARAM(lexicalGlobalObject); >@@ -980,6 +968,17 @@ JSC_DEFINE_CUSTOM_GETTER(jsTestGlobalObj > return IDLAttribute<JSTestGlobalObject>::get<jsTestGlobalObject_TestDefaultToJSONInheritFinalConstructorGetter>(*lexicalGlobalObject, thisValue, attributeName); > } > >+static inline JSValue jsTestGlobalObject_TestDelegateToSharedSyntheticAttributeConstructorGetter(JSGlobalObject& lexicalGlobalObject, JSTestGlobalObject& thisObject) >+{ >+ UNUSED_PARAM(lexicalGlobalObject); >+ return JSTestDelegateToSharedSyntheticAttribute::getConstructor(JSC::getVM(&lexicalGlobalObject), &thisObject); >+} >+ >+JSC_DEFINE_CUSTOM_GETTER(jsTestGlobalObject_TestDelegateToSharedSyntheticAttributeConstructor, (JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName)) >+{ >+ return IDLAttribute<JSTestGlobalObject>::get<jsTestGlobalObject_TestDelegateToSharedSyntheticAttributeConstructorGetter>(*lexicalGlobalObject, thisValue, attributeName); >+} >+ > static inline JSValue jsTestGlobalObject_TestDomainSecurityConstructorGetter(JSGlobalObject& lexicalGlobalObject, JSTestGlobalObject& thisObject) > { > UNUSED_PARAM(lexicalGlobalObject); >Index: Source/WebCore/css/CSSStyleDeclaration.cpp >=================================================================== >--- Source/WebCore/css/CSSStyleDeclaration.cpp (revision 275450) >+++ Source/WebCore/css/CSSStyleDeclaration.cpp (working copy) >@@ -36,6 +36,7 @@ > #include <wtf/IsoMallocInlines.h> > #include <wtf/Optional.h> > #include <wtf/Variant.h> >+#include <wtf/text/StringParsingBuffer.h> > > namespace WebCore { > >@@ -271,6 +272,120 @@ Vector<AtomString> CSSStyleDeclaration:: > > return result; > } >+ >+#else >+ >+enum class CSSPropertyLookupMode { ConvertUsingDashPrefix, ConvertUsingNoDashPrefix, NoConversion }; >+ >+template<CSSPropertyLookupMode mode> static CSSPropertyID lookupCSSPropertyFromIDLAttribute(const AtomString& attribute) >+{ >+ static NeverDestroyed<HashMap<AtomString, CSSPropertyID>> cache; >+ >+ if (auto id = cache.get().get(attribute)) >+ return id; >+ >+ char outputBuffer[maxCSSPropertyNameLength + 1]; >+ char* outputBufferCurrent = outputBuffer; >+ const char* outputBufferStart = outputBufferCurrent; >+ >+ if constexpr (mode == CSSPropertyLookupMode::ConvertUsingDashPrefix || mode == CSSPropertyLookupMode::ConvertUsingNoDashPrefix) { >+ // Conversion is implementing the "IDL attribute to CSS property algorithm" >+ // from https://drafts.csswg.org/cssom/#idl-attribute-to-css-property. >+ >+ if constexpr (mode == CSSPropertyLookupMode::ConvertUsingDashPrefix) >+ *outputBufferCurrent++ = '-'; >+ >+ readCharactersForParsing(attribute, [&](auto buffer) { >+ while (buffer.hasCharactersRemaining()) { >+ auto c = *buffer++; >+ ASSERT_WITH_MESSAGE(isASCII(c), "Invalid property name: %s", attribute.string().utf8().data()); >+ if (isASCIIUpper(c)) { >+ *outputBufferCurrent++ = '-'; >+ *outputBufferCurrent++ = toASCIILowerUnchecked(c); >+ } else >+ *outputBufferCurrent++ = c; >+ } >+ }); >+ *outputBufferCurrent = '\0'; >+ } else { >+ char outputBuffer[maxCSSPropertyNameLength + 1]; >+ char* outputBufferCurrent = outputBuffer; >+ const char* outputBufferStart = outputBufferCurrent; >+ >+ readCharactersForParsing(attribute, [&](auto buffer) { >+ while (buffer.hasCharactersRemaining()) { >+ auto c = *buffer++; >+ ASSERT_WITH_MESSAGE(c == '-' || isASCIILower(c), "Invalid property name: %s", attribute.string().utf8().data()); >+ *outputBufferCurrent++ = c; >+ } >+ }); >+ *outputBufferCurrent = '\0'; >+ } >+ >+ auto hashTableEntry = findProperty(outputBufferStart, outputBufferCurrent - outputBuffer); >+ ASSERT_WITH_MESSAGE(hashTableEntry, "Invalid property name: %s", attribute.string().utf8().data()); >+ >+ auto id = static_cast<CSSPropertyID>(hashTableEntry->id); >+ cache.get().add(attribute, id); >+ return id; >+} >+ >+String CSSStyleDeclaration::propertyValueForCamelCasedIDLAttribute(const AtomString& attribute) >+{ >+ auto propertyID = lookupCSSPropertyFromIDLAttribute<CSSPropertyLookupMode::ConvertUsingNoDashPrefix>(attribute); >+ ASSERT_WITH_MESSAGE(propertyID != CSSPropertyInvalid, "Invalid attribute: %s", attribute.string().utf8().data()); >+ return getPropertyValueInternal(propertyID); >+} >+ >+ExceptionOr<void> CSSStyleDeclaration::setPropertyValueForCamelCasedIDLAttribute(const AtomString& attribute, const String& value) >+{ >+ auto propertyID = lookupCSSPropertyFromIDLAttribute<CSSPropertyLookupMode::ConvertUsingNoDashPrefix>(attribute); >+ ASSERT_WITH_MESSAGE(propertyID != CSSPropertyInvalid, "Invalid attribute: %s", attribute.string().utf8().data()); >+ return setPropertyInternal(propertyID, value, false); >+} >+ >+String CSSStyleDeclaration::propertyValueForWebKitCasedIDLAttribute(const AtomString& attribute) >+{ >+ auto propertyID = lookupCSSPropertyFromIDLAttribute<CSSPropertyLookupMode::ConvertUsingDashPrefix>(attribute); >+ ASSERT_WITH_MESSAGE(propertyID != CSSPropertyInvalid, "Invalid attribute: %s", attribute.string().utf8().data()); >+ return getPropertyValueInternal(propertyID); >+} >+ >+ExceptionOr<void> CSSStyleDeclaration::setPropertyValueForWebKitCasedIDLAttribute(const AtomString& attribute, const String& value) >+{ >+ auto propertyID = lookupCSSPropertyFromIDLAttribute<CSSPropertyLookupMode::ConvertUsingDashPrefix>(attribute); >+ ASSERT_WITH_MESSAGE(propertyID != CSSPropertyInvalid, "Invalid attribute: %s", attribute.string().utf8().data()); >+ return setPropertyInternal(propertyID, value, false); >+} >+ >+String CSSStyleDeclaration::propertyValueForDashedIDLAttribute(const AtomString& attribute) >+{ >+ auto propertyID = lookupCSSPropertyFromIDLAttribute<CSSPropertyLookupMode::NoConversion>(attribute); >+ ASSERT_WITH_MESSAGE(propertyID != CSSPropertyInvalid, "Invalid attribute: %s", attribute.string().utf8().data()); >+ return getPropertyValueInternal(propertyID); >+} >+ >+ExceptionOr<void> CSSStyleDeclaration::setPropertyValueForDashedIDLAttribute(const AtomString& attribute, const String& value) >+{ >+ auto propertyID = lookupCSSPropertyFromIDLAttribute<CSSPropertyLookupMode::NoConversion>(attribute); >+ ASSERT_WITH_MESSAGE(propertyID != CSSPropertyInvalid, "Invalid attribute: %s", attribute.string().utf8().data()); >+ return setPropertyInternal(propertyID, value, false); >+} >+ >+String CSSStyleDeclaration::propertyValueForEpubCasedIDLAttribute(const AtomString& attribute) >+{ >+ auto propertyID = lookupCSSPropertyFromIDLAttribute<CSSPropertyLookupMode::ConvertUsingDashPrefix>(attribute); >+ ASSERT_WITH_MESSAGE(propertyID != CSSPropertyInvalid, "Invalid attribute: %s", attribute.string().utf8().data()); >+ return getPropertyValueInternal(propertyID); >+} >+ >+ExceptionOr<void> CSSStyleDeclaration::setPropertyValueForEpubCasedIDLAttribute(const AtomString& attribute, const String& value) >+{ >+ auto propertyID = lookupCSSPropertyFromIDLAttribute<CSSPropertyLookupMode::ConvertUsingDashPrefix>(attribute); >+ ASSERT_WITH_MESSAGE(propertyID != CSSPropertyInvalid, "Invalid attribute: %s", attribute.string().utf8().data()); >+ return setPropertyInternal(propertyID, value, false); >+} >+ > #endif > > String CSSStyleDeclaration::cssFloat() >Index: Source/WebCore/css/CSSStyleDeclaration.h >=================================================================== >--- Source/WebCore/css/CSSStyleDeclaration.h (revision 275450) >+++ Source/WebCore/css/CSSStyleDeclaration.h (working copy) >@@ -79,6 +79,26 @@ public: > Optional<Variant<String, double>> namedItem(const AtomString&); > ExceptionOr<void> setNamedItem(const AtomString& name, String value, bool& propertySupported); > Vector<AtomString> supportedPropertyNames() const; >+#else >+ // FIXME: It would be more efficient, by virtue of avoiding the text transformation and hash lookup currently >+ // required in the implementation, if we could could smuggle the CSSPropertyID through the bindings, perhaps >+ // by encoding it into the HashTableValue and then passing it together with the PropertyName. >+ >+ // Shared implementation for all properties that match https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-camel_cased_attribute. >+ String propertyValueForCamelCasedIDLAttribute(const AtomString&); >+ ExceptionOr<void> setPropertyValueForCamelCasedIDLAttribute(const AtomString&, const String&); >+ >+ // Shared implementation for all properties that match https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-webkit_cased_attribute. >+ String propertyValueForWebKitCasedIDLAttribute(const AtomString&); >+ ExceptionOr<void> setPropertyValueForWebKitCasedIDLAttribute(const AtomString&, const String&); >+ >+ // Shared implementation for all properties that match https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-dashed_attribute. >+ String propertyValueForDashedIDLAttribute(const AtomString&); >+ ExceptionOr<void> setPropertyValueForDashedIDLAttribute(const AtomString&, const String&); >+ >+ // Shared implementation for all properties that match non-standard Epub-cased. >+ String propertyValueForEpubCasedIDLAttribute(const AtomString&); >+ ExceptionOr<void> setPropertyValueForEpubCasedIDLAttribute(const AtomString&, const String&); > #endif > > // FIXME: This needs to pass in a Settings& to work correctly. >Index: Source/WebCore/css/CSSStyleDeclaration.idl >=================================================================== >--- Source/WebCore/css/CSSStyleDeclaration.idl (revision 275450) >+++ Source/WebCore/css/CSSStyleDeclaration.idl (working copy) >@@ -30,7 +30,6 @@ > #endif > ] interface CSSStyleDeclaration { > // FIXME: These attributes and functions should use CSSOMString not DOMString. >- > [CEReactions] attribute DOMString cssText; > readonly attribute unsigned long length; > getter DOMString item(unsigned long index); >Index: Source/WebCore/css/makeprop.pl >=================================================================== >--- Source/WebCore/css/makeprop.pl (revision 275450) >+++ Source/WebCore/css/makeprop.pl (working copy) >@@ -1427,7 +1427,7 @@ foreach my $nameOrAlias (@namesAndAliase > my $name = $namesAndAliasesToName{$nameOrAlias}; > my $propertyId = $nameToId{$namesAndAliasesToName{$name}}; > >- my @extendedAttributeValues = ("CSSProperty=${propertyId}"); >+ my @extendedAttributeValues = ("DelegateToSharedSyntheticAttribute=propertyValueForCamelCasedIDLAttribute"); > push(@extendedAttributeValues, "EnabledBySetting=${settingsFlags{$name}}") if $settingsFlags{$name}; > push(@extendedAttributeValues, "EnabledAtRuntime=${runtimeFlags{$name}}") if $runtimeFlags{$name}; > my $extendedAttributes = join(", ", @extendedAttributeValues); >@@ -1450,7 +1450,7 @@ foreach my $nameOrAlias (grep { $_ =~ /^ > my $name = $namesAndAliasesToName{$nameOrAlias}; > my $propertyId = $nameToId{$namesAndAliasesToName{$name}}; > >- my @extendedAttributeValues = ("CSSProperty=${propertyId}"); >+ my @extendedAttributeValues = ("DelegateToSharedSyntheticAttribute=propertyValueForWebKitCasedIDLAttribute"); > push(@extendedAttributeValues, "EnabledBySetting=${settingsFlags{$name}}") if $settingsFlags{$name}; > push(@extendedAttributeValues, "EnabledAtRuntime=${runtimeFlags{$name}}") if $runtimeFlags{$name}; > my $extendedAttributes = join(", ", @extendedAttributeValues); >@@ -1472,7 +1472,7 @@ foreach my $nameOrAlias (grep { $_ =~ /\ > my $name = $namesAndAliasesToName{$nameOrAlias}; > my $propertyId = $nameToId{$namesAndAliasesToName{$name}}; > >- my @extendedAttributeValues = ("CSSProperty=${propertyId}"); >+ my @extendedAttributeValues = ("DelegateToSharedSyntheticAttribute=propertyValueForDashedIDLAttribute"); > push(@extendedAttributeValues, "EnabledBySetting=${settingsFlags{$name}}") if $settingsFlags{$name}; > push(@extendedAttributeValues, "EnabledAtRuntime=${runtimeFlags{$name}}") if $runtimeFlags{$name}; > my $extendedAttributes = join(", ", @extendedAttributeValues); >@@ -1494,7 +1494,7 @@ foreach my $nameOrAlias (grep { $_ =~ /^ > my $name = $namesAndAliasesToName{$nameOrAlias}; > my $propertyId = $nameToId{$namesAndAliasesToName{$name}}; > >- my @extendedAttributeValues = ("CSSProperty=${propertyId}"); >+ my @extendedAttributeValues = ("DelegateToSharedSyntheticAttribute=propertyValueForEpubCasedIDLAttribute"); > push(@extendedAttributeValues, "EnabledBySetting=${settingsFlags{$name}}") if $settingsFlags{$name}; > push(@extendedAttributeValues, "EnabledAtRuntime=${runtimeFlags{$name}}") if $runtimeFlags{$name}; > my $extendedAttributes = join(", ", @extendedAttributeValues); >Index: LayoutTests/ChangeLog >=================================================================== >--- LayoutTests/ChangeLog (revision 275450) >+++ LayoutTests/ChangeLog (working copy) >@@ -1,3 +1,30 @@ >+2021-04-02 Sam Weinig <weinig@apple.com> >+ >+ Reduce compile time and binary size cost of enabling proper CSSStyleDeclaration property access behavior >+ https://bugs.webkit.org/show_bug.cgi?id=222518 >+ <rdar://problem/75136887> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * fast/css/style-enumerate-properties-expected.txt: >+ * fast/css/style-enumerate-properties.html: >+ * fast/dom/domListEnumeration-expected.txt: >+ * fast/dom/domListEnumeration.html: >+ Remove tests for iteration order, which is not standardized, and not consistent among >+ browsers. >+ >+ * fast/dom/CSSStyleDeclaration/cssstyledeclaration-properties-descriptor-expected.txt: >+ * fast/dom/CSSStyleDeclaration/cssstyledeclaration-properties-descriptor.html: >+ Update now that the properties are proper attributes on the prototype. >+ >+ * js/dom/put-override-should-not-use-ic.html: >+ Switch to using a DOMStringList as the object that overrides put, since CSSStyleDeclaration no longer does. >+ >+ * transitions/transitions-parsing-expected.txt: >+ * transitions/transitions-parsing.html: >+ Remove Object.keys() aspect of the test, which is no longer meaningful since the >+ properties should no longer exist in the result set. >+ > 2021-04-02 Amir Mark Jr <amir_mark@apple.com> > > [ MacOS ] media/modern-media-controls/macos-inline-media-controls/macos-inline-media-dropping-controls.html is a flaky failure >Index: LayoutTests/fast/css/style-enumerate-properties-expected.txt >=================================================================== >--- LayoutTests/fast/css/style-enumerate-properties-expected.txt (revision 275450) >+++ LayoutTests/fast/css/style-enumerate-properties-expected.txt (working copy) >@@ -11,7 +11,6 @@ PASS 'WebkitTransform' in document.body. > PASS 'bogus-random-String' in document.body.style is false > PASS 'cssText' in document.body.style is true > PASS 'getPropertyCSSValue' in document.body.style is true >-PASS The CSS property order is correct > PASS successfullyParsed is true > > TEST COMPLETE >Index: LayoutTests/fast/css/style-enumerate-properties.html >=================================================================== >--- LayoutTests/fast/css/style-enumerate-properties.html (revision 275450) >+++ LayoutTests/fast/css/style-enumerate-properties.html (working copy) >@@ -23,33 +23,6 @@ > shouldBeFalse("'bogus-random-String' in document.body.style"); > shouldBeTrue("'cssText' in document.body.style"); > shouldBeTrue("'getPropertyCSSValue' in document.body.style"); >- >- // Test CSS property order. >- var started; >- var cssPropertyCount = 0; >- var previous; >- var seenFilter; >- for (var p in document.body.style) { >- if (p === "alignmentBaseline") >- started = true; >- if (!started) >- continue; >- if (p === "filter") >- seenFilter = true; >- if (previous && previous >= p) { >- testFailed("Invalid CSS-mapped property order: '" + p + "' after '" + previous + "'"); >- break; >- } >- if (++cssPropertyCount <= 400) >- previous = p; >- else { >- if (seenFilter) >- testPassed("The CSS property order is correct"); >- else >- testFailed("The 'filter' property was not enumerated"); >- break; >- } >- } > </script> > <script src="../../resources/js-test-post.js"></script> > </body> >Index: LayoutTests/fast/dom/domListEnumeration-expected.txt >=================================================================== >--- LayoutTests/fast/dom/domListEnumeration-expected.txt (revision 275450) >+++ LayoutTests/fast/dom/domListEnumeration-expected.txt (working copy) >@@ -65,14 +65,6 @@ PASS resultArray[1].item is cssRuleList. > PASS resultArray[2].i is '2' > PASS resultArray[2].item is cssRuleList.item(2) > >-[object CSSStyleDeclaration] >-PASS resultArray[0].i is '0' >-PASS resultArray[0].item is cssStyleDeclaration.item(0) >-PASS resultArray[1].i is '1' >-PASS resultArray[1].item is cssStyleDeclaration.item(1) >-PASS resultArray[2].i is '2' >-PASS resultArray[2].item is cssStyleDeclaration.item(2) >- > [object CSSValueList] > PASS resultArray.length is 10 > PASS resultArray[0].i is '0' >Index: LayoutTests/fast/dom/domListEnumeration.html >=================================================================== >--- LayoutTests/fast/dom/domListEnumeration.html (revision 275450) >+++ LayoutTests/fast/dom/domListEnumeration.html (working copy) >@@ -177,17 +177,6 @@ shouldBe("resultArray[1].item", "cssRule > shouldBe("resultArray[2].i", "'2'"); > shouldBe("resultArray[2].item", "cssRuleList.item(2)"); > >-// CSSStyleDeclaration >-//debug(escapeHTML(document.getElementsByTagName('style'))); >-var cssStyleDeclaration = document.styleSheets[2].cssRules[0].style; >-resultArray = iterateList(cssStyleDeclaration); >-shouldBe("resultArray[0].i", "'0'"); >-shouldBe("resultArray[0].item", "cssStyleDeclaration.item(0)"); >-shouldBe("resultArray[1].i", "'1'"); >-shouldBe("resultArray[1].item", "cssStyleDeclaration.item(1)"); >-shouldBe("resultArray[2].i", "'2'"); >-shouldBe("resultArray[2].item", "cssStyleDeclaration.item(2)"); >- > // CSSValueList > var cssValueList = window.getComputedStyle(document.getElementsByTagName('ol')[0]).getPropertyCSSValue('border-spacing'); > resultArray = iterateList(cssValueList); >Index: LayoutTests/fast/dom/CSSStyleDeclaration/cssstyledeclaration-properties-descriptor-expected.txt >=================================================================== >--- LayoutTests/fast/dom/CSSStyleDeclaration/cssstyledeclaration-properties-descriptor-expected.txt (revision 275450) >+++ LayoutTests/fast/dom/CSSStyleDeclaration/cssstyledeclaration-properties-descriptor-expected.txt (working copy) >@@ -3,7 +3,8 @@ This tests the descriptor of CSSStyleDec > On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". > > >-PASS descriptor['writable'] is true >+PASS descriptor['get'] is an instance of Function >+PASS descriptor['set'] is an instance of Function > PASS descriptor['enumerable'] is true > PASS descriptor['configurable'] is true > PASS successfullyParsed is true >Index: LayoutTests/fast/dom/CSSStyleDeclaration/cssstyledeclaration-properties-descriptor.html >=================================================================== >--- LayoutTests/fast/dom/CSSStyleDeclaration/cssstyledeclaration-properties-descriptor.html (revision 275450) >+++ LayoutTests/fast/dom/CSSStyleDeclaration/cssstyledeclaration-properties-descriptor.html (working copy) >@@ -5,8 +5,9 @@ > <script> > description("This tests the descriptor of CSSStyleDeclaration properties."); > >- var descriptor = Object.getOwnPropertyDescriptor(document.body.style, 'color'); >- shouldBeTrue("descriptor['writable']"); >+ var descriptor = Object.getOwnPropertyDescriptor(document.body.style.__proto__, 'color'); >+ shouldBeType("descriptor['get']", "Function"); >+ shouldBeType("descriptor['set']", "Function"); > shouldBeTrue("descriptor['enumerable']"); > shouldBeTrue("descriptor['configurable']"); > </script> >Index: LayoutTests/imported/w3c/ChangeLog >=================================================================== >--- LayoutTests/imported/w3c/ChangeLog (revision 275450) >+++ LayoutTests/imported/w3c/ChangeLog (working copy) >@@ -1,3 +1,14 @@ >+2021-04-02 Sam Weinig <weinig@apple.com> >+ >+ Reduce compile time and binary size cost of enabling proper CSSStyleDeclaration property access behavior >+ https://bugs.webkit.org/show_bug.cgi?id=222518 >+ <rdar://problem/75136887> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * web-platform-tests/css/cssom/cssstyledeclaration-properties-expected.txt: >+ Update test result now that it is passing. >+ > 2021-04-02 Alexey Shvayka <shvaikalesh@gmail.com> > > Remove [Replaceable] extended attribute from `document.all` >Index: LayoutTests/imported/w3c/web-platform-tests/compat/css-style-declaration-alias-enumeration-expected.txt >=================================================================== >--- LayoutTests/imported/w3c/web-platform-tests/compat/css-style-declaration-alias-enumeration-expected.txt (revision 275450) >+++ LayoutTests/imported/w3c/web-platform-tests/compat/css-style-declaration-alias-enumeration-expected.txt (working copy) >@@ -1,3 +1,3 @@ > >-FAIL Aliases enumerated on CSSStyleDeclaration assert_true: Alias webkitTransform seen expected true got false >+PASS Aliases enumerated on CSSStyleDeclaration > >Index: LayoutTests/imported/w3c/web-platform-tests/css/cssom/cssstyledeclaration-properties-expected.txt >=================================================================== >--- LayoutTests/imported/w3c/web-platform-tests/css/cssom/cssstyledeclaration-properties-expected.txt (revision 275450) >+++ LayoutTests/imported/w3c/web-platform-tests/css/cssom/cssstyledeclaration-properties-expected.txt (working copy) >@@ -1,3 +1,3 @@ > >-FAIL CSS Test: CSSStyleDeclaration properties are defined as WebIDL attributes, not using getOwnPropertyNames() assert_false: shouldn't have an own property for WebIDL attributes expected false got true >+PASS CSS Test: CSSStyleDeclaration properties are defined as WebIDL attributes, not using getOwnPropertyNames() > >Index: LayoutTests/js/dom/put-override-should-not-use-ic.html >=================================================================== >--- LayoutTests/js/dom/put-override-should-not-use-ic.html (revision 275450) >+++ LayoutTests/js/dom/put-override-should-not-use-ic.html (working copy) >@@ -8,10 +8,10 @@ > <script> > test(function() { > function transitioned() { >- style = document.createElement('p').style; >+ dataset = document.createElement('p').dataset; > for(var i = 0; i < 20; i++) >- style['p'+i] = i; >- return style; >+ dataset['p'+i] = i; >+ return dataset; > } > > function putter(o) { >Index: LayoutTests/transitions/transitions-parsing-expected.txt >=================================================================== >--- LayoutTests/transitions/transitions-parsing-expected.txt (revision 275450) >+++ LayoutTests/transitions/transitions-parsing-expected.txt (working copy) >@@ -6,8 +6,6 @@ On success, you will see a series of "PA > Valid transition-property values. > PASS computedStyle.transitionProperty is 'all' > PASS computedStyle.webkitTransitionProperty is 'all' >-PASS Object.keys(style).indexOf('transitionProperty') is not -1 >-PASS Object.keys(style).indexOf('webkitTransitionProperty') is -1 > PASS style.transitionProperty is 'none' > PASS computedStyle.transitionProperty is 'none' > PASS style.webkitTransitionProperty is 'none' >@@ -100,8 +98,6 @@ PASS computedStyle.webkitTransitionPrope > Valid transition-duration values. > PASS computedStyle.transitionDuration is '0s' > PASS computedStyle.webkitTransitionDuration is '0s' >-PASS Object.keys(style).indexOf('transitionDuration') is not -1 >-PASS Object.keys(style).indexOf('webkitTransitionDuration') is -1 > PASS style.transitionDuration is '0s' > PASS computedStyle.transitionDuration is '0s' > PASS style.webkitTransitionDuration is '0s' >@@ -150,8 +146,6 @@ PASS computedStyle.webkitTransitionDurat > Valid transition-timing-function values. > PASS computedStyle.transitionTimingFunction is 'ease' > PASS computedStyle.webkitTransitionTimingFunction is 'ease' >-PASS Object.keys(style).indexOf('transitionTimingFunction') is not -1 >-PASS Object.keys(style).indexOf('webkitTransitionTimingFunction') is -1 > PASS style.transitionTimingFunction is 'linear' > PASS computedStyle.transitionTimingFunction is 'linear' > PASS style.webkitTransitionTimingFunction is 'linear' >@@ -300,8 +294,6 @@ PASS computedStyle.webkitTransitionTimin > Valid transition-delay values. > PASS computedStyle.transitionDelay is '0s' > PASS computedStyle.webkitTransitionDelay is '0s' >-PASS Object.keys(style).indexOf('transitionDelay') is not -1 >-PASS Object.keys(style).indexOf('webkitTransitionDelay') is -1 > PASS style.transitionDelay is '0s' > PASS computedStyle.transitionDelay is '0s' > PASS style.webkitTransitionDelay is '0s' >@@ -350,8 +342,6 @@ PASS computedStyle.webkitTransitionDelay > Valid transition shorthand values. > PASS computedStyle.transition is 'all 0s ease 0s' > PASS computedStyle.webkitTransition is 'all 0s ease 0s' >-PASS Object.keys(style).indexOf('transition') is not -1 >-PASS Object.keys(style).indexOf('webkitTransition') is -1 > PASS style.transition is 'none' > PASS computedStyle.transition is 'none 0s ease 0s' > PASS style.webkitTransition is 'none' >Index: LayoutTests/transitions/transitions-parsing.html >=================================================================== >--- LayoutTests/transitions/transitions-parsing.html (revision 275450) >+++ LayoutTests/transitions/transitions-parsing.html (working copy) >@@ -30,8 +30,6 @@ shouldBe("computedStyle.transitionProper > shouldBe("computedStyle.webkitTransitionProperty", "'all'"); > > style.transitionProperty = "none"; >-shouldNotBe("Object.keys(style).indexOf('transitionProperty')", "-1"); >-shouldBe("Object.keys(style).indexOf('webkitTransitionProperty')", "-1"); > shouldBe("style.transitionProperty", "'none'"); > shouldBe("computedStyle.transitionProperty", "'none'"); > shouldBe("style.webkitTransitionProperty", "'none'"); >@@ -176,8 +174,6 @@ shouldBe("computedStyle.transitionDurati > shouldBe("computedStyle.webkitTransitionDuration", "'0s'"); > > style.transitionDuration = "0s"; >-shouldNotBe("Object.keys(style).indexOf('transitionDuration')", "-1"); >-shouldBe("Object.keys(style).indexOf('webkitTransitionDuration')", "-1"); > shouldBe("style.transitionDuration", "'0s'"); > shouldBe("computedStyle.transitionDuration", "'0s'"); > shouldBe("style.webkitTransitionDuration", "'0s'"); >@@ -256,8 +252,6 @@ shouldBe("computedStyle.transitionTiming > shouldBe("computedStyle.webkitTransitionTimingFunction", "'ease'"); > > style.transitionTimingFunction = "linear"; >-shouldNotBe("Object.keys(style).indexOf('transitionTimingFunction')", "-1"); >-shouldBe("Object.keys(style).indexOf('webkitTransitionTimingFunction')", "-1"); > shouldBe("style.transitionTimingFunction", "'linear'"); > shouldBe("computedStyle.transitionTimingFunction", "'linear'"); > shouldBe("style.webkitTransitionTimingFunction", "'linear'"); >@@ -485,8 +479,6 @@ shouldBe("computedStyle.transitionDelay" > shouldBe("computedStyle.webkitTransitionDelay", "'0s'"); > > style.transitionDelay = "0s"; >-shouldNotBe("Object.keys(style).indexOf('transitionDelay')", "-1"); >-shouldBe("Object.keys(style).indexOf('webkitTransitionDelay')", "-1"); > shouldBe("style.transitionDelay", "'0s'"); > shouldBe("computedStyle.transitionDelay", "'0s'"); > shouldBe("style.webkitTransitionDelay", "'0s'"); >@@ -565,8 +557,6 @@ shouldBe("computedStyle.transition", "'a > shouldBe("computedStyle.webkitTransition", "'all 0s ease 0s'"); > > style.transition = "none"; >-shouldNotBe("Object.keys(style).indexOf('transition')", "-1"); >-shouldBe("Object.keys(style).indexOf('webkitTransition')", "-1"); > shouldBe("style.transition", "'none'"); > shouldBe("computedStyle.transition", "'none 0s ease 0s'"); > shouldBe("style.webkitTransition", "'none'");
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
ews-feeder
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 222518
:
422110
|
425080
|
425105
|
425107
|
425108
|
425158
|
425187
|
425687
|
425697
|
425709