Add CSSProp and CSSPropDefinition#42913
Closed
NickGerleman wants to merge 4 commits into
Closed
Conversation
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D53518450 |
5f95ecd to
aa813ac
Compare
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D53518450 |
aa813ac to
22408f5
Compare
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D53518450 |
22408f5 to
aa27cdf
Compare
Differential Revision: D53377527, fbshipit-source-id: 9540b53c6feaf8f275b4754cc0da0df9f5bf6b6d
Summary: This adds: 1. `CSSValue`: A union-y type, mapping to a collection of CSS data types. The aim here is to more closely model the data types after the CSS spec, to allow RN to store them correctly, while not taking up too much space. These types will form the foundation of Yoga prop storage (and probably some other props down the line), so compactness is a priority. 2. `parseCSSValue()`: This uses the previously added Tokenizer, along with parsing rules, to be able to parse a single component value, into a literal keyword, `<length>`, `<length-percentage>`, `<percent>`, or `<number>`. This will be wired to the props parsing infrastructure. Changelog: [Internal] Differential Revision: D53342595 fbshipit-source-id: 436078dfea7aafeae7e4a55c732aabb1d73220dc
Summary: Adds support for parsing and storing the <ratio> CSS basic data type. Changelog: [Internal] Differential Revision: D53457930 fbshipit-source-id: b0f6e1203a5f3aa636a4c59d4ea6c69ef475606b
Summary: Pull Request resolved: react#42913 This structures properties into a `CSSProp` enum (so that we can have a runtime-key per style prop), associated with a `CSSPropDefinition` structure which groups the supported types and keywords. This has some niceness of removing the macro bits, but more importantly, means we can query parse related information without a field of the value yet existing (need for sparse storage of CSS values). In the future, it will serve as where we define "initial" values, and likely, the processes for interpolation and inheritance. We restructure `CSSValueVariant` to not always support keywords, as it may not be a valid possibility for computed values (which do not have CSS wide keywords). Computed values themselves may also reduce more keywords than the global ones (e.g. border width computed value absolutizes keywords). We also flesh out more of the prop definitions, and parsing. All the properties here relay back to YogaStylableProps of today, but I intentionally filled out the prop definitions a bit more than we do anything with right now (will design higher level to ignore unknown props). Changelog: [Internal] Reviewed By: rozele Differential Revision: D53518450 fbshipit-source-id: 4308795814632c5319acb5667298b5c1c22ef69b
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D53518450 |
aa27cdf to
757cfaf
Compare
Contributor
|
This pull request has been merged in c37fc74. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
This structures properties into a
CSSPropenum (so that we can have a runtime-key per style prop), associated with aCSSPropDefinitionstructure which groups the supported types and keywords. This has some niceness of removing the macro bits, but more importantly, means we can query parse related information without a field of the value yet existing (need for sparse storage of CSS values). In the future, it will serve as where we define "initial" values, and likely, the processes for interpolation and inheritance.We restructure
CSSValueVariantto not always support keywords, as it may not be a valid possibility for computed values (which do not have CSS wide keywords). Computed values themselves may also reduce more keywords than the global ones (e.g. border width computed value absolutizes keywords).We also flesh out more of the prop definitions, and parsing. All the properties here relay back to YogaStylableProps of today, but I intentionally filled out the prop definitions a bit more than we do anything with right now (will design higher level to ignore unknown props).
Changelog: [Internal]
Differential Revision: D53518450