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

Make it possible to draw layers outside of the window #833

Closed
paulrouget opened this issue Feb 6, 2017 · 5 comments
Closed

Make it possible to draw layers outside of the window #833

paulrouget opened this issue Feb 6, 2017 · 5 comments

Comments

@paulrouget
Copy link
Collaborator

@paulrouget paulrouget commented Feb 6, 2017

Why: we want to be able to draw a transparent toolbar on top of content, but the content covered by the toolbar should not be within the window. So we want to be able to tell WR to not clip at the window boundaries but a larger rectangle.

I tried to prototype this: master...paulrouget:outOfWindowRendering

But it's not working so well. Only the background of the page is drawn outside of the window boundaries.

screen shot 2017-02-06 at 09 41 48

In this screenshot, the window starts at black line. After scrolling:

screen shot 2017-02-06 at 09 43 11

@glennw
Copy link
Member

@glennw glennw commented Feb 6, 2017

I pushed a very hacky proof of concept branch, that (I think) does what you're looking for - https://github.com/glennw/webrender/tree/overlay-demo.

With the following branch, when you first load a page, the content is 100px below the top of the window:

wp1

Once you start to scroll, the content scrolls up to the top of the window, which would allow you to place your transparent toolbar on top of the content:

wp2

Feel free to have a play around with that branch - and once we get something that does what you're looking for, we can work out the right API.

@paulrouget
Copy link
Collaborator Author

@paulrouget paulrouget commented Feb 7, 2017

This is working very well!

Two issues:

  • the scrollbar should be shifted as well
  • position:fixed;bottom:0 is off screen

As for the API, ideally we could do something like that: api.set_clipping_region(Rect)

@paulrouget
Copy link
Collaborator Author

@paulrouget paulrouget commented Feb 23, 2017

It would help me to get that in master. I need a way to update the clipping region dynamically.

Maybe via: Browser::handle_event(WindowEvent::UpdateClippingRegion(Rect)).

@paulrouget
Copy link
Collaborator Author

@paulrouget paulrouget commented Mar 2, 2017

PR wip: #951

@glennw
Copy link
Member

@glennw glennw commented Mar 5, 2017

This has landed in WR in #951. I'll do a WR update to Servo today. We can then open more specific bugs in Servo related to the public API.

@glennw glennw closed this Mar 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.