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 uplayout: Force reflow in the sequential fallback of block format context #16458
Conversation
|
@bors-servo try |
layout: Force reflow in the sequential fallback of block format context When reflowing a block format context during the inorder traversal, propagate restyle damage manually to its children since they were already reflowed. Also, test the border box to see if it can fit into floats according to CSS 2.1 § 9.5. Improves reddit. <!-- 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: --> - [ ] `./mach build -d` does not report any errors - [ ] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] 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 pull request is ready for review. r? @notriddle or @pcwalton |
|
@bors-servo try again |
layout: Force reflow in the sequential fallback of block format context When reflowing a block format context during the inorder traversal, propagate restyle damage manually to its children since they were already reflowed. Also, test the border box to see if it can fit into floats according to CSS 2.1 § 9.5. Improves reddit. --- <!-- 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 - [X] 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. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16458) <!-- Reviewable:end -->
|
|
| @@ -1491,7 +1491,7 @@ impl BlockFlow { | |||
| debug_assert!(!self.is_inline_flex_item()); | |||
|
|
|||
| // Compute the available space for us, based on the actual floats. | |||
| let rect = self.base.floats.available_rect(Au(0), | |||
This comment has been minimized.
This comment has been minimized.
emilio
Apr 16, 2017
Member
Just curious, is it this change or the force_reflow stuff what makes the new tests pass?
This comment has been minimized.
This comment has been minimized.
stshine
Apr 16, 2017
Author
Contributor
I'm pretty sure they are fixed by force reflow because all the blocks in these two tests have zero margins.
This comment has been minimized.
This comment has been minimized.
emilio
Apr 16, 2017
Member
Oh, right. Could we add a test that exercises this? Also, I've got another question, why only reflow and not also REPOSITION? There's a long time since I looked at this code, but seems that it could also be needed?
This comment has been minimized.
This comment has been minimized.
stshine
Apr 17, 2017
Author
Contributor
Whoops, didn't see you comment, Sure I can add a test that utilize both :) I'm not famillar with incremental layout infrastructure, but they are the only flags AssignISizes and AssignBSizes check, so if they were any problem please comment :)
This comment has been minimized.
This comment has been minimized.
emilio
Apr 17, 2017
Member
You're totally right. I have looked to the details now. we only use REPOSITION to handle absolute positioning, not all out-of-flows as I thought. Also, it's handled in a later phase, so no need to do it here.
|
There is a regression I may introduce in this pull request, let me see if I can fix it. |
|
@emilio @notriddle After testing for several days I noticed that we do not advance the margin collapse info before in-order traversal, so floating does not take the margin into account both when the child is block formatting context or not. Fixing this would be quite complicated because the margin collapse info of the child is not computed when the in-order traversal happens, and since a floating rewrite is proposed I decided to revert the float ceiling change. |
| @@ -38,16 +38,22 @@ pub fn resolve_generated_content(root: &mut Flow, layout_context: &LayoutContext | |||
| } | |||
|
|
|||
| pub fn traverse_flow_tree_preorder(root: &mut Flow, | |||
| layout_context: &LayoutContext) { | |||
| layout_context: &LayoutContext, | |||
| force_reflow: bool) { | |||
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| assign_block_sizes: AssignBSizes) { | ||
| assign_block_sizes: AssignBSizes, | ||
| force_reflow: bool) { | ||
| if force_reflow { |
This comment has been minimized.
This comment has been minimized.
|
Updated according to comments. |
| @@ -7,6 +7,12 @@ use style::computed_values::float; | |||
| use style::selector_parser::RestyleDamage; | |||
| use style::servo::restyle_damage::{REFLOW, RECONSTRUCT_FLOW}; | |||
|
|
|||
| #[derive(Clone, Copy, PartialEq)] | |||
| pub enum RelayoutMode { | |||
This comment has been minimized.
This comment has been minimized.
emilio
Apr 23, 2017
Member
I believe a comment here saying why is this used and where would be helpful, but apart from this, it looks good.
|
@bors-servo delegate+ |
|
|
When reflowing a block format context during the inorder traversal, propagate restyle damage manually to its children since they were already reflowed.
|
|
|
@bors-servo r=pcwalton,emilio |
|
|
|
layout: Force reflow in the sequential fallback of block format context When reflowing a block format context during the inorder traversal, propagate restyle damage manually to its children since they were already reflowed. Also, test the border box to see if it can fit into floats according to CSS 2.1 § 9.5. Improves reddit and yahoo. --- <!-- 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 - [X] 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. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16458) <!-- Reviewable:end -->
|
|
|
@bors-servo: retry |
|
|
|
|
|
@bors-servo: retry |
layout: Force reflow in the sequential fallback of block format context When reflowing a block format context during the inorder traversal, propagate restyle damage manually to its children since they were already reflowed. Also, test the border box to see if it can fit into floats according to CSS 2.1 § 9.5. Improves reddit and yahoo. --- <!-- 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 - [X] 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. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16458) <!-- Reviewable:end -->
|
|
stshine commentedApr 14, 2017
•
edited
When reflowing a block format context during the inorder traversal,
propagate restyle damage manually to its children since they were
already reflowed. Also, test the border box to see if it can fit into
floats according to CSS 2.1 § 9.5.
Improves reddit and yahoo.
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is