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

Use CSS terminology for sizing rules #1460

Closed
wants to merge 2 commits into from

Conversation

NickGerleman
Copy link
Contributor

Summary:
Yoga passes MeasureMode/YGMeasureMode to express constraints in how a box should be measured, given definite or indefinite available space.

This is modeled after Android MeasureSpec, with a table above calculateLayoutImpl() explaining the CSS terms they map to. This can be confusing when flipping between the spec, and code.

This switches internal usages to the CSS terms, but leaves around YGMeasureMode since it is the public API passed to measure functions.

Reviewed By: joevilches

Differential Revision: D51068417

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D51068417

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D51068417

NickGerleman added a commit to NickGerleman/yoga that referenced this pull request Nov 9, 2023
Summary:
X-link: facebook/react-native#41390

Pull Request resolved: facebook#1460

Yoga passes `MeasureMode`/`YGMeasureMode` to express constraints in how a box should be measured, given definite or indefinite available space.

This is modeled after Android [MeasureSpec](https://developer.android.com/reference/android/view/View.MeasureSpec), with a table above `calculateLayoutImpl()` explaining the CSS terms they map to. This can be confusing when flipping between the spec, and code.

This switches internal usages to the CSS terms, but leaves around `YGMeasureMode` since it is the public API passed to measure functions.

Reviewed By: joevilches

Differential Revision: D51068417

fbshipit-source-id: d61705235a175149a15e1cad4d3bf3fd1a2b7303
NickGerleman added a commit to NickGerleman/react-native that referenced this pull request Nov 9, 2023
Summary:
Pull Request resolved: facebook#41390

X-link: facebook/yoga#1460

Yoga passes `MeasureMode`/`YGMeasureMode` to express constraints in how a box should be measured, given definite or indefinite available space.

This is modeled after Android [MeasureSpec](https://developer.android.com/reference/android/view/View.MeasureSpec), with a table above `calculateLayoutImpl()` explaining the CSS terms they map to. This can be confusing when flipping between the spec, and code.

This switches internal usages to the CSS terms, but leaves around `YGMeasureMode` since it is the public API passed to measure functions.

Reviewed By: joevilches

Differential Revision: D51068417

fbshipit-source-id: 9d53eea277c67c039545a47c3492fd22816ce33a
NickGerleman added a commit to NickGerleman/yoga that referenced this pull request Nov 14, 2023
Summary:
X-link: facebook/react-native#41390


Yoga passes `MeasureMode`/`YGMeasureMode` to express constraints in how a box should be measured, given definite or indefinite available space.

This is modeled after Android [MeasureSpec](https://developer.android.com/reference/android/view/View.MeasureSpec), with a table above `calculateLayoutImpl()` explaining the CSS terms they map to. This can be confusing when flipping between the spec, and code.

This switches internal usages to the CSS terms, but leaves around `YGMeasureMode` since it is the public API passed to measure functions.

Reviewed By: joevilches

Differential Revision: D51068417
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D51068417

NickGerleman added a commit to NickGerleman/react-native that referenced this pull request Nov 14, 2023
Summary:
Pull Request resolved: facebook#41390

X-link: facebook/yoga#1460

Yoga passes `MeasureMode`/`YGMeasureMode` to express constraints in how a box should be measured, given definite or indefinite available space.

This is modeled after Android [MeasureSpec](https://developer.android.com/reference/android/view/View.MeasureSpec), with a table above `calculateLayoutImpl()` explaining the CSS terms they map to. This can be confusing when flipping between the spec, and code.

This switches internal usages to the CSS terms, but leaves around `YGMeasureMode` since it is the public API passed to measure functions.

Reviewed By: joevilches

Differential Revision: D51068417

fbshipit-source-id: 01ca8b16b6b6e16fb0cce51e64e5e5e8ea64ff72
NickGerleman added a commit to NickGerleman/yoga that referenced this pull request Nov 14, 2023
Summary:
X-link: facebook/react-native#41390


Yoga passes `MeasureMode`/`YGMeasureMode` to express constraints in how a box should be measured, given definite or indefinite available space.

This is modeled after Android [MeasureSpec](https://developer.android.com/reference/android/view/View.MeasureSpec), with a table above `calculateLayoutImpl()` explaining the CSS terms they map to. This can be confusing when flipping between the spec, and code.

This switches internal usages to the CSS terms, but leaves around `YGMeasureMode` since it is the public API passed to measure functions.

Reviewed By: joevilches

Differential Revision: D51068417
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D51068417

NickGerleman added a commit to NickGerleman/yoga that referenced this pull request Nov 14, 2023
Summary:
X-link: facebook/react-native#41390


Yoga passes `MeasureMode`/`YGMeasureMode` to express constraints in how a box should be measured, given definite or indefinite available space.

This is modeled after Android [MeasureSpec](https://developer.android.com/reference/android/view/View.MeasureSpec), with a table above `calculateLayoutImpl()` explaining the CSS terms they map to. This can be confusing when flipping between the spec, and code.

This switches internal usages to the CSS terms, but leaves around `YGMeasureMode` since it is the public API passed to measure functions.

Reviewed By: joevilches

Differential Revision: D51068417
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D51068417

NickGerleman added a commit to NickGerleman/react-native that referenced this pull request Nov 14, 2023
Summary:
Pull Request resolved: facebook#41390

X-link: facebook/yoga#1460

Yoga passes `MeasureMode`/`YGMeasureMode` to express constraints in how a box should be measured, given definite or indefinite available space.

This is modeled after Android [MeasureSpec](https://developer.android.com/reference/android/view/View.MeasureSpec), with a table above `calculateLayoutImpl()` explaining the CSS terms they map to. This can be confusing when flipping between the spec, and code.

This switches internal usages to the CSS terms, but leaves around `YGMeasureMode` since it is the public API passed to measure functions.

Reviewed By: joevilches

Differential Revision: D51068417

fbshipit-source-id: fc3ff8661ae5689ae06d256e287f20fa2b46f15a
NickGerleman added a commit to NickGerleman/react-native that referenced this pull request Nov 14, 2023
Summary:
Pull Request resolved: facebook#41390

X-link: facebook/yoga#1460

Yoga passes `MeasureMode`/`YGMeasureMode` to express constraints in how a box should be measured, given definite or indefinite available space.

This is modeled after Android [MeasureSpec](https://developer.android.com/reference/android/view/View.MeasureSpec), with a table above `calculateLayoutImpl()` explaining the CSS terms they map to. This can be confusing when flipping between the spec, and code.

This switches internal usages to the CSS terms, but leaves around `YGMeasureMode` since it is the public API passed to measure functions.

Reviewed By: joevilches

Differential Revision: D51068417

fbshipit-source-id: 8611be0b63c77e6655a4a53dafae78c25728c8b8
NickGerleman added a commit to NickGerleman/yoga that referenced this pull request Nov 14, 2023
Summary:
X-link: facebook/react-native#41390


Yoga passes `MeasureMode`/`YGMeasureMode` to express constraints in how a box should be measured, given definite or indefinite available space.

This is modeled after Android [MeasureSpec](https://developer.android.com/reference/android/view/View.MeasureSpec), with a table above `calculateLayoutImpl()` explaining the CSS terms they map to. This can be confusing when flipping between the spec, and code.

This switches internal usages to the CSS terms, but leaves around `YGMeasureMode` since it is the public API passed to measure functions.

Reviewed By: joevilches

Differential Revision: D51068417
NickGerleman added a commit to NickGerleman/yoga that referenced this pull request Nov 14, 2023
Summary:
X-link: facebook/react-native#41390


Yoga passes `MeasureMode`/`YGMeasureMode` to express constraints in how a box should be measured, given definite or indefinite available space.

This is modeled after Android [MeasureSpec](https://developer.android.com/reference/android/view/View.MeasureSpec), with a table above `calculateLayoutImpl()` explaining the CSS terms they map to. This can be confusing when flipping between the spec, and code.

This switches internal usages to the CSS terms, but leaves around `YGMeasureMode` since it is the public API passed to measure functions.

Reviewed By: joevilches

Differential Revision: D51068417
NickGerleman added a commit to NickGerleman/react-native that referenced this pull request Nov 14, 2023
Summary:

X-link: facebook/yoga#1460

Yoga passes `MeasureMode`/`YGMeasureMode` to express constraints in how a box should be measured, given definite or indefinite available space.

This is modeled after Android [MeasureSpec](https://developer.android.com/reference/android/view/View.MeasureSpec), with a table above `calculateLayoutImpl()` explaining the CSS terms they map to. This can be confusing when flipping between the spec, and code.

This switches internal usages to the CSS terms, but leaves around `YGMeasureMode` since it is the public API passed to measure functions.

Reviewed By: joevilches

Differential Revision: D51068417
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D51068417

NickGerleman added a commit to NickGerleman/yoga that referenced this pull request Nov 14, 2023
Summary:
X-link: facebook/react-native#41390


Yoga passes `MeasureMode`/`YGMeasureMode` to express constraints in how a box should be measured, given definite or indefinite available space.

This is modeled after Android [MeasureSpec](https://developer.android.com/reference/android/view/View.MeasureSpec), with a table above `calculateLayoutImpl()` explaining the CSS terms they map to. This can be confusing when flipping between the spec, and code.

This switches internal usages to the CSS terms, but leaves around `YGMeasureMode` since it is the public API passed to measure functions.

Reviewed By: joevilches

Differential Revision: D51068417
NickGerleman added a commit to NickGerleman/yoga that referenced this pull request Nov 14, 2023
Summary:
X-link: facebook/react-native#41390


Yoga passes `MeasureMode`/`YGMeasureMode` to express constraints in how a box should be measured, given definite or indefinite available space.

This is modeled after Android [MeasureSpec](https://developer.android.com/reference/android/view/View.MeasureSpec), with a table above `calculateLayoutImpl()` explaining the CSS terms they map to. This can be confusing when flipping between the spec, and code.

This switches internal usages to the CSS terms, but leaves around `YGMeasureMode` since it is the public API passed to measure functions.

Reviewed By: joevilches

Differential Revision: D51068417
NickGerleman added a commit to NickGerleman/react-native that referenced this pull request Nov 14, 2023
Summary:

X-link: facebook/yoga#1460

Yoga passes `MeasureMode`/`YGMeasureMode` to express constraints in how a box should be measured, given definite or indefinite available space.

This is modeled after Android [MeasureSpec](https://developer.android.com/reference/android/view/View.MeasureSpec), with a table above `calculateLayoutImpl()` explaining the CSS terms they map to. This can be confusing when flipping between the spec, and code.

This switches internal usages to the CSS terms, but leaves around `YGMeasureMode` since it is the public API passed to measure functions.

Reviewed By: joevilches

Differential Revision: D51068417
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D51068417

NickGerleman added a commit to NickGerleman/yoga that referenced this pull request Nov 14, 2023
Summary:
X-link: facebook/react-native#41390


Yoga passes `MeasureMode`/`YGMeasureMode` to express constraints in how a box should be measured, given definite or indefinite available space.

This is modeled after Android [MeasureSpec](https://developer.android.com/reference/android/view/View.MeasureSpec), with a table above `calculateLayoutImpl()` explaining the CSS terms they map to. This can be confusing when flipping between the spec, and code.

This switches internal usages to the CSS terms, but leaves around `YGMeasureMode` since it is the public API passed to measure functions.

Reviewed By: joevilches

Differential Revision: D51068417
NickGerleman added a commit to NickGerleman/yoga that referenced this pull request Nov 25, 2023
Summary:
X-link: facebook/react-native#41390


Yoga passes `MeasureMode`/`YGMeasureMode` to express constraints in how a box should be measured, given definite or indefinite available space.

This is modeled after Android [MeasureSpec](https://developer.android.com/reference/android/view/View.MeasureSpec), with a table above `calculateLayoutImpl()` explaining the CSS terms they map to. This can be confusing when flipping between the spec, and code.

This switches internal usages to the CSS terms, but leaves around `YGMeasureMode` since it is the public API passed to measure functions.

Reviewed By: joevilches

Differential Revision: D51068417
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D51068417

NickGerleman added a commit to NickGerleman/yoga that referenced this pull request Nov 25, 2023
Summary:
X-link: facebook/react-native#41390


Yoga passes `MeasureMode`/`YGMeasureMode` to express constraints in how a box should be measured, given definite or indefinite available space.

This is modeled after Android [MeasureSpec](https://developer.android.com/reference/android/view/View.MeasureSpec), with a table above `calculateLayoutImpl()` explaining the CSS terms they map to. This can be confusing when flipping between the spec, and code.

This switches internal usages to the CSS terms, but leaves around `YGMeasureMode` since it is the public API passed to measure functions.

Reviewed By: joevilches

Differential Revision: D51068417
NickGerleman added a commit to NickGerleman/yoga that referenced this pull request Nov 25, 2023
Summary:
X-link: facebook/react-native#41390


Yoga passes `MeasureMode`/`YGMeasureMode` to express constraints in how a box should be measured, given definite or indefinite available space.

This is modeled after Android [MeasureSpec](https://developer.android.com/reference/android/view/View.MeasureSpec), with a table above `calculateLayoutImpl()` explaining the CSS terms they map to. This can be confusing when flipping between the spec, and code.

This switches internal usages to the CSS terms, but leaves around `YGMeasureMode` since it is the public API passed to measure functions.

Reviewed By: joevilches

Differential Revision: D51068417
NickGerleman added a commit to NickGerleman/yoga that referenced this pull request Nov 25, 2023
Summary:
X-link: facebook/react-native#41390


Yoga passes `MeasureMode`/`YGMeasureMode` to express constraints in how a box should be measured, given definite or indefinite available space.

This is modeled after Android [MeasureSpec](https://developer.android.com/reference/android/view/View.MeasureSpec), with a table above `calculateLayoutImpl()` explaining the CSS terms they map to. This can be confusing when flipping between the spec, and code.

This switches internal usages to the CSS terms, but leaves around `YGMeasureMode` since it is the public API passed to measure functions.

Reviewed By: joevilches

Differential Revision: D51068417
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D51068417

NickGerleman added a commit to NickGerleman/react-native that referenced this pull request Nov 25, 2023
Summary:

X-link: facebook/yoga#1460

Yoga passes `MeasureMode`/`YGMeasureMode` to express constraints in how a box should be measured, given definite or indefinite available space.

This is modeled after Android [MeasureSpec](https://developer.android.com/reference/android/view/View.MeasureSpec), with a table above `calculateLayoutImpl()` explaining the CSS terms they map to. This can be confusing when flipping between the spec, and code.

This switches internal usages to the CSS terms, but leaves around `YGMeasureMode` since it is the public API passed to measure functions.

Reviewed By: joevilches

Differential Revision: D51068417
NickGerleman added a commit to NickGerleman/react-native that referenced this pull request Nov 25, 2023
Summary:

X-link: facebook/yoga#1460

Yoga passes `MeasureMode`/`YGMeasureMode` to express constraints in how a box should be measured, given definite or indefinite available space.

This is modeled after Android [MeasureSpec](https://developer.android.com/reference/android/view/View.MeasureSpec), with a table above `calculateLayoutImpl()` explaining the CSS terms they map to. This can be confusing when flipping between the spec, and code.

This switches internal usages to the CSS terms, but leaves around `YGMeasureMode` since it is the public API passed to measure functions.

Reviewed By: joevilches

Differential Revision: D51068417
Summary:
X-link: facebook/react-native#41392


We're moving `CompactValue` to be an internal detail of `yoga::Style`, where users outside of the style will be dealing with a resolved/non-compact representation.

This change renames usages of `CompactValue` to `Style::Length`, which will be Yoga's representation for CSS input lengths. Right now one is just a type alias of the other, but this will let us change the internals of CompactValue with the rest of the world looking the same.

A few factory functions are added to `yoga::value` for creating CSS values. There are some shenanigans around how we want to represent CSS pixels (one YGUnitPoint), when we also end up adding CSS points (slightly larger than one YGUnitPoint). For now, I reused `point` until making other changes.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D51000389
Summary:
X-link: facebook/react-native#41390


Yoga passes `MeasureMode`/`YGMeasureMode` to express constraints in how a box should be measured, given definite or indefinite available space.

This is modeled after Android [MeasureSpec](https://developer.android.com/reference/android/view/View.MeasureSpec), with a table above `calculateLayoutImpl()` explaining the CSS terms they map to. This can be confusing when flipping between the spec, and code.

This switches internal usages to the CSS terms, but leaves around `YGMeasureMode` since it is the public API passed to measure functions.

Reviewed By: joevilches

Differential Revision: D51068417
NickGerleman added a commit to NickGerleman/yoga that referenced this pull request Nov 25, 2023
Summary:
X-link: facebook/react-native#41390


Yoga passes `MeasureMode`/`YGMeasureMode` to express constraints in how a box should be measured, given definite or indefinite available space.

This is modeled after Android [MeasureSpec](https://developer.android.com/reference/android/view/View.MeasureSpec), with a table above `calculateLayoutImpl()` explaining the CSS terms they map to. This can be confusing when flipping between the spec, and code.

This switches internal usages to the CSS terms, but leaves around `YGMeasureMode` since it is the public API passed to measure functions.

Reviewed By: joevilches

Differential Revision: D51068417
NickGerleman added a commit to NickGerleman/react-native that referenced this pull request Nov 25, 2023
Summary:

X-link: facebook/yoga#1460

Yoga passes `MeasureMode`/`YGMeasureMode` to express constraints in how a box should be measured, given definite or indefinite available space.

This is modeled after Android [MeasureSpec](https://developer.android.com/reference/android/view/View.MeasureSpec), with a table above `calculateLayoutImpl()` explaining the CSS terms they map to. This can be confusing when flipping between the spec, and code.

This switches internal usages to the CSS terms, but leaves around `YGMeasureMode` since it is the public API passed to measure functions.

Reviewed By: joevilches

Differential Revision: D51068417
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D51068417

NickGerleman added a commit to NickGerleman/yoga that referenced this pull request Nov 25, 2023
Summary:
X-link: facebook/react-native#41390


Yoga passes `MeasureMode`/`YGMeasureMode` to express constraints in how a box should be measured, given definite or indefinite available space.

This is modeled after Android [MeasureSpec](https://developer.android.com/reference/android/view/View.MeasureSpec), with a table above `calculateLayoutImpl()` explaining the CSS terms they map to. This can be confusing when flipping between the spec, and code.

This switches internal usages to the CSS terms, but leaves around `YGMeasureMode` since it is the public API passed to measure functions.

Reviewed By: joevilches

Differential Revision: D51068417
facebook-github-bot pushed a commit to facebook/litho that referenced this pull request Nov 26, 2023
Summary:
X-link: facebook/react-native#41390

X-link: facebook/yoga#1460

Yoga passes `MeasureMode`/`YGMeasureMode` to express constraints in how a box should be measured, given definite or indefinite available space.

This is modeled after Android [MeasureSpec](https://developer.android.com/reference/android/view/View.MeasureSpec), with a table above `calculateLayoutImpl()` explaining the CSS terms they map to. This can be confusing when flipping between the spec, and code.

This switches internal usages to the CSS terms, but leaves around `YGMeasureMode` since it is the public API passed to measure functions.

Reviewed By: joevilches

Differential Revision: D51068417

fbshipit-source-id: 0a76266a4e7e0cc39996164607229c3c41de2818
facebook-github-bot pushed a commit to facebook/react-native that referenced this pull request Nov 26, 2023
Summary:
Pull Request resolved: #41390

X-link: facebook/yoga#1460

Yoga passes `MeasureMode`/`YGMeasureMode` to express constraints in how a box should be measured, given definite or indefinite available space.

This is modeled after Android [MeasureSpec](https://developer.android.com/reference/android/view/View.MeasureSpec), with a table above `calculateLayoutImpl()` explaining the CSS terms they map to. This can be confusing when flipping between the spec, and code.

This switches internal usages to the CSS terms, but leaves around `YGMeasureMode` since it is the public API passed to measure functions.

Reviewed By: joevilches

Differential Revision: D51068417

fbshipit-source-id: 0a76266a4e7e0cc39996164607229c3c41de2818
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in a121483.

joevilches pushed a commit to joevilches/react-native that referenced this pull request Dec 1, 2023
Summary:
Was reading the code in this file and noticed that this comment is no longer true after D51068417 (facebook/yoga#1460). Updated the comment to reflect the current state of things

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D51730986
joevilches pushed a commit to joevilches/react-native that referenced this pull request Dec 1, 2023
Summary:

Was reading the code in this file and noticed that this comment is no longer true after D51068417 (facebook/yoga#1460). Updated the comment to reflect the current state of things

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D51730986
joevilches pushed a commit to joevilches/react-native that referenced this pull request Dec 1, 2023
Summary:

Was reading the code in this file and noticed that this comment is no longer true after D51068417 (facebook/yoga#1460). Updated the comment to reflect the current state of things

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D51730986
facebook-github-bot pushed a commit to facebook/react-native that referenced this pull request Dec 1, 2023
Summary:
Pull Request resolved: #41732

Was reading the code in this file and noticed that this comment is no longer true after D51068417 (facebook/yoga#1460). Updated the comment to reflect the current state of things

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D51730986

fbshipit-source-id: beaa5de9576d86e56def35f6e970376c7be8f7ee
Othinn pushed a commit to Othinn/react-native that referenced this pull request Jan 9, 2024
Summary:
Pull Request resolved: facebook#41390

X-link: facebook/yoga#1460

Yoga passes `MeasureMode`/`YGMeasureMode` to express constraints in how a box should be measured, given definite or indefinite available space.

This is modeled after Android [MeasureSpec](https://developer.android.com/reference/android/view/View.MeasureSpec), with a table above `calculateLayoutImpl()` explaining the CSS terms they map to. This can be confusing when flipping between the spec, and code.

This switches internal usages to the CSS terms, but leaves around `YGMeasureMode` since it is the public API passed to measure functions.

Reviewed By: joevilches

Differential Revision: D51068417

fbshipit-source-id: 0a76266a4e7e0cc39996164607229c3c41de2818
Othinn pushed a commit to Othinn/react-native that referenced this pull request Jan 9, 2024
Summary:
Pull Request resolved: facebook#41732

Was reading the code in this file and noticed that this comment is no longer true after D51068417 (facebook/yoga#1460). Updated the comment to reflect the current state of things

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D51730986

fbshipit-source-id: beaa5de9576d86e56def35f6e970376c7be8f7ee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants