use js::context::JSContext;
use script_bindings::reflector::DomObject;
use servo_canvas_traits::webgl::WebGLVersion;
use super::WebGLExtensions;
use crate::dom::bindings::root::DomRoot;
use crate::dom::bindings::trace::JSTraceable;
use crate::dom::webgl::webglrenderingcontext::WebGLRenderingContext;
pub(crate) trait WebGLExtension: Sized
where
Self::Extension: DomObject + JSTraceable,
{
#[cfg_attr(crown, crown::unrooted_must_root_lint::must_root)]
type Extension;
fn new(cx: &mut JSContext, ctx: &WebGLRenderingContext) -> DomRoot<Self::Extension>;
fn spec() -> WebGLExtensionSpec;
fn is_supported(ext: &WebGLExtensions) -> bool;
fn enable(ext: &WebGLExtensions);
fn name() -> &'static str;
}
pub(crate) enum WebGLExtensionSpec {
All,
Specific(WebGLVersion),
}