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
Next

layout: Remove the now-useless `dirty` field from the layout context.

At this point the only thing it does is to try to avoid adding display
items that are outside the root scrollable area, which is both wrong
(since it's incompatible with having scrollable areas outside the root)
and is useless (because we have displayports now).
  • Loading branch information
pcwalton committed Aug 11, 2015
commit 11822f3eb14ab3622f54652c77f2f3742d733961
@@ -109,9 +109,6 @@ pub struct SharedLayoutContext {
/// The URL.
pub url: Url,

/// The dirty rectangle, used during display list building.
pub dirty: Rect<Au>,

/// Starts at zero, and increased by one every time a layout completes.
/// This can be used to easily check for invalid stale data.
pub generation: u32,
@@ -900,11 +900,9 @@ impl FragmentDisplayListBuilding for Fragment {
relative_containing_block_mode,
CoordinateSystem::Own);

debug!("Fragment::build_display_list at rel={:?}, abs={:?}, dirty={:?}, flow origin={:?}: \
{:?}",
debug!("Fragment::build_display_list at rel={:?}, abs={:?}, flow origin={:?}: {:?}",
self.border_box,
stacking_relative_border_box,
layout_context.shared.dirty,
stacking_relative_flow_origin,
self);

@@ -913,11 +911,6 @@ impl FragmentDisplayListBuilding for Fragment {
return
}

if !stacking_relative_border_box.intersects(&layout_context.shared.dirty) {
debug!("Fragment::build_display_list: Did not intersect...");
return
}

// Calculate the clip rect. If there's nothing to render at all, don't even construct
// display list items.
let clip = self.calculate_style_specified_clip(clip, &stacking_relative_border_box);
@@ -119,9 +119,6 @@ pub struct LayoutTaskData {
/// The workers that we use for parallel operation.
pub parallel_traversal: Option<WorkQueue<SharedLayoutContext, WorkQueueData>>,

/// The dirty rect. Used during display list construction.
pub dirty: Rect<Au>,

/// Starts at zero, and increased by one every time a layout completes.
/// This can be used to easily check for invalid stale data.
pub generation: u32,
@@ -377,7 +374,6 @@ impl LayoutTask {
stacking_context: None,
stylist: stylist,
parallel_traversal: parallel_traversal,
dirty: Rect::zero(),
generation: 0,
content_box_response: Rect::zero(),
content_boxes_response: Vec::new(),
@@ -421,7 +417,6 @@ impl LayoutTask {
stylist: &*rw_data.stylist,
url: (*url).clone(),
reflow_root: reflow_root.map(|node| node.opaque()),
dirty: Rect::zero(),
visible_rects: rw_data.visible_rects.clone(),
generation: rw_data.generation,
new_animations_sender: rw_data.new_animations_sender.clone(),
@@ -1005,9 +1000,6 @@ impl LayoutTask {
self.profiler_metadata(),
self.time_profiler_chan.clone(),
|| {
shared_layout_context.dirty =
flow::base(&**layout_root).position.to_physical(writing_mode,
rw_data.screen_size);
flow::mut_base(&mut **layout_root).stacking_relative_position =
LogicalPoint::zero(writing_mode).to_physical(writing_mode,
rw_data.screen_size);
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.