diff --git a/benchmark/Benchmark.cpp b/benchmark/Benchmark.cpp index 0bd4c45d..b97a8eae 100644 --- a/benchmark/Benchmark.cpp +++ b/benchmark/Benchmark.cpp @@ -21,9 +21,9 @@ namespace facebook::yoga { using namespace nlohmann; using namespace std::chrono; -constexpr uint32_t kNumRepititions = 100; +constexpr uint32_t kNumRepetitions = 100; using SteadyClockDurations = - std::array; + std::array; static bool inputsMatch( float actualWidth, @@ -333,23 +333,23 @@ BenchmarkResult generateBenchmark(json& capture) { static void printBenchmarkResult( const std::string& name, SteadyClockDurations& durations) { - std::array timesInMs{}; + std::array timesInMs{}; double mean = 0; - for (uint32_t i = 0; i < kNumRepititions; i++) { + for (uint32_t i = 0; i < kNumRepetitions; i++) { auto ms = duration(durations[i]).count(); timesInMs[i] = ms; mean += ms; } - mean /= kNumRepititions; + mean /= kNumRepetitions; std::sort(timesInMs.begin(), timesInMs.end()); - double median = timesInMs[kNumRepititions / 2]; + double median = timesInMs[kNumRepetitions / 2]; double variance = 0; - for (uint32_t i = 0; i < kNumRepititions; i++) { + for (uint32_t i = 0; i < kNumRepetitions; i++) { variance += std::pow(timesInMs[i] - mean, 2); } - variance /= kNumRepititions; + variance /= kNumRepetitions; double stddev = std::sqrt(variance); printf("%s: median: %lf ms, stddev: %lf ms\n", name.c_str(), median, stddev); @@ -370,7 +370,7 @@ void benchmark(std::filesystem::path& capturesDir) { std::string captureName = capture.path().stem().string(); std::cout << "Starting benchmark for " << captureName << std::endl; - for (uint32_t i = 0; i < kNumRepititions; i++) { + for (uint32_t i = 0; i < kNumRepetitions; i++) { BenchmarkResult result = generateBenchmark(j); treeCreationDurations[i] = result.treeCreationDuration; layoutDurations[i] = result.layoutDuration; diff --git a/gentest/fixtures/YGJustifyContentTest.html b/gentest/fixtures/YGJustifyContentTest.html index 1305748b..9cb9d2a4 100644 --- a/gentest/fixtures/YGJustifyContentTest.html +++ b/gentest/fixtures/YGJustifyContentTest.html @@ -70,7 +70,7 @@
-
+
diff --git a/gentest/fixtures/YGMarginTest.html b/gentest/fixtures/YGMarginTest.html index 3258c1fc..d95a058d 100644 --- a/gentest/fixtures/YGMarginTest.html +++ b/gentest/fixtures/YGMarginTest.html @@ -60,13 +60,13 @@
-
+
-
+
diff --git a/java/jni/ScopedGlobalRef.h b/java/jni/ScopedGlobalRef.h index c0ca023e..ff969643 100644 --- a/java/jni/ScopedGlobalRef.h +++ b/java/jni/ScopedGlobalRef.h @@ -33,7 +33,7 @@ namespace facebook::yoga::vanillajni { * * This class is very explicit in its behavior, and it does not allow to perform * unexpected conversions or unexpected ownership transfer. In practice, this - * class acts as a unique pointer where the underying JNI reference can have one + * class acts as a unique pointer where the underlying JNI reference can have one * and just one owner. Transferring ownership is allowed but it is an explicit * operation (implemented via move semantics and also via explicitly API calls). * diff --git a/java/jni/ScopedLocalRef.h b/java/jni/ScopedLocalRef.h index fd49e832..803a8698 100644 --- a/java/jni/ScopedLocalRef.h +++ b/java/jni/ScopedLocalRef.h @@ -35,7 +35,7 @@ namespace facebook::yoga::vanillajni { * * This class is very explicit in its behavior, and it does not allow to perform * unexpected conversions or unexpected ownership transfer. In practice, this - * class acts as a unique pointer where the underying JNI reference can have one + * class acts as a unique pointer where the underlying JNI reference can have one * and just one owner. Transferring ownership is allowed but it is an explicit * operation (implemented via move semantics and also via explicitly API calls). * diff --git a/java/tests/com/facebook/yoga/YGJustifyContentTest.java b/java/tests/com/facebook/yoga/YGJustifyContentTest.java index 52cfebce..f52e351f 100644 --- a/java/tests/com/facebook/yoga/YGJustifyContentTest.java +++ b/java/tests/com/facebook/yoga/YGJustifyContentTest.java @@ -836,7 +836,7 @@ public class YGJustifyContentTest { } @Test - public void test_justify_content_colunn_max_height_and_margin() { + public void test_justify_content_column_max_height_and_margin() { YogaConfig config = YogaConfigFactory.create(); final YogaNode root = createNode(config); diff --git a/java/tests/com/facebook/yoga/YGMarginTest.java b/java/tests/com/facebook/yoga/YGMarginTest.java index fc07ee41..78b327fa 100644 --- a/java/tests/com/facebook/yoga/YGMarginTest.java +++ b/java/tests/com/facebook/yoga/YGMarginTest.java @@ -696,7 +696,7 @@ public class YGMarginTest { } @Test - public void test_margin_auto_mutiple_children_column() { + public void test_margin_auto_multiple_children_column() { YogaConfig config = YogaConfigFactory.create(); final YogaNode root = createNode(config); @@ -769,7 +769,7 @@ public class YGMarginTest { } @Test - public void test_margin_auto_mutiple_children_row() { + public void test_margin_auto_multiple_children_row() { YogaConfig config = YogaConfigFactory.create(); final YogaNode root = createNode(config); diff --git a/javascript/tests/generated/YGJustifyContentTest.test.ts b/javascript/tests/generated/YGJustifyContentTest.test.ts index 0f6609bc..d17ecac1 100644 --- a/javascript/tests/generated/YGJustifyContentTest.test.ts +++ b/javascript/tests/generated/YGJustifyContentTest.test.ts @@ -900,7 +900,7 @@ test('justify_content_column_min_height_and_margin', () => { config.free(); } }); -test('justify_content_colunn_max_height_and_margin', () => { +test('justify_content_column_max_height_and_margin', () => { const config = Yoga.Config.create(); let root; diff --git a/javascript/tests/generated/YGMarginTest.test.ts b/javascript/tests/generated/YGMarginTest.test.ts index 10029189..501e2e36 100644 --- a/javascript/tests/generated/YGMarginTest.test.ts +++ b/javascript/tests/generated/YGMarginTest.test.ts @@ -765,7 +765,7 @@ test('margin_auto_bottom_and_top_justify_center', () => { config.free(); } }); -test('margin_auto_mutiple_children_column', () => { +test('margin_auto_multiple_children_column', () => { const config = Yoga.Config.create(); let root; @@ -843,7 +843,7 @@ test('margin_auto_mutiple_children_column', () => { config.free(); } }); -test('margin_auto_mutiple_children_row', () => { +test('margin_auto_multiple_children_row', () => { const config = Yoga.Config.create(); let root; diff --git a/tests/YGZeroOutLayoutRecursivlyTest.cpp b/tests/YGZeroOutLayoutRecursivelyTest.cpp similarity index 100% rename from tests/YGZeroOutLayoutRecursivlyTest.cpp rename to tests/YGZeroOutLayoutRecursivelyTest.cpp diff --git a/tests/generated/YGJustifyContentTest.cpp b/tests/generated/YGJustifyContentTest.cpp index 52863049..903cbe1f 100644 --- a/tests/generated/YGJustifyContentTest.cpp +++ b/tests/generated/YGJustifyContentTest.cpp @@ -834,7 +834,7 @@ TEST(YogaTest, justify_content_column_min_height_and_margin) { YGConfigFree(config); } -TEST(YogaTest, justify_content_colunn_max_height_and_margin) { +TEST(YogaTest, justify_content_column_max_height_and_margin) { const YGConfigRef config = YGConfigNew(); const YGNodeRef root = YGNodeNewWithConfig(config); diff --git a/tests/generated/YGMarginTest.cpp b/tests/generated/YGMarginTest.cpp index 9db5662d..71393414 100644 --- a/tests/generated/YGMarginTest.cpp +++ b/tests/generated/YGMarginTest.cpp @@ -695,7 +695,7 @@ TEST(YogaTest, margin_auto_bottom_and_top_justify_center) { YGConfigFree(config); } -TEST(YogaTest, margin_auto_mutiple_children_column) { +TEST(YogaTest, margin_auto_multiple_children_column) { const YGConfigRef config = YGConfigNew(); const YGNodeRef root = YGNodeNewWithConfig(config); @@ -769,7 +769,7 @@ TEST(YogaTest, margin_auto_mutiple_children_column) { YGConfigFree(config); } -TEST(YogaTest, margin_auto_mutiple_children_row) { +TEST(YogaTest, margin_auto_multiple_children_row) { const YGConfigRef config = YGConfigNew(); const YGNodeRef root = YGNodeNewWithConfig(config); diff --git a/website/blog/yoga-3-release/2024-05-14-announcing-yoga-3.0.md b/website/blog/yoga-3-release/2024-05-14-announcing-yoga-3.0.md index c77938f3..8b301437 100644 --- a/website/blog/yoga-3-release/2024-05-14-announcing-yoga-3.0.md +++ b/website/blog/yoga-3-release/2024-05-14-announcing-yoga-3.0.md @@ -21,7 +21,7 @@ Yoga 3.0 is a new major (breaking) version of Yoga, used by React Native 0.74. We added full support for the `static` position type which has existed in an incomplete state for some time now. With this release `static` is now web-compliant in the context of Flexbox. Some things that were added/changed: -* The default position type is now `relative` [again](https://github.com/facebook/yoga/commit/fc88b2f774f0ab9090d7ca15de6680f26d7285ad) and not `static`. This should not have any effect on layout as the previously introduced `YGPostitionTypeStatic` was not being used within Yoga, so it behaved just like `relative`. +* The default position type is now `relative` [again](https://github.com/facebook/yoga/commit/fc88b2f774f0ab9090d7ca15de6680f26d7285ad) and not `static`. This should not have any effect on layout as the previously introduced `YGPositionTypeStatic` was not being used within Yoga, so it behaved just like `relative`. * `static` nodes ignore insets (`left`, `right`, `top`, `bottom`, etc.) * The idea of a[ containing block](../../docs/advanced/containing-block) was introduced. For `absolute` nodes this is usually the nearest non-`static` ancestor. For every other position type this is just the parent since Yoga is a Flexbox implementation. * A new public API `YGNodeSetAlwaysFormsContainingBlock` which takes a boolean indicating if the node should always form a containing block for any descendant. This is useful for properly supporting things like [transforms](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_transforms), which will force the node to form a containing block but is outside the scope of Yoga. diff --git a/website/docs/advanced/containing-block.md b/website/docs/advanced/containing-block.md index 4658a234..a879991b 100644 --- a/website/docs/advanced/containing-block.md +++ b/website/docs/advanced/containing-block.md @@ -29,7 +29,7 @@ containing blocks is much more streamlined and it is helpful to frame it differe is helpful for supporting things outside of Yoga which would form a containing block on the web, such as [filters](https://developer.mozilla.org/en-US/docs/Web/CSS/filter) or [transforms](https://developer.mozilla.org/en-US/docs/Web/CSS/transform). This - is done by calling the corresponding API for the lanuage you are working in. + is done by calling the corresponding API for the language you are working in. ```cpp diff --git a/website/docs/advanced/incremental-layout.mdx b/website/docs/advanced/incremental-layout.mdx index 7c4eaf36..1b00806a 100644 --- a/website/docs/advanced/incremental-layout.mdx +++ b/website/docs/advanced/incremental-layout.mdx @@ -61,7 +61,7 @@ void applyLayout(YogaNode node) { :::danger -Yoga's JavaScript bindings are missing support for acessing the `HasNewLayout` flag. https://github.com/facebook/yoga/issues/681 +Yoga's JavaScript bindings are missing support for accessing the `HasNewLayout` flag. https://github.com/facebook/yoga/issues/681 ::: diff --git a/website/docs/styling/align-content.mdx b/website/docs/styling/align-content.mdx index 390cee35..e7409723 100644 --- a/website/docs/styling/align-content.mdx +++ b/website/docs/styling/align-content.mdx @@ -22,7 +22,7 @@ remaining space between the lines. **Space around**: Evenly space wrapped lines across the container's main axis, distributing remaining space around the lines. Compared to space between using -space around will result in space being distributed to the begining of +space around will result in space being distributed to the beginning of the first lines and end of the last line. **Space evenly**: Evenly space wrapped lines across the container's main axis, distributing diff --git a/website/docs/styling/insets.mdx b/website/docs/styling/insets.mdx index 1ab853d2..39287750 100644 --- a/website/docs/styling/insets.mdx +++ b/website/docs/styling/insets.mdx @@ -36,7 +36,7 @@ what [position type](/docs/styling/position) the node has. from where the node would normally be in the container. Each inset property is relative to the node's corresponding physical edge. So `YGNodeStyleSetPosition(node, YGEdgeRight, 10.0f)` will offset the node so that the right edge is 10 units away from where the right edge would be originally. -* If the node is aboslute then insets will move the node the designated amount away from +* If the node is absolute then insets will move the node the designated amount away from the node's [containing block](/docs/advanced/containing-block). So `YGNodeStyleSetPosition(node, YGEdgeRight, 10.0f)` will offset the node so that the right edge is 10 units away from the [containing block's](/docs/advanced/containing-block) right edge. diff --git a/website/docs/styling/margin-padding-border.mdx b/website/docs/styling/margin-padding-border.mdx index 742be082..b5897035 100644 --- a/website/docs/styling/margin-padding-border.mdx +++ b/website/docs/styling/margin-padding-border.mdx @@ -16,7 +16,7 @@ of its parent if the parent is auto sized. of an element if it has an explicit size set. For auto sized nodes padding will increase the size of the node as well as offset the location of any children. -**Border**: in Yoga acts exactly like padding and only exists as a seperate property so +**Border**: in Yoga acts exactly like padding and only exists as a separate property so that higher level frameworks get a hint as to how thick to draw a border. Yoga however does not do any drawing so just uses this information during layout where border acts exactly like padding. diff --git a/yoga/YGConfig.h b/yoga/YGConfig.h index 7c1a8f29..12f6e204 100644 --- a/yoga/YGConfig.h +++ b/yoga/YGConfig.h @@ -25,7 +25,7 @@ typedef const struct YGNode* YGNodeConstRef; typedef struct YGConfig* YGConfigRef; /** - * Handle to an immutable Yoga configruation. + * Handle to an immutable Yoga configuration. */ typedef const struct YGConfig* YGConfigConstRef; @@ -60,7 +60,7 @@ YG_EXPORT void YGConfigSetUseWebDefaults(YGConfigRef config, bool enabled); YG_EXPORT bool YGConfigGetUseWebDefaults(YGConfigConstRef config); /** - * Yoga will by deafult round final layout positions and dimensions to the + * Yoga will by default round final layout positions and dimensions to the * nearst point. `pointScaleFactor` controls the density of the grid used for * layout rounding (e.g. to round to the closest display pixel). * @@ -79,11 +79,11 @@ YG_EXPORT float YGConfigGetPointScaleFactor(YGConfigConstRef config); * Configures how Yoga balances W3C conformance vs compatibility with layouts * created against earlier versions of Yoga. * - * By deafult Yoga will prioritize W3C conformance. `Errata` may be set to ask + * By default Yoga will prioritize W3C conformance. `Errata` may be set to ask * Yoga to produce specific incorrect behaviors. E.g. `YGConfigSetErrata(config, * YGErrataStretchFlexBasis)`. * - * YGErrata is a bitmask, and multiple errata may be set at once. Predfined + * YGErrata is a bitmask, and multiple errata may be set at once. Predefined * constants exist for convenience: * 1. YGErrataNone: No errata * 2. YGErrataClassic: Match layout behaviors of Yoga 1.x diff --git a/yoga/YGNode.h b/yoga/YGNode.h index 448000eb..de797b82 100644 --- a/yoga/YGNode.h +++ b/yoga/YGNode.h @@ -56,7 +56,7 @@ YG_EXPORT void YGNodeFreeRecursive(YGNodeRef node); /** * Frees the Yoga node without disconnecting it from its owner or children. * Allows garbage collecting Yoga nodes in parallel when the entire tree is - * unrechable. + * unreachable. */ YG_EXPORT void YGNodeFinalize(YGNodeRef node); @@ -186,7 +186,7 @@ typedef struct YGSize { } YGSize; /** - * Returns the computed dimensions of the node, following the contraints of + * Returns the computed dimensions of the node, following the constraints of * `widthMode` and `heightMode`: * * YGMeasureModeUndefined: The parent has not imposed any constraint on the @@ -199,7 +199,7 @@ typedef struct YGSize { * child. The child is going to be given those bounds regardless of how big it * wants to be. * - * @returns the size of the leaf node, measured under the given contraints. + * @returns the size of the leaf node, measured under the given constraints. */ typedef YGSize (*YGMeasureFunc)( YGNodeConstRef node, @@ -221,7 +221,7 @@ YG_EXPORT void YGNodeSetMeasureFunc(YGNodeRef node, YGMeasureFunc measureFunc); YG_EXPORT bool YGNodeHasMeasureFunc(YGNodeConstRef node); /** - * @returns a defined offet to baseline (ascent). + * @returns a defined offset to baseline (ascent). */ typedef float (*YGBaselineFunc)(YGNodeConstRef node, float width, float height);