Bug 214847 - thisValue is not always set correctly when calling JS callbacks
Summary: thisValue is not always set correctly when calling JS callbacks
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Bindings (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL: https://heycam.github.io/webidl/#call...
Keywords: InRadar
: 213716 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-07-27 14:04 PDT by Chris Dumez
Modified: 2020-08-02 03:45 PDT (History)
9 users (show)

See Also:


Attachments
Patch (5.24 KB, patch)
2020-07-27 14:07 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2020-07-27 14:04:22 PDT
thisValue is not always set correctly when calling JS callbacks.

This is causing us to fail the last subtest on:
http://w3c-test.org/dom/traversal/TreeWalker-acceptNode-filter.html

The specification for TreeWalker is here:
- https://dom.spec.whatwg.org/#concept-node-filter

Step 6 refers to [call a user object’s operation] in the WebIDL specification:
- https://heycam.github.io/webidl/#call-a-user-objects-operation

Step 10.5 says:
"Set thisArg to O (overriding the provided value)."

We're missing this step in our implementation so thisValue ends up being undefined (per earlier step 2).
Comment 1 Chris Dumez 2020-07-27 14:07:08 PDT
Created attachment 405310 [details]
Patch
Comment 2 EWS Watchlist 2020-07-27 14:07:51 PDT
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess
Comment 3 EWS 2020-07-27 15:06:36 PDT
Committed r264948: <https://trac.webkit.org/changeset/264948>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 405310 [details].
Comment 4 Radar WebKit Bug Importer 2020-07-27 15:07:19 PDT
<rdar://problem/66184276>
Comment 5 Alexey Shvayka 2020-08-02 03:45:04 PDT
*** Bug 213716 has been marked as a duplicate of this bug. ***