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: Clean up inline_metrics_of_block a little. #17556

Merged
merged 1 commit into from Jul 6, 2017

Conversation

jyc
Copy link
Contributor

@jyc jyc commented Jun 28, 2017

Previously the variable names were a little confusing (ascent was used
for the space_above_baseline in one branch and the and ascent field in
another branch, and was not really the ascent in one). Also add a
small diagram.


  • ./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 they just refactor existing code

This change is Reviewable

@highfive
Copy link

Heads up! This PR modifies the following files:

  • @emilio: components/layout/fragment.rs

@highfive
Copy link

warning Warning warning

  • These commits modify layout code, but no tests are modified. Please consider adding a test!

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Jun 28, 2017
@asajeffrey
Copy link
Member

r? @emilio this looks more like your sort of thing!

@highfive highfive assigned emilio and unassigned asajeffrey Jul 4, 2017
Copy link
Member

@emilio emilio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good over all, should it be still marked as [wip] @jyc?

(baseline_offset, border_box_block_size - baseline_offset + end_margin)
},
// Case B
_ => (border_box_block_size + end_margin, Au(0))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like you could derive space_below_baseline from ascent, using:

let space_below_baseline = border_box_block_size + end_margin - ascent;

I think it would be slightly more readable, what do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, that sounds better--thanks!

@emilio
Copy link
Member

emilio commented Jul 5, 2017

@bors-servo try

@bors-servo
Copy link
Contributor

⌛ Trying commit d2403df with merge 003b19a...

bors-servo pushed a commit that referenced this pull request Jul 5, 2017
[WIP] layout: Clean up inline_metrics_of_block a little.

Previously the variable names were a little confusing (ascent was used
for the space_above_baseline in one branch and the and ascent field in
another branch, and was not really the ascent in one). Also add a
small diagram.

<!-- 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: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because they just refactor existing code

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

@jyc jyc changed the title [WIP] layout: Clean up inline_metrics_of_block a little. layout: Clean up inline_metrics_of_block a little. Jul 5, 2017
Previously the variable names were a little confusing (ascent was used
for the space_above_baseline in one branch and the and ascent field in
another branch, and was not really the ascent in one). Also add a
small diagram.
@jyc jyc force-pushed the inline-metrics-of-block branch from d2403df to 7a7dfe4 Compare July 5, 2017 18:14
@jyc
Copy link
Contributor Author

jyc commented Jul 6, 2017

Strange, seems to fail when compiling net_tests, but I can't reproduce it on my local machine. Going to wait a little and then try again.

@emilio
Copy link
Member

emilio commented Jul 6, 2017

@bors-servo r+

I think that's intermittent, and we don't gate on travis.

Thanks for the cleanup @jyc!

@bors-servo
Copy link
Contributor

📌 Commit 7a7dfe4 has been approved by emilio

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Jul 6, 2017
@bors-servo
Copy link
Contributor

⌛ Testing commit 7a7dfe4 with merge 03450ee...

bors-servo pushed a commit that referenced this pull request Jul 6, 2017
layout: Clean up inline_metrics_of_block a little.

Previously the variable names were a little confusing (ascent was used
for the space_above_baseline in one branch and the and ascent field in
another branch, and was not really the ascent in one). Also add a
small diagram.

<!-- 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: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because they just refactor existing code

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

☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css1, mac-rel-css2, mac-rel-wpt1, mac-rel-wpt2, mac-rel-wpt3, mac-rel-wpt4, windows-msvc-dev
Approved by: emilio
Pushing 03450ee to master...

@bors-servo bors-servo merged commit 7a7dfe4 into servo:master Jul 6, 2017
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Jul 6, 2017
@jyc jyc deleted the inline-metrics-of-block branch July 12, 2017 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants