Impl of content box (#1711)
Summary: X-link: https://github.com/facebook/react-native/pull/46741 Pull Request resolved: https://github.com/facebook/yoga/pull/1711 box sizing is really just a reinterpretation of what length properties (like `width`, `height`, `max-width`, etc) mean. So to implement this I just add the border and padding if we are in content box when we ask for any of these properties. All the math that gets done by the algorithm is still in border box land, and the layout we return is to be interpreted as the border box (this is actually the expected behavior per https://drafts.csswg.org/css-sizing/#box-sizing). This makes this implementation pretty simple actually. Changelog: [Internal] Reviewed By: NickGerleman Differential Revision: D63416833 fbshipit-source-id: fd76132cf51e8a5092129802c3a12ab24023018b
This commit is contained in:
committed by
Facebook GitHub Bot
parent
bc5098fc80
commit
671ae61a39
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<84bb16d1a7ae39fb8f159ee58baef4c2>>
|
||||
* @generated SignedSource<<c57cfea6c33a34e2a67a855138e9833b>>
|
||||
* generated by gentest/gentest-driver.ts from gentest/fixtures/YGBoxSizingTest.html
|
||||
*/
|
||||
|
||||
@@ -28,8 +28,7 @@ public class YGBoxSizingTest {
|
||||
@Parameterized.Parameter public TestParametrization.NodeFactory mNodeFactory;
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void test_box_sizing_content_box() {
|
||||
public void test_box_sizing_content_box_simple() {
|
||||
YogaConfig config = YogaConfigFactory.create();
|
||||
|
||||
final YogaNode root = createNode(config);
|
||||
@@ -96,7 +95,6 @@ public class YGBoxSizingTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void test_box_sizing_content_box_padding_only() {
|
||||
YogaConfig config = YogaConfigFactory.create();
|
||||
|
||||
@@ -156,7 +154,6 @@ public class YGBoxSizingTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void test_box_sizing_content_box_border_only() {
|
||||
YogaConfig config = YogaConfigFactory.create();
|
||||
|
||||
@@ -216,7 +213,6 @@ public class YGBoxSizingTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void test_box_sizing_content_box_no_padding_no_border() {
|
||||
YogaConfig config = YogaConfigFactory.create();
|
||||
|
||||
@@ -268,7 +264,6 @@ public class YGBoxSizingTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void test_box_sizing_content_box_children() {
|
||||
YogaConfig config = YogaConfigFactory.create();
|
||||
|
||||
@@ -456,7 +451,6 @@ public class YGBoxSizingTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void test_box_sizing_content_box_siblings() {
|
||||
YogaConfig config = YogaConfigFactory.create();
|
||||
|
||||
@@ -644,7 +638,6 @@ public class YGBoxSizingTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void test_box_sizing_content_box_max_width() {
|
||||
YogaConfig config = YogaConfigFactory.create();
|
||||
|
||||
@@ -772,7 +765,6 @@ public class YGBoxSizingTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void test_box_sizing_content_box_max_height() {
|
||||
YogaConfig config = YogaConfigFactory.create();
|
||||
|
||||
@@ -900,7 +892,6 @@ public class YGBoxSizingTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void test_box_sizing_content_box_min_width() {
|
||||
YogaConfig config = YogaConfigFactory.create();
|
||||
|
||||
@@ -1028,7 +1019,6 @@ public class YGBoxSizingTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void test_box_sizing_content_box_min_height() {
|
||||
YogaConfig config = YogaConfigFactory.create();
|
||||
|
||||
@@ -1156,7 +1146,6 @@ public class YGBoxSizingTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void test_box_sizing_content_box_no_height_no_width() {
|
||||
YogaConfig config = YogaConfigFactory.create();
|
||||
|
||||
@@ -1250,7 +1239,6 @@ public class YGBoxSizingTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void test_box_sizing_content_box_nested() {
|
||||
YogaConfig config = YogaConfigFactory.create();
|
||||
|
||||
@@ -1412,7 +1400,6 @@ public class YGBoxSizingTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void test_box_sizing_content_box_nested_alternating() {
|
||||
YogaConfig config = YogaConfigFactory.create();
|
||||
|
||||
@@ -1517,7 +1504,6 @@ public class YGBoxSizingTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void test_box_sizing_border_box_nested_alternating() {
|
||||
YogaConfig config = YogaConfigFactory.create();
|
||||
|
||||
|
Reference in New Issue
Block a user