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

Have transforms and filters be CBs for all descendants in layout_2020 #25862

Merged
merged 1 commit into from Mar 2, 2020

Conversation

@mrobinson
Copy link
Member

mrobinson commented Feb 28, 2020

This is a feature that was never properly implemented in the previous
layout system. We still need to preserve their in-tree order in the
display list though.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #___ (GitHub issue number if applicable)
  • There are tests for these changes OR
  • These changes do not require tests because ___
Copy link
Contributor

pcwalton left a comment

This looks good, modulo a few nits, but I'd like @nox to glance at it before merging.

current_space_and_clip: wr::SpaceAndClipInfo,

/// The id of the nearest ancestor reference frame for this `DisplayListBuilder`.
nearest_reference_frame: wr::SpatialId,

This comment has been minimized.

Copy link
@pcwalton

pcwalton Feb 28, 2020

Contributor

What is a reference frame defined as? A quick Google search doesn't pull up that term in a CSS spec.

This comment has been minimized.

Copy link
@mrobinson

mrobinson Mar 2, 2020

Author Member

The reference frame is a concept from WebRender. Essentially it is the thing that does transformations and starts new coordinate systems.

// https://www.w3.org/TR/css-transforms-1/#containing-block-for-all-descendants
//
// We use the abbreviation `cbfad` here only because `containing block for all descendants`
// is so unwieldy.

This comment has been minimized.

Copy link
@pcwalton

pcwalton Feb 28, 2020

Contributor

😆

This comment has been minimized.

Copy link
@nox

nox Feb 28, 2020

Member

Personally I think containing_block_for_all_descendants is way better, and not even the longest identifier in layout 2020.

This comment has been minimized.

Copy link
@nox

nox Feb 28, 2020

Member

We have a next_in_flow_margin_collapses_with_parent_start_margin.

This comment has been minimized.

Copy link
@mrobinson

mrobinson Mar 2, 2020

Author Member

Okay. I've changed this to be containing_block_for_all_descendants everywhere.

cbis - start - pb.inline_sum() - margin.inline_sum()
},
Anchor::End(end) => cbis - end - pb.inline_sum() - margin.inline_sum(),
let for_cbfad = for_nearest_cbfad;

This comment has been minimized.

Copy link
@pcwalton

pcwalton Feb 28, 2020

Contributor

This isn't changed other than the replacement of PositioningContext::for_positioned with PositioningContext::create_and_layout_positioned, right?

This comment has been minimized.

Copy link
@mrobinson

mrobinson Mar 2, 2020

Author Member

That's correct. Unfortunately this caused a reflow of the entire block.

_ => return self.get_position().z_index.integer_or(0),
}

0

This comment has been minimized.

Copy link
@pcwalton

pcwalton Feb 28, 2020

Contributor

nit: would probably be simpler and more idiomatic to simply write:

match self.get_box().position {
    ComputedPosition::Static => 0,
    _ => self.get_position().z_index.integer_or(0),
}

or even

if self.get_box().position == ComputedPosition::Static {
    0
} else {
    self.get_position().z_index.integer_or(0)
}

This comment has been minimized.

Copy link
@mrobinson

mrobinson Mar 2, 2020

Author Member

Fixed!

!self.get_box().transform.0.is_empty() || self.get_box().perspective != Perspective::None
}

/// Get the effective z-index of this fragment. Z-indices only apply to positioned element

This comment has been minimized.

Copy link
@pcwalton

pcwalton Feb 28, 2020

Contributor

uber-nit: should be "positioned elements"

This comment has been minimized.

Copy link
@mrobinson

mrobinson Mar 2, 2020

Author Member

Fixed this as well. Thanks for pointing it out.

@mrobinson mrobinson force-pushed the mrobinson:transforms-containing-block branch from d1b1c90 to 4ec2d6a Mar 2, 2020
@mrobinson
Copy link
Member Author

mrobinson commented Mar 2, 2020

Okay. Thanks for the reviews. There's a new version of the branch if you'd all like to take a look.

@nox
Copy link
Member

nox commented Mar 2, 2020

@bors-servo r=pcwalton,nox

@bors-servo
Copy link
Contributor

bors-servo commented Mar 2, 2020

📌 Commit 4ec2d6a has been approved by pcwalton,nox

@bors-servo
Copy link
Contributor

bors-servo commented Mar 2, 2020

Testing commit 4ec2d6a with merge bf301b2...

bors-servo added a commit that referenced this pull request Mar 2, 2020
…ton,nox

Have transforms and filters be CBs for all descendants in layout_2020

This is a feature that was never properly implemented in the previous
layout system. We still need to preserve their in-tree order in the
display list though.

<!-- 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: -->
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

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

bors-servo commented Mar 2, 2020

💔 Test failed - status-taskcluster

This is a feature that was never properly implemented in the previous
layout system. We still need to preserve their in-tree order in the
display list though.
@mrobinson mrobinson force-pushed the mrobinson:transforms-containing-block branch from 4ec2d6a to 8de5569 Mar 2, 2020
@mrobinson
Copy link
Member Author

mrobinson commented Mar 2, 2020

@bors-servo r=pcwalton,nox

The earlier version of the branch had added a bogus assertion. I've removed this.

@bors-servo
Copy link
Contributor

bors-servo commented Mar 2, 2020

📌 Commit 8de5569 has been approved by pcwalton,nox

@bors-servo
Copy link
Contributor

bors-servo commented Mar 2, 2020

Testing commit 8de5569 with merge b340673...

bors-servo added a commit that referenced this pull request Mar 2, 2020
…ton,nox

Have transforms and filters be CBs for all descendants in layout_2020

This is a feature that was never properly implemented in the previous
layout system. We still need to preserve their in-tree order in the
display list though.

<!-- 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: -->
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

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

bors-servo commented Mar 2, 2020

💔 Test failed - status-taskcluster

@mrobinson
Copy link
Member Author

mrobinson commented Mar 2, 2020

@bors-servo
Copy link
Contributor

bors-servo commented Mar 2, 2020

Testing commit 8de5569 with merge 19323e8...

@bors-servo
Copy link
Contributor

bors-servo commented Mar 2, 2020

☀️ Test successful - status-taskcluster
Approved by: pcwalton,nox
Pushing 19323e8 to master...

@bors-servo bors-servo merged commit 19323e8 into servo:master Mar 2, 2020
2 checks passed
2 checks passed
Community-TC (pull_request) TaskGroup: success
Details
homu Test successful
Details
@mrobinson mrobinson deleted the mrobinson:transforms-containing-block branch Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants
You can’t perform that action at this time.