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

Stop appending canvas to document in web platform #1089

Merged
merged 3 commits into from
Aug 8, 2019

Conversation

hecrj
Copy link
Contributor

@hecrj hecrj commented Aug 2, 2019

The changes here stop winit from automatically appending the window canvas to the document root in the web platform. I discussed this with @ryanisaacg on Discord and we seemed to agree.

I think this approach has multiple benefits:

  • It reduces the scope of winit to simply providing a canvas with the proper event listeners attached.
  • We get multiple canvas support for free, given that all the event listeners are currently local to the canvas (however, we still need to think if we should provide fullscreen support and how in Web support tracking issue #1072).
  • The user decides how to embed the canvas freely in their own web document. This allows us to leave some functionality out of winit's scope, like changing the document/tab title or updating the favicon. The user is expected to implement this on top of winit if necessary.

Additionally, I have updated an unnecessary TODO comment and fixed some panics on canvas creation.

@hecrj hecrj mentioned this pull request Aug 2, 2019
26 tasks
@goddessfreya goddessfreya merged commit dbdde3d into rust-windowing:web Aug 8, 2019
@goddessfreya
Copy link
Contributor

lgtm, merging, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants