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
+354
−217
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.
Loading status checks…
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.
- Loading branch information
commit 8de55695e48bf894aa64f85afb532ae5bf117455
| @@ -37,7 +37,12 @@ type ItemTag = (u64, u16); | ||
| type HitInfo = Option<ItemTag>; | ||
|
|
||
| pub struct DisplayListBuilder<'a> { | ||
| /// The current SpatialId and ClipId information for this `DisplayListBuilder`. | ||
| current_space_and_clip: wr::SpaceAndClipInfo, | ||
|
|
||
| /// The id of the nearest ancestor reference frame for this `DisplayListBuilder`. | ||
| nearest_reference_frame: wr::SpatialId, | ||
mrobinson
Author
Member
|
||
|
|
||
| pub context: &'a LayoutContext<'a>, | ||
| pub wr: wr::DisplayListBuilder, | ||
|
|
||
| @@ -56,6 +61,7 @@ impl<'a> DisplayListBuilder<'a> { | ||
| ) -> Self { | ||
| Self { | ||
| current_space_and_clip: wr::SpaceAndClipInfo::root_scroll(pipeline_id), | ||
| nearest_reference_frame: wr::SpatialId::root_reference_frame(pipeline_id), | ||
| is_contentful: false, | ||
| context, | ||
| wr: wr::DisplayListBuilder::new(pipeline_id, viewport_size), | ||
| @@ -68,9 +74,14 @@ impl<'a> DisplayListBuilder<'a> { | ||
| } | ||
|
|
||
| fn clipping_and_scrolling_scope<R>(&mut self, f: impl FnOnce(&mut Self) -> R) -> R { | ||
| let previous = self.current_space_and_clip; | ||
| let previous_space_and_clip = self.current_space_and_clip; | ||
| let previous_nearest_reference_frame = self.nearest_reference_frame; | ||
|
|
||
| let result = f(self); | ||
| self.current_space_and_clip = previous; | ||
|
|
||
| self.current_space_and_clip = previous_space_and_clip; | ||
| self.nearest_reference_frame = previous_nearest_reference_frame; | ||
|
|
||
| result | ||
| } | ||
| } | ||
Oops, something went wrong.
ProTip!
Use n and p to navigate between commits in a pull request.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
What is a reference frame defined as? A quick Google search doesn't pull up that term in a CSS spec.