You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For browser.html, we want to draw the titlebar ourselves.
On osx, we need to be able to draw a window with rounded corners. the browser.html HTML page would use html {border-radius:6px}. To support that, we need to:
add an option to start servo with no titlebar
create the glutin window with with_decorations(false).with_transparency(true);
in rust-layers, render_scene should use a transparent clear color;
There are some more issues (the border radius doesn't clip its content, see #7575, and for some reasons vertical coordinates are messed up), but these can be fixed later.
Can someone tell me if this approach makes sense?
Letting HTML define the shape of the window is nice, but it's not a hard requirement. Maybe instead of using border-radius, we can clip the window in the compositor directly, or expose a function in Glutin to clip the window, or maybe always add rounded corner to decoration-less windows.
PS: we will need more things to make the titlebar fully functional:
support closing, maximizing and minimizing the window from JS (window controls will be built in HTML/CSS). This will be possible with Implement a Servo-based runtime #7379
The text was updated successfully, but these errors were encountered:
paulrouget
changed the title
Make it possible to draw the titlebar and clip the window in HTML (need feedback)
Make it possible to draw the titlebar and clip the window in HTML\
Sep 21, 2015
paulrouget
changed the title
Make it possible to draw the titlebar and clip the window in HTML\
Make it possible to draw the titlebar and clip the window in HTM
Sep 21, 2015
paulrouget
changed the title
Make it possible to draw the titlebar and clip the window in HTM
Make it possible to draw the titlebar and clip the window in HTML
Sep 21, 2015
For browser.html, we want to draw the titlebar ourselves.
On osx, we need to be able to draw a window with rounded corners. the browser.html HTML page would use
html {border-radius:6px}
. To support that, we need to:with_decorations(false).with_transparency(true)
;render_scene
should use a transparent clear color;invalidate_window_shape
method, or something like that, that would call the cocoa methodwindow.invalidateShadow()
to invalidate the shadow once the border radius has been painted. Edit: see Make it possible to draw the titlebar and clip the window in HTML #7659 (comment)With all of this, it appears to work:
There are some more issues (the border radius doesn't clip its content, see #7575, and for some reasons vertical coordinates are messed up), but these can be fixed later.
Can someone tell me if this approach makes sense?
Letting HTML define the shape of the window is nice, but it's not a hard requirement. Maybe instead of using
border-radius
, we can clip the window in the compositor directly, or expose a function in Glutin to clip the window, or maybe always add rounded corner to decoration-less windows.PS: we will need more things to make the titlebar fully functional:
The text was updated successfully, but these errors were encountered: