mirror of
https://github.com/servo/servo.git
synced 2025-08-02 20:20:14 +01:00
Mix stacking contexts into the positioned content list
Sometimes positioned content needs to be layered on top of stacking contexts. The layer synthesis code can do this, but the current design prevents it because stacking contexts are stored in a separate struct member. In order to preserve tree order, mix stacking contexts into the positioned content list, by adding a new StackingContextClass DisplayItem. Such items do not have a base DisplayItem. In some ways this simplifies the code, because we no longer have to have a separate code path in the StackingContextLayerCreator. Fixes #7779. Fixes #7983. Fixes #8122. Fixes #8310.
This commit is contained in:
parent
5c11c88e92
commit
c1a38e240a
13 changed files with 330 additions and 295 deletions
|
@ -81,7 +81,8 @@ impl DisplayListBuildingResult {
|
|||
match *self {
|
||||
DisplayListBuildingResult::None => return,
|
||||
DisplayListBuildingResult::StackingContext(ref mut stacking_context) => {
|
||||
display_list.children.push_back((*stacking_context).clone())
|
||||
display_list.positioned_content.push_back(
|
||||
DisplayItem::StackingContextClass((*stacking_context).clone()))
|
||||
}
|
||||
DisplayListBuildingResult::Normal(ref mut source_display_list) => {
|
||||
display_list.append_from(&mut **source_display_list)
|
||||
|
@ -1691,11 +1692,12 @@ impl BlockFlowDisplayListBuilding for BlockFlow {
|
|||
|
||||
let stacking_context = match outer_display_list_for_overflow_scroll {
|
||||
Some(mut outer_display_list) => {
|
||||
outer_display_list.children.push_back(self.fragment.create_stacking_context(
|
||||
&self.base,
|
||||
display_list,
|
||||
scroll_policy,
|
||||
StackingContextCreationMode::InnerScrollWrapper));
|
||||
outer_display_list.positioned_content.push_back(
|
||||
DisplayItem::StackingContextClass(self.fragment.create_stacking_context(
|
||||
&self.base,
|
||||
display_list,
|
||||
scroll_policy,
|
||||
StackingContextCreationMode::InnerScrollWrapper)));
|
||||
self.fragment.create_stacking_context(
|
||||
&self.base,
|
||||
outer_display_list,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue