Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

layout: Implement basic `overflow: scroll` functionality. #7090

Merged
merged 6 commits into from Aug 11, 2015

layout: Carry out some minor style cleanups.

  • Loading branch information
pcwalton committed Aug 11, 2015
commit bf26a2373f297f4b34347c0c12e406361dfff7f3
@@ -255,13 +255,13 @@ impl<Window: WindowMethods> IOCompositor<Window> {
time_profiler_chan: time::ProfilerChan,
mem_profiler_chan: mem::ProfilerChan)
-> IOCompositor<Window> {

// Register this thread as a memory reporter, via its own channel.
let (reporter_sender, reporter_receiver) = ipc::channel().unwrap();
let compositor_proxy_for_memory_reporter = sender.clone_compositor_proxy();
ROUTER.add_route(reporter_receiver.to_opaque(), box move |reporter_request| {
let reporter_request: ReporterRequest = reporter_request.to().unwrap();
compositor_proxy_for_memory_reporter.send(Msg::CollectMemoryReports(reporter_request.reports_channel));
compositor_proxy_for_memory_reporter.send(Msg::CollectMemoryReports(
reporter_request.reports_channel));
});
let reporter = Reporter(reporter_sender);
mem_profiler_chan.send(mem::ProfilerMsg::RegisterReporter(reporter_name(), reporter));
@@ -376,7 +376,8 @@ impl<Window: WindowMethods> IOCompositor<Window> {
self.get_title_for_main_frame();
}

(Msg::InitializeLayersForPipeline(pipeline_id, epoch, properties), ShutdownState::NotShuttingDown) => {
(Msg::InitializeLayersForPipeline(pipeline_id, epoch, properties),
ShutdownState::NotShuttingDown) => {
self.get_or_create_pipeline_details(pipeline_id).current_epoch = epoch;
for (index, layer_properties) in properties.iter().enumerate() {
if index == 0 {
@@ -692,7 +693,9 @@ impl<Window: WindowMethods> IOCompositor<Window> {
}
}

fn create_or_update_base_layer(&mut self, pipeline_id: PipelineId, layer_properties: LayerProperties) {
fn create_or_update_base_layer(&mut self,
pipeline_id: PipelineId,
layer_properties: LayerProperties) {
debug_assert!(layer_properties.parent_id.is_none());

let root_layer = match self.find_pipeline_root_layer(pipeline_id) {
@@ -334,7 +334,9 @@ impl<C> PaintTask<C> where C: PaintListener + Send + 'static {
&Matrix4::identity(),
&Matrix4::identity(),
None);
self.compositor.initialize_layers_for_pipeline(self.id, properties, self.current_epoch.unwrap());
self.compositor.initialize_layers_for_pipeline(self.id,
properties,
self.current_epoch.unwrap());

fn build(properties: &mut Vec<LayerProperties>,
stacking_context: &StackingContext,
@@ -477,7 +477,7 @@ impl FragmentDisplayListBuilding for Fragment {
(-border.left, -border.top)
}
background_origin::T::content_box => {
let border_padding = (self.border_padding).to_physical(self.style.writing_mode);
let border_padding = self.border_padding.to_physical(self.style.writing_mode);
(border_padding.left - border.left, border_padding.top - border.top)
}
};
@@ -676,10 +676,11 @@ impl FragmentDisplayListBuilding for Fragment {
clip: &ClippingRegion) {
// NB: According to CSS-BACKGROUNDS, box shadows render in *reverse* order (front to back).
for box_shadow in style.get_effects().box_shadow.0.iter().rev() {
let bounds = shadow_bounds(&absolute_bounds.translate(&Point2D::new(box_shadow.offset_x,
box_shadow.offset_y)),
box_shadow.blur_radius,
box_shadow.spread_radius);
let bounds =
shadow_bounds(&absolute_bounds.translate(&Point2D::new(box_shadow.offset_x,
box_shadow.offset_y)),
box_shadow.blur_radius,
box_shadow.spread_radius);
list.push(DisplayItem::BoxShadowClass(box BoxShadowDisplayItem {
base: BaseDisplayItem::new(bounds,
DisplayItemMetadata::new(self.node,
@@ -1557,7 +1558,9 @@ impl BlockFlowDisplayListBuilding for BlockFlow {
ScrollPolicy::Scrollable
};

let paint_layer = PaintLayer::new(self.layer_id(0), color::transparent(), scroll_policy);
let paint_layer = PaintLayer::new(self.layer_id(0),
color::transparent(),
scroll_policy);
let layer = StackingContextLayer::Existing(paint_layer);
let stacking_context = self.fragment.create_stacking_context(
&self.base,
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.