mirror of
https://github.com/vlang/v.git
synced 2025-09-15 07:22:27 +03:00
jsdom, checker: add more methods for CanvasRenderingContext2D, fix interop check for JS methods (#12372)
This commit is contained in:
parent
c4e282a0c8
commit
2b4154910c
8 changed files with 235 additions and 80 deletions
|
@ -1,7 +1,5 @@
|
|||
module jsdom
|
||||
|
||||
import jsdom.ctx
|
||||
|
||||
pub struct HTMLCanvasElement {
|
||||
HTMLElement
|
||||
}
|
||||
|
@ -31,10 +29,10 @@ pub fn (elem HTMLCanvasElement) add_event_listener(event string, cb EventCallbac
|
|||
#});
|
||||
}
|
||||
|
||||
pub fn (elem HTMLCanvasElement) get_context(ctx_ string) ctx.ContextResult {
|
||||
mut res := ctx.NoneContext{}
|
||||
pub fn (elem HTMLCanvasElement) get_context(ctx_ string) ContextResult {
|
||||
mut res := NoneContext{}
|
||||
#let ctx = elem.node.getContext(ctx_.str);
|
||||
#if (ctx instanceof CanvasRenderingContext2D) { res = new jsdom__ctx__CanvasRenderingContext2D(ctx); res.ctx = ctx; }
|
||||
#if (ctx instanceof CanvasRenderingContext2D) { res = new jsdom__CanvasRenderingContext2D(ctx); res.ctx = ctx; }
|
||||
|
||||
return res
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue