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

Implement sequential fallback to float speculation #13401

Merged
merged 3 commits into from Sep 29, 2016

Conversation

@notriddle
Copy link
Contributor

notriddle commented Sep 23, 2016

This shouldn't impact any pages that are already rendering correctly, but it is a very naive implementation of this pass.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #13284 and fix #13223
  • There are tests for these changes

This change is Reviewable

@jdm
Copy link
Member

jdm commented Sep 23, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Sep 23, 2016

Trying commit 681a08c with merge 101f1cb...

bors-servo added a commit that referenced this pull request Sep 23, 2016
Implement sequential fallback to float speculation

This shouldn't impact any pages that are already rendering correctly, but it is a very naive implementation of this pass.

---

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #13284 and fix #13223
- [X] There are tests for these changes

<!-- 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/13401)
<!-- Reviewable:end -->
@larsbergstrom
Copy link
Contributor

larsbergstrom commented Sep 23, 2016

@highfive highfive assigned pcwalton and unassigned larsbergstrom Sep 23, 2016
@bors-servo
Copy link
Contributor

bors-servo commented Sep 23, 2016

💔 Test failed - mac-rel-css

@highfive
Copy link

highfive commented Sep 23, 2016

  ▶ PASS [expected FAIL] /css21_dev/html4/block-formatting-contexts-015.htm

  ▶ PASS [expected FAIL] /css21_dev/html4/floats-bfc-002.htm

  ▶ FAIL [expected PASS] /css21_dev/html4/floats-wrap-bfc-001-left-overflow.htm
  └   → /css21_dev/html4/floats-wrap-bfc-001-left-overflow.htm 2d6a5fdccd9eefb689e8f881df829f743f0e3de4
/css21_dev/html4/reference/floats-wrap-bfc-001-left-overflow-ref.htm c3a278115ff68702eec6eef472830b73b56c5ca4
Testing 2d6a5fdccd9eefb689e8f881df829f743f0e3de4 == c3a278115ff68702eec6eef472830b73b56c5ca4

  ▶ FAIL [expected PASS] /css21_dev/html4/floats-wrap-bfc-002-left-overflow.htm
  └   → /css21_dev/html4/floats-wrap-bfc-002-left-overflow.htm a4bf58f4ae043db01bec5e0d88db4c96fdf0d552
/css21_dev/html4/reference/floats-wrap-bfc-002-left-ref.htm 71b5a9a854228c0d9f4f458558ca9fffb6fc3591
Testing a4bf58f4ae043db01bec5e0d88db4c96fdf0d552 == 71b5a9a854228c0d9f4f458558ca9fffb6fc3591

  ▶ FAIL [expected PASS] /css21_dev/html4/floats-wrap-bfc-003-left-overflow.htm
  └   → /css21_dev/html4/floats-wrap-bfc-003-left-overflow.htm b1fae663feb9fa39bceddc374c3883c5496d2028
/css21_dev/html4/reference/floats-wrap-bfc-003-left-overflow-ref.htm 43f657c70beb6673a6f90ff025c7f06c55e5e20a
Testing b1fae663feb9fa39bceddc374c3883c5496d2028 == 43f657c70beb6673a6f90ff025c7f06c55e5e20a
@notriddle
Copy link
Contributor Author

notriddle commented Sep 23, 2016

Let's try that again.

@bors-servo try

@bors-servo
Copy link
Contributor

bors-servo commented Sep 23, 2016

Trying commit 95f59b5 with merge 336d8dc...

bors-servo added a commit that referenced this pull request Sep 23, 2016
Implement sequential fallback to float speculation

This shouldn't impact any pages that are already rendering correctly, but it is a very naive implementation of this pass.

---

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #13284 and fix #13223
- [X] There are tests for these changes

<!-- 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/13401)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Sep 24, 2016

💔 Test failed - linux-rel

@highfive
Copy link

highfive commented Sep 24, 2016

  ▶ FAIL [expected PASS] /_mozilla/css/block_formatting_context_max_width_a.html
  └   → /_mozilla/css/block_formatting_context_max_width_a.html 25eebe380e566e884c3c6ff5ba455c23cf47f934
/_mozilla/css/block_formatting_context_max_width_ref.html 175e96def9539286d756e52a7fef8899877b31e9
Testing 25eebe380e566e884c3c6ff5ba455c23cf47f934 == 175e96def9539286d756e52a7fef8899877b31e9

  ▶ FAIL [expected PASS] /_mozilla/css/block_formatting_context_margin_inout_a.html
  └   → /_mozilla/css/block_formatting_context_margin_inout_a.html 2aee0325975fc9a281e1a63c5e93799687c51c49
/_mozilla/css/block_formatting_context_margin_inout_ref.html 5cc93120b21f24648fd136070ab186250570646f
Testing 2aee0325975fc9a281e1a63c5e93799687c51c49 == 5cc93120b21f24648fd136070ab186250570646f

  ▶ FAIL [expected PASS] /_mozilla/css/block_formatting_context_negative_margins_a.html
  └   → /_mozilla/css/block_formatting_context_negative_margins_a.html cfe4660a21d266bc636625877f5befe2893a00b8
/_mozilla/css/block_formatting_context_negative_margins_ref.html c925eae8f74a6adf7bbd32e458d47e6dec397983
Testing cfe4660a21d266bc636625877f5befe2893a00b8 == c925eae8f74a6adf7bbd32e458d47e6dec397983
@notriddle
Copy link
Contributor Author

notriddle commented Sep 24, 2016

Those silly margins

@bors-servo try

@bors-servo
Copy link
Contributor

bors-servo commented Sep 24, 2016

Trying commit 06978f6 with merge 91e771b...

bors-servo added a commit that referenced this pull request Sep 24, 2016
Implement sequential fallback to float speculation

This shouldn't impact any pages that are already rendering correctly, but it is a very naive implementation of this pass.

---

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #13284 and fix #13223
- [X] There are tests for these changes

<!-- 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/13401)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Sep 24, 2016

💔 Test failed - linux-rel

@notriddle
Copy link
Contributor Author

notriddle commented Sep 24, 2016

The annoying git.

@bors-servo retry

@bors-servo
Copy link
Contributor

bors-servo commented Sep 24, 2016

Trying commit 06978f6 with merge a367404...

bors-servo added a commit that referenced this pull request Sep 24, 2016
Implement sequential fallback to float speculation

This shouldn't impact any pages that are already rendering correctly, but it is a very naive implementation of this pass.

---

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #13284 and fix #13223
- [X] There are tests for these changes

<!-- 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/13401)
<!-- Reviewable:end -->
Copy link
Contributor

pcwalton left a comment

Nice to see that this is so straightforward to implement!

self.base.block_container_inline_size - self.fragment.margin.inline_start_end(),
);
match rect {
Some(rect) => {

This comment has been minimized.

@pcwalton

pcwalton Sep 24, 2016

Contributor

nit: use if let Some(rect) = rect { to avoid a level of indentation

This comment has been minimized.

@notriddle

notriddle Sep 24, 2016

Author Contributor

Done.

min_inline_size
} else {
rect.size.inline
};

This comment has been minimized.

@pcwalton

pcwalton Sep 24, 2016

Contributor

Do we have a clamp function for this? Should we make one in util?

Some(rect) => {
self.base.position.start.i = max(
rect.start.i,
self.fragment.margin.inline_start,

This comment has been minimized.

@pcwalton

pcwalton Sep 24, 2016

Contributor

nit: either put this comma in on all of the function calls or remove it from all of them. Style in this file usually has the comma removed, but it's up to you.

This comment has been minimized.

@notriddle

notriddle Sep 24, 2016

Author Contributor

Now that I look at this again, it's wrong anyway. My base position should not be offset by the inline_start, because it includes inline_start. Position includes the margins in the inline direction.

// TODO(pcwalton): If the inline-size of this flow is different from the size we estimated
// earlier, lay it out again.
// If float speculation failed, fixup our layout, and re-layout all the children.
if self.fragment.margin_box_inline_size() != self.base.position.size.inline {

This comment has been minimized.

@pcwalton

pcwalton Sep 24, 2016

Contributor

Could you add a debug!() log message here? For performance reasons, it's nice to know when we hit this case.

This comment has been minimized.

@notriddle

notriddle Sep 24, 2016

Author Contributor

Done.


self.base.restyle_damage.remove(REFLOW_OUT_OF_FLOW | REFLOW);
self.fragment.restyle_damage.remove(REFLOW_OUT_OF_FLOW | REFLOW);
assert_eq!(self.fragment.margin_box_inline_size(), self.base.position.size.inline);

This comment has been minimized.

@pcwalton

pcwalton Sep 24, 2016

Contributor

Use debug_assert!

This comment has been minimized.

@notriddle

notriddle Sep 24, 2016

Author Contributor

Done.

@bors-servo
Copy link
Contributor

bors-servo commented Sep 24, 2016

💔 Test failed - mac-rel-wpt

@bors-servo
Copy link
Contributor

bors-servo commented Sep 28, 2016

💔 Test failed - mac-dev-unit

@KiChjang
Copy link
Member

KiChjang commented Sep 28, 2016

@bors-servo retry

1 similar comment
@notriddle
Copy link
Contributor Author

notriddle commented Sep 29, 2016

@bors-servo retry

bors-servo added a commit that referenced this pull request Sep 29, 2016
Implement sequential fallback to float speculation

This shouldn't impact any pages that are already rendering correctly, but it is a very naive implementation of this pass.

---

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #13284 and fix #13223
- [X] There are tests for these changes

<!-- 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/13401)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Sep 29, 2016

Testing commit bf69b76 with merge 5a64f3e...

@bors-servo
Copy link
Contributor

bors-servo commented Sep 29, 2016

💔 Test failed - linux-dev

@Ms2ger
Copy link
Contributor

Ms2ger commented Sep 29, 2016

./components/util/lib.rs:49: tab on line
./components/util/lib.rs:50: tab on line
./components/util/lib.rs:51: tab on line
./components/util/lib.rs:52: tab on line
./components/util/lib.rs:53: tab on line
./components/util/lib.rs:54: tab on line
./components/util/lib.rs:55: tab on line
./components/util/lib.rs:56: no newline at EOF
@bors-servo
Copy link
Contributor

bors-servo commented Sep 29, 2016

📌 Commit 81676ea has been approved by pcwalton

@bors-servo
Copy link
Contributor

bors-servo commented Sep 29, 2016

Testing commit 81676ea with merge 4ebecc9...

bors-servo added a commit that referenced this pull request Sep 29, 2016
Implement sequential fallback to float speculation

This shouldn't impact any pages that are already rendering correctly, but it is a very naive implementation of this pass.

---

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #13284 and fix #13223
- [X] There are tests for these changes

<!-- 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/13401)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Sep 29, 2016

@bors-servo bors-servo merged commit 81676ea into servo:master Sep 29, 2016
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
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.

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