Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd support for overflow:scroll and overflow:hidden to layout_2020 #25645
Conversation
highfive
commented
Jan 30, 2020
|
Heads up! This PR modifies the following files:
|
|
r? @SimonSapin |
| @@ -180,10 +178,33 @@ impl BoxFragment { | |||
| border, | |||
| margin, | |||
| block_margins_collapsed_with_children, | |||
| scrollable_overflow, | |||
| scrollable_overflow: PhysicalRect::zero(), | |||
This comment has been minimized.
This comment has been minimized.
SimonSapin
Jan 30, 2020
Member
I’m not a fan of initializing here with known-incorrect data and rely on calculate_scrollable_overflow being called later at some point for its side effect. Why is that computation delayed? If it needs to be, what do you think of making this an Option and calling unwrap when the data is used, so we don’t accidentally use a non-initialized zero?
This comment has been minimized.
This comment has been minimized.
mrobinson
Jan 30, 2020
Author
Member
The issue is that the BoxFragment is created and then positioned later. Does it make sense to modify layout_block_level_children to create and place BoxFragments at the same time?
This comment has been minimized.
This comment has been minimized.
SimonSapin
Jan 30, 2020
Member
Creation is separated from placement in layout_block_level_children so that the former (including recursion in a subtree) can be parallelized across siblings, while the latter needs to be sequential.
What if we defined BoxFragment::scrollable_overflow to be in a coordinate system where self.content_rect.start_corner is the origin, and the parent is responsible for doing the translation?
This comment has been minimized.
This comment has been minimized.
mrobinson
Jan 31, 2020
Author
Member
I have done something like this in the latest branch. Now the final position of the scrollable overflow is calculated when it is used. This shouldn't have a large overhead. I've kept the calculation inside of the child since it knows about its position when the calculation is done.
| let overflow_x = self.fragment.style.get_box().overflow_x; | ||
| let overflow_y = self.fragment.style.get_box().overflow_y; | ||
| let original_scroll_and_clip_info = builder.current_space_and_clip; | ||
| if overflow_x != ComputedOverflow::Visible || overflow_y != ComputedOverflow::Visible { |
This comment has been minimized.
This comment has been minimized.
SimonSapin
Jan 30, 2020
Member
This seems to treat all values other than visible the same. Landing things incrementally is fine, but what’s the plan for fixing that later?
This comment has been minimized.
This comment has been minimized.
mrobinson
Jan 30, 2020
Author
Member
The only difference here, I think, is with Overflow::Auto. As far as correctness goes, I think the unnecessary creation of the scroll frame doesn't affect it. Overflow::Hidden is handled below.
8f76b4f
to
d8cdd90
|
Looks like this needs some code formatting changes, see "Details" near "checks have failed to find the CI log. You can check the same locally by running (I have Feel free to |
d8cdd90
to
e1027cd
|
@bors-servo r=SimonSapin |
|
|
Add support for overflow:scroll and overflow:hidden to layout_2020 This adds clipping and interactive scrolling support, but scrolling from script is still not functional. <!-- 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. -->
|
|
|
This adds clipping and interactive scrolling support, but scrolling from script is still not functional.
e1027cd
to
7a5a320
Add support for overflow:scroll and overflow:hidden to layout_2020 This adds clipping and interactive scrolling support, but scrolling from script is still not functional. <!-- 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 retry |
Add support for overflow:scroll and overflow:hidden to layout_2020 This adds clipping and interactive scrolling support, but scrolling from script is still not functional. <!-- 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 retry |
Add support for overflow:scroll and overflow:hidden to layout_2020 This adds clipping and interactive scrolling support, but scrolling from script is still not functional. <!-- 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 retry |
Add support for overflow:scroll and overflow:hidden to layout_2020 This adds clipping and interactive scrolling support, but scrolling from script is still not functional. <!-- 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. -->
|
|
mrobinson commentedJan 30, 2020
This adds clipping and interactive scrolling support, but scrolling from
script is still not functional.
./mach build -ddoes not report any errors./mach test-tidydoes not report any errors