mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Don't let base layers override root layer size
Base layers (the background layer of each frame) shouldn't override the size of their root layers. This allows base layers to scroll inside root layer frames. This does mean that when determining the maximum scroll position, we need to look at the size of scrolling root children though.
This commit is contained in:
parent
e01c5cd863
commit
f346a215f3
3 changed files with 17 additions and 4 deletions
|
@ -72,14 +72,17 @@ impl CompositorData {
|
|||
tile_size, new_compositor_data))
|
||||
}
|
||||
|
||||
pub fn update_layer(layer: Rc<Layer<CompositorData>>, layer_properties: LayerProperties) {
|
||||
pub fn update_layer_except_size(layer: Rc<Layer<CompositorData>>,
|
||||
layer_properties: LayerProperties) {
|
||||
layer.extra_data.borrow_mut().epoch = layer_properties.epoch;
|
||||
layer.extra_data.borrow_mut().scroll_policy = layer_properties.scroll_policy;
|
||||
layer.extra_data.borrow_mut().background_color = layer_properties.background_color;
|
||||
layer.contents_changed();
|
||||
}
|
||||
|
||||
pub fn update_layer(layer: Rc<Layer<CompositorData>>, layer_properties: LayerProperties) {
|
||||
let size: TypedSize2D<DevicePixel, f32> = Size2D::from_untyped(&layer_properties.rect.size);
|
||||
layer.resize(size);
|
||||
layer.contents_changed();
|
||||
|
||||
// Call scroll for bounds checking if the page shrunk. Use (-1, -1) as the
|
||||
// cursor position to make sure the scroll isn't propagated downwards. The
|
||||
|
@ -89,6 +92,7 @@ impl CompositorData {
|
|||
TypedPoint2D(-1f32, -1f32),
|
||||
size,
|
||||
ScaleFactor(1.0) /* scene_scale */);
|
||||
CompositorData::update_layer_except_size(layer, layer_properties);
|
||||
}
|
||||
|
||||
pub fn find_layer_with_pipeline_and_layer_id(layer: Rc<Layer<CompositorData>>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue