Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Figure out how to support interfaces with NoInterfaceObject attribute #893

Closed
fitzgen opened this issue Sep 26, 2018 · 2 comments · Fixed by #1449
Closed

Figure out how to support interfaces with NoInterfaceObject attribute #893

fitzgen opened this issue Sep 26, 2018 · 2 comments · Fixed by #1449
Labels
frontend:webidl Issues related to the WebIDL frontend to wasm-bindgen web-sys Issues related to the `web-sys` crate

Comments

@fitzgen
Copy link
Member

fitzgen commented Sep 26, 2018

Right now, we completely skip generating code for any interface that is marked [NoInterfaceObject]. I think we might want to do something like:

  • mark all their methods structural, since we don't ahve the prototype until we get an instance
  • make JsCast::is_instance_of always return false for them, because we don't have access to the constructor without getting an instance

cc @alexcrichton @afdw

Here are the 71 interfaces with [NoInterfaceObject] in our webidls

  • ANGLE_instanced_arrays
  • Coordinates
  • DeviceAcceleration
  • DeviceRotationRate
  • Exception
  • EXT_blend_minmax
  • EXT_color_buffer_float
  • EXT_color_buffer_half_float
  • EXT_disjoint_timer_query
  • External
  • EXT_frag_depth
  • EXT_shader_texture_lod
  • EXT_sRGB
  • EXT_texture_filter_anisotropic
  • FontFaceSetIterator
  • Geolocation
  • GetUserMediaRequest
  • HTMLHyperlinkElementUtils
  • ImageCaptureError
  • IntlUtils
  • ListBoxObject
  • MediaStreamError
  • MOZ_debug
  • NavigatorAutomationInformation
  • OES_element_index_uint
  • OES_standard_derivatives
  • OES_texture_float
  • OES_texture_float_linear
  • OES_texture_half_float
  • OES_texture_half_float_linear
  • OES_vertex_array_object
  • Position
  • PositionError
  • PromiseNativeHandler
  • RTCIdentityProviderRegistrar
  • ScrollBoxObject
  • SVGPathSeg
  • SVGPathSegArcAbs
  • SVGPathSegArcRel
  • SVGPathSegClosePath
  • SVGPathSegCurvetoCubicAbs
  • SVGPathSegCurvetoCubicRel
  • SVGPathSegCurvetoCubicSmoothAbs
  • SVGPathSegCurvetoCubicSmoothRel
  • SVGPathSegCurvetoQuadraticAbs
  • SVGPathSegCurvetoQuadraticRel
  • SVGPathSegCurvetoQuadraticSmoothAbs
  • SVGPathSegCurvetoQuadraticSmoothRel
  • SVGPathSegLinetoAbs
  • SVGPathSegLinetoHorizontalAbs
  • SVGPathSegLinetoHorizontalRel
  • SVGPathSegLinetoRel
  • SVGPathSegLinetoVerticalAbs
  • SVGPathSegLinetoVerticalRel
  • SVGPathSegMovetoAbs
  • SVGPathSegMovetoRel
  • TreeBoxObject
  • TreeView
  • WEBGL_color_buffer_float
  • WEBGL_compressed_texture_astc
  • WEBGL_compressed_texture_atc
  • WEBGL_compressed_texture_etc
  • WEBGL_compressed_texture_etc1
  • WEBGL_compressed_texture_pvrtc
  • WEBGL_compressed_texture_s3tc
  • WEBGL_compressed_texture_s3tc_srgb
  • WEBGL_debug_renderer_info
  • WEBGL_debug_shaders
  • WEBGL_depth_texture
  • WEBGL_draw_buffers
  • WEBGL_lose_context
@fitzgen fitzgen added frontend:webidl Issues related to the WebIDL frontend to wasm-bindgen web-sys Issues related to the `web-sys` crate labels Sep 26, 2018
alexcrichton added a commit to alexcrichton/wasm-bindgen that referenced this issue Apr 12, 2019
This commit enables `[NoInterfaceObject]` annotated interfaces in
`web-sys`. The `NoInterfaceObject` attribute means that there's not
actually a JS class for the object, but all of its properties and such
can still be accessed structually and invoked. This should help provide
more bindings for some more common types on the web!

Note that this builds on recent features to ensure that `dyn_into` and
friends always fail for `NoInterfaceObject` objects because they don't
actually have a class.

Closes rustwasm#893
Closes rustwasm#1257
Closes rustwasm#1315
alexcrichton added a commit to alexcrichton/wasm-bindgen that referenced this issue Apr 15, 2019
This commit enables `[NoInterfaceObject]` annotated interfaces in
`web-sys`. The `NoInterfaceObject` attribute means that there's not
actually a JS class for the object, but all of its properties and such
can still be accessed structually and invoked. This should help provide
more bindings for some more common types on the web!

Note that this builds on recent features to ensure that `dyn_into` and
friends always fail for `NoInterfaceObject` objects because they don't
actually have a class.

Closes rustwasm#893
Closes rustwasm#1257
Closes rustwasm#1315
@ZacLiveEarth
Copy link

Any chance of getting a new release cut sometime soon? I've been chomping at the bit for this change.

@alexcrichton
Copy link
Contributor

sure thing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend:webidl Issues related to the WebIDL frontend to wasm-bindgen web-sys Issues related to the `web-sys` crate
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants