canvas: fix unrecognized offscreen webgl context#44159
Conversation
Signed-off-by: Niya Gupta <niyabits@disroot.org>
|
Actually the code at and needs to be changed to accept a&GlobalScope, then
needs to be rewritten to downcast the global to a Window or WorkerGlobalScope. Then we'll need to add servo/components/script/dom/window.rs Lines 680 to 684 in 38f77f4 servo/components/script/dom/window.rs Lines 382 to 384 in 38f77f4 |
|
I think you will need to add a webgl_chan member to , and then you can access it from WorkerGlobalScope::new. Then you can add a webgl_chan argument to and get it from the globals at the callsites by (again) downcasting them to Window or WorkerGlobalScope. |
|
@jdm While calling Expects a servo/components/script/dom/window.rs Lines 680 to 684 in 38f77f4 How should I go about returning |
|
That's fun! I suggest adding a temporary method to Window to return the WebGLChan until #44193 is fixed. |
Signed-off-by: Niya Gupta <niyabits@disroot.org>
|
Thanks for the help @jdm! That said, I still need to work on some stuff: In the servo/components/script/dom/canvas/2d/canvas_state.rs Lines 674 to 675 in d11fc3a Same for the servo/components/script/dom/canvas/2d/canvas_state.rs Lines 781 to 785 in d11fc3a I copied an unsafe method and implemented it on the I think this should be okay, although, I am not sure if there is a better way. Test Result Summary
Details |
|
Exciting! This is looking really good! |
Signed-off-by: Niya Gupta <niyabits@disroot.org>
e240528 to
dc758c1
Compare
Signed-off-by: Niya Gupta <niyabits@disroot.org>
Signed-off-by: Niya Gupta <niyabits@disroot.org>
| self.global() | ||
| .downcast::<Window>() | ||
| .and_then(|window| { |
There was a problem hiding this comment.
Aha, we can file a followup issue about updating WebGLRenderingContext::new to accept a &GlobalScope argument instead.
Signed-off-by: Niya Gupta <niyabits@disroot.org>
|
🔨 Triggering try run (#24417719696) for Linux (WPT) |
|
Test results for linux-wpt from try job (#24417719696): Flaky unexpected result (34)
Stable unexpected results that are known to be intermittent (17)
Stable unexpected results (13)
|
|
|
Signed-off-by: Niya Gupta <niyabits@disroot.org>

fix unrecognized type error on
OffscreenCanvasTesting: existing WPT:
tests/wpt/webgl/tests/conformance/offscreencanvastests/wpt/webgl/tests/conformance2/offscreencanvasFixes: #43540