Skip to content

Stop appending canvas to document in web platform#1089

Merged
goddessfreya merged 3 commits intorust-windowing:webfrom
hecrj:web
Aug 8, 2019
Merged

Stop appending canvas to document in web platform#1089
goddessfreya merged 3 commits intorust-windowing:webfrom
hecrj:web

Conversation

@hecrj
Copy link
Copy Markdown
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
Copy Markdown
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