Commit Graph

24 Commits

Author SHA1 Message Date
Jakub Grzmiel c866ef243e Clean up BUCK files for missing dependencies and tests
Differential Revision: D7625433

fbshipit-source-id: 332b7ff7eaed82cb52f459921f1ae67b702a1636
2018-04-14 15:32:22 -07:00
Jakub Grzmiel a42b2988ae Clean up BUCK files for missing dependencies and tests
Differential Revision: D7618360

fbshipit-source-id: 421834892519998ad088a138b3fc3d96afe34d79
2018-04-14 13:18:08 -07:00
Valentin Shergin b13d5beb11 Fabric: `LayoutableShadowNodeList::getChildren` renamed to `getLayoutableChildNodes`
Summary:
The previous name conflicts with the method with same (but with different semantic) name in `ShadowNode` class.
That was bad idea to use same name especially because the different semantic.

Reviewed By: fkgozali

Differential Revision: D7554549

fbshipit-source-id: 0bccbaacd0812f8a26592b2008f15ddb5bc34ebc
2018-04-10 17:15:08 -07:00
Valentin Shergin 711abeda79 Fabric: Using `enum class` for some graphics types
Summary:
`enum class` types do not provide default conversion to integers and reguire use typename before value names.
This must prevent bugs like the previous one where we used `Undefined` as a number value.

Reviewed By: fkgozali

Differential Revision: D7554548

fbshipit-source-id: b19379aae48c9aebe03043e08cf3acc712da3cb8
2018-04-10 17:15:08 -07:00
Valentin Shergin dd49f9e0bc Fabric: Fixed incorrect usage of `Undefined` (instead of `kFloatUndefined`) in `yogaValuesConversions`
Summary: `Undefined` is actually equal `0` (becasuse it is `LayoutDirection::Undefined`), whereas `kFloatUndefined` is a magic huge number.

Reviewed By: fkgozali

Differential Revision: D7554550

fbshipit-source-id: 3ea37f0b8b6a59b4b0e00d205b75cd7252247d03
2018-04-10 17:15:08 -07:00
Valentin Shergin 05f41931e2 Fabric: Fixed YogaLayoutableShadowNode::yogaNodeCloneCallbackConnector
Summary:
YogaLayoutableShadowNode::yogaNodeCloneCallbackConnector recently was disabled because of change in Yoga (D7339832).
This diff brings is back.

Reviewed By: mdvacca

Differential Revision: D7526417

fbshipit-source-id: 5369d641bf1e118132cf742d2d243bf426c0ffdb
2018-04-10 17:15:08 -07:00
Valentin Shergin 47c0ab91a5 Fabric: Using `shallowSourceNode()` inside `ViewShadowNode::cloneAndReplaceChild()`
Summary:
We have to call shallowSourceNode() in all cases of cloning which were not caused by UIManager instructions,
otherwise the diffing alogorith might produce incorrect mutation instructions.

Reviewed By: mdvacca

Differential Revision: D7503383

fbshipit-source-id: b33e5c39b7ba8cbd0f925fd29b3af379441a40a4
2018-04-10 12:59:51 -07:00
Valentin Shergin 53837c4a4f Fabric: Refined usage of `ensureunSealed` in `YogaLayoutableShadowNode::layout()`
Summary: We have to call `ensureunSealed()` only if the node was changed.

Reviewed By: mdvacca

Differential Revision: D7503388

fbshipit-source-id: a3d07d50fa983ef93c14fa771711fa783fdf4c12
2018-04-10 12:59:51 -07:00
Valentin Shergin 0332d475cc Fabric: Refined Yoga's `isDirty` flag management in YogaLayoutableShadowNode
Summary:
Motivation:
 * We never should call `markDirtyAndPropogate()` during tree construction/mutation because it might affect trees in different thread/dimentions;
 * In Fabric we basically always have to dirty nodes ourselves manually duting tree construction;
 * In Fabric we don't have "scoped/limited" tree mutations which require recursive dirtying; any mutation is creation of the new tree instance;
 * Default value of the `isDirty` flag is "false", so we have to change this right after creation of Yoga node (and after cloning).

Reviewed By: mdvacca

Differential Revision: D7467797

fbshipit-source-id: 2c9144271dceea6ba2b95173209b99b5d86fbd87
2018-04-10 12:59:51 -07:00
Valentin Shergin ef6b916e48 Fabric: New approach to manage Yoga's parent/owner references
Summary:
The modern Concurent Yoga's concept is:
We have to set parent/owner reference as part of `appendChild` process only if the current reference to parent/owner is `null`.
The motivation:
 * Null-parent indicates that this node was not attached to anything yet;
 * So, in this case there is no any concurrent memory access because we always create and (first time) attach the node on same thread;
 * Simmetrical parent-child relationship indicates that we don't need to (re)clone assosiated ShadowNode (nor Yoga node).

Reviewed By: mdvacca

Differential Revision: D7467791

fbshipit-source-id: 9a7f517380fde3bb00272de18fd5dc13edb52071
2018-04-10 12:59:51 -07:00
Valentin Shergin 1a4b6f0b3d Fabric: Overriden equality operator for ViewShadowNode
Summary:
Computed `layoutMetrics` are also considered as part of ViewShadowNode's value.
In the future we probably have to add something like `localData` and `imperativeCommands`.
We need all this for diffing algorithm and mointing phase.

Reviewed By: mdvacca

Differential Revision: D7467800

fbshipit-source-id: 8a0dcf1fd2f97dc501d6969cb0b0f6a2c6a648b4
2018-04-10 12:59:51 -07:00
Valentin Shergin fec0a51e85 Fabric: Simplified `ViewShadowNode::cloneAndReplaceChild`
Summary: Using methods of the base class instead of custom implementation.

Reviewed By: fkgozali

Differential Revision: D7467795

fbshipit-source-id: 4d168b72880f6900bf8b747e1d655c10140e0c79
2018-04-10 12:59:51 -07:00
Valentin Shergin a38f32a5a6 Fabric: Couple of ViewProps fields were exposed as getters
Summary: We have to have getters for all props/fields.

Reviewed By: mdvacca

Differential Revision: D7467792

fbshipit-source-id: 1492aad2d3398e6c14e0e354047730cf91201175
2018-04-10 12:59:51 -07:00
Pritesh Nandgaonkar bcd12f1e87 Change the type of aspect Ratio to YGFloatOptional
Reviewed By: emilsjolander

Differential Revision: D7302651

fbshipit-source-id: 53e3b4c9627207a379f927b1f3485e36a9c70601
2018-04-03 15:02:57 -07:00
David Vacca 29ff30c539 Rename YogaNode.parent -> YogaNode.owner
Reviewed By: priteshrnandgaonkar

Differential Revision: D7352778

fbshipit-source-id: dcf1af5e72bfc3063b5c4bda197d7952a9194768
2018-04-01 18:32:12 -07:00
David Vacca aff5a75d8e Refactor cloning of YogaNode
Reviewed By: priteshrnandgaonkar

Differential Revision: D7339832

fbshipit-source-id: 2de6f47ae7601ac083d3b9fbe10ffaf6307ae760
2018-04-01 18:32:12 -07:00
Valentin Shergin 1f27098a1a Fabric: Proper Yoga node dirting in YogaLayoutableShadowNode
Summary: Any change must be propagate upwards.

Reviewed By: mdvacca

Differential Revision: D7389058

fbshipit-source-id: 09c74640d0e9607d2e17bdd31d7ce69df8565f72
2018-03-30 12:25:51 -07:00
Valentin Shergin ee0cc6bbe7 Fabric: Implementing cloneAndReplaceChild() for ViewShadowNode
Summary:
First, LayoutableShadowNode::cloneAndReplaceChild() is now pure virtual. The default implementation was useless and confusing.
Second, cloneAndReplaceChild() is now fully implemented for ViewShadowNode, so fancy Yoga Concurrent layout *should* work now.

Reviewed By: mdvacca

Differential Revision: D7376352

fbshipit-source-id: 1199a37e64535c8592a2a5480e60139f61d02006
2018-03-25 22:48:18 -07:00
Valentin Shergin 8f9212b839 Fabric: Fixed lost YogaNode's context in YogaLayoutableShadowNode
Summary: We replace yogaNode with newly creaded (by Yoga) one. So, we have to set up context.

Reviewed By: mdvacca

Differential Revision: D7376345

fbshipit-source-id: 7926a10e3f057fc385e7731c354827aeb8245760
2018-03-25 22:48:18 -07:00
Valentin Shergin 1bb6db36be Fabric: Removed unused copy constructor YogaLayoutableShadowNode()
Summary: Trivial. We don't use it, and it shouldn't be exist by desing.

Reviewed By: mdvacca

Differential Revision: D7376351

fbshipit-source-id: 22f03af2b3596c274a22bab1fab6d8af854a7374
2018-03-25 22:48:18 -07:00
Kevin Gozali 1acef45977 iOS: added placeholder test setup for fabric graphics/uimanager/view targets
Reviewed By: shergin

Differential Revision: D7390366

fbshipit-source-id: d49fcc335fc03d52402676341f1da24177c6084b
2018-03-23 22:22:20 -07:00
Valentin Shergin 39383d1189 Fabric: Improved YogaLayoutableShadowNode printing
Summary: `LTR` is actually a default value for `direction` here, because an `inherit` value makes no sense for YGLayout (because it's *computed* value by definition).

Reviewed By: fkgozali

Differential Revision: D7330335

fbshipit-source-id: b3c7736c104689f2296e150f0cf57d622483d537
2018-03-19 17:08:31 -07:00
Valentin Shergin ff288b7416 Fabric: Complete implementation of `layoutMetricsFromYogaNode`
Summary: That was simply incomplete.

Reviewed By: fkgozali

Differential Revision: D7330336

fbshipit-source-id: c495c7f61d8e551fa963bfa6cc0408343eb8439b
2018-03-19 17:08:31 -07:00
Valentin Shergin 965e60b05a `fabric/view` module
Summary: Defines `<View>`: Yoga-powered, Accessible and styleable component.

Reviewed By: fkgozali

Differential Revision: D7230673

fbshipit-source-id: 08a1d8626c0b41260fafdca938d4fe9489b1b793
2018-03-18 19:17:39 -07:00