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

Mix stacking contexts into the positioned content list #8266

Merged
merged 1 commit into from
Nov 4, 2015

Conversation

mrobinson
Copy link
Member

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.

Review on Reviewable

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Oct 30, 2015
@mrobinson
Copy link
Member Author

@pcwalton r?

This is the main prerequisite for eliminating LAYERS_NEEDED_FOR_DESCENDANTS.

@@ -206,23 +204,31 @@ impl DisplayList {
/// inefficient and should only be used for debugging.
pub fn all_display_items(&self) -> Vec<DisplayItem> {
let mut result = Vec::new();
fn add_all_display_items_for_item(result: &mut Vec<DisplayItem>, item: &DisplayItem) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just call this flatten? That's the terminology WR uses for a similar operation.

@mrobinson
Copy link
Member Author

@pcwalton Thanks, as always, for the review comments. I think I've made all the changes you suggested in the latest version of the branch. Do you see any other issues here?

gilles-leblanc referenced this pull request in gilles-leblanc/servo Nov 3, 2015
Adding overflow:hidden to an absolute positioned div will change it's
stacking order.

referencing servo#8122
@paulrouget
Copy link
Contributor

Not sure if you want to address this issue in this PR or not, but for the record: #8310

@mrobinson
Copy link
Member Author

@paulrouget Thanks for finding that issue! I've fixed it in the latest version. I had omitted some code that was removed.

@pcwalton
Copy link
Contributor

pcwalton commented Nov 3, 2015

@bors-servo: r+

@bors-servo
Copy link
Contributor

📌 Commit 5b3e953 has been approved by pcwalton

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Nov 3, 2015
@pcwalton
Copy link
Contributor

pcwalton commented Nov 3, 2015

@bors-servo: r-

@mrobinson wants to add a test

@pcwalton
Copy link
Contributor

pcwalton commented Nov 3, 2015

@bors-servo: r+

@bors-servo
Copy link
Contributor

📌 Commit 5b3e953 has been approved by pcwalton

@bors-servo
Copy link
Contributor

⌛ Testing commit 5b3e953 with merge 61ef78e...

bors-servo pushed a commit that referenced this pull request Nov 3, 2015
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.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8266)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

💔 Test failed - linux-rel

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Nov 4, 2015
@mrobinson
Copy link
Member Author

Looks like some tests are now passing with this change. I'll update the branch and reupload.

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 servo#7779.
Fixes servo#7983.
Fixes servo#8122.
Fixes servo#8310.
@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-tests-failed The changes caused existing tests to fail. labels Nov 4, 2015
@mrobinson
Copy link
Member Author

@bors-servo: r=pcwalton

I confirmed with @pcwalton via IRC that he was okay with trying to land this again.

@bors-servo
Copy link
Contributor

📌 Commit c1a38e2 has been approved by pcwalton

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Nov 4, 2015
@bors-servo
Copy link
Contributor

⌛ Testing commit c1a38e2 with merge 86e3add...

bors-servo pushed a commit that referenced this pull request Nov 4, 2015
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.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8266)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

☀️ Test successful - android, gonk, linux-dev, linux-rel, mac-dev-ref-unit, mac-rel-css, mac-rel-wpt

@bors-servo bors-servo merged commit c1a38e2 into servo:master Nov 4, 2015
@mrobinson mrobinson deleted the stacking-context-mix branch November 5, 2015 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants