Repository navigation
WebKit export of https://bugs.webkit.org/show_bug.cgi?id=230941 - #32012
Conversation
wpt-pr-bot
left a comment
There was a problem hiding this comment.
The review process for this patch is being conducted in the WebKit project.
|
These are good tests. The fact that everyone is failing structuredClone() is a bit worrying. But I guess if you can get them working in WebKit, we can probably get them working in Chromium and Gecko too. |
|
Thanks Domenic!
I've looked through Chromium (https://chromium-review.googlesource.com/c/chromium/src/+/3245334) and Gecko patches (https://hg.mozilla.org/mozilla-central/rev/f50502328881) and can confirm ерфе changing current to relevant for deserialisation would be indeed a trivial change: just like in WebKit, deserialisation routines accept a realm argument for creating objects. |
…nstead of _relevant_ https://bugs.webkit.org/show_bug.cgi?id=230941 Patch by Alexey Shvayka <[email protected]> on 2021-12-10 Reviewed by Sam Weinig. LayoutTests/imported/w3c: Import WPT tests from web-platform-tests/wpt#32012. * web-platform-tests/dom/events/Event-timestamp-cross-realm-getter-expected.txt: Added. * web-platform-tests/dom/events/Event-timestamp-cross-realm-getter.html: Added. * web-platform-tests/html/browsers/history/the-history-interface/history_back_cross_realm_method-expected.txt: Added. * web-platform-tests/html/browsers/history/the-history-interface/history_back_cross_realm_method.html: Added. * web-platform-tests/html/browsers/history/the-history-interface/history_forward_cross_realm_method-expected.txt: Added. * web-platform-tests/html/browsers/history/the-history-interface/history_forward_cross_realm_method.html: Added. * web-platform-tests/html/browsers/history/the-history-interface/history_go_cross_realm_method-expected.txt: Added. * web-platform-tests/html/browsers/history/the-history-interface/history_go_cross_realm_method.html: Added. * web-platform-tests/html/webappapis/scripting/reporterror-cross-realm-method-expected.txt: Added. * web-platform-tests/html/webappapis/scripting/reporterror-cross-realm-method.html: Added. * web-platform-tests/html/webappapis/structured-clone/structured-clone-cross-realm-method-expected.txt: Added. * web-platform-tests/html/webappapis/structured-clone/structured-clone-cross-realm-method.html: Added. * web-platform-tests/requestidlecallback/callback-timeRemaining-cross-realm-method-expected.txt: Added. * web-platform-tests/requestidlecallback/callback-timeRemaining-cross-realm-method.html: Added. Source/WebCore: This patch replaces _current_ global object with _relevant_, as per recommendation for spec authors [1], for select WebIDL operations / attributes that satisfy all the following conditions: 1) it's an instance member: static ones and constructors can't use _relevant_; 2) it's on standards track (not deprecated / WebKit-only / internal); 3) the change is directly observable: global object is used for something beyond lifecycle / event loop / parsing CSS etc; 4) the change either aligns WebKit with both Blink and Gecko, or the spec explicitly requires _relevant_ realm / settings object. Most of the remaining [CallWith=GlobalObject] instances are correctly used for converting JS arguments to WebIDL values; the rest, along with _current_ Document and ScriptExecutionContext, either match the spec or replacing them with _relevant_ global object is not directly observable (see condition #3). This change is aimed at fixing web-exposed APIs rather than performing a global cleanup. [1] https://html.spec.whatwg.org/multipage/webappapis.html#concept-current-everything Tests: imported/w3c/web-platform-tests/dom/events/Event-timestamp-cross-realm-getter.html imported/w3c/web-platform-tests/html/browsers/history/the-history-interface/history_back_cross_realm_method.html imported/w3c/web-platform-tests/html/browsers/history/the-history-interface/history_forward_cross_realm_method.html imported/w3c/web-platform-tests/html/browsers/history/the-history-interface/history_go_cross_realm_method.html imported/w3c/web-platform-tests/html/webappapis/scripting/reporterror-cross-realm-method.html imported/w3c/web-platform-tests/html/webappapis/structured-clone/structured-clone-cross-realm-method.html imported/w3c/web-platform-tests/requestidlecallback/callback-timeRemaining-cross-realm-method.html * Modules/indexeddb/IDBFactory.idl: https://www.w3.org/TR/IndexedDB/#dom-idbfactory-open (step 2) https://www.w3.org/TR/IndexedDB/#dom-idbfactory-deletedatabase (step 1) https://www.w3.org/TR/IndexedDB/#dom-idbfactory-databases (step 1) * Modules/paymentrequest/PaymentRequest.idl: https://www.w3.org/TR/payment-request/#show-method (steps 2-4) https://www.w3.org/TR/payment-request/#can-make-payment-algorithm (before step 1) * bindings/scripts/CodeGeneratorJS.pm: (GenerateCallWith): * bindings/scripts/IDLAttributes.json: * bindings/scripts/test/JS/JSTestObj.cpp: * bindings/scripts/test/TestObj.idl: * dom/Event.idl: https://dom.spec.whatwg.org/#inner-event-creation-steps (step 3) * dom/IdleDeadline.idl: https://w3c.github.io/requestidlecallback/#the-requestidlecallback-method (step 1) * page/History.idl: https://html.spec.whatwg.org/multipage/history.html#dom-history-go (step 1) https://html.spec.whatwg.org/multipage/history.html#dom-history-back (step 1) https://html.spec.whatwg.org/multipage/history.html#dom-history-forward (step 1) * page/DOMWindow.cpp: (WebCore::DOMWindow::setTimeout): (WebCore::DOMWindow::setInterval): * page/DOMWindow.h: * workers/WorkerGlobalScope.cpp: (WebCore::WorkerGlobalScope::setTimeout): (WebCore::WorkerGlobalScope::setInterval): * workers/WorkerGlobalScope.h: Although condition #4 isn't satisfied for setTimeout() / setInterval() because _current_ global object is used only for logging, replacing it with _relevant_ nicely cleans up method signatures. * page/WindowOrWorkerGlobalScope.cpp: (WebCore::WindowOrWorkerGlobalScope::structuredClone): * page/WindowOrWorkerGlobalScope.h: * page/WindowOrWorkerGlobalScope.idl: https://html.spec.whatwg.org/multipage/webappapis.html#report-the-exception https://html.spec.whatwg.org/multipage/structured-data.html#structured-cloning (step 2) Canonical link: https://commits.webkit.org/245123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@286895 268f45cc-cd09-0410-ab3c-d52691b4dbfc
…nstead of _relevant_ https://bugs.webkit.org/show_bug.cgi?id=230941 Patch by Alexey Shvayka <[email protected]> on 2021-12-10 Reviewed by Sam Weinig. LayoutTests/imported/w3c: Import WPT tests from web-platform-tests/wpt#32012. * web-platform-tests/dom/events/Event-timestamp-cross-realm-getter-expected.txt: Added. * web-platform-tests/dom/events/Event-timestamp-cross-realm-getter.html: Added. * web-platform-tests/html/browsers/history/the-history-interface/history_back_cross_realm_method-expected.txt: Added. * web-platform-tests/html/browsers/history/the-history-interface/history_back_cross_realm_method.html: Added. * web-platform-tests/html/browsers/history/the-history-interface/history_forward_cross_realm_method-expected.txt: Added. * web-platform-tests/html/browsers/history/the-history-interface/history_forward_cross_realm_method.html: Added. * web-platform-tests/html/browsers/history/the-history-interface/history_go_cross_realm_method-expected.txt: Added. * web-platform-tests/html/browsers/history/the-history-interface/history_go_cross_realm_method.html: Added. * web-platform-tests/html/webappapis/scripting/reporterror-cross-realm-method-expected.txt: Added. * web-platform-tests/html/webappapis/scripting/reporterror-cross-realm-method.html: Added. * web-platform-tests/html/webappapis/structured-clone/structured-clone-cross-realm-method-expected.txt: Added. * web-platform-tests/html/webappapis/structured-clone/structured-clone-cross-realm-method.html: Added. * web-platform-tests/requestidlecallback/callback-timeRemaining-cross-realm-method-expected.txt: Added. * web-platform-tests/requestidlecallback/callback-timeRemaining-cross-realm-method.html: Added. Source/WebCore: This patch replaces _current_ global object with _relevant_, as per recommendation for spec authors [1], for select WebIDL operations / attributes that satisfy all the following conditions: 1) it's an instance member: static ones and constructors can't use _relevant_; 2) it's on standards track (not deprecated / WebKit-only / internal); 3) the change is directly observable: global object is used for something beyond lifecycle / event loop / parsing CSS etc; 4) the change either aligns WebKit with both Blink and Gecko, or the spec explicitly requires _relevant_ realm / settings object. Most of the remaining [CallWith=GlobalObject] instances are correctly used for converting JS arguments to WebIDL values; the rest, along with _current_ Document and ScriptExecutionContext, either match the spec or replacing them with _relevant_ global object is not directly observable (see condition #3). This change is aimed at fixing web-exposed APIs rather than performing a global cleanup. [1] https://html.spec.whatwg.org/multipage/webappapis.html#concept-current-everything Tests: imported/w3c/web-platform-tests/dom/events/Event-timestamp-cross-realm-getter.html imported/w3c/web-platform-tests/html/browsers/history/the-history-interface/history_back_cross_realm_method.html imported/w3c/web-platform-tests/html/browsers/history/the-history-interface/history_forward_cross_realm_method.html imported/w3c/web-platform-tests/html/browsers/history/the-history-interface/history_go_cross_realm_method.html imported/w3c/web-platform-tests/html/webappapis/scripting/reporterror-cross-realm-method.html imported/w3c/web-platform-tests/html/webappapis/structured-clone/structured-clone-cross-realm-method.html imported/w3c/web-platform-tests/requestidlecallback/callback-timeRemaining-cross-realm-method.html * Modules/indexeddb/IDBFactory.idl: https://www.w3.org/TR/IndexedDB/#dom-idbfactory-open (step 2) https://www.w3.org/TR/IndexedDB/#dom-idbfactory-deletedatabase (step 1) https://www.w3.org/TR/IndexedDB/#dom-idbfactory-databases (step 1) * Modules/paymentrequest/PaymentRequest.idl: https://www.w3.org/TR/payment-request/#show-method (steps 2-4) https://www.w3.org/TR/payment-request/#can-make-payment-algorithm (before step 1) * bindings/scripts/CodeGeneratorJS.pm: (GenerateCallWith): * bindings/scripts/IDLAttributes.json: * bindings/scripts/test/JS/JSTestObj.cpp: * bindings/scripts/test/TestObj.idl: * dom/Event.idl: https://dom.spec.whatwg.org/#inner-event-creation-steps (step 3) * dom/IdleDeadline.idl: https://w3c.github.io/requestidlecallback/#the-requestidlecallback-method (step 1) * page/History.idl: https://html.spec.whatwg.org/multipage/history.html#dom-history-go (step 1) https://html.spec.whatwg.org/multipage/history.html#dom-history-back (step 1) https://html.spec.whatwg.org/multipage/history.html#dom-history-forward (step 1) * page/DOMWindow.cpp: (WebCore::DOMWindow::setTimeout): (WebCore::DOMWindow::setInterval): * page/DOMWindow.h: * workers/WorkerGlobalScope.cpp: (WebCore::WorkerGlobalScope::setTimeout): (WebCore::WorkerGlobalScope::setInterval): * workers/WorkerGlobalScope.h: Although condition #4 isn't satisfied for setTimeout() / setInterval() because _current_ global object is used only for logging, replacing it with _relevant_ nicely cleans up method signatures. * page/WindowOrWorkerGlobalScope.cpp: (WebCore::WindowOrWorkerGlobalScope::structuredClone): * page/WindowOrWorkerGlobalScope.h: * page/WindowOrWorkerGlobalScope.idl: https://html.spec.whatwg.org/multipage/webappapis.html#report-the-exception https://html.spec.whatwg.org/multipage/structured-data.html#structured-cloning (step 2) git-svn-id: http://svn.webkit.org/repository/webkit/trunk@286895 268f45cc-cd09-0410-ab3c-d52691b4dbfc
|
For the record, I filed https://bugs.chromium.org/p/chromium/issues/detail?id=1279558 for Chromium |
This upstream reviewed change tests that selected WebIDL attributes and operations use relevant global object instead of current as per their specs or general guideline to prefer relevant.