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

Sequential layout bug with (possibly) RTL direction #11818

Closed
avadacatavra opened this issue Jun 21, 2016 · 7 comments
Closed

Sequential layout bug with (possibly) RTL direction #11818

avadacatavra opened this issue Jun 21, 2016 · 7 comments

Comments

@avadacatavra
Copy link
Contributor

@avadacatavra avadacatavra commented Jun 21, 2016

When we use the sequential layout traversal, there's an error with overconstrained_block.html and div_align.html.

Discovered while testing #11713

@avadacatavra avadacatavra self-assigned this Jun 21, 2016
@avadacatavra
Copy link
Contributor Author

@avadacatavra avadacatavra commented Jun 22, 2016

It seems like there are two main issues:

  1. In the sequential code, RTL isn't set properly
    • boxes 2 and 4 should both be RTL, but only 2 is
    • if you set all 4 blocks to be RTL, only 1 and 2 are
  2. Neither parallel or sequential match the Firefox reference
    • But parallel mode with a single thread does (y1 screenshot)

Screenshots

@avadacatavra
Copy link
Contributor Author

@avadacatavra avadacatavra commented Jun 29, 2016

@pcwalton
Copy link
Contributor

@pcwalton pcwalton commented Jul 19, 2016

This could have something to do with dirty bits. Perhaps we are checking different dirty bits in parallel mode and sequential mode and incorrectly bailing out earlier in the latter?

@metajack
Copy link
Contributor

@metajack metajack commented Jul 19, 2016

Would disabling incremental layout make the problem go away in that case? That seems like an easy test.

@pcwalton
Copy link
Contributor

@pcwalton pcwalton commented Jul 19, 2016

Yes, it's worth a shot!

@avadacatavra
Copy link
Contributor Author

@avadacatavra avadacatavra commented Jul 21, 2016

Here's the test run in sequential mode with incremental layout disabled. Didn't go away :(

screenshot 2016-07-21 11 12 39

@avadacatavra avadacatavra removed their assignment Jul 27, 2016
@notriddle notriddle self-assigned this Jul 27, 2016
@notriddle
Copy link
Contributor

@notriddle notriddle commented Jul 30, 2016

When I force it to combine sequential restyle with parallel layout, I get both outputs depending on whether Satan manages to get into my computer before Hades blocks the entry off.

screen_race_a

screen_race_b

Both of these screenshots were produced by running this command:

./mach run -d -y2 tests/wpt/mozilla/tests/css/overconstrained_block.html

And I used this patch:

diff --git a/components/layout_thread/lib.rs b/components/layout_thread/lib.rs
index 403f30a..b023187 100644
--- a/components/layout_thread/lib.rs
+++ b/components/layout_thread/lib.rs
@@ -1155,17 +1155,8 @@ impl LayoutThread {
                     self.profiler_metadata(),
                     self.time_profiler_chan.clone(),
                     || {
-                // Perform CSS selector matching and flow construction.
-                match self.parallel_traversal {
-                    None => {
-                        sequential::traverse_dom::<ServoLayoutNode, RecalcStyleAndConstructFlows>(
-                            node, &shared_layout_context);
-                    }
-                    Some(ref mut traversal) => {
-                        parallel::traverse_dom::<ServoLayoutNode, RecalcStyleAndConstructFlows>(
-                            node, &shared_layout_context, traversal);
-                    }
-                }
+                sequential::traverse_dom::<ServoLayoutNode, RecalcStyleAndConstructFlows>(
+                    node, &shared_layout_context);
             });

             // TODO(pcwalton): Measure energy usage of text shaping, perhaps?

I don't think there's anything interesting about the combination of parallel layout and sequential restyle, except for how it forces the race to go.

@notriddle notriddle added the I-race label Jul 30, 2016
bors-servo added a commit that referenced this issue Aug 13, 2016
Add a flag to dump the computed style values

I used this to trace #11818 to a style bug, rather than a layout bug.

---

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes do not fix any issues
- [X] These changes do not require tests because debugging

<!-- 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/12831)
<!-- Reviewable:end -->
bors-servo added a commit that referenced this issue Aug 13, 2016
Fix a cached style cascade bug that only manifested in sequential mode

When copying cached styles, keep the `writing_mode` up to date.

---

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #11818 (github issue number if applicable).
- [...] There are tests for these changes

NOTE TO THE REVIEWER: This PR contains a test that works, but I need to run the test in sequential mode (couldn't figure out how to make it show up in parallel mode). What do I need to do to make the test harness pass `-y1` to Servo?

<!-- 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/12839)
<!-- Reviewable:end -->
bors-servo added a commit that referenced this issue Aug 13, 2016
Fix a cached style cascade bug that only manifested in sequential mode

When copying cached styles, keep the `writing_mode` up to date.

---

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #11818 (github issue number if applicable).
- [...] There are tests for these changes

NOTE TO THE REVIEWER: This PR contains a test that works, but I need to run the test in sequential mode (couldn't figure out how to make it show up in parallel mode). What do I need to do to make the test harness pass `-y1` to Servo?

<!-- 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/12839)
<!-- Reviewable:end -->
bors-servo added a commit that referenced this issue Aug 13, 2016
Fix a cached style cascade bug that only manifested in sequential mode

When copying cached styles, keep the `writing_mode` up to date.

---

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #11818 (github issue number if applicable).
- [X] There are tests for these changes

EDIT: The test is now working. I ran it with the first commit (the actual fix) reverted and it failed.

<!-- 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/12839)
<!-- Reviewable:end -->
bors-servo added a commit that referenced this issue Aug 14, 2016
Fix a cached style cascade bug that only manifested in sequential mode

When copying cached styles, keep the `writing_mode` up to date.

---

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #11818 (github issue number if applicable).
- [X] There are tests for these changes

EDIT: The test is now working. I ran it with the first commit (the actual fix) reverted and it failed.

<!-- 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/12839)
<!-- Reviewable:end -->
samuknet added a commit to samuknet/servo that referenced this issue Sep 6, 2016
I used this to trace servo#11818 to a style bug, rather than a layout bug.
samuknet added a commit to samuknet/servo that referenced this issue Sep 6, 2016
samuknet added a commit to samuknet/servo that referenced this issue Sep 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

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