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 upImplement sequential fallback to float speculation #13401
Conversation
|
@bors-servo: try |
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 -->
|
r? @pcwalton |
|
|
highfive
commented
Sep 23, 2016
|
|
Let's try that again. @bors-servo try |
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 -->
|
|
highfive
commented
Sep 24, 2016
|
|
Those silly margins @bors-servo try |
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 -->
|
|
|
The annoying git. @bors-servo retry |
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 -->
|
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.
This comment has been minimized.
pcwalton
Sep 24, 2016
Contributor
nit: use if let Some(rect) = rect { to avoid a level of indentation
This comment has been minimized.
This comment has been minimized.
| min_inline_size | ||
| } else { | ||
| rect.size.inline | ||
| }; |
This comment has been minimized.
This comment has been minimized.
| Some(rect) => { | ||
| self.base.position.start.i = max( | ||
| rect.start.i, | ||
| self.fragment.margin.inline_start, |
This comment has been minimized.
This comment has been minimized.
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.
This comment has been minimized.
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.
This comment has been minimized.
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.
This comment has been minimized.
|
|
||
| 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.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
|
|
|
|
@bors-servo retry |
1 similar comment
|
@bors-servo retry |
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 -->
|
|
|
|
|
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 -->
|
|
notriddle commentedSep 23, 2016
•
edited by larsbergstrom
This shouldn't impact any pages that are already rendering correctly, but it is a very naive implementation of this pass.
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is