-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regression(264594@main) Unable to search for flights on delta.com #15251
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should WPT have these kinds of tests too?
else if (slot.attributes() & PropertyAttribute::CustomAccessor) { | ||
ASSERT_WITH_MESSAGE(slot.isCustom(), "PropertySlot::TypeCustom is required in case of PropertyAttribute::CustomAccessor"); | ||
setAccessorDescriptor((slot.attributes() | PropertyAttribute::Accessor) & ~PropertyAttribute::CustomAccessor); | ||
JSGlobalObject* slotBaseGlobalObject = slot.slotBase()->globalObject(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not auto*
?
{ | ||
UNUSED_PARAM(ignoreNamedProperties); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not indented
WPT does have tests like these. They clearly don't cover this HTMLFormElement edge case though where the named property shadows a builtin one and you try to set the property. |
Makes sense. I guess what I was trying to ask was, should we also extend WPT to cover this case? |
Yes, I am working on it. |
EWS run on previous version of this PR (hash 87cea3b)
|
EWS run on previous version of this PR (hash 690dc54)
|
@@ -32,6 +32,21 @@ | |||
assert_equals(element.attributes.foo, "foo"); | |||
}, "must allow assigning to a named property on an object which implements a named property getter but not a setter in strict mode"); | |||
|
|||
test(function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Improved WPT test coverage here to cover the bug.
Upstream PR: web-platform-tests/wpt#40734
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me. Can you ensure that this does not affect on SP2 score?
Good point, I will start a/b testing. |
EWS run on previous version of this PR (hash c679e0c)
|
EWS run on current version of this PR (hash 6624d4e)
|
A/b says no regression on speedometer. |
https://bugs.webkit.org/show_bug.cgi?id=258471 rdar://110787556 Reviewed by Yusuke Suzuki and Darin Adler. 264594@main tried to align the behavior of our bindings objects setters / deleters with the Web IDL specification and with other major browsers. I however made a slight mistake that impacted objects that have the [LegacyOverrideBuiltIns] Web IDL extended attribute, such as HTMLFormElement. Such interfaces are very special because properties returned by the named property getter override built-in properties. This means that `form.action` returns the input element by the id/name "action" in the delta case, instead of the built-in form action attribute. We were getting this part right. However, the behavior when setting the action property wasn't quite right. We're supposed to set the built-in action property and we would fail to do so. The source of the bug is that [[Set]] is supposed to call LegacyPlatformObjectGetOwnProperty() with `ignoreNamedProperties=true` and then call OrdinarySetWithOwnDescriptor() with the descriptor that was returned [1]. Because we should ignore named properties, it should return the slot of the built-in `form.action` property, not the slot for the input Element with the name/id that is "action". However, we were calling JSC's ordinarySetSlow() which would call the standard getOwnPropertySlot(), which would not ignore the named properties. To address the issue, I moved the getOwnPropertySlot() implementation of our bindings object to a separate LegacyPlatformObjectGetOwnProperty() function, which takes a ignoreNamedProperties parameter to decide we should should ignore named properties or not, as per the specification [2]. I also split part of JSC's ordinarySetSlow() into a new ordinarySetWithOwnDescriptor() function which implements OrdinarySetWithOwnDescriptor() in the EcmaScript spec [3]. ordinarySetSlow() is an implementation of EcmaScript's OrdinarySet(), which is meant to call OrdinarySetWithOwnDescriptor() [4] so we are now more aligned with the spec. put() in our generated bindings now calls legacyPlatformObjectGetOwnProperty() when it exists and calls JSC's ordinarySetWithOwnDescriptor() with it. [1] https://webidl.spec.whatwg.org/#legacy-platform-object-set [2] https://webidl.spec.whatwg.org/#LegacyPlatformObjectGetOwnProperty [3] https://tc39.es/ecma262/multipage/ordinary-and-exotic-objects-behaviours.html#sec-ordinarysetwithowndescriptor [4] https://tc39.es/ecma262/multipage/ordinary-and-exotic-objects-behaviours.html#sec-ordinaryset * LayoutTests/fast/forms/set-property-expected.txt: Added. * LayoutTests/fast/forms/set-property.html: Added. * LayoutTests/fast/html/HTMLCollection-set-property-expected.txt: Added. * LayoutTests/fast/html/HTMLCollection-set-property.html: Added. * LayoutTests/fast/html/HTMLOptionsCollection-set-property-expected.txt: Added. * LayoutTests/fast/html/HTMLOptionsCollection-set-property.html: Added. Extend test coverage. I have verified that all these tests are passing in Chrome and Firefox. * Source/JavaScriptCore/runtime/JSObject.cpp: (JSC::ordinarySetSlow): (JSC::ordinarySetWithOwnDescriptor): (JSC::JSObject::getOwnPropertyDescriptor): (JSC::WeakCustomGetterOrSetterHashTranslator::hash): Deleted. (JSC::WeakCustomGetterOrSetterHashTranslator::equal): Deleted. (JSC::createCustomGetterFunction): Deleted. (JSC::createCustomSetterFunction): Deleted. * Source/JavaScriptCore/runtime/JSObject.h: * Source/JavaScriptCore/runtime/PropertyDescriptor.cpp: (JSC::WeakCustomGetterOrSetterHashTranslator::hash): (JSC::WeakCustomGetterOrSetterHashTranslator::equal): (JSC::createCustomSetterFunction): (JSC::createCustomGetterFunction): (JSC::PropertyDescriptor::setPropertySlot): * Source/JavaScriptCore/runtime/PropertyDescriptor.h: * Source/WebCore/bindings/scripts/CodeGeneratorJS.pm: (GenerateNamedGetterLambda): (GenerateGetOwnPropertySlot): (GenerateGetOwnPropertySlotByIndex): (GeneratePut): (GenerateHeader): * Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp: (WebCore::JSTestEventTarget::legacyPlatformObjectGetOwnProperty): (WebCore::JSTestEventTarget::getOwnPropertySlot): (WebCore::JSTestEventTarget::put): * Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.h: * Source/WebCore/bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp: (WebCore::JSTestIndexedSetterNoIdentifier::legacyPlatformObjectGetOwnProperty): (WebCore::JSTestIndexedSetterNoIdentifier::getOwnPropertySlot): (WebCore::JSTestIndexedSetterNoIdentifier::put): * Source/WebCore/bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.h: * Source/WebCore/bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp: (WebCore::JSTestIndexedSetterThrowingException::legacyPlatformObjectGetOwnProperty): (WebCore::JSTestIndexedSetterThrowingException::getOwnPropertySlot): (WebCore::JSTestIndexedSetterThrowingException::put): * Source/WebCore/bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.h: * Source/WebCore/bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp: (WebCore::JSTestIndexedSetterWithIdentifier::legacyPlatformObjectGetOwnProperty): (WebCore::JSTestIndexedSetterWithIdentifier::getOwnPropertySlot): (WebCore::JSTestIndexedSetterWithIdentifier::put): * Source/WebCore/bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.h: * Source/WebCore/bindings/scripts/test/JS/JSTestLegacyOverrideBuiltIns.cpp: (WebCore::JSTestLegacyOverrideBuiltIns::legacyPlatformObjectGetOwnProperty): (WebCore::JSTestLegacyOverrideBuiltIns::getOwnPropertySlot): (WebCore::JSTestLegacyOverrideBuiltIns::put): * Source/WebCore/bindings/scripts/test/JS/JSTestLegacyOverrideBuiltIns.h: * Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp: (WebCore::JSTestNamedAndIndexedSetterNoIdentifier::legacyPlatformObjectGetOwnProperty): (WebCore::JSTestNamedAndIndexedSetterNoIdentifier::getOwnPropertySlot): (WebCore::JSTestNamedAndIndexedSetterNoIdentifier::put): * Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.h: * Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp: (WebCore::JSTestNamedAndIndexedSetterThrowingException::legacyPlatformObjectGetOwnProperty): (WebCore::JSTestNamedAndIndexedSetterThrowingException::getOwnPropertySlot): (WebCore::JSTestNamedAndIndexedSetterThrowingException::put): * Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.h: * Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp: (WebCore::JSTestNamedAndIndexedSetterWithIdentifier::legacyPlatformObjectGetOwnProperty): (WebCore::JSTestNamedAndIndexedSetterWithIdentifier::getOwnPropertySlot): (WebCore::JSTestNamedAndIndexedSetterWithIdentifier::put): * Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.h: * Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp: (WebCore::JSTestNamedDeleterNoIdentifier::legacyPlatformObjectGetOwnProperty): (WebCore::JSTestNamedDeleterNoIdentifier::getOwnPropertySlot): (WebCore::JSTestNamedDeleterNoIdentifier::put): * Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.h: * Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp: (WebCore::JSTestNamedDeleterThrowingException::legacyPlatformObjectGetOwnProperty): (WebCore::JSTestNamedDeleterThrowingException::getOwnPropertySlot): (WebCore::JSTestNamedDeleterThrowingException::put): * Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.h: * Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp: (WebCore::JSTestNamedDeleterWithIdentifier::legacyPlatformObjectGetOwnProperty): (WebCore::JSTestNamedDeleterWithIdentifier::getOwnPropertySlot): (WebCore::JSTestNamedDeleterWithIdentifier::put): * Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.h: * Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp: (WebCore::JSTestNamedDeleterWithIndexedGetter::legacyPlatformObjectGetOwnProperty): (WebCore::JSTestNamedDeleterWithIndexedGetter::getOwnPropertySlot): (WebCore::JSTestNamedDeleterWithIndexedGetter::put): * Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.h: * Source/WebCore/bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp: (WebCore::JSTestNamedGetterCallWith::legacyPlatformObjectGetOwnProperty): (WebCore::JSTestNamedGetterCallWith::getOwnPropertySlot): (WebCore::JSTestNamedGetterCallWith::put): * Source/WebCore/bindings/scripts/test/JS/JSTestNamedGetterCallWith.h: * Source/WebCore/bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp: (WebCore::JSTestNamedGetterNoIdentifier::legacyPlatformObjectGetOwnProperty): (WebCore::JSTestNamedGetterNoIdentifier::getOwnPropertySlot): (WebCore::JSTestNamedGetterNoIdentifier::put): * Source/WebCore/bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.h: * Source/WebCore/bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp: (WebCore::JSTestNamedGetterWithIdentifier::legacyPlatformObjectGetOwnProperty): (WebCore::JSTestNamedGetterWithIdentifier::getOwnPropertySlot): (WebCore::JSTestNamedGetterWithIdentifier::put): * Source/WebCore/bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.h: * Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp: (WebCore::JSTestNamedSetterNoIdentifier::legacyPlatformObjectGetOwnProperty): (WebCore::JSTestNamedSetterNoIdentifier::getOwnPropertySlot): (WebCore::JSTestNamedSetterNoIdentifier::put): * Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.h: * Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp: (WebCore::JSTestNamedSetterThrowingException::legacyPlatformObjectGetOwnProperty): (WebCore::JSTestNamedSetterThrowingException::getOwnPropertySlot): (WebCore::JSTestNamedSetterThrowingException::put): * Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterThrowingException.h: * Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp: (WebCore::JSTestNamedSetterWithIdentifier::legacyPlatformObjectGetOwnProperty): (WebCore::JSTestNamedSetterWithIdentifier::getOwnPropertySlot): (WebCore::JSTestNamedSetterWithIdentifier::put): * Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.h: * Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp: (WebCore::JSTestNamedSetterWithIndexedGetter::legacyPlatformObjectGetOwnProperty): (WebCore::JSTestNamedSetterWithIndexedGetter::getOwnPropertySlot): (WebCore::JSTestNamedSetterWithIndexedGetter::put): * Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.h: * Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp: (WebCore::JSTestNamedSetterWithIndexedGetterAndSetter::legacyPlatformObjectGetOwnProperty): (WebCore::JSTestNamedSetterWithIndexedGetterAndSetter::getOwnPropertySlot): (WebCore::JSTestNamedSetterWithIndexedGetterAndSetter::put): * Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.h: * Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithLegacyOverrideBuiltIns.cpp: (WebCore::JSTestNamedSetterWithLegacyOverrideBuiltIns::legacyPlatformObjectGetOwnProperty): (WebCore::JSTestNamedSetterWithLegacyOverrideBuiltIns::getOwnPropertySlot): (WebCore::JSTestNamedSetterWithLegacyOverrideBuiltIns::put): * Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithLegacyOverrideBuiltIns.h: * Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeableProperties.cpp: (WebCore::JSTestNamedSetterWithLegacyUnforgeableProperties::legacyPlatformObjectGetOwnProperty): (WebCore::JSTestNamedSetterWithLegacyUnforgeableProperties::getOwnPropertySlot): (WebCore::JSTestNamedSetterWithLegacyUnforgeableProperties::put): * Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeableProperties.h: * Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeablePropertiesAndLegacyOverrideBuiltIns.cpp: (WebCore::JSTestNamedSetterWithLegacyUnforgeablePropertiesAndLegacyOverrideBuiltIns::legacyPlatformObjectGetOwnProperty): (WebCore::JSTestNamedSetterWithLegacyUnforgeablePropertiesAndLegacyOverrideBuiltIns::getOwnPropertySlot): (WebCore::JSTestNamedSetterWithLegacyUnforgeablePropertiesAndLegacyOverrideBuiltIns::put): * Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeablePropertiesAndLegacyOverrideBuiltIns.h: * Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::JSTestObj::legacyPlatformObjectGetOwnProperty): (WebCore::JSTestObj::getOwnPropertySlot): (WebCore::JSTestObj::put): * Source/WebCore/bindings/scripts/test/JS/JSTestObj.h: * Source/WebCore/bindings/scripts/test/JS/JSTestPluginInterface.cpp: (WebCore::JSTestPluginInterface::legacyPlatformObjectGetOwnProperty): (WebCore::JSTestPluginInterface::getOwnPropertySlot): * Source/WebCore/bindings/scripts/test/JS/JSTestPluginInterface.h: Canonical link: https://commits.webkit.org/265501@main
Committed 265501@main (4806e62): https://commits.webkit.org/265501@main Reviewed commits have been landed. Closing PR #15251 and removing active labels. |
6624d4e
to
4806e62
Compare
4806e62
6624d4e