You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Implement the preserveWrapperCallback API to allow our DOM objects to be stored in WeakMaps. #7218
➜ servo git:(master) ✗ RUST_BACKTRACE=1 ./build/servo http://localhost:4000
Error at http://localhost:4000/dist.js:27: TypeError: document.createElement(...).getContext is not a function
evaluate_script failed
Not sure if getContext is not a method of an HTMLCanvasElement, or if createElement is not a method of the document object?
changed the title [-]Unable to get a WebGL context[/-][+]Implement the preserveWrapperCallback API to allow our DOM objects to be stored in WeakMaps.[/+]on Sep 14, 2015
This involves calling js::jsapi::SetPreserveWrapperCallback in ScriptTask::new_rt_and_cx() (components/script/script_task.rs). The argument should be a new preserve_wrapper function that unconditionally returns true.
Activity
jdm commentedon Aug 14, 2015
Both of those exist and are tested. What is the code that isn't working?
http://mxr.mozilla.org/servo/source/components/script/dom/htmlcanvaselement.rs#241
nickdesaulniers commentedon Aug 28, 2015
https://www.dropbox.com/s/l2oywvluzwjwy9o/demo.zip?dl=0
jdm commentedon Aug 28, 2015
jdm commentedon Aug 28, 2015
Looks like we need to implement the preserveWrapperCallback API to allow our DOM objects to be stored in WeakMaps.
nox commentedon Aug 30, 2015
WeakMaps? Where are they? Do they do what I think they do? Can we use them from Rust for ranges and things like that?
jdm commentedon Aug 30, 2015
They're SpiderMonkey things. I don't even know the situation for using them from C++, let alone Rust.
jdm commentedon Aug 30, 2015
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap
[-]Unable to get a WebGL context[/-][+]Implement the preserveWrapperCallback API to allow our DOM objects to be stored in WeakMaps.[/+]Ms2ger commentedon Sep 14, 2015
This involves calling
js::jsapi::SetPreserveWrapperCallbackinScriptTask::new_rt_and_cx()(components/script/script_task.rs). The argument should be a newpreserve_wrapperfunction that unconditionally returns true.Ms2ger commentedon Sep 14, 2015
... as well as adding tests in window and worker contexts.
jdm commentedon Sep 14, 2015
#7620 has a great testcase for the window context that we can copy.
Manishearth commentedon Sep 15, 2015
Minimimized GitHub testcase:
Manishearth commentedon Sep 15, 2015
@jdm Also, rust-mozjs expects a function returning a u8, whereas actually it is
-> bool. I'm not sure if that part is autogenerated, but should we fix that?jdm commentedon Sep 15, 2015
I do not know anything about the implications of using bool/u8 in FFI, unfortunately.
Ms2ger commentedon Sep 16, 2015
Use
JSTruefor now.Add preserveWrapperCallback (fixes servo#7218)
Manishearth commentedon Sep 17, 2015
A naive
return JSTrueimpl of this seems to segfault a lot. Not E-Easy.Add preserveWrapperCallback (fixes servo#7218)
Add preserveWrapperCallback (fixes servo#7218)