aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbors-servo <metajack+bors@gmail.com>2014-12-18 08:06:54 -0700
committerbors-servo <metajack+bors@gmail.com>2014-12-18 08:06:54 -0700
commitd7f38a8973c1baac2a68bd83a0c141deef920bac (patch)
treec3430222882d8c1938e3895497533dfc4bc74eac
parenteea49ee1d986c306a8eec32b64be9b10cb2278fc (diff)
parent8dd1a363cb253a5aac439f57d0a0b002da4c9680 (diff)
downloadservo-d7f38a8973c1baac2a68bd83a0c141deef920bac.tar.gz
servo-d7f38a8973c1baac2a68bd83a0c141deef920bac.zip
auto merge of #4412 : mbrubeck/servo/fixed-layer-resize, r=mrobinson
This fixes a bug where fixed-position layers are not repositioned when the window is resized. This can be reproduced with any `position: fixed` element with a `right` or `bottom` position. I'm not sure how to reftest this, though. r? @mrobinson
-rw-r--r--components/compositing/compositor.rs2
-rw-r--r--components/compositing/compositor_layer.rs10
2 files changed, 6 insertions, 6 deletions
diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs
index 59ceaea49dc..0e5294ae2f3 100644
--- a/components/compositing/compositor.rs
+++ b/components/compositing/compositor.rs
@@ -499,7 +499,7 @@ impl<Window: WindowMethods> IOCompositor<Window> {
let need_new_root_layer = !self.update_layer_if_exists(layer_properties);
if need_new_root_layer {
let root_layer = self.find_pipeline_root_layer(layer_properties.pipeline_id);
- root_layer.update_layer_except_size(layer_properties);
+ root_layer.update_layer_except_bounds(layer_properties);
let root_layer_pipeline = root_layer.extra_data.borrow().pipeline.clone();
let first_child = CompositorData::new_layer(
diff --git a/components/compositing/compositor_layer.rs b/components/compositing/compositor_layer.rs
index 00324bd34c4..4fa7fc54437 100644
--- a/components/compositing/compositor_layer.rs
+++ b/components/compositing/compositor_layer.rs
@@ -10,7 +10,7 @@ use azure::azure_hl;
use geom::length::Length;
use geom::matrix::identity;
use geom::point::{Point2D, TypedPoint2D};
-use geom::size::{Size2D, TypedSize2D};
+use geom::size::TypedSize2D;
use geom::rect::Rect;
use gfx::paint_task::UnusedBufferMsg;
use layers::color::Color;
@@ -69,7 +69,7 @@ impl CompositorData {
}
pub trait CompositorLayer {
- fn update_layer_except_size(&self, layer_properties: LayerProperties);
+ fn update_layer_except_bounds(&self, layer_properties: LayerProperties);
fn update_layer(&self, layer_properties: LayerProperties);
@@ -166,7 +166,7 @@ pub enum ScrollEventResult {
}
impl CompositorLayer for Layer<CompositorData> {
- fn update_layer_except_size(&self, layer_properties: LayerProperties) {
+ fn update_layer_except_bounds(&self, layer_properties: LayerProperties) {
self.extra_data.borrow_mut().epoch = layer_properties.epoch;
self.extra_data.borrow_mut().scroll_policy = layer_properties.scroll_policy;
@@ -176,12 +176,12 @@ impl CompositorLayer for Layer<CompositorData> {
}
fn update_layer(&self, layer_properties: LayerProperties) {
- self.resize(Size2D::from_untyped(&layer_properties.rect.size));
+ *self.bounds.borrow_mut() = Rect::from_untyped(&layer_properties.rect);
// 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.
self.handle_scroll_event(TypedPoint2D(0f32, 0f32), TypedPoint2D(-1f32, -1f32));
- self.update_layer_except_size(layer_properties);
+ self.update_layer_except_bounds(layer_properties);
}
// Add LayerBuffers to the specified layer. Returns the layer buffer set back if the layer that