This has one important benefit: fixing the stretching behavior of spacer nodes.
In addition, it should help efficiency of Yoga and certainly minimize calls
to layoutThatFits:.
Next up for Yoga is a mostly-red diff, deleting the non-Contiguous code branches.
* [Yoga] Rewrite YOGA_TREE_CONTIGUOUS mode with support for mixing with ASLayoutSpec.
After experimentation with the ASYogaLayoutSpec (or non-contiguous) approach to
integrating Yoga, test results and feedback from the authors of Yoga have shown
that this approach can't be made completely correct,
There are issues with some of the features required to represent Web-style
flexbox; in particular: padding, margins, and border handling have varience.
This diff is a first step towards a truly correct and elegant implementation of
Yoga integration with Texture. In addition to reducing the footprint of
the integration, which is an explicit goal of work at this stage, these changes
already support improved behavior - including mixing between ASLayoutSpecs
even as subnodes of Yoga layout-driven nodes, in addition to above them. Yoga
may be used for any set of nodes.
Because Yoga usage is limited at this time, it's safe to merge this diff and
further improvements will be refinements in this direction.
* [ASDKgram] Add Yoga layout implementation for PhotoCellNode.
* [Yoga] Final fixes for the upgraded implementation of the Contiguous layout mode.
* [Yoga] Add CHANGELOG.md entry and fix for Yoga rounding to screen scale.
* [Yoga] Minor cleanup to remove old comments and generalize utility methods.
* [ASTraitCollection] Convert ASPrimitiveTraitCollection from lock to atomic.
This resolves a deadlock case: https://github.com/TextureGroup/Texture/issues/353
* [ASTraitCollection] Use assignment operator instead of .store() for C++ atomic.
* Add support for skipping reload if node decides it is compatible with new view model also
* Sort things right
* Put the order back
* No need for redundant expectation
* Fix license header
* Fix comment
* [Performance] Convert ASLayoutElementSize to atomic
* [ASLayoutElementStyle] Put locks around setter methods.
* Also add lock to setSize: internal method.
* Small changes required by the layout debugger
- `ASDisplayNode` can be told to not flatten its layout immediately but later on. The unflattened layout is also stored in a separate property. It's needed for inspecting not only display nodes but also layout specs used to compute a layout tree.
- `ASLayout` can be told to always retain its sublayout elements. This is needed especially for layout specs since they are usually not retained after an ASLayout was computed.
* Update CHANGELOG
* Address comments
It is rare that this code has any effect, but I've discovered a case in which it occurs.
This task tracks moving this code to a DEBUG-only assertion: https://github.com/TextureGroup/Texture/issues/335
* [Yoga] Implement ASYogaLayoutSpec, an experimental alternative to full-tree integration.
This approach allows us to avoid any ASDisplayNode.mm integration points.
However, it is not yet proven to be possible to achieve correctness with this approach.
The entry point (to start calculating), and the measurement function inputs, lack
the full expressiveness of ASSizeRange; we need to make sure that workarounds like
using style.minSize are successful in simulating the behavior of a full Yoga tree.
* [Yoga] Fix file comments, move towards <ASLayoutElement> support.
* [Yoga] Important fix for simplified, non-contiguous Yoga integration.
* [Yoga] Complete implementation of manual memory management (__bridge_transfer, YGNodeFree)
* Lock released between add to pend controller and modifying pend state
The existing design is pretty fraught with error. We should probably
rethink this but in the meantime, this fixes a bug where calling
setNeedsLayout can start failing for nodes.
Essentially the method ASDisplayNodeShouldApplyBridgedWriteToView has
a side effect of registering a node to apply it's pending state *if*
it doesn't currently need the pending state applied. My guess is this
was to avoid continually registering the node and this behavior actually
helped expose this bug.
The bug: after the node is registered for flushing it's state, several
code paths released the lock before applying that state to the pending
state object. Before it could re-obtain the lock to apply it to the pending
state, the pending state controller flushed it on the main thread.
On subsequent calls to setNeedsLayout, the pending state had pending state
already (from previous calls which missed the flush) and thus wasn't
registered for future flushing.
* Add changelog
* Fixed bug where ASVideoNodeDelegate error reporting callback would crash an app because of not responding to selector;
refs #291
* updated changelog.md
* fixed typo in const name of ASVideoNodeDelegate method in delegate flags;
refs #292
* Fix alignment of ASImageNodeContentsKey struct to fix hashing
* Change the change log by logging a change
* Add the world's stupidest explicit cast
* Actually its simpler
* Add ASBatchFetchingDelegate
- In addition to checking remaining leading screens, ASBatchFetching now also calculates a remaining time and consults its delegate if needed.
- The delegate can override the decision of ASBatchFetching, for example based on remaining time and average time of past batch requests.
* Fix up tests
* Update CHANGELOG
* Add experimental text node implementation, based on YYText
* Fix warnings and alert when unimplemented experimental features are used.
* Address feedback from review
* Extend the cthulog
* Update license headers
* [ASTextKitFontSizeAdjuster] Replace use of boundingRectWithSize:options:context: with boundingRectForGlyphRange: inTextContainer:
`boundingRectWithSize:options:context:` started returning different values for the same strings between iOS 10.2 and iOS 10.3. Switching to using `NSLayoutManager`’s `boundingRectForGlyphRange: inTextContainer:` fixed this. It also makes sure we are consistent with what `ASTextKitTailTruncater` uses.
* updated changelog