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

layout: Force reflow in the sequential fallback of block format context #16458

Merged
merged 1 commit into from Apr 23, 2017

Conversation

@stshine
Copy link
Contributor

stshine commented Apr 14, 2017

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 -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 _____

This change is Reviewable

@stshine
Copy link
Contributor Author

stshine commented Apr 14, 2017

@bors-servo
Copy link
Contributor

bors-servo commented Apr 14, 2017

Trying commit 40ef73f with merge 91a7a9b...

bors-servo added a commit that referenced this pull request Apr 14, 2017
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. -->
@bors-servo
Copy link
Contributor

bors-servo commented Apr 14, 2017

💔 Test failed - linux-rel-css

@stshine stshine force-pushed the stshine:sequential-fallback branch from 40ef73f to 9e32111 Apr 14, 2017
@stshine
Copy link
Contributor Author

stshine commented Apr 14, 2017

This pull request is ready for review.

r? @notriddle or @pcwalton

@notriddle
Copy link
Contributor

notriddle commented Apr 14, 2017

@bors-servo try again

@bors-servo
Copy link
Contributor

bors-servo commented Apr 14, 2017

Trying commit 9e32111 with merge 1df7f04...

bors-servo added a commit that referenced this pull request Apr 14, 2017
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 -->
@bors-servo
Copy link
Contributor

bors-servo commented Apr 14, 2017

@@ -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.

@emilio

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.

@stshine

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.

@emilio

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.

@stshine

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.

@emilio

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.

@stshine
Copy link
Contributor Author

stshine commented Apr 21, 2017

There is a regression I may introduce in this pull request, let me see if I can fix it.

@stshine stshine changed the title layout: Force reflow in the sequential fallback of block format context [WIP] layout: Force reflow in the sequential fallback of block format context Apr 21, 2017
@stshine stshine force-pushed the stshine:sequential-fallback branch from 9e32111 to 483b8da Apr 22, 2017
@stshine
Copy link
Contributor Author

stshine commented Apr 22, 2017

@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.

@stshine stshine changed the title [WIP] layout: Force reflow in the sequential fallback of block format context layout: Force reflow in the sequential fallback of block format context Apr 22, 2017
@@ -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.

@pcwalton

pcwalton Apr 22, 2017

Contributor

Could you make this parameter an enum so as to improve clarity?

This comment has been minimized.

@stshine

stshine Apr 22, 2017

Author Contributor

Will do.

assign_block_sizes: AssignBSizes) {
assign_block_sizes: AssignBSizes,
force_reflow: bool) {
if force_reflow {

This comment has been minimized.

@pcwalton

pcwalton Apr 22, 2017

Contributor

Add a comment saying when this can happen.

@stshine stshine force-pushed the stshine:sequential-fallback branch from 483b8da to 3ba74ff Apr 23, 2017
@stshine
Copy link
Contributor Author

stshine commented Apr 23, 2017

Updated according to comments.

@emilio
emilio approved these changes Apr 23, 2017
@@ -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.

@emilio

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.

@emilio
Copy link
Member

emilio commented Apr 23, 2017

@bors-servo delegate+

@bors-servo
Copy link
Contributor

bors-servo commented Apr 23, 2017

✌️ @stshine can now approve this pull request

When reflowing a block format context during the inorder traversal,
propagate restyle damage manually to its children since they were
already reflowed.
@stshine stshine force-pushed the stshine:sequential-fallback branch from 3ba74ff to 68f74d5 Apr 23, 2017
@bors-servo
Copy link
Contributor

bors-servo commented Apr 23, 2017

📌 Commit 68f74d5 has been approved by pcwalton,emilio

@stshine
Copy link
Contributor Author

stshine commented Apr 23, 2017

@bors-servo r=pcwalton,emilio

@bors-servo
Copy link
Contributor

bors-servo commented Apr 23, 2017

💡 This pull request was already approved, no need to approve it again.

  • There's another pull request that is currently being tested, blocking this pull request: #16573
@bors-servo
Copy link
Contributor

bors-servo commented Apr 23, 2017

📌 Commit 68f74d5 has been approved by pcwalton,emilio

@bors-servo
Copy link
Contributor

bors-servo commented Apr 23, 2017

Testing commit 68f74d5 with merge 242ca8f...

bors-servo added a commit that referenced this pull request Apr 23, 2017
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
Copy link
Contributor

bors-servo commented Apr 23, 2017

💔 Test failed - linux-rel-wpt

@jdm
Copy link
Member

jdm commented Apr 23, 2017

@bors-servo
Copy link
Contributor

bors-servo commented Apr 23, 2017

Previous build results for android, arm32, arm64, linux-dev, linux-rel-css, mac-dev-unit, mac-rel-css, mac-rel-wpt1, mac-rel-wpt2, windows-msvc-dev are reusable. Rebuilding only linux-rel-wpt...

@bors-servo
Copy link
Contributor

bors-servo commented Apr 23, 2017

💔 Test failed - linux-rel-wpt

@stshine
Copy link
Contributor Author

stshine commented Apr 23, 2017

@bors-servo
Copy link
Contributor

bors-servo commented Apr 23, 2017

Testing commit 68f74d5 with merge 541db5f...

bors-servo added a commit that referenced this pull request Apr 23, 2017
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
Copy link
Contributor

bors-servo commented Apr 23, 2017

☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css, mac-rel-wpt1, mac-rel-wpt2, windows-msvc-dev
Approved by: pcwalton,emilio
Pushing 541db5f to master...

@bors-servo bors-servo merged commit 68f74d5 into servo:master Apr 23, 2017
2 of 3 checks passed
2 of 3 checks passed
continuous-integration/travis-ci/pr The Travis CI build failed
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
homu Test successful
Details
@stshine stshine deleted the stshine:sequential-fallback branch Apr 23, 2017
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

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