mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
Rename PushScrollRoot and remove PopScrollRoot
PopScrollRoot was unused and PushScrollRoot no longer pushes a scroll root, but defines a new one.
This commit is contained in:
parent
8187969c39
commit
83ac0a8505
3 changed files with 14 additions and 22 deletions
|
@ -86,7 +86,7 @@ impl DisplayList {
|
||||||
scroll_offsets,
|
scroll_offsets,
|
||||||
result);
|
result);
|
||||||
}
|
}
|
||||||
&DisplayItem::PushScrollRoot(ref item) => {
|
&DisplayItem::DefineClip(ref item) => {
|
||||||
let mut point = *translated_point;
|
let mut point = *translated_point;
|
||||||
DisplayList::scroll_root(&item.scroll_root,
|
DisplayList::scroll_root(&item.scroll_root,
|
||||||
&mut point,
|
&mut point,
|
||||||
|
@ -149,7 +149,7 @@ impl DisplayList {
|
||||||
scroll_offsets,
|
scroll_offsets,
|
||||||
result);
|
result);
|
||||||
}
|
}
|
||||||
&DisplayItem::PushScrollRoot(ref item) => {
|
&DisplayItem::DefineClip(ref item) => {
|
||||||
let mut point = *translated_point;
|
let mut point = *translated_point;
|
||||||
DisplayList::scroll_root(&item.scroll_root,
|
DisplayList::scroll_root(&item.scroll_root,
|
||||||
&mut point,
|
&mut point,
|
||||||
|
@ -160,7 +160,7 @@ impl DisplayList {
|
||||||
scroll_offsets,
|
scroll_offsets,
|
||||||
result);
|
result);
|
||||||
}
|
}
|
||||||
&DisplayItem::PopStackingContext(_) | &DisplayItem::PopScrollRoot(_) => return,
|
&DisplayItem::PopStackingContext(_) => return,
|
||||||
_ => {
|
_ => {
|
||||||
if let Some(meta) = item.hit_test(*translated_point) {
|
if let Some(meta) = item.hit_test(*translated_point) {
|
||||||
result.push(meta);
|
result.push(meta);
|
||||||
|
@ -510,8 +510,8 @@ pub struct ScrollRoot {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ScrollRoot {
|
impl ScrollRoot {
|
||||||
pub fn to_push(&self, pipeline_id: PipelineId) -> DisplayItem {
|
pub fn to_define_item(&self, pipeline_id: PipelineId) -> DisplayItem {
|
||||||
DisplayItem::PushScrollRoot(box PushScrollRootItem {
|
DisplayItem::DefineClip(box DefineClipItem {
|
||||||
base: BaseDisplayItem::empty(pipeline_id),
|
base: BaseDisplayItem::empty(pipeline_id),
|
||||||
scroll_root: self.clone(),
|
scroll_root: self.clone(),
|
||||||
})
|
})
|
||||||
|
@ -534,8 +534,7 @@ pub enum DisplayItem {
|
||||||
Iframe(Box<IframeDisplayItem>),
|
Iframe(Box<IframeDisplayItem>),
|
||||||
PushStackingContext(Box<PushStackingContextItem>),
|
PushStackingContext(Box<PushStackingContextItem>),
|
||||||
PopStackingContext(Box<PopStackingContextItem>),
|
PopStackingContext(Box<PopStackingContextItem>),
|
||||||
PushScrollRoot(Box<PushScrollRootItem>),
|
DefineClip(Box<DefineClipItem>),
|
||||||
PopScrollRoot(Box<BaseDisplayItem>),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Information common to all display items.
|
/// Information common to all display items.
|
||||||
|
@ -1123,7 +1122,7 @@ pub struct PopStackingContextItem {
|
||||||
|
|
||||||
/// Starts a group of items inside a particular scroll root.
|
/// Starts a group of items inside a particular scroll root.
|
||||||
#[derive(Clone, HeapSizeOf, Deserialize, Serialize)]
|
#[derive(Clone, HeapSizeOf, Deserialize, Serialize)]
|
||||||
pub struct PushScrollRootItem {
|
pub struct DefineClipItem {
|
||||||
/// Fields common to all display items.
|
/// Fields common to all display items.
|
||||||
pub base: BaseDisplayItem,
|
pub base: BaseDisplayItem,
|
||||||
|
|
||||||
|
@ -1159,8 +1158,7 @@ impl DisplayItem {
|
||||||
DisplayItem::Iframe(ref iframe) => &iframe.base,
|
DisplayItem::Iframe(ref iframe) => &iframe.base,
|
||||||
DisplayItem::PushStackingContext(ref stacking_context) => &stacking_context.base,
|
DisplayItem::PushStackingContext(ref stacking_context) => &stacking_context.base,
|
||||||
DisplayItem::PopStackingContext(ref item) => &item.base,
|
DisplayItem::PopStackingContext(ref item) => &item.base,
|
||||||
DisplayItem::PushScrollRoot(ref item) => &item.base,
|
DisplayItem::DefineClip(ref item) => &item.base,
|
||||||
DisplayItem::PopScrollRoot(ref base) => &base,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1246,12 +1244,8 @@ impl fmt::Debug for DisplayItem {
|
||||||
return write!(f, "PopStackingContext({:?}", item.stacking_context_id);
|
return write!(f, "PopStackingContext({:?}", item.stacking_context_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
if let DisplayItem::PushScrollRoot(ref item) = *self {
|
if let DisplayItem::DefineClip(ref item) = *self {
|
||||||
return write!(f, "PushScrollRoot({:?}", item.scroll_root);
|
return write!(f, "DefineClip({:?}", item.scroll_root);
|
||||||
}
|
|
||||||
|
|
||||||
if let DisplayItem::PopScrollRoot(_) = *self {
|
|
||||||
return write!(f, "PopScrollRoot");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
write!(f, "{} @ {:?} {:?}",
|
write!(f, "{} @ {:?} {:?}",
|
||||||
|
@ -1277,8 +1271,7 @@ impl fmt::Debug for DisplayItem {
|
||||||
DisplayItem::Iframe(_) => "Iframe".to_owned(),
|
DisplayItem::Iframe(_) => "Iframe".to_owned(),
|
||||||
DisplayItem::PushStackingContext(_) |
|
DisplayItem::PushStackingContext(_) |
|
||||||
DisplayItem::PopStackingContext(_) |
|
DisplayItem::PopStackingContext(_) |
|
||||||
DisplayItem::PushScrollRoot(_) |
|
DisplayItem::DefineClip(_) => "".to_owned(),
|
||||||
DisplayItem::PopScrollRoot(_) => "".to_owned(),
|
|
||||||
},
|
},
|
||||||
self.bounds(),
|
self.bounds(),
|
||||||
self.base().clip
|
self.base().clip
|
||||||
|
|
|
@ -289,12 +289,12 @@ impl<'a> DisplayListBuildState<'a> {
|
||||||
|
|
||||||
let pipeline_id = self.layout_context.id;
|
let pipeline_id = self.layout_context.id;
|
||||||
if stacking_context.context_type != StackingContextType::Real {
|
if stacking_context.context_type != StackingContextType::Real {
|
||||||
list.extend(info.scroll_roots.into_iter().map(|root| root.to_push(pipeline_id)));
|
list.extend(info.scroll_roots.into_iter().map(|root| root.to_define_item(pipeline_id)));
|
||||||
self.to_display_list_for_items(list, child_items, info.children);
|
self.to_display_list_for_items(list, child_items, info.children);
|
||||||
} else {
|
} else {
|
||||||
let (push_item, pop_item) = stacking_context.to_display_list_items(pipeline_id);
|
let (push_item, pop_item) = stacking_context.to_display_list_items(pipeline_id);
|
||||||
list.push(push_item);
|
list.push(push_item);
|
||||||
list.extend(info.scroll_roots.into_iter().map(|root| root.to_push(pipeline_id)));
|
list.extend(info.scroll_roots.into_iter().map(|root| root.to_define_item(pipeline_id)));
|
||||||
self.to_display_list_for_items(list, child_items, info.children);
|
self.to_display_list_for_items(list, child_items, info.children);
|
||||||
list.push(pop_item);
|
list.push(pop_item);
|
||||||
}
|
}
|
||||||
|
|
|
@ -449,7 +449,7 @@ impl WebRenderDisplayItemConverter for DisplayItem {
|
||||||
stacking_context.filters.to_filter_ops());
|
stacking_context.filters.to_filter_ops());
|
||||||
}
|
}
|
||||||
DisplayItem::PopStackingContext(_) => builder.pop_stacking_context(),
|
DisplayItem::PopStackingContext(_) => builder.pop_stacking_context(),
|
||||||
DisplayItem::PushScrollRoot(ref item) => {
|
DisplayItem::DefineClip(ref item) => {
|
||||||
builder.push_clip_id(item.scroll_root.parent_id);
|
builder.push_clip_id(item.scroll_root.parent_id);
|
||||||
|
|
||||||
let our_id = item.scroll_root.id;
|
let our_id = item.scroll_root.id;
|
||||||
|
@ -460,7 +460,6 @@ impl WebRenderDisplayItemConverter for DisplayItem {
|
||||||
|
|
||||||
builder.pop_clip_id();
|
builder.pop_clip_id();
|
||||||
}
|
}
|
||||||
DisplayItem::PopScrollRoot(_) => {} //builder.pop_scroll_layer(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue