Give root layers a scrollable policy

This allows iframe layers to move properly when their parents scroll
and is necessary to properly track their masking rects as their
children move and to draw their backgrounds in the proper position.
This commit is contained in:
Martin Robinson 2014-09-22 16:32:26 -07:00
parent 2724c3c6bb
commit 6bbde703c1
2 changed files with 4 additions and 3 deletions

View file

@ -35,8 +35,8 @@ use layers::rendergl::RenderContext;
use layers::scene::Scene;
use opengles::gl2;
use png;
use servo_msg::compositor_msg::{Blank, Epoch, FixedPosition, FinishedLoading, IdleRenderState};
use servo_msg::compositor_msg::{LayerId, ReadyState, RenderingRenderState, RenderState};
use servo_msg::compositor_msg::{Blank, Epoch, FinishedLoading, IdleRenderState, LayerId};
use servo_msg::compositor_msg::{ReadyState, RenderingRenderState, RenderState, Scrollable};
use servo_msg::constellation_msg::{ConstellationChan, ExitMsg, LoadUrlMsg, NavigateMsg};
use servo_msg::constellation_msg::{PipelineId, ResizedWindowMsg, WindowSizeData};
use servo_msg::constellation_msg;
@ -433,7 +433,7 @@ impl IOCompositor {
id: LayerId::null(),
rect: Rect::zero(),
background_color: azure_hl::Color::new(0., 0., 0., 0.),
scroll_policy: FixedPosition,
scroll_policy: Scrollable,
};
let root_layer = CompositorData::new_layer(frame_tree.pipeline.clone(),
layer_properties,

View file

@ -74,6 +74,7 @@ impl CompositorData {
pub fn update_layer(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;
let size: TypedSize2D<DevicePixel, f32> = Size2D::from_untyped(&layer_properties.rect.size);