Auto merge of #13820 - mrobinson:remove-nesting, r=glennw

Remove the concept of nested stacking contexts from display list builder

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because they should not change behavior.

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

With the removal of the legacy rendering path, we don't need to worry
about nested stacking contexts. This change just pushes the
complication to the WebRender conversion step, but a later change will
remove the concept from WebRender as well.

This also helps to prepare for the introduction of ids for particular
scrolling regions, an integral part of multiple ScrollLayers per block.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13820)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-10-19 12:54:40 -05:00 committed by GitHub
commit e667e62f0c
4 changed files with 105 additions and 109 deletions

View file

@ -589,14 +589,14 @@ pub struct StackingContext {
/// Whether this stacking context creates a new 3d rendering context.
pub establishes_3d_context: bool,
/// Whether this stacking context scrolls its overflow area.
pub scrolls_overflow_area: bool,
/// The layer info for this stacking context, if there is any.
pub layer_info: Option<LayerInfo>,
/// Children of this StackingContext.
pub children: Vec<StackingContext>,
/// If this StackingContext scrolls its overflow area, this will contain the id.
pub overflow_scroll_id: Option<StackingContextId>,
}
impl StackingContext {
@ -612,8 +612,8 @@ impl StackingContext {
transform: Matrix4D<f32>,
perspective: Matrix4D<f32>,
establishes_3d_context: bool,
scrolls_overflow_area: bool,
layer_info: Option<LayerInfo>)
layer_info: Option<LayerInfo>,
scroll_id: Option<StackingContextId>)
-> StackingContext {
StackingContext {
id: id,
@ -626,9 +626,9 @@ impl StackingContext {
transform: transform,
perspective: perspective,
establishes_3d_context: establishes_3d_context,
scrolls_overflow_area: scrolls_overflow_area,
layer_info: layer_info,
children: Vec::new(),
overflow_scroll_id: scroll_id,
}
}
@ -648,13 +648,10 @@ impl StackingContext {
fn update_overflow_for_all_children(&mut self) {
for child in self.children.iter() {
if self.context_type == StackingContextType::Real &&
child.context_type == StackingContextType::Real &&
!self.scrolls_overflow_area {
child.context_type == StackingContextType::Real {
// This child might be transformed, so we need to take into account
// its transformed overflow rect too, but at the correct position.
let overflow =
child.overflow_rect_in_parent_space();
let overflow = child.overflow_rect_in_parent_space();
self.overflow = self.overflow.union(&overflow);
}
}
@ -740,7 +737,7 @@ impl fmt::Debug for StackingContext {
"Pseudo-StackingContext"
};
let scrollable_string = if self.scrolls_overflow_area {
let scrollable_string = if self.overflow_scroll_id.is_some() {
" (scrolls overflow area)"
} else {
""