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

Fix issue where paddingStart and paddingEnd were swapped with row reverse #1426

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions gentest/fixtures/YGFlexDirectionTest.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
<div style="width: 10px;"></div>
</div>

<div id="flex_direction_row_reverse_border_start" data-disabled="true" style="height: 100px; width: 100px; flex-direction: row-reverse; border-start-width: 100px;">
<div id="flex_direction_row_reverse_border_start" style="height: 100px; width: 100px; flex-direction: row-reverse; border-start-width: 100px;">
<div style="width: 10px;"></div>
<div style="width: 10px;"></div>
<div style="width: 10px;"></div>
Expand All @@ -125,7 +125,7 @@
<div style="width: 10px;"></div>
</div>

<div id="flex_direction_row_reverse_border_end" data-disabled="true" style="height: 100px; width: 100px; flex-direction: row-reverse; border-end-width: 100px;">
<div id="flex_direction_row_reverse_border_end" style="height: 100px; width: 100px; flex-direction: row-reverse; border-end-width: 100px;">
<div style="width: 10px;"></div>
<div style="width: 10px;"></div>
<div style="width: 10px;"></div>
Expand Down
56 changes: 28 additions & 28 deletions java/tests/com/facebook/yoga/YGAspectRatioTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,28 +95,28 @@ public void test_aspect_ratio_does_not_stretch_cross_axis_dim() {

assertEquals(0f, root_child0_child0.getLayoutX(), 0.0f);
assertEquals(0f, root_child0_child0.getLayoutY(), 0.0f);
assertEquals(300f, root_child0_child0.getLayoutWidth(), 0.0f);
assertEquals(197f, root_child0_child0.getLayoutHeight(), 0.0f);
assertEquals(285f, root_child0_child0.getLayoutWidth(), 0.0f);
assertEquals(187f, root_child0_child0.getLayoutHeight(), 0.0f);

assertEquals(0f, root_child0_child0_child0.getLayoutX(), 0.0f);
assertEquals(0f, root_child0_child0_child0.getLayoutY(), 0.0f);
assertEquals(197f, root_child0_child0_child0.getLayoutWidth(), 0.0f);
assertEquals(197f, root_child0_child0_child0.getLayoutHeight(), 0.0f);
assertEquals(187f, root_child0_child0_child0.getLayoutWidth(), 0.0f);
assertEquals(187f, root_child0_child0_child0.getLayoutHeight(), 0.0f);

assertEquals(197f, root_child0_child0_child1.getLayoutX(), 0.0f);
assertEquals(187f, root_child0_child0_child1.getLayoutX(), 0.0f);
assertEquals(0f, root_child0_child0_child1.getLayoutY(), 0.0f);
assertEquals(5f, root_child0_child0_child1.getLayoutWidth(), 0.0f);
assertEquals(197f, root_child0_child0_child1.getLayoutHeight(), 0.0f);
assertEquals(187f, root_child0_child0_child1.getLayoutHeight(), 0.0f);

assertEquals(202f, root_child0_child0_child2.getLayoutX(), 0.0f);
assertEquals(192f, root_child0_child0_child2.getLayoutX(), 0.0f);
assertEquals(0f, root_child0_child0_child2.getLayoutY(), 0.0f);
assertEquals(98f, root_child0_child0_child2.getLayoutWidth(), 0.0f);
assertEquals(197f, root_child0_child0_child2.getLayoutHeight(), 0.0f);
assertEquals(93f, root_child0_child0_child2.getLayoutWidth(), 0.0f);
assertEquals(187f, root_child0_child0_child2.getLayoutHeight(), 0.0f);

assertEquals(0f, root_child0_child0_child2_child0.getLayoutX(), 0.0f);
assertEquals(0f, root_child0_child0_child2_child0.getLayoutY(), 0.0f);
assertEquals(98f, root_child0_child0_child2_child0.getLayoutWidth(), 0.0f);
assertEquals(197f, root_child0_child0_child2_child0.getLayoutHeight(), 0.0f);
assertEquals(93f, root_child0_child0_child2_child0.getLayoutWidth(), 0.0f);
assertEquals(187f, root_child0_child0_child2_child0.getLayoutHeight(), 0.0f);

assertEquals(0f, root_child0_child0_child2_child0_child0.getLayoutX(), 0.0f);
assertEquals(0f, root_child0_child0_child2_child0_child0.getLayoutY(), 0.0f);
Expand All @@ -125,8 +125,8 @@ public void test_aspect_ratio_does_not_stretch_cross_axis_dim() {

assertEquals(0f, root_child0_child0_child2_child0_child1.getLayoutX(), 0.0f);
assertEquals(0f, root_child0_child0_child2_child0_child1.getLayoutY(), 0.0f);
assertEquals(98f, root_child0_child0_child2_child0_child1.getLayoutWidth(), 0.0f);
assertEquals(197f, root_child0_child0_child2_child0_child1.getLayoutHeight(), 0.0f);
assertEquals(93f, root_child0_child0_child2_child0_child1.getLayoutWidth(), 0.0f);
assertEquals(187f, root_child0_child0_child2_child0_child1.getLayoutHeight(), 0.0f);

root.setDirection(YogaDirection.RTL);
root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);
Expand All @@ -141,40 +141,40 @@ public void test_aspect_ratio_does_not_stretch_cross_axis_dim() {
assertEquals(300f, root_child0.getLayoutWidth(), 0.0f);
assertEquals(300f, root_child0.getLayoutHeight(), 0.0f);

assertEquals(0f, root_child0_child0.getLayoutX(), 0.0f);
assertEquals(30f, root_child0_child0.getLayoutX(), 0.0f);
assertEquals(0f, root_child0_child0.getLayoutY(), 0.0f);
assertEquals(300f, root_child0_child0.getLayoutWidth(), 0.0f);
assertEquals(197f, root_child0_child0.getLayoutHeight(), 0.0f);
assertEquals(285f, root_child0_child0.getLayoutWidth(), 0.0f);
assertEquals(187f, root_child0_child0.getLayoutHeight(), 0.0f);

assertEquals(103f, root_child0_child0_child0.getLayoutX(), 0.0f);
assertEquals(98f, root_child0_child0_child0.getLayoutX(), 0.0f);
assertEquals(0f, root_child0_child0_child0.getLayoutY(), 0.0f);
assertEquals(197f, root_child0_child0_child0.getLayoutWidth(), 0.0f);
assertEquals(197f, root_child0_child0_child0.getLayoutHeight(), 0.0f);
assertEquals(187f, root_child0_child0_child0.getLayoutWidth(), 0.0f);
assertEquals(187f, root_child0_child0_child0.getLayoutHeight(), 0.0f);

assertEquals(98f, root_child0_child0_child1.getLayoutX(), 0.0f);
assertEquals(93f, root_child0_child0_child1.getLayoutX(), 0.0f);
assertEquals(0f, root_child0_child0_child1.getLayoutY(), 0.0f);
assertEquals(5f, root_child0_child0_child1.getLayoutWidth(), 0.0f);
assertEquals(197f, root_child0_child0_child1.getLayoutHeight(), 0.0f);
assertEquals(187f, root_child0_child0_child1.getLayoutHeight(), 0.0f);

assertEquals(0f, root_child0_child0_child2.getLayoutX(), 0.0f);
assertEquals(0f, root_child0_child0_child2.getLayoutY(), 0.0f);
assertEquals(98f, root_child0_child0_child2.getLayoutWidth(), 0.0f);
assertEquals(197f, root_child0_child0_child2.getLayoutHeight(), 0.0f);
assertEquals(93f, root_child0_child0_child2.getLayoutWidth(), 0.0f);
assertEquals(187f, root_child0_child0_child2.getLayoutHeight(), 0.0f);

assertEquals(0f, root_child0_child0_child2_child0.getLayoutX(), 0.0f);
assertEquals(0f, root_child0_child0_child2_child0.getLayoutY(), 0.0f);
assertEquals(98f, root_child0_child0_child2_child0.getLayoutWidth(), 0.0f);
assertEquals(197f, root_child0_child0_child2_child0.getLayoutHeight(), 0.0f);
assertEquals(93f, root_child0_child0_child2_child0.getLayoutWidth(), 0.0f);
assertEquals(187f, root_child0_child0_child2_child0.getLayoutHeight(), 0.0f);

assertEquals(93f, root_child0_child0_child2_child0_child0.getLayoutX(), 0.0f);
assertEquals(88f, root_child0_child0_child2_child0_child0.getLayoutX(), 0.0f);
assertEquals(0f, root_child0_child0_child2_child0_child0.getLayoutY(), 0.0f);
assertEquals(5f, root_child0_child0_child2_child0_child0.getLayoutWidth(), 0.0f);
assertEquals(0f, root_child0_child0_child2_child0_child0.getLayoutHeight(), 0.0f);

assertEquals(0f, root_child0_child0_child2_child0_child1.getLayoutX(), 0.0f);
assertEquals(0f, root_child0_child0_child2_child0_child1.getLayoutY(), 0.0f);
assertEquals(98f, root_child0_child0_child2_child0_child1.getLayoutWidth(), 0.0f);
assertEquals(197f, root_child0_child0_child2_child0_child1.getLayoutHeight(), 0.0f);
assertEquals(93f, root_child0_child0_child2_child0_child1.getLayoutWidth(), 0.0f);
assertEquals(187f, root_child0_child0_child2_child0_child1.getLayoutHeight(), 0.0f);
}

private YogaNode createNode(YogaConfig config) {
Expand Down
2 changes: 0 additions & 2 deletions java/tests/com/facebook/yoga/YGFlexDirectionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -1329,7 +1329,6 @@ public void test_flex_direction_row_reverse_border_left() {
}

@Test
@Ignore
public void test_flex_direction_row_reverse_border_start() {
YogaConfig config = YogaConfigFactory.create();
config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);
Expand Down Expand Up @@ -1468,7 +1467,6 @@ public void test_flex_direction_row_reverse_border_right() {
}

@Test
@Ignore
public void test_flex_direction_row_reverse_border_end() {
YogaConfig config = YogaConfigFactory.create();
config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);
Expand Down
56 changes: 28 additions & 28 deletions javascript/tests/generated/YGAspectRatioTest.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,28 +95,28 @@ test.skip('aspect_ratio_does_not_stretch_cross_axis_dim', () => {

expect(root_child0_child0.getComputedLeft()).toBe(0);
expect(root_child0_child0.getComputedTop()).toBe(0);
expect(root_child0_child0.getComputedWidth()).toBe(300);
expect(root_child0_child0.getComputedHeight()).toBe(197);
expect(root_child0_child0.getComputedWidth()).toBe(285);
expect(root_child0_child0.getComputedHeight()).toBe(187);

expect(root_child0_child0_child0.getComputedLeft()).toBe(0);
expect(root_child0_child0_child0.getComputedTop()).toBe(0);
expect(root_child0_child0_child0.getComputedWidth()).toBe(197);
expect(root_child0_child0_child0.getComputedHeight()).toBe(197);
expect(root_child0_child0_child0.getComputedWidth()).toBe(187);
expect(root_child0_child0_child0.getComputedHeight()).toBe(187);

expect(root_child0_child0_child1.getComputedLeft()).toBe(197);
expect(root_child0_child0_child1.getComputedLeft()).toBe(187);
expect(root_child0_child0_child1.getComputedTop()).toBe(0);
expect(root_child0_child0_child1.getComputedWidth()).toBe(5);
expect(root_child0_child0_child1.getComputedHeight()).toBe(197);
expect(root_child0_child0_child1.getComputedHeight()).toBe(187);

expect(root_child0_child0_child2.getComputedLeft()).toBe(202);
expect(root_child0_child0_child2.getComputedLeft()).toBe(192);
expect(root_child0_child0_child2.getComputedTop()).toBe(0);
expect(root_child0_child0_child2.getComputedWidth()).toBe(98);
expect(root_child0_child0_child2.getComputedHeight()).toBe(197);
expect(root_child0_child0_child2.getComputedWidth()).toBe(93);
expect(root_child0_child0_child2.getComputedHeight()).toBe(187);

expect(root_child0_child0_child2_child0.getComputedLeft()).toBe(0);
expect(root_child0_child0_child2_child0.getComputedTop()).toBe(0);
expect(root_child0_child0_child2_child0.getComputedWidth()).toBe(98);
expect(root_child0_child0_child2_child0.getComputedHeight()).toBe(197);
expect(root_child0_child0_child2_child0.getComputedWidth()).toBe(93);
expect(root_child0_child0_child2_child0.getComputedHeight()).toBe(187);

expect(root_child0_child0_child2_child0_child0.getComputedLeft()).toBe(0);
expect(root_child0_child0_child2_child0_child0.getComputedTop()).toBe(0);
Expand All @@ -125,8 +125,8 @@ test.skip('aspect_ratio_does_not_stretch_cross_axis_dim', () => {

expect(root_child0_child0_child2_child0_child1.getComputedLeft()).toBe(0);
expect(root_child0_child0_child2_child0_child1.getComputedTop()).toBe(0);
expect(root_child0_child0_child2_child0_child1.getComputedWidth()).toBe(98);
expect(root_child0_child0_child2_child0_child1.getComputedHeight()).toBe(197);
expect(root_child0_child0_child2_child0_child1.getComputedWidth()).toBe(93);
expect(root_child0_child0_child2_child0_child1.getComputedHeight()).toBe(187);

root.calculateLayout(undefined, undefined, Direction.RTL);

Expand All @@ -140,40 +140,40 @@ test.skip('aspect_ratio_does_not_stretch_cross_axis_dim', () => {
expect(root_child0.getComputedWidth()).toBe(300);
expect(root_child0.getComputedHeight()).toBe(300);

expect(root_child0_child0.getComputedLeft()).toBe(0);
expect(root_child0_child0.getComputedLeft()).toBe(30);
expect(root_child0_child0.getComputedTop()).toBe(0);
expect(root_child0_child0.getComputedWidth()).toBe(300);
expect(root_child0_child0.getComputedHeight()).toBe(197);
expect(root_child0_child0.getComputedWidth()).toBe(285);
expect(root_child0_child0.getComputedHeight()).toBe(187);

expect(root_child0_child0_child0.getComputedLeft()).toBe(103);
expect(root_child0_child0_child0.getComputedLeft()).toBe(98);
expect(root_child0_child0_child0.getComputedTop()).toBe(0);
expect(root_child0_child0_child0.getComputedWidth()).toBe(197);
expect(root_child0_child0_child0.getComputedHeight()).toBe(197);
expect(root_child0_child0_child0.getComputedWidth()).toBe(187);
expect(root_child0_child0_child0.getComputedHeight()).toBe(187);

expect(root_child0_child0_child1.getComputedLeft()).toBe(98);
expect(root_child0_child0_child1.getComputedLeft()).toBe(93);
expect(root_child0_child0_child1.getComputedTop()).toBe(0);
expect(root_child0_child0_child1.getComputedWidth()).toBe(5);
expect(root_child0_child0_child1.getComputedHeight()).toBe(197);
expect(root_child0_child0_child1.getComputedHeight()).toBe(187);

expect(root_child0_child0_child2.getComputedLeft()).toBe(0);
expect(root_child0_child0_child2.getComputedTop()).toBe(0);
expect(root_child0_child0_child2.getComputedWidth()).toBe(98);
expect(root_child0_child0_child2.getComputedHeight()).toBe(197);
expect(root_child0_child0_child2.getComputedWidth()).toBe(93);
expect(root_child0_child0_child2.getComputedHeight()).toBe(187);

expect(root_child0_child0_child2_child0.getComputedLeft()).toBe(0);
expect(root_child0_child0_child2_child0.getComputedTop()).toBe(0);
expect(root_child0_child0_child2_child0.getComputedWidth()).toBe(98);
expect(root_child0_child0_child2_child0.getComputedHeight()).toBe(197);
expect(root_child0_child0_child2_child0.getComputedWidth()).toBe(93);
expect(root_child0_child0_child2_child0.getComputedHeight()).toBe(187);

expect(root_child0_child0_child2_child0_child0.getComputedLeft()).toBe(93);
expect(root_child0_child0_child2_child0_child0.getComputedLeft()).toBe(88);
expect(root_child0_child0_child2_child0_child0.getComputedTop()).toBe(0);
expect(root_child0_child0_child2_child0_child0.getComputedWidth()).toBe(5);
expect(root_child0_child0_child2_child0_child0.getComputedHeight()).toBe(0);

expect(root_child0_child0_child2_child0_child1.getComputedLeft()).toBe(0);
expect(root_child0_child0_child2_child0_child1.getComputedTop()).toBe(0);
expect(root_child0_child0_child2_child0_child1.getComputedWidth()).toBe(98);
expect(root_child0_child0_child2_child0_child1.getComputedHeight()).toBe(197);
expect(root_child0_child0_child2_child0_child1.getComputedWidth()).toBe(93);
expect(root_child0_child0_child2_child0_child1.getComputedHeight()).toBe(187);
} finally {
if (typeof root !== 'undefined') {
root.freeRecursive();
Expand Down
4 changes: 2 additions & 2 deletions javascript/tests/generated/YGFlexDirectionTest.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1440,7 +1440,7 @@ test('flex_direction_row_reverse_border_left', () => {
config.free();
}
});
test.skip('flex_direction_row_reverse_border_start', () => {
test('flex_direction_row_reverse_border_start', () => {
const config = Yoga.Config.create();
let root;

Expand Down Expand Up @@ -1590,7 +1590,7 @@ test('flex_direction_row_reverse_border_right', () => {
config.free();
}
});
test.skip('flex_direction_row_reverse_border_end', () => {
test('flex_direction_row_reverse_border_end', () => {
const config = Yoga.Config.create();
let root;

Expand Down
Loading
Loading