Skip to content
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

legacy platform objects no longer override desc.[[Configurable]] #1418

Merged
merged 1 commit into from
Jul 10, 2024

Conversation

caitp
Copy link
Contributor

@caitp caitp commented Jul 10, 2024

None of the code generation for named setters in any of the major browsers appears to honor Step 3. of 3.9.3. [DefineOwnProperty].

The test case in WPT
(http://wpt.live/dom/collections/HTMLCollection-supported-property-names.html) already appears to assert that the descriptor is not forced to become [[Configurable]], and this test case is passing in most implementations.

I've done a bunch of detective work to justify this 2 line patch, so dumping all of that here. commit hashes are current as of writing this.

WebKit:
https://github.com/WebKit/WebKit/blob/f288b9088d1b74b980c3b7a8d5add134f7689bdb/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm#L1545-L1551

Chromium:
https://source.chromium.org/chromium/chromium/src/+/b1387a25dd3e3ebb02ff33c935325a0d4d74c330:third_party/blink/renderer/bindings/scripts/bind_gen/interface.py;l=3484-3538

Gecko:
https://github.com/mozilla/gecko-dev/blob/0b1d02b2cb5736511139cf0e40b318273e825899/dom/bindings/Codegen.py#L15261-L15301

With the [[GetOwnProperty]] algorithm, there are a few documented instances where this is intentionally ignored:

[[GetOwnProperty]] for Location objects: https://github.com/mozilla/gecko-dev/blob/0b1d02b2cb5736511139cf0e40b318273e825899/dom/bindings/Codegen.py#L16396-L16400 -- Per Gecko's passing the test, it does not appear to actually override the set descriptor in any way, at least not with regards to configurability.

In Chromium, similarly, it doesn't appear that any overriding occurs in LegacyPlatformObjecttGetOwnProperty:
https://source.chromium.org/chromium/chromium/src/+/b1387a25dd3e3ebb02ff33c935325a0d4d74c330:third_party/blink/renderer/bindings/scripts/bind_gen/interface.py;l=3186-3202

Finally, in WebKit we also see no overriding behaviour for the descriptor attributes when the named property visibility algorithm returns false: https://github.com/WebKit/WebKit/blob/f288b9088d1b74b980c3b7a8d5add134f7689bdb/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm#L983-L992

  • At least two implementers are interested (and none opposed):
    • N/A, already implemented
  • Tests are written and can be reviewed and commented upon at:
    • N/A, already tested
  • Implementation bugs are filed:
    • N/A, already implemented
  • MDN issue is filed: N/A
  • The top of this comment includes a clear commit message to use.

(See WHATWG Working Mode: Changes for more details.)


Preview | Diff

index.bs Outdated Show resolved Hide resolved
None of the code generation for named setters in any of the major browsers
appears to honor Step 3. of 3.9.3. [[DefineOwnProperty]](
https://webidl.spec.whatwg.org/#legacy-platform-object-defineownproperty).

The test case in WPT
(http://wpt.live/dom/collections/HTMLCollection-supported-property-names.html)
already appears to assert that the descriptor is not forced to become
[[Configurable]], and this test case is passing in most implementations.

I've done a bunch of detective work to justify this 2 line patch, so dumping
all of that here. commit hashes are current as of writing this.

WebKit:
https://github.com/WebKit/WebKit/blob/f288b9088d1b74b980c3b7a8d5add134f7689bdb/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm#L1545-L1551

Chromium:
https://source.chromium.org/chromium/chromium/src/+/b1387a25dd3e3ebb02ff33c935325a0d4d74c330:third_party/blink/renderer/bindings/scripts/bind_gen/interface.py;l=3484-3538

Gecko:
https://github.com/mozilla/gecko-dev/blob/0b1d02b2cb5736511139cf0e40b318273e825899/dom/bindings/Codegen.py#L15261-L15301

With the [[GetOwnProperty]] algorithm, there are a few documented instances
where this is intentionally ignored:

[[GetOwnProperty]] for Location objects: https://github.com/mozilla/gecko-dev/blob/0b1d02b2cb5736511139cf0e40b318273e825899/dom/bindings/Codegen.py#L16396-L16400
-- Per Gecko's passing the test, it does not appear to actually override the
set descriptor in any way, at least not with regards to configurability.

In Chromium, similarly, it doesn't appear that any overriding occurs in
LegacyPlatformObjecttGetOwnProperty:
https://source.chromium.org/chromium/chromium/src/+/b1387a25dd3e3ebb02ff33c935325a0d4d74c330:third_party/blink/renderer/bindings/scripts/bind_gen/interface.py;l=3186-3202

Finally, in WebKit we also see no overriding behaviour for the descriptor
attributes when the named property visibility algorithm returns false: https://github.com/WebKit/WebKit/blob/f288b9088d1b74b980c3b7a8d5add134f7689bdb/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm#L983-L992
@annevk
Copy link
Member

annevk commented Jul 10, 2024

Given that browsers are interoperable and there's test coverage, and there's highly unlikely to be MDN coverage I think this is sufficient for merging.

I'll note in the final commit message that this fixes #669.

@annevk annevk merged commit 3fb6ab4 into whatwg:main Jul 10, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants