Repository navigation
script: Implement observable array - #46130
arihant2math wants to merge 1 commit into
Conversation
|
Currently it seems codegen is still a little broken, once I fix that, the PR should be ready. |
0ddbf96 to
d60f214
Compare
|
🔨 Triggering try run (#28490716551) for Linux (WPT) |
|
|
ba779a4 to
0d49164
Compare
Signed-off-by: Ashwin Naren <[email protected]>
|
🔨 Triggering try run (#28493600359) for Linux (WPT) |
|
Test results for linux-wpt from try job (#28493600359): Flaky unexpected result (46)
Stable unexpected results that are known to be intermittent (20)
Stable unexpected results (7)
|
|
|
| #[expect(unsafe_code)] | ||
| fn OnSetAdoptedStyleSheets( | ||
| &self, | ||
| cx: SafeJSContext, |
There was a problem hiding this comment.
We have removed SafeJsContext from codegen. Use &mut jSContext instead
There was a problem hiding this comment.
I wonder how to deal with this, I also add OnSetAdoptedStyleSheets on Bindings.rs cx?
Diagnostics:
1. method `OnSetAdoptedStyleSheets` has an incompatible type for trait
expected signature `fn(&dom::document::document::Document, script_bindings::script_runtime::JSContext, script_bindings::root::Root<_>, _) -> std::result::Result<_, _>`
found signature `fn(&dom::document::document::Document, &mut js::context::JSContext, script_bindings::root::Root<_>, _) -> std::result::Result<_, _>` [E0053]
There was a problem hiding this comment.
Yes, &mut js::context::JSContext is what we use now, and adding a method to cx in Bindings.conf makes that argument be added.
There was a problem hiding this comment.
Yes,
&mut js::context::JSContextis what we use now, and adding a method tocxin Bindings.conf makes that argument be added.
I still got the error after updating cx in Bindings.conf and doing the rebuild
There was a problem hiding this comment.
Then it looks like the implementation in doucment.rs needs to be updated with the correct argument type?
There was a problem hiding this comment.
Well, this PR was behind the current &mut js::context::JSContext implementation. After updating the branch, it now generates the cx bindings
|
Closing in favour of #48506. Thanks for the initial implementation! |
Resurrecting the implementation of ObservableArray in servo#46130 Testing: - ./mach test-wpt tests/wpt/tests/webidl/ecmascript-binding/observable-array-ownkeys.window.js - ./mach test-wpt tests/wpt/tests/webidl/ecmascript-binding/observable-array-no-leak-of-internals.window.js - ./mach test-wpt tests/wpt/meta/css/cssom/CSSStyleSheet-constructable-insertRule-base-uri.html - ./mach test-wpt tests/wpt/meta/custom-elements/state/state-css-selector-shadow-dom.html - ./mach test-wpt tests/wpt/meta/webidl/ecmascript-binding/observable-array-ownkeys.window.js Fixes servo#37902 Fixes servo#38132 --------- Signed-off-by: Jerens Lensun <[email protected]> Co-authored-by: Ashwin Naren <[email protected]>
Ports over firefox's implementation. Uses observable array in adopted stylesheet.
Fixes: #37902
Fixes: #38132