Skip to content

Commit

Permalink
Change comment on Yoga measure modes in RN (facebook#41732)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Joe Vilches authored and facebook-github-bot committed Dec 1, 2023
1 parent 7e5f15b commit 4be9607
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -604,13 +604,11 @@ void YogaLayoutableShadowNode::layoutTree(
react_native_assert(!std::isinf(minimumSize.width));
react_native_assert(!std::isinf(minimumSize.height));

// Internally Yoga uses three different measurement modes controlling layout
// constraints: `Undefined`, `Exactly`, and `AtMost`. These modes are an
// implementation detail and are not defined in `CSS Flexible Box Layout
// Module`. Yoga C++ API (and `YGNodeCalculateLayout` function particularly)
// does not allow to specify the measure modes explicitly. Instead, it infers
// these from styles associated with the root node.
// To pass the actual layout constraints to Yoga we represent them as
// Yoga C++ API (and `YGNodeCalculateLayout` function particularly)
// does not allow to specify sizing modes (see
// https://www.w3.org/TR/css-sizing-3/#auto-box-sizes) explicitly. Instead, it
// infers these from styles associated with the root node. To pass the actual
// layout constraints to Yoga we represent them as
// `(min/max)(Height/Width)` style properties. Also, we pass `ownerWidth` &
// `ownerHeight` to allow proper calculation of relative (e.g. specified in
// percents) style values.
Expand Down

0 comments on commit 4be9607

Please sign in to comment.