mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Properly resize iframe root layers
When a layer containing an iframe changes, we also need to resize the root layer of the subpage. This ensures that content from the child layer tree is masked to the new size. Fixes #8301.
This commit is contained in:
parent
daad09d442
commit
261246ea25
5 changed files with 72 additions and 1 deletions
|
@ -791,8 +791,20 @@ impl<Window: WindowMethods> IOCompositor<Window> {
|
|||
self.pipeline_details.remove(&pipeline_id);
|
||||
}
|
||||
|
||||
fn update_layer_if_exists(&mut self, pipeline_id: PipelineId, properties: LayerProperties)
|
||||
fn update_layer_if_exists(&mut self,
|
||||
pipeline_id: PipelineId,
|
||||
properties: LayerProperties)
|
||||
-> bool {
|
||||
if let Some(subpage_id) = properties.subpage_pipeline_id {
|
||||
match self.find_layer_with_pipeline_and_layer_id(subpage_id, LayerId::null()) {
|
||||
Some(layer) => {
|
||||
*layer.bounds.borrow_mut() = Rect::from_untyped(
|
||||
&Rect::new(Point2D::zero(), properties.rect.size));
|
||||
}
|
||||
None => warn!("Tried to update non-existent subpage root layer: {:?}", subpage_id),
|
||||
}
|
||||
}
|
||||
|
||||
match self.find_layer_with_pipeline_and_layer_id(pipeline_id, properties.id) {
|
||||
Some(existing_layer) => {
|
||||
existing_layer.update_layer(properties);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue